Merge: 497958b 68dcaa7
authorJim Procter <jprocter@dundee.ac.uk>
Mon, 22 Dec 2014 16:16:17 +0000 (16:16 +0000)
committerJim Procter <jprocter@dundee.ac.uk>
Mon, 22 Dec 2014 16:16:17 +0000 (16:16 +0000)
(fake synthesised by jbp)

Merge branch 'develop' into JAL-1483_29dev
Conflicts:
       src/jalview/api/AlignmentViewPanel.java
       src/jalview/appletgui/SeqPanel.java
       src/jalview/gui/AlignFrame.java
       src/jalview/gui/AlignViewport.java
       src/jalview/gui/AnnotationExporter.java
       src/jalview/gui/FeatureRenderer.java
       src/jalview/gui/FeatureSettings.java
       src/jalview/gui/Jalview2XML.java
       src/jalview/gui/Jalview2XML_V1.java
       src/jalview/gui/PopupMenu.java
       src/jalview/gui/SeqPanel.java

172 files changed:
.classpath
.externalToolBuilders/Jalview Release indices [Builder].launch
.settings/org.eclipse.jdt.core.prefs
AUTHORS
THIRDPARTYLIBS
build.xml
examples/example_biojs.html
examples/uniref50.score_ascii [new file with mode: 0644]
help/help.jhm
help/helpTOC.xml
help/html/calculations/consensus.html
help/html/calculations/pca.html
help/html/colourSchemes/annotationColouring.html
help/html/colourSchemes/pid.html
help/html/features/annotation.html
help/html/features/chimera.html [new file with mode: 0644]
help/html/features/clarguments.html
help/html/features/dassettings.html
help/html/features/featuresFormat.html
help/html/features/featuresettings.html
help/html/features/hiddenRegions.html
help/html/features/jmol.html
help/html/features/multipleViews.html
help/html/features/preferences.html
help/html/features/seqfetch.html
help/html/features/varna.html
help/html/features/viewingpdbs.html
help/html/features/xsspannotation.html [new file with mode: 0644]
help/html/index.html
help/html/io/export.html
help/html/io/fileformats.html
help/html/jalviewjnlp.html [deleted file]
help/html/memory.html
help/html/menus/alignmentMenu.html
help/html/menus/alwedit.html
help/html/menus/alwfile.html
help/html/menus/popupMenu.html
help/html/na/index.html
help/html/privacy.html
help/html/releases.html
help/html/vamsas/index.html
help/html/webServices/JABAWS.html
help/html/webServices/RNAalifold.html
help/html/webServices/dbreffetcher.html
help/html/webServices/jnet.html
help/html/whatsNew.html
resources/authors.props
resources/lang/Messages.properties
resources/lang/Messages_es.properties
resources/templates/BioJSTemplate.txt
src/MCview/PDBChain.java
src/MCview/PDBViewer.java
src/MCview/PDBfile.java
src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java
src/jalview/analysis/AlignSeq.java
src/jalview/analysis/AlignmentUtils.java
src/jalview/analysis/AnnotationSorter.java
src/jalview/analysis/Rna.java
src/jalview/api/AlignmentViewPanel.java
src/jalview/appletgui/APopupMenu.java
src/jalview/appletgui/AlignFrame.java
src/jalview/appletgui/AlignmentPanel.java
src/jalview/appletgui/AnnotationPanel.java
src/jalview/appletgui/PairwiseAlignPanel.java
src/jalview/appletgui/RedundancyPanel.java
src/jalview/appletgui/SeqPanel.java
src/jalview/bin/Cache.java
src/jalview/bin/Jalview.java
src/jalview/bin/JalviewLite.java
src/jalview/commands/EditCommand.java
src/jalview/commands/RemoveGapColCommand.java
src/jalview/commands/RemoveGapsCommand.java
src/jalview/commands/SlideSequencesCommand.java
src/jalview/commands/TrimRegionCommand.java
src/jalview/datamodel/Alignment.java
src/jalview/datamodel/AlignmentAnnotation.java
src/jalview/datamodel/AnnotatedCollectionI.java
src/jalview/datamodel/ColumnSelection.java
src/jalview/datamodel/HiddenSequences.java
src/jalview/datamodel/Sequence.java
src/jalview/datamodel/SequenceGroup.java
src/jalview/datamodel/SequenceI.java
src/jalview/exceptions/JalviewException.java [new file with mode: 0644]
src/jalview/exceptions/NoFileSelectedException.java [new file with mode: 0644]
src/jalview/ext/jmol/PDBFileWithJmol.java
src/jalview/ext/rbvi/chimera/JalviewChimeraBinding.java
src/jalview/gui/AlignFrame.java
src/jalview/gui/AlignViewport.java
src/jalview/gui/AlignmentPanel.java
src/jalview/gui/AnnotationExporter.java
src/jalview/gui/AnnotationLabels.java
src/jalview/gui/AnnotationPanel.java
src/jalview/gui/AppJmol.java
src/jalview/gui/BlogReader.java
src/jalview/gui/ChimeraViewFrame.java
src/jalview/gui/Desktop.java
src/jalview/gui/FeatureRenderer.java
src/jalview/gui/FeatureSettings.java
src/jalview/gui/Finder.java
src/jalview/gui/FontChooser.java
src/jalview/gui/HTMLOptions.java [new file with mode: 0644]
src/jalview/gui/Help.java
src/jalview/gui/IdCanvas.java
src/jalview/gui/IdPanel.java
src/jalview/gui/IdwidthAdjuster.java
src/jalview/gui/Jalview2XML.java
src/jalview/gui/Jalview2XML_V1.java
src/jalview/gui/JalviewChimeraBindingModel.java
src/jalview/gui/JvSwingUtils.java
src/jalview/gui/OverviewPanel.java
src/jalview/gui/PairwiseAlignPanel.java
src/jalview/gui/PopupMenu.java
src/jalview/gui/Preferences.java
src/jalview/gui/RedundancyPanel.java
src/jalview/gui/SVGOptions.java [new file with mode: 0644]
src/jalview/gui/ScalePanel.java
src/jalview/gui/SeqCanvas.java
src/jalview/gui/SeqPanel.java
src/jalview/gui/SliderPanel.java
src/jalview/gui/WebserviceInfo.java
src/jalview/gui/WsJobParameters.java
src/jalview/gui/WsParamSetManager.java
src/jalview/gui/WsPreferences.java
src/jalview/io/AppletFormatAdapter.java
src/jalview/io/BioJsHTMLOutput.java
src/jalview/io/FormatAdapter.java
src/jalview/io/HtmlFile.java
src/jalview/io/HtmlSvgOutput.java [new file with mode: 0644]
src/jalview/io/IdentifyFile.java
src/jalview/io/RnamlFile.java
src/jalview/io/StockholmFile.java
src/jalview/jbgui/GAlignFrame.java
src/jalview/jbgui/GDesktop.java
src/jalview/jbgui/GPreferences.java
src/jalview/jbgui/GStructureViewer.java
src/jalview/json/binding/v1/BioJsAlignmentPojo.java
src/jalview/math/AlignmentDimension.java [new file with mode: 0644]
src/jalview/renderer/AnnotationRenderer.java
src/jalview/schemes/AnnotationColourGradient.java
src/jalview/schemes/ColourSchemeProperty.java
src/jalview/schemes/ResidueProperties.java
src/jalview/structure/StructureSelectionManager.java
src/jalview/util/ImageMaker.java
src/jalview/viewmodel/AlignmentViewport.java
src/jalview/ws/DasSequenceFeatureFetcher.java
src/jalview/ws/HttpClientUtils.java
src/jalview/ws/jws1/JPredClient.java
src/jalview/ws/jws1/JPredThread.java
src/jalview/ws/jws1/WS1Client.java
src/jalview/ws/jws2/AADisorderClient.java
src/jalview/ws/jws2/JabaWsServerQuery.java
src/jalview/ws/jws2/JabawsCalcWorker.java
src/jalview/ws/jws2/Jws2Client.java
src/jalview/ws/jws2/Jws2Discoverer.java
src/jalview/ws/jws2/MsaWSClient.java
src/jalview/ws/jws2/MsaWSThread.java
src/jalview/ws/jws2/jabaws2/Jws2InstanceFactory.java
src/jalview/ws/rest/RestClient.java
test/jalview/commands/EditCommandTest.java [new file with mode: 0644]
test/jalview/datamodel/SequenceTest.java
test/jalview/ext/jmol/PDBFileWithJmolTest.java
test/jalview/ext/paradise/TestAnnotate3D.java
test/jalview/gui/HelpTest.java [new file with mode: 0644]
test/jalview/gui/PopupMenuTest.java
test/jalview/io/BioJsHTMLOutputTest.java [new file with mode: 0644]
test/jalview/io/HtmlFileTest.java [new file with mode: 0644]
test/jalview/io/Jalview2xmlTests.java
test/jalview/io/RNAMLfileTest.java
test/jalview/io/StockholmFileTest.java
test/jalview/io/testProps.jvprops [new file with mode: 0644]
test/jalview/ws/jabaws/JalviewJabawsTestUtils.java
utils/InstallAnywhere/Jalview.iap_xml

index 801980d..388e111 100644 (file)
        <classpathentry kind="lib" path="lib/log4j-to-slf4j-2.0-rc2.jar"/>
        <classpathentry kind="lib" path="lib/slf4j-log4j12-1.7.7.jar"/>
        <classpathentry kind="lib" path="lib/VARNAv3-91.jar"/>
-       <classpathentry kind="lib" path="lib/jfreesvg-2.1.jar"/>
        <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/plugin.jar"/>
        <classpathentry kind="lib" path="lib/xml-apis.jar"/>
-       <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/plugin17"/>
        <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/plugin"/>
+       <classpathentry kind="lib" path="lib/jfreesvg-2.1.jar"/>
        <classpathentry kind="output" path="classes"/>
 </classpath>
index 4c0c7dd..9d81cc8 100644 (file)
@@ -14,6 +14,7 @@
 <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
 <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="jalview"/>
 <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value=""/>
 <stringAttribute key="org.eclipse.ui.externaltools.ATTR_ANT_TARGETS" value="buildindices,"/>
 <booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="true"/>
 <stringAttribute key="org.eclipse.ui.externaltools.ATTR_LAUNCH_CONFIGURATION_BUILD_SCOPE" value="${none}"/>
index 884491a..f72955b 100644 (file)
@@ -1,4 +1,15 @@
 eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/AUTHORS b/AUTHORS
index 1bca12a..30db2a1 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -14,6 +14,8 @@ In particular, check the resources/authors.props file !
 
 Jim Procter
 Andrew Waterhouse
+Mungo Carstairs
+Tochukwu 'Charles' Ofoegbu
 Jan Engelhardt
 Lauren Lui
 Anne Menard
index 386541e..ea44193 100644 (file)
@@ -11,6 +11,7 @@ Licencing information for each library is given below:
 
 JGoogleAnalytics_0.3.jar       APL 2.0 License - http://code.google.com/p/jgoogleanalytics/
 Jmol-12.1.13.jar       GPL/LGPLv2 http://sourceforge.net/projects/jmol/files/
+VARNAv3-91.jar GPL licenced software by Kévin Darty, Alain Denise and Yann Ponty. http://varna.lri.fr
 activation.jar 
 apache-mime4j-0.6.jar
 axis.jar
@@ -39,6 +40,7 @@ wsdl4j.jar
 xercesImpl.jar
 xml-apis.jar
 json_simple-1.1.jar : Apache 2.0 license : downloaded from https://code.google.com/p/json-simple/downloads/list (will move to 1.1.1 version when jalview is mavenised and osgi-ised)
+jfreesvg-2.1.jar : GPL v3 licensed library from the JFree suite: http://www.jfree.org/jfreesvg/
 
 Additional dependencies
 
index 3705821..d8ebe1e 100755 (executable)
--- a/build.xml
+++ b/build.xml
         <include name="*.jar"/>
       </fileset> -->
       </path>
+       
     <!-- Jalview Version String displayed by application on startup and used to check for updates -->
     <property name="JALVIEW_VERSION" value="DEVELOPMENT" />
+       
+    <property name="INSTALLATION" value="Source" />
+       
     <!-- 2.4 (VAMSAS)" -->
     <!-- Include debugging information in javac true or false -->
     <property name="javac.debug" value="true" />
     <!-- switch to exclude associations from generated jnlp files -->
     <!-- <property name="nojnlpfileassocs" value="true"/> -->
 
-    <!-- Jalview Web Service Clients - see the comments in 'buildextexcclients' for details -->
+    <!-- Jalview Web Service Clients - see the comments in 'buildextclients' for details -->
     <property name="wsdl.File" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred?wsdl" />
     <property name="wsdl.Files" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/vamsas?wsdlFiles" />
     <property name="wsdl.MsaWS" value="http://www.compbio.dundee.ac.uk/JalviewWS/services/MuscleWS?wsdl" />
     <properties file="${outputDir}/.build_properties">
       <header>
           ---Jalview Build Details---
-        </header>
+        </header>      
       <property name="VERSION" value="${JALVIEW_VERSION}" />
+      <property name="INSTALLATION" value="${INSTALLATION}" />
       <property name="BUILD_DATE" value="${build.date}" />
     </properties>
   </target>
   <mkdir dir="${outputDir}" />
   <javac source="1.5" target="1.5" srcdir="${sourceDir}" destdir="${outputDir}" debug="${javac.debug}" 
                        classpathref="jalviewlite.deps" includes="jalview/appletgui/**"
-                       excludes="ext/**,MCview/**,org/**,vamsas/**,jalview/io/**,jalview/ext/paradise/**" />
+                       excludes="ext/**,MCview/**,org/**,vamsas/**,jalview/ext/paradise/**" />
 </target>
 
 <target name="packageApplet" depends="compileApplet, buildPropertiesFile">
index 5b0d71e..b6f7bec 100644 (file)
@@ -7,21 +7,21 @@
 <!-- <script src="https://s3-eu-west-1.amazonaws.com/biojs/msa/latest/msa.js"></script> -->
 <!-- <link type=text/css rel=stylesheet href=https://s3-eu-west-1.amazonaws.com/biojs/msa/latest/msa.css /> -->
  
- <img src="file:/Users/tcnofoegbu/Documents/workspace/java/dev/jalview/classes/images/Jalview_Logo.png" alt="Jalview Logo" title="This html page was generated from Jalview, to import the data back to Jalview, please drag the generated html file and drop it unto the Jalview workbench.
+ <img src="http://www.jalview.org/help/html/Jalview_Logo.png" alt="Jalview Logo" title="This html page was generated from Jalview, to import the data back to Jalview, please drag the generated html file and drop it unto the Jalview workbench.
  
  Alternatively, you could copy the url from the address bar and use Jalview's url importer (main menu-> File-> Input Alignment-> from URL) to import back the alignment jalview." >
 
 </br>
 </br>
 
-<button onclick="javascipt:openJalviewUsingCurrentUrl();">Launch in Jalview</button>
 <input type="button" name="divToggleButton" id="divToggleButton" onclick="javascipt:toggleMenuVisibility();" value="Show Menu"></input>
+<button onclick="javascipt:openJalviewUsingCurrentUrl();">Launch in Jalview</button>
 
 </br>
 </br> 
   
 <div id="yourDiv">press "Run with JS"</div>
-<input type='hidden' id='seqData' name='seqData' value='{"globalColorScheme":"zappo","seqs":[{"id":"1","start":1,"name":"FER_CAPAA/1-97","seq":"----------------------------------------------------------ASYKVKLITPDGPIEFDCPDDVYILDQAEEAGHDLPYSCRAGSCSSCAGKIAGGAVDQTDGNFLDDDQLEEGWVLTCVAYPQSDVTIETHKEAELVG-","features":[],"end":97},{"id":"2","start":1,"name":"FER_CAPAN/1-144","seq":"------MASVSATMISTSFMPRKPAVTSLKPIP-NVG-EALFGLKS---ANGGKVTCMASYKVKLITPDGPIEFDCPDNVYILDQAEEAGHDLPYSCRAGSCSSCAGKIAGGAVDQTDGNFLDDDQLEEGWVLTCVAYPQSDVTIETHKEAELVG-","features":[{"xEnd":22,"text":"feature_1","fillColor":"#8c25cd","xStart":2}],"end":144},{"id":"3","start":1,"name":"FER1_SOLLC/1-144","seq":"------MASISGTMISTSFLPRKPAVTSLKAIS-NVG-EALFGLKS---GRNGRITCMASYKVKLITPEGPIEFECPDDVYILDQAEEEGHDLPYSCRAGSCSSCAGKVTAGSVDQSDGNFLDEDQEAAGFVLTCVAYPKGDVTIETHKEEELTA-","features":[],"end":144},{"id":"4","start":1,"name":"Q93XJ9_SOLTU/1-144","seq":"------MASISGTMISTSFLPRKPVVTSLKAIS-NVG-EALFGLKS---GRNGRITCMASYKVKLITPDGPIEFECPDDVYILDQAEEEGHDLPYSCRAGSCSSCAGKVTAGTVDQSDGKFLDDDQEAAGFVLTCVAYPKCDVTIETHKEEELTA-","features":[],"end":144},{"id":"5","start":1,"name":"FER1_PEA/1-149","seq":"---MATTPALYGTAVSTSFLRTQPMPMSVTTTKAFSN--GFLGLKT-SLKRGDLAVAMASYKVKLVTPDGTQEFECPSDVYILDHAEEVGIDLPYSCRAGSCSSCAGKVVGGEVDQSDGSFLDDEQIEAGFVLTCVAYPTSDVVIETHKEEDLTA-","features":[],"end":149},{"id":"6","start":1,"name":"Q7XA98_TRIPR/1-152","seq":"---MATTPALYGTAVSTSFMRRQPVPMSVATTTTTKAFPSGFGLKSVSTKRGDLAVAMATYKVKLITPEGPQEFDCPDDVYILDHAEEVGIELPYSCRAGSCSSCAGKVVNGNVNQEDGSFLDDEQIEGGWVLTCVAFPTSDVTIETHKEEELTA-","features":[],"end":152},{"id":"7","start":1,"name":"FER1_MESCR/1-148","seq":"--MAATTAALSGATMSTAFAPKT--PPMTAALPTNVG-RALFGLKS--SASRGRVTAMAAYKVTLVTPEGKQELECPDDVYILDAAEEAGIDLPYSCRAGSCSSCAGKVTSGSVNQDDGSFLDDDQIKEGWVLTCVAYPTGDVTIETHKEEELTA-","features":[],"end":148},{"id":"8","start":1,"name":"FER1_SPIOL/1-147","seq":"----MAATTTTMMGMATTFVPKPQAPPMMAALPSNTG-RSLFGLKT--GSRGGRMT-MAAYKVTLVTPTGNVEFQCPDDVYILDAAEEEGIDLPYSCRAGSCSSCAGKLKTGSLNQDDQSFLDDDQIDEGWVLTCAAYPVSDVTIETHKEEELTA-","features":[],"end":147},{"id":"9","start":1,"name":"FER3_RAPSA/1-96","seq":"----------------------------------------------------------ATYKVKFITPEGEQEVECDDDVYVLDAAEEAGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSFLDDDQIAEGFVLTCAAYPTSDVTIETHREEDMV--","features":[],"end":96},{"id":"10","start":1,"name":"FER1_ARATH/1-148","seq":"----MASTALSSAIVGTSFIRRSPAPISLRSLPSANT-QSLFGLKS-GTARGGRVTAMATYKVKFITPEGELEVECDDDVYVLDAAEEAGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSFLDDEQIGEGFVLTCAAYPTSDVTIETHKEEDIV--","features":[],"end":148},{"id":"11","start":1,"name":"FER_BRANA/1-96","seq":"----------------------------------------------------------ATYKVKFITPEGEQEVECDDDVYVLDAAEEAGIDLPYSCRAGSCSSCAGKVVSGFVDQSDESFLDDDQIAEGFVLTCAAYPTSDVTIETHKEEELV--","features":[],"end":96},{"id":"12","start":1,"name":"FER2_ARATH/1-148","seq":"----MASTALSSAIVSTSFLRRQQTPISLRSLPFANT-QSLFGLKS-STARGGRVTAMATYKVKFITPEGEQEVECEEDVYVLDAAEEAGLDLPYSCRAGSCSSCAGKVVSGSIDQSDQSFLDDEQMSEGYVLTCVAYPTSDVVIETHKEEAIM--","features":[],"end":148},{"id":"13","start":1,"name":"Q93Z60_ARATH/1-118","seq":"----MASTALSSAIVSTSFLRRQQTPISLRSLPFANT-QSLFGLKS-STARGGRVTAMATYKVKFITPEGEQEVECEEDVYVLDAAEEAGLDLPYSCRAGSCSSCAGKVVSGSIDQSDQSFLDD--------------------------------","features":[],"end":118},{"id":"14","start":1,"name":"FER1_MAIZE/1-150","seq":"MATVLGSPRAPAFFFSSSSLRAAPAPTAVALPAAKVG---IMGRSA---SSRRRLRAQATYNVKLITPEGEVELQVPDDVYILDQAEEDGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSYLDDGQIADGWVLTCHAYPTSDVVIETHKEEELTGA","features":[],"end":150},{"id":"15","start":1,"name":"O80429_MAIZE/1-140","seq":"---------MAATALSMSILRAPP-PCFSSPLRLRVAVAKPLAAPM----RRQLLRAQATYNVKLITPEGEVELQVPDDVYILDFAEEEGIDLPFSCRAGSCSSCAGKVVSGSVDQSDQSFLNDNQVADGWVLTCAAYPTSDVVIETHKEDDLL--","features":[],"end":140}]}'/>
+<input type='hidden' id='seqData' name='seqData' value='{"globalColorScheme":"zappo","seqs":[{"id":"1","start":1,"name":"FER_CAPAA/1-97","seq":"----------------------------------------------------------ASYKVKLITPDGPIEFDCPDDVYILDQAEEAGHDLPYSCRAGSCSSCAGKIAGGAVDQTDGNFLDDDQLEEGWVLTCVAYPQSDVTIETHKEAELVG-","features":[],"end":97},{"id":"2","start":1,"name":"FER_CAPAN/1-144","seq":"------MASVSATMISTSFMPRKPAVTSLKPIP-NVG-EALFGLKS---ANGGKVTCMASYKVKLITPDGPIEFDCPDNVYILDQAEEAGHDLPYSCRAGSCSSCAGKIAGGAVDQTDGNFLDDDQLEEGWVLTCVAYPQSDVTIETHKEAELVG-","features":[{"text":"feature_1","xEnd":46,"fillColor":"#8c25cd","xStart":16}],"end":144},{"id":"3","start":1,"name":"FER1_SOLLC/1-144","seq":"------MASISGTMISTSFLPRKPAVTSLKAIS-NVG-EALFGLKS---GRNGRITCMASYKVKLITPEGPIEFECPDDVYILDQAEEEGHDLPYSCRAGSCSSCAGKVTAGSVDQSDGNFLDEDQEAAGFVLTCVAYPKGDVTIETHKEEELTA-","features":[],"end":144},{"id":"4","start":1,"name":"Q93XJ9_SOLTU/1-144","seq":"------MASISGTMISTSFLPRKPVVTSLKAIS-NVG-EALFGLKS---GRNGRITCMASYKVKLITPDGPIEFECPDDVYILDQAEEEGHDLPYSCRAGSCSSCAGKVTAGTVDQSDGKFLDDDQEAAGFVLTCVAYPKCDVTIETHKEEELTA-","features":[],"end":144},{"id":"5","start":1,"name":"FER1_PEA/1-149","seq":"---MATTPALYGTAVSTSFLRTQPMPMSVTTTKAFSN--GFLGLKT-SLKRGDLAVAMASYKVKLVTPDGTQEFECPSDVYILDHAEEVGIDLPYSCRAGSCSSCAGKVVGGEVDQSDGSFLDDEQIEAGFVLTCVAYPTSDVVIETHKEEDLTA-","features":[],"end":149},{"id":"6","start":1,"name":"Q7XA98_TRIPR/1-152","seq":"---MATTPALYGTAVSTSFMRRQPVPMSVATTTTTKAFPSGFGLKSVSTKRGDLAVAMATYKVKLITPEGPQEFDCPDDVYILDHAEEVGIELPYSCRAGSCSSCAGKVVNGNVNQEDGSFLDDEQIEGGWVLTCVAFPTSDVTIETHKEEELTA-","features":[{"text":"feature_2","xEnd":24,"fillColor":"#0000cc","xStart":8}],"end":152},{"id":"7","start":1,"name":"FER1_MESCR/1-148","seq":"--MAATTAALSGATMSTAFAPKT--PPMTAALPTNVG-RALFGLKS--SASRGRVTAMAAYKVTLVTPEGKQELECPDDVYILDAAEEAGIDLPYSCRAGSCSSCAGKVTSGSVNQDDGSFLDDDQIKEGWVLTCVAYPTGDVTIETHKEEELTA-","features":[],"end":148},{"id":"8","start":1,"name":"FER1_SPIOL/1-147","seq":"----MAATTTTMMGMATTFVPKPQAPPMMAALPSNTG-RSLFGLKT--GSRGGRMT-MAAYKVTLVTPTGNVEFQCPDDVYILDAAEEEGIDLPYSCRAGSCSSCAGKLKTGSLNQDDQSFLDDDQIDEGWVLTCAAYPVSDVTIETHKEEELTA-","features":[],"end":147},{"id":"9","start":1,"name":"FER3_RAPSA/1-96","seq":"----------------------------------------------------------ATYKVKFITPEGEQEVECDDDVYVLDAAEEAGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSFLDDDQIAEGFVLTCAAYPTSDVTIETHREEDMV--","features":[],"end":96},{"id":"10","start":1,"name":"FER1_ARATH/1-148","seq":"----MASTALSSAIVGTSFIRRSPAPISLRSLPSANT-QSLFGLKS-GTARGGRVTAMATYKVKFITPEGELEVECDDDVYVLDAAEEAGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSFLDDEQIGEGFVLTCAAYPTSDVTIETHKEEDIV--","features":[],"end":148},{"id":"11","start":1,"name":"FER_BRANA/1-96","seq":"----------------------------------------------------------ATYKVKFITPEGEQEVECDDDVYVLDAAEEAGIDLPYSCRAGSCSSCAGKVVSGFVDQSDESFLDDDQIAEGFVLTCAAYPTSDVTIETHKEEELV--","features":[],"end":96},{"id":"12","start":1,"name":"FER2_ARATH/1-148","seq":"----MASTALSSAIVSTSFLRRQQTPISLRSLPFANT-QSLFGLKS-STARGGRVTAMATYKVKFITPEGEQEVECEEDVYVLDAAEEAGLDLPYSCRAGSCSSCAGKVVSGSIDQSDQSFLDDEQMSEGYVLTCVAYPTSDVVIETHKEEAIM--","features":[{"text":"feature_3","xEnd":32,"fillColor":"#ffff00","xStart":4}],"end":148},{"id":"13","start":1,"name":"Q93Z60_ARATH/1-118","seq":"----MASTALSSAIVSTSFLRRQQTPISLRSLPFANT-QSLFGLKS-STARGGRVTAMATYKVKFITPEGEQEVECEEDVYVLDAAEEAGLDLPYSCRAGSCSSCAGKVVSGSIDQSDQSFLDD--------------------------------","features":[],"end":118},{"id":"14","start":1,"name":"FER1_MAIZE/1-150","seq":"MATVLGSPRAPAFFFSSSSLRAAPAPTAVALPAAKVG---IMGRSA---SSRRRLRAQATYNVKLITPEGEVELQVPDDVYILDQAEEDGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSYLDDGQIADGWVLTCHAYPTSDVVIETHKEEELTGA","features":[],"end":150},{"id":"15","start":1,"name":"O80429_MAIZE/1-140","seq":"---------MAATALSMSILRAPP-PCFSSPLRLRVAVAKPLAAPM----RRQLLRAQATYNVKLITPEGEVELQVPDDVYILDFAEEEGIDLPFSCRAGSCSSCAGKVVSGSVDQSDQSFLNDNQVADGWVLTCAAYPTSDVVIETHKEDDLL--","features":[],"end":140}],"webStartUrl":"http://www.jalview.org/services/launchApp","jalviewVersion":"Test"}'/>
 
 </body>
 </html>
@@ -31,8 +31,6 @@
 <script>
 
 function toggleMenuVisibility(){
-       //alert("toggleMenuVisibility called!");
-       
        var menu = document.getElementsByClassName("biojs_msa_menubar");
        var divToggleButton = document.getElementById("divToggleButton");
        if(menu[0].style.display == 'block'){
@@ -43,54 +41,30 @@ function toggleMenuVisibility(){
           divToggleButton.value="Hide Menu";
           }
 }
-function openJalviewUsingCurrentUrl2(){
-var jnpl = "<!--"+
-"Hi!"+
-"If you have downloaded this file after pressing \"Launch Full Application\" from Jalview on a web page and you don't know what to do with this file, you must install Java from http://www.java.sun.com then try opening this file again."+
-" \n"+
-"      JNLP generated by /jalviewServlet/services/launchAppDev"+
-"      JNLP generated from http://www.jalview.org/builds/develop/webstart/jalview.jnlp"+
-"Available servlet parameters (please URLEncode):"+
-"      open=<alignment file URL>"+
-"      jvm-max-heap=heap size in M or G"+
-"      features maps to        '-features'"+
-"      treeFile maps to        '-tree'"+
-"      tree maps to    '-tree'"+
-"      annotations maps to     '-annotations'"+
-"      colour maps to  '-colour'"+
-" "+
-"-->"+
-"<?xml version=\"1.0\" encoding=\"UTF-8\"?><jnlp spec=\"1.0+\" codebase=\"http://www.jalview.org/builds/develop/webstart\">    <information>           <title>Jalview</title>          <vendor>The Barton Group</vendor>               <homepage href=\"http://www.jalview.org\"/>             <description>Jalview Multiple Alignment Editor</description>            <description kind=\"short\">Jalview</description>               <icon href=\"JalviewLogo_big.png\"/>            <offline-allowed/>      </information>  <security>              <all-permissions/>      </security>     <resources>             <j2se version=\"1.7+\" initial-heap-size=\"10M\" max-heap-size=\"2G\"/>         <jar href=\"jalview.jar\"/>             <jar href=\"JGoogleAnalytics_0.3.jar\"/>                <jar href=\"Jmol-12.2.4.jar\"/>         <jar href=\"VARNAv3-91.jar\"/>          <jar href=\"activation.jar\"/>          <jar href=\"apache-mime4j-0.6.jar\"/>           <jar href=\"axis.jar\"/>                <jar href=\"castor-1.1-cycle-xml.jar\"/>                <jar href=\"commons-codec-1.3.jar\"/>           <jar href=\"commons-discovery.jar\"/>           <jar href=\"commons-logging-1.1.1.jar\"/>               <jar href=\"groovy-all-1.8.2.jar\"/>            <jar href=\"httpclient-4.0.3.jar\"/>            <jar href=\"httpcore-4.0.1.jar\"/>              <jar href=\"httpmime-4.0.3.jar\"/>              <jar href=\"jalview_jnlp_vm.jar\"/>             <jar href=\"jaxrpc.jar\"/>              <jar href=\"jdas-1.0.4.jar\"/>          <jar href=\"jhall.jar\"/>               <jar href=\"json_simple-1.1.jar\"/>             <jar href=\"jsoup-1.8.1.jar\"/>         <jar href=\"jswingreader-0.3.jar\"/>            <jar href=\"log4j-to-slf4j-2.0-rc2.jar\"/>              <jar href=\"mail.jar\"/>                <jar href=\"miglayout-4.0-swing.jar\"/>         <jar href=\"min-jabaws-client-2.1.0.jar\"/>             <jar href=\"regex.jar\"/>               <jar href=\"saaj.jar\"/>                <jar href=\"slf4j-api-1.7.7.jar\"/>             <jar href=\"slf4j-log4j12-1.7.7.jar\"/>         <jar href=\"spring-core-3.0.5.RELEASE.jar\"/>           <jar href=\"spring-web-3.0.5.RELEASE.jar\"/>            <jar href=\"vamsas-client.jar\"/>               <jar href=\"wsdl4j.jar\"/>              <jar href=\"xercesImpl.jar\"/>          <jar href=\"xml-apis.jar\"/>            <property name=\"jalview.version\" value=\"Development Branch Build\"/> </resources>"+
-"<application-desc main-class=\"jalview.bin.Jalview\">"+
-"<argument>-open</argument>"+
-"<argument>file:///Users/tcnofoegbu/Documents/workspace/java/dev/jalview/examples/example_biojs.html</argument>"+
-"</application-desc>"+
-"      <security>"+
-"              <all-permissions/>"+
-"      </security>"+
-"</jnlp>"
-
-var encodedUri = encodeURI(jnpl);
-window.open(encodedUri)
-//alert(jnpl)
-}
+
 
 function openJalviewUsingCurrentUrl(){
-       var url = "http://webservices.compbio.dundee.ac.uk:38080/jalviewServlet/services/launchAppDev";
+       var jalviewData = JSON.parse(document.getElementById("seqData").value)
+    var jalviewVersion = jalviewData['jalviewVersion'];
+    var url = jalviewData['webStartUrl'];
        var myForm = document.createElement("form");
        myForm.action = url;
        
-    var myInput = document.createElement("input") ;
-    myInput.setAttribute("name", "jvm-max-heap") ;
-    myInput.setAttribute("value", "2G");
-    myForm.appendChild(myInput) ;
+    var heap = document.createElement("input") ;
+    heap.setAttribute("name", "jvm-max-heap") ;
+    heap.setAttribute("value", "2G");
+    myForm.appendChild(heap) ;
     
-    var myInput1 = document.createElement("input") ;
-    myInput1.setAttribute("name", "open") ;
-    myInput1.setAttribute("value", document.URL);
-    myForm.appendChild(myInput1) ;
+    var target = document.createElement("input") ;
+    target.setAttribute("name", "open") ;
+    target.setAttribute("value", document.URL);
+    myForm.appendChild(target) ;
+    
+    var jvVersion = document.createElement("input") ;
+    jvVersion.setAttribute("name", "version") ;
+    jvVersion.setAttribute("value", jalviewVersion);
+    myForm.appendChild(jvVersion) ;
     
-
        document.body.appendChild(myForm) ;
        myForm.submit() ;
        document.body.removeChild(myForm) ;
@@ -9051,7 +9025,6 @@ m.addView("menu", defMenu);
 
 // call render at the end to display the whole MSA
 m.render();
 toggleMenuVisibility(); 
 toggleMenuVisibility(); 
 });
diff --git a/examples/uniref50.score_ascii b/examples/uniref50.score_ascii
new file mode 100644 (file)
index 0000000..4a506d9
--- /dev/null
@@ -0,0 +1,99 @@
+T-COFFEE, Version_8.99(Fri Feb 18 08:27:45 CET 2011 - Revision 596)
+Cedric Notredame 
+CPU TIME:0 sec.
+SCORE=94
+*
+ BAD AVG GOOD
+*
+FER_CAPAA      :  99
+FER_CAPAN      :  94
+FER1_SOLLC     :  94
+Q93XJ9_SOLTU   :  93
+FER1_PEA       :  93
+Q7XA98_TRIPR   :  92
+FER1_MESCR     :  92
+FER1_SPIOL     :  92
+FER3_RAPSA     :  99
+FER1_ARATH     :  93
+FER_BRANA      :  99
+FER2_ARATH     :  93
+Q93Z60_ARATH   :  92
+FER1_MAIZE     :  91
+O80429_MAIZE   :  91
+cons           :  94
+
+FER_CAPAA      ------------------------------------------------
+FER_CAPAN      99------333445778888876665554-23333345--6778765-
+FER1_SOLLC     98------344556788888876665544-23333344--5677765-
+Q93XJ9_SOLTU   98------344556788888876555554-23333344--5677765-
+FER1_PEA       9964---1344556788888876655544-23333344--6778876-
+Q7XA98_TRIPR   9964---1344566788888876665554-222222210056777650
+FER1_MESCR     9954--1124455677878765--22222122233345--5677776-
+FER1_SPIOL     9965--111111--677777765444444233334445--6789876-
+FER3_RAPSA     ------------------------------------------------
+FER1_ARATH     9965----344556888888876665554233333344--6788776-
+FER_BRANA      ------------------------------------------------
+FER2_ARATH     9965----344556888888876665555233333345--6778876-
+Q93Z60_ARATH   9965----344556888888876665555233333345--6778876-
+FER1_MAIZE     99540001222334677777765555443--2222233--4567554-
+O80429_MAIZE   9854---------23445555---11111111111111--1212222-
+cons           996400012344557778887766544441222233340056777650
+
+
+FER_CAPAA      -----------9999999999999999999999999999999999999
+FER_CAPAN      4--445678999999999999999999999999999999999999999
+FER1_SOLLC     4--445678999999999999999999999999999999999999999
+Q93XJ9_SOLTU   4--445678999999999999999999999999999999999999999
+FER1_PEA       533444568999999999999999999999999999999999999999
+Q7XA98_TRIPR   333434568999999999999999999999999999999999999999
+FER1_MESCR     4333-5678999999999999999999999999999999999999999
+FER1_SPIOL     422--2334599999999999999999999999999999999999999
+FER3_RAPSA     -----------9999999999999999999999999999999999999
+FER1_ARATH     533446788999999999999999999999999999999999999999
+FER_BRANA      -----------9999999999999999999999999999999999999
+FER2_ARATH     533546788999999999999999999999999999999999999999
+Q93Z60_ARATH   533546788999999999999999999999999999999999999999
+FER1_MAIZE     4222--567899999999999999999999999999999999999999
+O80429_MAIZE   222435678999999999999999999999999999999999999999
+cons           422445677899999999999999999999999999999999999999
+
+
+FER_CAPAA      999999999999999999999999999999999999999999999999
+FER_CAPAN      999999999999999999999999999999999999999999999999
+FER1_SOLLC     999999999999999999999999999999999999999999999999
+Q93XJ9_SOLTU   999999999999999999999999999999999999999999999999
+FER1_PEA       999999999999999999999999999999999999999999999999
+Q7XA98_TRIPR   999999999999999999999999999999999999999999999999
+FER1_MESCR     999999999999999999999999999999999999999999999999
+FER1_SPIOL     999999999999999999999999999999999999999999999999
+FER3_RAPSA     999999999999999999999999999999999999999999999999
+FER1_ARATH     999999999999999999999999999999999999999999999999
+FER_BRANA      999999999999999999999999999999999999999999999999
+FER2_ARATH     999999999999999999999999999999999999999999999999
+Q93Z60_ARATH   99999999999999999999999999999-------------------
+FER1_MAIZE     999999999999999999999999999999999999999999999999
+O80429_MAIZE   999999999999999999999999999999999999999999999999
+cons           999999999999999999999999999999999999999999999999
+
+
+FER_CAPAA      999999998865-
+FER_CAPAN      999999998865-
+FER1_SOLLC     999999998865-
+Q93XJ9_SOLTU   999999998865-
+FER1_PEA       999999999865-
+Q7XA98_TRIPR   999999998865-
+FER1_MESCR     999999998865-
+FER1_SPIOL     999999998865-
+FER3_RAPSA     99999999874--
+FER1_ARATH     99999998874--
+FER_BRANA      99999999874--
+FER2_ARATH     99999998764--
+Q93Z60_ARATH   -------------
+FER1_MAIZE     9999999998620
+O80429_MAIZE   99999999874--
+cons           9999999987550
+
+
+
+
+
index 7750265..af010a4 100755 (executable)
@@ -39,6 +39,7 @@
    <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="seqannots" url="html/features/annotation.html#seqannots"/>
    <mapID target="seqfetch" url="html/features/seqfetch.html"/>
    <mapID target="dbreffetcher" url="html/webServices/dbreffetcher.html"/>
    <mapID target="seqmappings" url="html/features/seqmappings.html"/>
    <mapID target="viewingpdbs.reps" url="html/features/viewingpdbs.html#viewreps"/>
    <mapID target="pdbmcviewer" url="html/features/pdbviewer.html"/>
    <mapID target="pdbjmol" url="html/features/jmol.html"/>
+   <mapID target="chimera" url="html/features/chimera.html"/>
    <mapID target="varna" url="html/features/varna.html"/>
+   <mapID target="xsspannotation" url="html/features/xsspannotation.html"/>
    <mapID target="preferences" url="html/features/preferences.html"/>     
+   <mapID target="strucprefs" url="html/features/preferences.html#structure"/>     
    <mapID target="commandline" url="html/features/commandline.html"/>
    <mapID target="clarguments" url="html/features/clarguments.html"/>
    <mapID target="io" url="html/io/index.html"/>
    
    <mapID target="wsMenu" url="html/menus/wsmenu.html"/>
    <mapID target="popMenu" url="html/menus/popupMenu.html"/>
+   <mapID target="popMenuAddref" url="html/menus/popupMenu.html#addrefannot"/>
    <mapID target="annotPanelMenu" url="html/menus/alwannotationpanel.html"/>
    
    <mapID target="memory" url="html/memory.html" />
-   <mapID target="jalviewjnlp" url="html/jalviewjnlp.html" />
    <mapID target="groovy" url="html/features/groovy.html" />
    <mapID target="privacy" url="html/privacy.html" />
    <mapID target="vamsas" url="html/vamsas/index.html"/>
index 4c09e8f..b67eb6f 100755 (executable)
 <?xml version="1.0" encoding="ISO-8859-1"  ?>
-<!--
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
- * 
- * 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/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
--->
+<!-- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) * 
+       Copyright (C) 2014 The Jalview Authors * * 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/>. 
+       * The Jalview Authors are detailed in the 'AUTHORS' file. -->
 <!DOCTYPE toc PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp TOC Version 1.0//EN" "http://java.sun.com/products/javahelp/toc_1_0.dtd">
 <toc version="1.0">
-<tocitem text="Jalview Documentation" target="home" expand="true" >
- <tocitem text="What's new" target="new" expand="true">
-    <tocitem text="RNAalifold RNA Secondary Structure Prediction" target="rnaalifold"/>
-    <tocitem text="Select columns containing sequence features" target="seqfeatures.settings.selcols"/>
-    <tocitem text="View all representative PDB structures" target="viewingpdbs.reps"/>
-    <tocitem text="Support for PAM250 for trees and PCA calculations" target="subtMatrices.pam250"/>
-  </tocitem>
-  <tocitem text="Editing Alignments" target ="edit"/>  
-  <tocitem text="Cursor Mode" target="cursor"/>
-  <tocitem text="Key Strokes" target="keys"/>
-       <tocitem text="Input / Output" target="io"/>
-       <tocitem text="Making Figures" target="export"/>
-       <tocitem text="Hidden Regions" target="hiddenRegions"/>
-       <tocitem text="Multiple Views" target="multipleviews"/>
-       <tocitem text="Viewing Trees" target="treeviewer" expand="false"/>
-       <tocitem text="Fetching Sequences" target="seqfetch"/>
-       <tocitem text="Nucleic Acid Support" target="nucleicAcids" expand="false">
-               <tocitem text="Viewing RNA structure" target="varna" />
-               <tocitem text="RNA Structure Consensus" target="calcs.alstrconsensus"/>
-               <tocitem text="RNA Helices coloring" target="colours.rnahelices"/>
-       </tocitem>
-       <tocitem text="Sequence Features" target="seqfeatures" expand="false">
-          <tocitem text="Sequence Feature Settings" target="seqfeatures.settings"/>
-          <tocitem text="Sequence Features File" target="features.fileformat"/>
-          <tocitem text="Feature Colourschemes" target="features.featureschemes"/>
-          <tocitem text="User Defined Sequence Features" target="seqfeatcreat"/>
-                 <tocitem text="Editing Sequence Features" target="seqfeatedit"/>
-          <tocitem text="DAS Feature Retrieval" target="das.viewing"/>
-         <tocitem text="DAS Feature Settings" target="das.settings"/>
-         <tocitem text="HTML annotation report" target="io.seqreport"/>
-        </tocitem>
-       <tocitem text="Web Services" target="webservice" expand="false">
-       <tocitem text="JABAWS" target="jabaws"/>
-       <tocitem text="Web Service Preferences" target="wsprefs"/>
-       <tocitem text="Web Service Parameters" target="wsparams"/>
-       <tocitem text="Sequence Alignment" target="msaservice" expand="false">
-                <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"/>
-               <tocitem text="Sequence Retrieval" target="seqfetch"/>
-               <tocitem text="Database Reference Retrieval" target="dbreffetcher"/>
-               <tocitem text="DAS Feature Retrieval" target="das.viewing"/>
-       </tocitem>
-       <tocitem text="Colour Schemes" target="colours" expand="false">
-               <tocitem text="Background Dependent Text Colour" target="backdeptextcol"/>
-               <tocitem text="ClustalX" target="colours.clustal"/>
-               <tocitem text="Zappo" target="colours.zappo"/>
-               <tocitem text="Taylor" target="colours.taylor"/>
-               <tocitem text="Hydrophobicity" target="colours.hydro"/>
-               <tocitem text="Helix propensity" target="colours.helix"/>
-               <tocitem text="Strand propensity" target="colours.strand"/>
-               <tocitem text="Turn propensity" target="colours.turn"/>
-               <tocitem text="Buried index" target="colours.buried"/>
-               <tocitem text="Nucleotide colours" target="colours.nucleotide"/>
-               <tocitem text="Purine/Pyrimidine colours" target="colours.purinepyrimidine"/>
-               <tocitem text="Blosum62" target="colours.blosum"/>
-               <tocitem text="by Percentage Identity" target="colours.pid"/>   
-               <tocitem text="User Defined" target="colours.user"/>
-               <tocitem text="Above Percentage Identity" target="colours.abovepid"/>
-               <tocitem text="By conservation" target="colours.conservation"/>
-    <tocitem text="T-COFFEE Scores" target="io.tcoffeescores"/>
-               <tocitem text="By Annotation" target="colours.annotation"/>
-               <tocitem text="By RNA Helices" target="colours.rnahelices"/>
-       </tocitem>
-       <tocitem text="Calculations" target="calculations" expand="false">
-               <tocitem text="Sorting alignments" target="sorting"/>
-                <tocitem text="Calculating trees" target="trees"/>
-               <tocitem text="Principal Component Analysis" target="pca"/>
-               <tocitem text="Tree/PCA Input Data" target="recoverInputdata"/>
-               <tocitem text="Pairwise Alignments" target="pairwise"/>
-               <tocitem text="Remove Redundancy" target="redundancy"/>
-       </tocitem>
-       <tocitem text="Alignment Annotations" target ="alannotation" expand="false">
-          <tocitem text="Conservation" target="calcs.alconserv"/>          
-          <tocitem text="Quality" target="calcs.alquality"/>
-          <tocitem text="Consensus" target="calcs.consensus"/>
-          <tocitem text="RNA Structure Consensus" target="calcs.alstrconsensus"/>
-          <tocitem text="Annotations File Format" target="annotations.fileformat"/>
-        </tocitem>
-       <tocitem text="Viewing PDB Files" target="viewingpdbs" expand="false">
-         <tocitem text="Jmol Viewer" target="pdbjmol"/>
-         <tocitem text="Simple PDB Viewer" target="pdbmcviewer"/>
-       </tocitem>
-       <tocitem text="Viewing RNA structures" target="varna" expand="false">   </tocitem>
-       <tocitem text="VAMSAS Data Exchange" target="vamsas">
-               <!-- what can Jalview share with other apps -->
-               <!-- what other apps exist -->
+<!-- DO NOT WRAP THESE LINES - help2Website relies on each item being on one line! -->
+       <tocitem text="Jalview Documentation" target="home" expand="true">
+               <tocitem text="What's new" target="new" expand="true">
+                       <tocitem text="Annotation from Structure" target="xsspannotation" expand="false" />
+                       <tocitem text="Annotation Panel Menu" target="alwAnnotations" />
+                       <tocitem text="Add reference annotation" target="popMenuAddref" />
+                       <tocitem text="Colour By Annotation" target="colours.annotation" />
+                       <tocitem text="Chimera Viewer" target="chimera" />
+                       <tocitem text="Structure Preferences" target="strucprefs" />
+               </tocitem>
+               <tocitem text="Editing Alignments" target="edit" />
+               <tocitem text="Cursor Mode" target="cursor" />
+               <tocitem text="Key Strokes" target="keys" />
+               <tocitem text="Input / Output" target="io" />
+               <tocitem text="Making Figures" target="export" />
+               <tocitem text="Hidden Regions" target="hiddenRegions" />
+               <tocitem text="Multiple Views" target="multipleviews" />
+               <tocitem text="Viewing Trees" target="treeviewer" expand="false" />
+               <tocitem text="Fetching Sequences" target="seqfetch" />
+               <tocitem text="Nucleic Acid Support" target="nucleicAcids" expand="false">
+                       <tocitem text="Viewing RNA structure" target="varna" />
+                       <tocitem text="RNA Structure Consensus" target="calcs.alstrconsensus" />
+                       <tocitem text="RNA Helices coloring" target="colours.rnahelices" />
+               </tocitem>
+               <tocitem text="Sequence Features" target="seqfeatures" expand="false">
+                       <tocitem text="Sequence Feature Settings" target="seqfeatures.settings" />
+                       <tocitem text="Sequence Features File" target="features.fileformat" />
+                       <tocitem text="Feature Colourschemes" target="features.featureschemes" />
+                       <tocitem text="User Defined Sequence Features" target="seqfeatcreat" />
+                       <tocitem text="Editing Sequence Features" target="seqfeatedit" />
+                       <tocitem text="DAS Feature Retrieval" target="das.viewing" />
+                       <tocitem text="DAS Feature Settings" target="das.settings" />
+                       <tocitem text="HTML annotation report" target="io.seqreport" />
+               </tocitem>
+               <tocitem text="Web Services" target="webservice" expand="false">
+                       <tocitem text="JABAWS" target="jabaws" />
+                       <tocitem text="Web Service Preferences" target="wsprefs" />
+                       <tocitem text="Web Service Parameters" target="wsparams" />
+                       <tocitem text="Sequence Alignment" target="msaservice"  expand="false">
+                               <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" />
+                       <tocitem text="Sequence Retrieval" target="seqfetch" />
+                       <tocitem text="Database Reference Retrieval" target="dbreffetcher" />
+                       <tocitem text="DAS Feature Retrieval" target="das.viewing" />
+               </tocitem>
+               <tocitem text="Colour Schemes" target="colours" expand="false">
+                       <tocitem text="Background Dependent Text Colour" target="backdeptextcol" />
+                       <tocitem text="ClustalX" target="colours.clustal" />
+                       <tocitem text="Zappo" target="colours.zappo" />
+                       <tocitem text="Taylor" target="colours.taylor" />
+                       <tocitem text="Hydrophobicity" target="colours.hydro" />
+                       <tocitem text="Helix propensity" target="colours.helix" />
+                       <tocitem text="Strand propensity" target="colours.strand" />
+                       <tocitem text="Turn propensity" target="colours.turn" />
+                       <tocitem text="Buried index" target="colours.buried" />
+                       <tocitem text="Nucleotide colours" target="colours.nucleotide" />
+                       <tocitem text="Purine/Pyrimidine colours" target="colours.purinepyrimidine" />
+                       <tocitem text="Blosum62" target="colours.blosum" />
+                       <tocitem text="by Percentage Identity" target="colours.pid" />
+                       <tocitem text="User Defined" target="colours.user" />
+                       <tocitem text="Above Percentage Identity" target="colours.abovepid" />
+                       <tocitem text="By conservation" target="colours.conservation" />
+                       <tocitem text="T-COFFEE Scores" target="io.tcoffeescores" />
+                       <tocitem text="By Annotation" target="colours.annotation" />
+                       <tocitem text="By RNA Helices" target="colours.rnahelices" />
                </tocitem>
-       <tocitem text="Window Menus" target="menus" expand="false">
-               <tocitem text="Desktop Window" target="desktopMenu"/>
-               <tocitem text="Alignment Window" target="alMenu">
-            <tocitem text="File Menu" target="alwFile"/>
-            <tocitem text="Edit Menu" target="alwEdit"/>
-                       <tocitem text="Select Menu" target="alwSelect"/> 
-            <tocitem text="View Menu" target="alwView"/>
-            <tocitem text="Annotations Menu" target="alwAnnotations"/>
-                       <tocitem text="Format Menu" target="alwFormat"/>
-            <tocitem text="Colour Menu" target="alwColour"/>
-            <tocitem text="Calculation Menu" target="alwCalc"/>
-                       <tocitem text="Web Service Menu" target="wsMenu"/>
-                       <tocitem text="Annotation Panel Menu" target="annotPanelMenu"/>
-                       <tocitem text="Popup Menu" target="popMenu"/>
-        </tocitem>
+               <tocitem text="Calculations" target="calculations" expand="false">
+                       <tocitem text="Sorting alignments" target="sorting" />
+                       <tocitem text="Calculating trees" target="trees" />
+                       <tocitem text="Principal Component Analysis" target="pca" />
+                       <tocitem text="Tree/PCA Input Data" target="recoverInputdata" />
+                       <tocitem text="Pairwise Alignments" target="pairwise" />
+                       <tocitem text="Remove Redundancy" target="redundancy" />
+               </tocitem>
+               <tocitem text="Sequence Annotations" target="seqannots" expand="true">
+                       <tocitem text="Annotation from Structure" target="xsspannotation" expand="false" />
+               </tocitem>
+               <tocitem text="Alignment Annotations" target="alannotation" expand="false">
+                       <tocitem text="Conservation" target="calcs.alconserv" />
+                       <tocitem text="Quality" target="calcs.alquality" />
+                       <tocitem text="Consensus" target="calcs.consensus" />
+                       <tocitem text="RNA Structure Consensus" target="calcs.alstrconsensus" />
+                       <tocitem text="Annotations File Format" target="annotations.fileformat" />
+               </tocitem>
+               <tocitem text="Viewing PDB Files" target="viewingpdbs" expand="false">
+                       <tocitem text="Jmol Viewer" target="pdbjmol" />
+                       <tocitem text="Chimera Viewer" target="chimera" />
+                       <tocitem text="Simple PDB Viewer" target="pdbmcviewer" />
+               </tocitem>
+               <tocitem text="Viewing RNA structures" target="varna" expand="false"/>
+               <tocitem text="VAMSAS Data Exchange" target="vamsas">
+                       <!-- what can Jalview share with other apps -->
+                       <!-- what other apps exist -->
+               </tocitem>
+               <tocitem text="Window Menus" target="menus" expand="false">
+                       <tocitem text="Desktop Window" target="desktopMenu" />
+                       <tocitem text="Alignment Window" target="alMenu">
+                               <tocitem text="File Menu" target="alwFile" />
+                               <tocitem text="Edit Menu" target="alwEdit" />
+                               <tocitem text="Select Menu" target="alwSelect" />
+                               <tocitem text="View Menu" target="alwView" />
+                               <tocitem text="Annotations Menu" target="alwAnnotations" />
+                               <tocitem text="Format Menu" target="alwFormat" />
+                               <tocitem text="Colour Menu" target="alwColour" />
+                               <tocitem text="Calculation Menu" target="alwCalc" />
+                               <tocitem text="Web Service Menu" target="wsMenu" />
+                               <tocitem text="Annotation Panel Menu" target="annotPanelMenu" />
+                               <tocitem text="Popup Menu" target="popMenu" />
+                       </tocitem>
+               </tocitem>
+               <tocitem text="Preferences" target="preferences" />
+               <tocitem text="Memory Settings" target="memory" expand="false"/>
+               <tocitem text="Command Line" target="commandline" expand="false">
+                       <tocitem text="Command Line Arguments" target="clarguments" />
+                       <tocitem text="Groovy Shell" target="groovy" />
+               </tocitem>
+               <tocitem text="Privacy" target="privacy" />
+       </tocitem>
+       <tocitem text="Useful information" expand="true">
+               <tocitem text="Amino Acid Table" target="aminoAcids" />
+               <tocitem text="Amino Acid Properties" target="aaProperties" />
+               <tocitem text="The Genetic Code" target="geneticCode" />
+               <tocitem text="Sequence Substitution Matrices" target="subtMatrices" />
+
        </tocitem>
-        <tocitem text="Preferences" target="preferences"/>
-       <tocitem text="Memory Settings" target="memory" expand="false">
-          <tocitem text="JNLP with extra memory parameters" target="jalviewjnlp"/>
-          </tocitem>
-        <tocitem text="Command Line" target="commandline" expand="false">
-          <tocitem text="Command Line Arguments" target="clarguments"/>
-             <tocitem text="Groovy Shell" target="groovy"/>
-        </tocitem>
-               <tocitem text="Privacy" target="privacy"/>
-</tocitem>
-<tocitem text="Useful information" expand="true">
-       <tocitem text="Amino Acid Table" target="aminoAcids"/>
-       <tocitem text="Amino Acid Properties" target="aaProperties"/>
-       <tocitem text="The Genetic Code" target="geneticCode"/>
-       <tocitem text="Sequence Substitution Matrices" target="subtMatrices"/>
-  
-</tocitem>
 </toc>
index bc42278..d5ce720 100644 (file)
@@ -23,7 +23,7 @@
 <body>
 <p><strong>Alignment Consensus Annotation</strong></p>
 <p>The consensus displayed below the alignment is the percentage of the modal 
-  residue per column. By default this calculation takes includes gaps in column. 
+  residue per column. By default this calculation includes gaps in columns. 
   You can choose to ignore gaps in the calculation by right clicking on the label 
   &quot;Consensus&quot; to the left of the consensus bar chart. 
 <p>If the modal value is shared by more than 1 residue, a &quot;+&quot; symbol 
@@ -38,7 +38,7 @@ clipboard.
        By clicking on the label you can also activate the sequence logo. It
        indicates the relative amount of residues per column which can be
        estimated by its size in the logo. The tooltip of a column gives the
-       exact numbers for all occuring residues.
+       exact numbers for all occurring residues.
        <br />If columns of the alignment are very diverse, then it can
        sometimes be difficult to see the sequence logo - in this case, right
        click on the annotation row label and select
index 8d6f329..66dbabd 100755 (executable)
@@ -37,10 +37,10 @@ executing the calculation via a web service.</p>
 <p><strong>About PCA</strong></p>
 <p>Principal components analysis is a technique for examining the
 structure of complex data sets. The components are a set of dimensions
-formed from the measured values in the data set, and the principle
+formed from the measured values in the data set, and the principal
 component is the one with the greatest magnitude, or length. The sets of
 measurements that differ the most should lie at either end of this
-principle axis, and the other axes correspond to less extreme patterns
+principal axis, and the other axes correspond to less extreme patterns
 of variation in the data set.</p>
 
        <p>
index 75d9f55..5100c6b 100755 (executable)
                                symbols and graphs, this may be black by default, so your alignment
                                will be coloured black.</em>
                </li>
+               <li><em>Secondary structure annotation colouring</em><br />By
+                       default, Jalview will employ the helix or sheet colours to shade
+                       sequences and columns by available secondary structure annotation
+                       tracks. In the case of RNA, each structure is processed to identify
+                       distinct RNA helices and rendered in the same way as the <a
+                       href="rnahelicesColouring.html">RNA Helices shading scheme</a>. <em>Structure based sequence shading was added in Jalview 2.8.2</em></li>
                <li>The colour scheme can display a colour gradient from a colour
                        representing the minimum value in the selected annotation to a colour
                        representing the maximum value in the selected annotation. Use the
index 47b992a..d4e70fb 100755 (executable)
@@ -35,6 +35,7 @@ td {
   The PID option colours the residues (boxes and/or text) according to the percentage
   of the residues in each column that agree with the consensus sequence. Only
   the residues that agree with the consensus residue for each column are coloured.</p>
+<div align="center">
 <table width="200" border="1">
   <tr>
     <td bgcolor="#6464FF">&gt; 80 %</td>
@@ -49,5 +50,6 @@ td {
     <td>&lt; 40%</td>
   </tr>
 </table>
+</div>
 </body>
 </html>
index 49128c2..01d9f64 100755 (executable)
@@ -39,6 +39,15 @@ and symbolic annotations can be added to an alignment via an <a
 href="annotationsFormat.html">Annotations File</a> dragged into the
 alignment window or loaded from the alignment's file menu.
 </p>
+<p><a name="seqannots"/><strong>Sequence Reference Annotation</strong>
+</p>
+<p>
+               Sequence reference annotation is created from 3D structure
+               data, and from the results of sequence based prediction of
+               <a href="../webServices/jnet.html">secondary structure</a> and <a
+                       href="../webServices/proteinDisorder.html">disordered region</a>
+               prediction methods. 
+</p>
 <p><strong>Interactive Alignment Annotation</strong></p>
 <p>
 Annotation rows are added using the <strong>Annotation Label</strong>
@@ -123,7 +132,7 @@ href="../features/jalarchive.html">Jalview Archives</a>.
 </p>
 <p><em>Current Limitations</em></p>
 <p>As of version 2.5, the Jalview user interface does not support the 
-creation and editing quantitative annotation (histograms and line graphs), or 
+creation and editing of quantitative annotation (histograms and line graphs), or 
 to create annotation associated with a specific sequence. It is also incapable of
 annotation grouping or changing the style of existing annotation (to change between line or bar charts, or to make multiple line graphs). These annotation capabilities are only possible by the import of an 
 <a href="annotationsFormat.html">Annotation file</a>.<br>
diff --git a/help/html/features/chimera.html b/help/html/features/chimera.html
new file mode 100644 (file)
index 0000000..dbaad73
--- /dev/null
@@ -0,0 +1,175 @@
+<html>
+<!--
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
+ * Copyright (C) 2014 The Jalview Authors
+ * 
+ * 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/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ -->
+<head>
+<title>The Chimera PDB Viewer</title>
+</head>
+<body>
+<p><strong>The Chimera Viewer</strong></p>
+<p>Since Jalview 2.8.2, <a href="http://www.cgl.ucsf.edu/chimera/">Chimera</a> (http://www.cgl.ucsf.edu/chimera/)
+has been integrated into Jalview for interactively viewing structures
+opened by entries in the <strong>&quot;Structure&quot;</strong> submenu in the <a href="../menus/popupMenu.html">sequence
+id pop-up menu</a> (if you can't see this, then you need to <a
+       href="viewingpdbs.html">associate a PDB structure</a> with the
+sequence). Chimera is available from the Jalview desktop, provided Chimera has been separately installed.</p>
+<p>You can set a default choice of Jmol or Chimera structure viewer in <a href="preferences.html#structure"> Preferences</a>. 
+You can also optionally specify the path to the Chimera program here (if it differs from the standard paths searched by Jalview).
+<p>The following menu entries are provided for viewing structure data<br>
+  <ul>
+    <li>The <strong>&quot;Structure&#8594;View
+        Structure&#8594;</strong> submenu allows a single PDB structure to be chosen
+      for display from the available structures for a sequence.
+    </li>
+    <li>The <strong>&quot;Structure&#8594;View all <em>N</em>
+        structures
+    </strong> option will open a new window containing all structures associated
+      with the current selection.
+    </li>
+    <li>The <strong>&quot;Structure&#8594;View all <em>N</em>
+        representative structures
+    </strong> option will open a new window containing exactly one structure per
+      currently selected sequence.<br /></li>
+  </ul>
+  <br> 
+</p>
+<p><a name="align"><strong>Superposing structures based
+on their aligned sequences</strong></a><br>
+<p>If several structures are available on the alignment, you may add
+additional structures to an existing Chimera view by selecting their entry
+in the appropriate pop-up menu. Jalview will ask you if you wish to add
+the structure to the existing alignment, and if you do, it will import
+and superimpose the new PDB file using the corresponding positions from
+the alignment. If the alignment is subsequently edited, you can use the
+<a href="#sAlign"><em>Chimera&#8594;Align</em></a> menu option from the
+menu bar of the structure view window to superpose the structures using
+the updated alignment.<br>
+</p>
+<p><strong>Chimera Controls</strong><br>
+<p>The structure is by default rendered as a ribbon diagram. Moving the
+mouse over the structure brings up tooltips giving the residue name, PDB
+residue number and chain code
+([RES]Num:Chain). Moving the mouse over an
+associated residue in an alignment window highlights the associated
+atoms in the displayed structures. For comprehensive details of Chimera's commands, refer to the tool's Help menu.</p>
+<p>Basic screen operations (see <a href="http://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/mouse.html">Chimera help</a> 
+(http://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/mouse.html) for full details).
+<table border="1">
+       <tr>
+               <td><strong>Action</strong></td>
+               <td><strong>Windows</strong></td>
+               <td><strong>Unix</strong></td>
+               <td><strong>Mac/OSX</strong></td>
+       </tr>
+       <tr>
+               <td>Rotate View</td>
+               <td>Left Click and Drag</td>
+               <td>Left Click and Drag</td>
+               <td>Left Click and Drag</td>
+       </tr>
+       <tr>
+               <td>Zoom</td><td>Right Click<br>
+               drag mouse up or down</td>
+               <td>Right Click<br>drag mouse up or down</td>
+               <td>cmd or Right + Click and drag mouse up or down, <br>or use mouse scroll button</td>
+       </tr>
+       <tr>
+               <td>Move Origin</td>
+               <td>Middle Button + Drag</td>
+               <td>Middle Button and drag</td>
+               <td>alt + Click<br>
+               and drag</td>
+       </tr>
+</table>
+</p>
+<p><strong>Jalview Controls</strong>
+<p>The Jalview Chimera View window has up to five menus:
+<ul>
+       <li><Strong>File<br>
+       </strong>
+       <ul>
+               <li><strong>View Mapping<br>
+               </strong><em> Opens a text window showing the alignment between the
+               residues corresponding to alpha-carbon atoms in the PDB structure and
+               the residues in the associated sequence.</em></li>
+       </ul>
+       </li>
+       <li><strong>View</strong>
+       <ul>
+               <li><strong>Show Chains<br>
+               </strong><em>Select which of the PDB file's chains (if more than one) are to be displayed.</em></li>
+               <li><strong>Colour by ..<br></strong><em>Submenu allowing specific alignment views to be selected for colouring associated chains in the structure display. This menu contains all the alignment views associated with the structure view, with those used to colour the view indicated by ticks. Addditionally, it contains the following menu entries:</em>
+               <ul><li><strong>Select many views<br></strong><em>When this option is enabled, selecting an alignment view adds it to the set used to colour the structures. Use this when colouring structures related to a number of alignments involving different domains or chains which are shown in the same structure view.</em>
+               </li>
+    <li><strong>Select all views<br></strong><em>This is only enabled when </em><strong>Select many views</strong><em> is also enabled, and will add all associated views to the set used to colour the structure display.</em>
+  </li>
+    <li><strong>Invert selection<br></strong><em>This is only enabled when </em><strong>Select many views</strong><em> is also enabled, and will replace the current set of views with any remaining views not currently used to colour the structure display.</em>
+  </li></ul></li></ul>
+       <li><strong>Colours<br>
+       </strong>
+       <ul>
+               <li><strong>By Sequence<br>
+               </strong><em> Colours each residue in the structure with the colour of its
+               corresponding residue in the associated sequence as rendered in the
+               associated alignment views, including any Uniprot sequence features or
+               region colourings.<br/>Pick which of the associated alignment views are used to colour the structures using the <strong>View&#8594;Colour by ..</strong> sub menu.</em><br>
+               Residues which only exist in the PDB structure are coloured white if
+               they are insertions (relative to the associated sequence in the
+               alignment) and grey if they are N or C terminal flanks outside the
+               region mapped to the alignment window's sequence.</em></li>
+               <li><strong>By Chain<br>
+               </strong><em>Uses the Chimera 'rainbow chain' command to apply a different colour to each chain.</em></li>
+               <li><strong>Charge &amp; Cysteine<br>
+               </strong><em> Highlights cysteines in yellow, anionic (Aspartic Acid or
+               Glutamic Acid) residues in red, and cationic (Lysine or Arginine)
+               residues in blue.</em></li>
+               <li><strong>Colour with Chimera<br></strong><em>Defers any colouring operations to Chimera. Select this if you want to use the 
+               Chimera scripting interface or menu to modify the view directly.</em></li>
+               <li><strong>Standard and User Defined Jalview
+               colourschemes.<br>
+               </strong><em>The remaining entries apply the colourschemes available from
+               the standard and user defined <a href="../colourSchemes/index.html">amino
+               acid colours</a>.</em></li>
+       </ul>
+       </li>
+       <li><strong>Chimera<br>
+       </strong><em>This pulldown menu is only displayed if there are multiple
+       structures shown in the Chimera window, and Jalview can also locate at
+       least two of the structures in the currently associated alignment view.</em>
+       <ul>
+               <li><strong><a name="sAlign">Align</a> <br>
+               </strong><em> When selected, the associated alignment will be used to
+               superimpose all the structures in the view onto the first structure in
+               the alignment. The regions used to calculate the superposition will be
+               highlighted using the 'Cartoon' rendering style, and the remaining
+               data shown as a chain trace.<br></em></li>
+       </ul>
+       </li>
+       <li><strong>Help<br>
+       </strong>
+       <ul>
+               <li><strong>Chimera Help<br>
+               </strong><em>Access the Chimera Help documentation in a new browser window.</em></li>
+       </ul>
+       </li>
+</ul>
+</p>
+</body>
+</html>
index b9ef30d..2a040fe 100644 (file)
@@ -53,7 +53,7 @@
                </td>
                <td>Set the colourscheme for the alignment. This can be any of
                the built-in colourschemes, a name of a predefined colourscheme
-               (defined in the jalview properties file), or an 'inline' colourscheme
+               (defined in the Jalview properties file), or an 'inline' colourscheme
                (see the applet's colour parameter for more information).</td>
  </tr>
        <tr>
                arguments have been processed</div>
                </td>
        </tr>
+ <tr>
+   <td>
+     <div align="center">-jabaws URL</div>
+   <td>
+     <div align="left">Specify the URL of the preferred JABAWS server</div>
+   </td>
+ </tr>
        <tr>
        <td>
                <div align="center">-vdoc VAMSAS DOCUMENT FILE/URL</div>
  <td><div align="center">-eps FILE</div></td>
  <td><div align="left">Create EPS file FILE from alignment.</div></td>
  </tr>
+ <tr> 
+ <td><div align="center">-svg FILE</div></td>
+ <td><div align="left">Create Scalable Vector Graphics file FILE from alignment.</div></td>
+ </tr>
  </table>
 </body>
 </html>
index 9676ed7..86162dc 100644 (file)
@@ -45,7 +45,7 @@ more about these values.
 <p>When the DAS Settings panel is first opened, and when the <strong>'Refresh
 source'</strong> buton is pressed, a list of DAS sources is retrieved from the
 DAS registry URL (set by default to the DAS registration server at
-http://das.sanger.ac.uk/registry/das1/sources/).</p>
+http://www.dasregistry.org/das/).</p>
 <p><strong>Adding your own DAS Sources</strong></p>
 <p>You can add your own DAS source to the list by clicking the
 &quot;Add Local Source&quot; button. Enter the URL and nickname of your
index 8665e66..32b4ccb 100755 (executable)
@@ -163,7 +163,7 @@ Specify the <em>start</em> and <em>end</em> for a feature to be
 <strong>0</strong> in order to attach it to the whole sequence.
 Non-positional features are shown in a tooltip when the mouse
 hovers over the sequence ID panel, and any embedded links can be
-accessed from the popup menu. <em>Scores</em><br>
+accessed from the popup menu.<br/> <em>Scores</em><br>
 Scores can be associated with sequence features, and used to sort
 sequences or shade the alignment (this was added in jalview 2.5).
 The score field is optional, and malformed scores will be
index 63217ee..3830302 100755 (executable)
@@ -76,8 +76,8 @@ alignment based on the average score or total number of currently active
 features and groups on each sequence. To order the alignment using a
 specific feature type, use the <em>sort by ..</em> entries in the pop-up
 menu for that type.<br>
-<em>Feature sorting and graduated feature colouring was introduced
-in jalview 2.5</em></p>
+<em>Feature sorting and graduated feature colouring were introduced
+in Jalview 2.5</em></p>
 
 <p><strong>Transparency and Feature Ordering</strong></p>
 <p>It is important to realise that sequence features are often not
@@ -85,7 +85,7 @@ distinct and often overlap (for example, a metal binding site feature
 may be attached to one position along a stretch of sequence marked with
 a secondary structure feature).</p>
 <p>The ordering of the sequence features in the dialog box list is
-the order used by jalview for rendering sequence features. A feature at
+the order used by Jalview for rendering sequence features. A feature at
 the bottom of the list is rendered <em>below</em> a feature higher up in
 the list.<br>
 <em><strong>You can change the order of a feature by
index 9b85cf9..63920f5 100644 (file)
@@ -41,7 +41,7 @@ web service alignments performed on visible sequences.</p>
 A more advanced hide involves a right-mouse click on a sequence, then
 selecting <strong>&quot;SequenceID -&gt; Represent Group with
 SequenceId&quot;</strong>. Using this method of hiding sequences, any edits
-performed on the visible group representative will be propogated to all
+performed on the visible group representative will be propagated to all
 the sequences in that group. <br>
 The hidden representative sequences will not be used in any calculations
 or web service alignments (<em>nb. this may change in the future</em>).
index 5102679..45e5526 100644 (file)
@@ -79,7 +79,7 @@ atoms in the displayed structures.</p>
 and alpha carbon location. Double clicking an atom allows distances to
 be measured from it to any other atom in the structure.</p>
 <p>
-<table>
+<table border="1">
        <tr>
                <td><strong>Action</strong></td>
                <td><strong>Windows</strong></td>
@@ -162,7 +162,7 @@ be measured from it to any other atom in the structure.</p>
     <li><strong>Select all views<br></strong><em>This is only enabled when </em><strong>Select many views</strong><em> is also enabled, and will add all associated views to the set used to colour the structure display.</em>
   </li>
     <li><strong>Invert selection<br></strong><em>This is only enabled when </em><strong>Select many views</strong><em> is also enabled, and will replace the current set of views with any remaining views not currently used to colour the structure display.</em>
-  </li></ul></li>
+  </li></ul></li></ul>
        <li><strong>Colours<br>
        </strong>
        <ul>
index 209aba4..b1ccf4b 100644 (file)
 </head>
 <body>
 <p><strong>Multiple Alignment Views</strong></p>
-<p>Multiple alignment views allows the same alignment to be viewed
+<p>Multiple alignment views allow the same alignment to be viewed
 independently in many different ways simultaneously. Each view is an
 independent visualization of the same alignment, so each may have a
-different ordering, colouring, row and column hiding and seuqence
+different ordering, colouring, row and column hiding and sequence
 feature and annotation display setting, but alignment, feature and
 annotation edits are common to all, since this affects the underlying
 data.</p>
index 1831c3e..657359e 100755 (executable)
@@ -113,14 +113,16 @@ will be loaded.</p>
 <p><a name="structure"><strong>&quot;Structure&quot;
 Preferences tab</strong></a><em> added in Jalview 2.8.2</em></p>
 <p><em>Process secondary structure from PDB</em> - if selected, then structure information
-read from PDB will be processed to derive secondary structure annotation.
-<p><em>Use RNAView for secondary structure</em> - if selected, the RNAView service will be 
-automatically called to derive secondary structure information.
-<p><em>Add secondary structure annotation to alignment</em> - if selected, PDB secondary structure
-annotation will be shown on the alignment when available.
-<p><em>Add Temperature Factor annotation to alignment</em> - if selected, PDB Temperature Factor
-annotation will be shown on the alignment when available. 
+read from PDB will be processed and annotation added to associated sequences.
+<p><em>Use RNAView for secondary structure</em> - if selected, the pyRNA RNAView service (<a href="https://github.com/fjossinet/PyRNA">https://github.com/fjossinet/PyRNA</a>) will be 
+called to derive secondary structure information for RNA chains.
+<p><em>Add secondary structure annotation to alignment</em> - if selected, <a href="http://swift.cmbi.ru.nl/gv/dssp/">Jmol's implementation DSSP</a> will be used to add annotation to polypeptide chains in the structure.
+<p><em>Add Temperature Factor annotation to alignment</em> - if selected, values extracted from the Temperature Factor
+column for the backbone atoms in the PDB file will be extracted as annotation lines shown on the alignment. 
 <p><em>Default structure viewer</em> - choose JMOL or CHIMERA for viewing 3D structures. 
+<p><em>Path to Chimera program</em> - Optional, as Jalview will search standard installation paths for Windows, Linux or MacOS. 
+If you have installed Chimera in a non-standard location, you can specify it here, by entering the full path to the Chimera executable program.
+Double-click this field to open a file chooser dialog.  
 
 <p><a name="connections"><strong>&quot;Connections&quot;
 Preferences tab</strong></a></p>
index 6f4363b..5f0744d 100755 (executable)
@@ -25,7 +25,7 @@
 <body>
 <p><strong>Sequence Fetcher</strong></p>
 <p>Jalview can retrieve sequences from certain databases using either the
-WSDBFetch service provided by the European Bioinformatics Institute, and, since Jalview 2.4, DAS servers capable of the <em>sequence</em> command (configured in <a href="dassettings.html">DAS settings</a>).</p>
+WSDBFetch service provided by the European Bioinformatics Institute, or, since Jalview 2.4, DAS servers capable of the <em>sequence</em> command (configured in <a href="dassettings.html">DAS settings</a>).</p>
        <img src="seqfetcher.gif" align="center"
                alt="The Jalview Sequence Fetcher Dialog Box">
        <p>The Sequence Fetcher dialog box can be opened via the &quot;File&quot; 
index ffc582b..290135c 100644 (file)
@@ -30,7 +30,7 @@ selecting the <strong>&quot;Structure&#8594;View
 Structure:&quot;</strong> option in
 the <a href="../menus/popupMenu.html">sequence id pop-up menu</a> (if
 you can't see this, then no RNA structure is associated with your
-sequence or alignment. In the pop-up menu all structures that
+sequence or alignment). In the pop-up menu all structures that
 are associated with this sequence and all sequences that are
 associated with the alignment are available.
 
@@ -52,7 +52,7 @@ associated with the alignment are available.
     <b>Individual structures</b>:
     this is a structure associated with the individual sequence and therefore not related to the alignment    
   </li>
-
+</ul>
 <p><strong>Controls</strong><br>
 <ul>
 <li>Rotate view - Left Click and drag</li>
index 1f49498..99f17fe 100755 (executable)
 </head>
 <body>
 <p><strong>Viewing PDB Structures</strong></p>
-
-<p>Jalview can view protein structures associated with a sequence
-via the <strong>"Structure&rarr;"</strong> submenu from a
-sequence's <a href="../menus/popupMenu.html">pop-up menu</a>.</p>
-<p>The following menu entries are provided for viewing structure data<br>
+       <p>
+               Jalview can view protein structures associated with a sequence via the
+               <strong>"Structure&rarr;"</strong> submenu from a sequence's <a
+                       href="../menus/popupMenu.html">pop-up menu</a>.
+       </p>
+       The
+       <a href="jmol.html">Jmol viewer</a> has been included since Jalview
+       2.3. Jalview 2.8.2 included support for <a href="chimera.html">Chimera</a>, provided it is
+       installed and can be launched by Jalview. The default viewer can be
+       configured in the
+       <a href="preferences.html#structure">Structure tab</a> in the
+       <strong>Tools&rarr;Preferences</strong> dialog box.
+       <p>
+               Structure data imported into Jalview can also be processed to display
+               secondary structure and temperature factor annotation. See the <a
+                       href="xsspannotation.html">Annotation from Structure</a> page for
+               more information.
+       </p>
+       <p>The following menu entries are provided for viewing structure data<br>
   <ul>
     <li>The <strong>&quot;Structure&#8594;View
         Structure&#8594;</strong> submenu allows a single PDB structure to be chosen
@@ -40,14 +54,13 @@ sequence's <a href="../menus/popupMenu.html">pop-up menu</a>.</p>
       with the current selection, superposed according to the currently selected region of the alignment.<br/><em>This
       capability was added in Jalview 2.7</em>
     </li>
-    <li><a name="viewreps"/>The <strong>&quot;Structure&#8594;View all <em>N</em>
+    <li>The <strong>&quot;Structure&#8594;View all <em>N</em>
         representative structures
     </strong> option will open a new window containing exactly one structure per
       currently selected sequence.<br />
     <em>The View representative structures option was introduced in
         Jalview 2.8.1</em></li>
   </ul>
-  <br> 
 </p>
 
 <p>If a single pdb
@@ -55,19 +68,19 @@ structure is selected, one of the following will happen:</p>
 
 <ul>
        <li>If no structures are open, then an interactive display of the
-       structure will be opened in a new window</li>
+       structure will be opened in a new window.</li>
 
        <li>If another structure is already shown for the current
        alignment, then you will be asked if you want to add and <a
                href="jmol.html#align">align this structure</a> to the structure in
-       the existing view. (<em>new feature in Jalview 2.6</em>)</li>
+       the existing view. (<em>new feature in Jalview 2.6</em>).</li>
 
        <li>If the structure is already shown, then you will be prompted
        to associate the sequence with an existing view of the selected
        structure. This is useful when working with multi-domain or multi-chain PDB files.</li>
 
        <li style="list-style: none">See the <a href="jmol.html">Jmol
-       PDB viewer</a> help page for more information about the display.</li>
+       </a> and <a href="chimera.html">Chimera</a> PDB viewer help pages for more information about the display.</li>
 </ul>
        <p><strong>Associating PDB files with Sequences</strong></p>
        <p>To associate PDB files with a sequence, right click on a sequence
diff --git a/help/html/features/xsspannotation.html b/help/html/features/xsspannotation.html
new file mode 100644 (file)
index 0000000..0dc7475
--- /dev/null
@@ -0,0 +1,90 @@
+<html>
+<!--
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
+ * Copyright (C) 2014 The Jalview Authors
+ * 
+ * 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/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ -->
+<head>
+<title>Annotation from 3D structure data</title>
+</head>
+<body>
+       <p>
+               <strong>Working with annotation from 3D structure data</strong>
+       </p>
+       <p>
+               Jalview can process PDB data associated with sequences to display
+               values extracted from the <em>Temperature Factor</em> column for
+               corresponding sites, and secondary structure from DSSP or RNAView (as
+               appropriate).
+       </p>
+       <p>
+               <strong>Extracting data from PDB files<br /></strong>Annotation is
+               created for structure files retrieved directly from the PDB loaded
+               from the file system (via the <strong>Structure&rarr;Associate
+                       Structure...&rarr;From file</strong> option, or when displayed via the View
+               Structures Menu.<br /> Structure annotation is not automatically
+               added to an alignment, but any available structure annotation rows for
+               the current selection or a particular sequence can be added via the <strong>Add
+                       Reference Annotation</strong> in the <strong>Selection</strong> and <strong>Sequence
+                       ID</strong> sub-menus of the Sequence ID Panel's popup menu.<br/> <em>Please
+                       note:</em>Protein structures are analysed
+               <em>in situ</em>, but Jalview employs a web service to process RNA
+               structures which can cause long delays if your internet connection is
+               slow.
+       </p>
+       <p>
+               The <a href="../menus/alwannotation.html"><em>Annotations</em>
+                       alignment menu</a> provides settings useful for controlling the display
+               of secondary structure annotation.
+       </p>
+       <p>
+               <strong>Shading sequences by associated structure annotation<br /></strong>The
+               annotation colouring dialog (opened by the <strong>Colour&rarr;By
+                       Annotation</strong> option) allows sequences with associated secondary
+               structure data to be shaded according to secondary structure type.
+               Once the dialog is opened, select the <em>Per Sequence</em> option and
+               then choose <em>Secondary structure</em> from the dropdown menu.<br />When
+               colouring alignments by secondary structure, two modes can be
+               employed. The default is to shade sequences with the same colour as
+               the secondary structure glyph. If, however, <em>original colours</em>
+               is selected and another colourscheme has already been applied, then
+               only portions of the sequence with defined secondary structure will be
+               shaded with the previously applied scheme.<br />
+       </p>
+       <p>
+               <strong>Configuration options for processing PDB files<br /></strong>
+               Occasionally, you may wish to disable secondary structure processing. 
+               Configuration options in the <strong>Structure</strong> tab in the <strong>Tools&rarr;Preferences</strong>
+               dialog allow the processing of structure data to be disabled, or
+               selectively enabled. For more information, take a look at the <a href="preferences.html#structure">documentation for the structure panel</a>.
+       </p>
+       <p>
+               <em>The display of secondary structure data was introduced in
+                       Jalview 2.8.2, and is made possible by Jalview's use of <a
+                       href="jmol.html">Jmol's DSSP implementation</a>, based on the
+                       original <a href="http://www.ncbi.nlm.nih.gov/pubmed/6667333">Kabsch
+                               and Sander algorithm</a> ported by <a
+                       href="http://swift.cmbi.ru.nl/gv/dssp/">Robbie P. Joosten and
+                               colleagues</a>, and a client for <a
+                       href="https://github.com/fjossinet/PyRNA">Fabrice Jossinet's
+                               pyRNA services</a> that was developed by Anne Menard, Jim Procter and
+                       Yann Ponty as part of the Jalview Summer of Code 2012.
+               </em>
+       </p>
+</body>
+</html>
index 3a45fc8..11b6f2a 100755 (executable)
 <p>Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M., Barton, G.J (2009), <br>
    &quot;Jalview version 2: A Multiple Sequence Alignment and Analysis Workbench,&quot;<br>
    <em>Bioinformatics</em> <strong>25</strong> (9) 1189-1191 doi: 10.1093/bioinformatics/btp033</p>
+   <p><strong>The Jalview Authors</strong><br/>
+   The following people have contributed to Jalview's development:
+       <ul>
+       <li>Jalview 1
+       <ul><li>Michele Clamp</li>
+               <li>James Cuff</li>
+               <li>Steve Searle</li>
+               <li>David Martin</li>
+               <li>Geoff Barton</li>
+       </ul>
+       </li><li>Jalview 2<ul>
+               <li>Jim Procter</li>
+               <li>Andrew Waterhouse</li>
+               <li>Mungo Carstairs</li>
+               <li>Tochukwu 'Charles' Ofoegbu</li>
+               <li>Jan Engelhardt</li>
+               <li>Lauren Lui</li>
+               <li>Anne Menard</li>
+               <li>Natasha Sherstnev</li>
+               <li>Daniel Barton</li>
+               <li>David Roldan-Martinez</li>
+               <li>David Martin</li>
+               <li>Geoff Barton</li>
+       </ul>
+       </li>
+       </ul>
+       </p>
 </body>
 </html>
index b08fff7..518729b 100755 (executable)
@@ -35,6 +35,8 @@ diagrams and powerpoint presentations</em>
 </li>
 <li>EPS - an Encapsulated Postscript Document<br><em>For high quality
 diagrams and publications.</em>
+<li>SVG - a Scalable Vector Graphics document<br><em>For high quality
+diagrams in publications and on the web.</em>
 </li></ul>
   
 <p><em>Tips for working with EPS Files</em></p>
@@ -46,7 +48,7 @@ diagrams and publications.</em>
   want an exact image of the alignment as displayed in Jalview. This is useful 
   if a 3rd Party EPS viewer does not have the same Font which the EPS file was 
   created with.</li>
-<li>When importing an EPS into to a Microsoft office document, a snapshot image of the
+<li>When importing an EPS file into a Microsoft office document, a snapshot image of the
   file will be displayed which often looks blurred. Right-click the
   image and choose &quot;Edit image.&quot; to convert it to word
   drawing objects which give a truer WYSIWIG representation.
index 7bfc435..6017d4b 100755 (executable)
@@ -31,7 +31,7 @@ td {
 </head>
 <body>
 
-<p><strong>Alignment Fileformats</strong>
+<p><strong>Alignment File Formats</strong>
 <p>Jalview understands a wide range of sequence alignment formats. In
 order to determine which format has been used for an alignment,
 jalview tries to detect some text or formatting unique to one of the formats:
@@ -71,6 +71,11 @@ THISISASEQUENCE<br></td>
 <td width="60%"># STOCKHOLM VersionNumber<br>
 <em>...</em><br>//</td>
 <td width="23%">.stk, .sto</td>
+</tr><tr>
+<td width="17%">Phylip</td>
+<td width="60%">Line starts with two numbers separated by white space<br>
+<em>...</em><br>//</td>
+<td width="23%">.phy</td>
 </tr>
 </table>
 <p>The file extensions are used to associate jalview alignment icons
diff --git a/help/html/jalviewjnlp.html b/help/html/jalviewjnlp.html
deleted file mode 100755 (executable)
index 8f32a2b..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-<html>
-<!--
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
- * 
- * 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/>.
- * The Jalview Authors are detailed in the 'AUTHORS' file.
- -->
-<head>
-<title>Jalview local Jnlp File</title>
-</head>
-<body>
-<h1>Jalview local Jnlp File</h1>
-<pre>
-&lt;jnlp spec="1.0+" codebase="http://www.jalview.org/webstart/"&gt;
-  &lt;information&gt;
-    &lt;title&gt;Jalview&lt;/title&gt;
-    &lt;vendor&gt;The Barton Group&lt;/vendor&gt;
-    &lt;homepage href="http://www.jalview.org"/&gt;
-    &lt;description&gt;Jalview Multiple Alignment Editor&lt;/description&gt;
-    &lt;description kind="short"&gt;Jalview&lt;/description&gt;
-    &lt;icon href="http://www.jalview.org/webstart/logo_big.gif" kind="default"/&gt;
-    &lt;association extensions="fa" mime-type="application-x/ext-file"/&gt;
-    &lt;association extensions="fasta" mime-type="application-x/ext-file"/&gt;
-    &lt;association extensions="fastq" mime-type="application-x/ext-file"/&gt;
-    &lt;association extensions="blc" mime-type="application-x/ext-file"/&gt;
-    &lt;association extensions="msf" mime-type="application-x/ext-file"/&gt;
-    &lt;association extensions="pfam" mime-type="application-x/ext-file"/&gt;
-    &lt;association extensions="aln" mime-type="application-x/ext-file"/&gt;
-    &lt;association extensions="pir" mime-type="application-x/ext-file"/&gt;
-    &lt;association extensions="stk" mime-type="application-x/ext-file"/&gt;
-    &lt;offline-allowed/&gt;
-  &lt;/information&gt;
-  &lt;security&gt;
-    &lt;all-permissions/&gt;
-  &lt;/security&gt;
-  &lt;resources&gt;
-  &lt;!-- <em>the additional memory parameters are here</em> --&gt;
-  &lt;j2se version="1.5+" initial-heap-size="500M" max-heap-size="1000M"/&gt;
-               &lt;jar href="jalview.jar"/&gt;
-               &lt;jar href="JGoogleAnalytics-0.2.1-SNAPSHOT.jar"/&gt;
-               &lt;jar href="Jmol-12.1.13.jar"/&gt;
-               &lt;jar href="activation.jar"/&gt;
-               &lt;jar href="axis.jar"/&gt;
-               &lt;jar href="castor-1.1-cycle-xml.jar"/&gt;
-               &lt;jar href="commons-discovery.jar"/&gt;
-               &lt;jar href="commons-logging.jar"/&gt;
-               &lt;jar href="jaxrpc.jar"/&gt;
-               &lt;jar href="jhall.jar"/&gt;
-               &lt;jar href="log4j-1.2.8.jar"/&gt;
-               &lt;jar href="mail.jar"/&gt;
-               &lt;jar href="min-jaba-client.jar"/&gt;
-               &lt;jar href="regex.jar"/&gt;
-               &lt;jar href="saaj.jar"/&gt;
-               &lt;jar href="vamsas-client.jar"/&gt;
-               &lt;jar href="wsdl4j.jar"/&gt;
-               &lt;jar href="xercesImpl.jar"/&gt;
-               &lt;jar href="xml-apis.jar"/&gt;
-               &lt;property name="jalview.version" value="2.6.1"/&gt;
-  &lt;/resources&gt;
-  &lt;application-desc main-class="jalview.bin.Jalview"/&gt;
-&lt;/jnlp&gt;
-</pre>
-<address><a
-       href="http://www.jalview.org/mailman/listinfo/jalview-discuss">If
-you have problems, send an email to jalview-discuss</a></address>
-</body>
-</html>
index 3ef4d77..1cb9596 100755 (executable)
 The way you increase the memory settings for the JVM depends on which installation
   of Jalview you use:</p>
 <ul>
-  <li><em><font size="3">Web Start Version</font></em>
-    <p>JavaWS sets the JVM parameters through special tags in the JNLP file. You'll
-      need to <a href="jalviewjnlp.html">make your own jnlp file</a> and add the following parameter into the
-      &lt;resources&gt; element.
-    <pre>
-&lt;j2se version="1.5+" initial-heap-size="500M" max-heap-size="1000M"/&gt;
-</pre>
-    Save the jnlp file somewhere and then - if you start Jalview through your
-    web browser, point your browser at the file's url, othewise simply run javaws
-    with the file location as its argument. The file's url is something like :<br>
-    <pre>
+               <li><em><font size="3">Web Start Version</font></em>
+                       <p>
+                               JavaWS sets the JVM parameters through special tags in the JNLP
+                               file. You can obtain a JNLP file with modified memory settings from
+                               our service with the following link (replace 2G with desired memory
+                               in G or M):<br /> <a
+                                       href="http://www.jalview.org/services/launchApp?jvm-max-heap=2G">http://www.jalview.org/services/launchApp?jvm-max-heap=2G</a>
+                       </p>
+                       <p>
+                               Alternatively, if you want to create your own JNLP file then please
+                               download the latest JNLP file from <a
+                                       href="http://www.jalview.org/webstart/jalview.jnlp">http://www.jalview.org/webstart/jalview.jnlp</a>
+                               and modify the max-heap-size parameter for the j2se tag in the
+                               &lt;resources&gt; element. e.g.
+                       <pre>
+&lt;j2se version="1.7+" initial-heap-size="500M" max-heap-size="1000M"/&gt;
+</pre> In both cases, you should save your new jnlp file somewhere and
+                       then either point your web browser at the file's url, launch it from
+                       your file browser, or from a terminal window run javaws (located in
+                       your Java installation's bin directory) with the file location as its
+                       argument. The file's url is something like :<br> <pre>
 file://&lt;full path to file&gt;
-</pre>
-    If jalview doesn't start up, see <a href="#memsetting">below</a>. You'll have
-    to edit the above settings in the JNLP file using a text editor, save it,
-    and try starting Jalview with it once more.
-    <p></li>
-  <li><em><font size="3">Install Anywhere version</font></em>
+</pre> If jalview doesn't start up, see <a href="#memsetting">below</a>.
+                       You'll have to edit the above settings in the JNLP file using a text
+                       editor, save it, and try starting Jalview with it once more.
+                       </p></li>
+               <li><em><font size="3">Install Anywhere version</font></em>
     <p> You need to change the InstallAnywhere configuration settings for the
       application. These are found in different places depending upon which operating
       system you have :
index f67faa9..95dcad8 100755 (executable)
                                                Select the format of the text by selecting one of the following
                                                menu items.</em>
                                        <ul>
-                                               <li><strong>FASTA</strong> <em></em>
-                                               </li>
-                                               <li><strong>MSF</strong>
-                                               </li>
-                                               <li><strong>CLUSTAL</strong>
-                                               </li>
-                                               <li><strong>BLC</strong>
-                                               </li>
-                                               <li><strong>PIR</strong>
-                                               </li>
-                                               <li><strong>PFAM</strong>
-                                               </li>
+                                               <li><strong>FASTA</strong> </li>
+                                               <li><strong>MSF</strong></li>
+                                               <li><strong>CLUSTAL</strong></li>
+                                               <li><strong>BLC</strong></li>
+                                               <li><strong>PIR</strong></li>
+                                               <li><strong>PFAM</strong></li>
+                                               <li><strong>PileUp</strong></li>
+                                               <li><strong>AMSA</strong></li>
+                                               <li><strong>STH</strong></li>
+                                               <li><strong>Phylip</strong></li>
                                        </ul></li>
                                <li><strong>Print (Control P)<br> </strong><em>Jalview
                                                will print the alignment using the current fonts and colours of
                                                the last redundancy deletion.</em>
                                </li>
                                <li><strong>Pad Gaps<br> </strong><em>When selected,
-                                               the alignment will be kept at minimal width (so there no empty
+                                               the alignment will be kept at minimal width (so there are no empty
                                                columns before or after the first or last aligned residue) and all
-                                               sequences will be padded with gap characters to the before and
+                                               sequences will be padded with gap characters before and
                                                after their terminating residues.<br> This switch is useful
                                                when making a tree using unaligned sequences and when working with
                                                alignment analysis programs which require 'properly aligned
index e44f3ac..67b3d2e 100755 (executable)
@@ -91,8 +91,8 @@
        undo the last redundancy deletion.</em></li>
        <li><strong>Pad Gaps<br>
        </strong><em>When selected, the alignment will be kept at minimal width (so
-       there no empty columns before or after the first or last aligned
-       residue) and all sequences will be padded with gap characters to the
+       there are no empty columns before or after the first or last aligned
+       residue) and all sequences will be padded with gap characters 
        before and after their terminating residues.<br>
        This switch is useful when making a tree using unaligned sequences and
        when working with alignment analysis programs which require 'properly
index 563d716..bf459e3 100755 (executable)
                <li><strong>BLC</strong></li>
                <li><strong>PIR</strong></li>
                <li><strong>PFAM</strong></li>
+               <li><strong>PileUp</strong></li>
+               <li><strong>AMSA</strong></li>
+               <li><strong>STH</strong></li>
+               <li><strong>Phylip</strong></li>
        </ul>
        </li>
        <li><strong>Page Setup ...</strong><br>
@@ -88,6 +92,8 @@
                <li><strong>PNG<br>
                </strong><em>Create a <a href="../io/export.html">Portable Network
                Graphics</a> file from your alignment.</em></li>
+               <li><strong>SVG<br>
+               </strong><em>Create a <a href="../io/export.html">Scalable Vector Graphics</a> file from your alignment for embedding in web pages.</em></li>
        </ul>
        </li>
        <li><strong>Export Features</strong><em><br>
index 511b85f..63bb815 100755 (executable)
@@ -41,7 +41,7 @@ not be accessible when in 'Cursor Mode' (toggled with the F2 key).</em></p>
       <li><strong>Hide Annotations...<br>
           </strong><em>Choose to hide either All or 
           a selected type of annotation for the selected sequences. (Since Jalview 2.8.2)</em></li>
-      <li><strong>Add Reference Annotations...<br>
+      <li><a name="addrefannot"><strong>Add Reference Annotations<br>
           </strong><em>Add to the alignment window any annotations on the selected sequences
           which have been read from reference sources or calculated (for example, 
           secondary structure derived from 3D structure). (Since Jalview 2.8.2)</em></li>
@@ -134,7 +134,7 @@ not be accessible when in 'Cursor Mode' (toggled with the F2 key).</em></p>
         window will be displayed asking for a new sequence name and sequence description 
         to be entered. Press OK to accept your edit. To save sequence descriptions, 
         you must save in Fasta, PIR or Jalview File format.</em></li>
-      <li><em> </em></li>
+      <li><a href="sqaddrefannot"><strong>Add Reference Annotations<br></strong><em>When enabled, copies any available alignment annotation for this sequence to the current view.</em></li>
       <li><strong>Represent Group With (Sequence Id)</strong><br>
         <em>All sequences in the current selection group will be hidden, apart 
         from (Sequence Id). Any edits performed on the visible representative 
index f3c4a56..844b6b7 100644 (file)
@@ -67,7 +67,7 @@ td {
                        as <a href="http://rna.informatik.uni-freiburg.de:8080/LocARNA.jsp">LocaRNA</a>
                        output consensus RNA secondary structure lines in the line normally
                        reserved for the Clustal consensus line in a clustal file.</li>
-               <!-- <li><em>RNAML</em> - (coming soon) - Jalview can import RNAML files containing sequences and extended secondary structure annotation derived from RNA 3D structure</li> -->
+               <li><em>RNAML</em> Jalview can import RNAML files containing sequences and extended secondary structure annotation derived from RNA 3D structure</li>
        </ul>
        <p>
                <strong>RNA Secondary Structure Visualization and Analysis</strong><br />
@@ -85,6 +85,10 @@ td {
                                Visualization in VARNA</a> - allows linked viewing of the consensus or
                        an individual sequence's structure</li>
        </ul>
+       <p><strong>Pseudo-knots</strong><br/>
+         Jalview 2.8.2 introduced limited support for working with structures including pseudoknots. Where possible, extended WUSS symbols (e.g. different types of parentheses, or upper and lower case letters) are preserved when parsing RNA structure annotation and will be shaded differently when displayed in the structure.<br/>
+  Extended WUSS annotation is also employed to distinguish different base pair interactions obtained from RNAML files.</p>
+         
        <p><strong>Limitations when working with RNA in Jalview</strong><br/>
        Currently, Jalview is not able to export RNA secondary structure annotation in any format other than Jalview annotation
        </br>
index be5cf56..e19122c 100644 (file)
@@ -25,7 +25,7 @@
 <body>
 <p><strong>Privacy for Jalview Users</strong><br>
 <p>The Jalview Desktop application which is available from the
-www.jalview.org site does not contain code designed collect personal or
+www.jalview.org site does not contain code designed to collect personal or
 private information without your consent. However, we do collect usage
 statistics to work out who is using Jalview, so we can apply for funding
 to support Jalview development, and make it better for our users.</p>
@@ -51,7 +51,7 @@ These are described below:</p>
        </ul><br>
        </li>
        <li><em>Google Analytics</em><br>
-       Since jalview 2.4.0b2, the Jalview Desktop records usage data with
+       Since Jalview 2.4.0b2, the Jalview Desktop records usage data with
        Google Analytics via the <a
                href="http://code.google.com/p/jgoogleanalytics/">JGoogleAnalytics</a>
        class.<br>
@@ -68,7 +68,7 @@ program shouldn't try to contact any of the web servers mentioned above
        href="features/commandline.html">command line options</a> to disable
 the questionnaire and usage statistics check. Finally, the <a
        href="features/preferences.html#connections">Connections Tab</a> of the
-jalview preferences contains options for controlling the submission of
+Jalview preferences contains options for controlling the submission of
 usage statistics.
 <p><strong>Other Web Clients in Jalview</strong><br>
 The Jalview desktop is intended to make it easier to interact with
index 6b92a2c..92a39cb 100755 (executable)
 <body>
 <p><strong>Release History</strong></p>
 <table border="1">
-       <tr>
-               <td width="60" nowrap>
-               <div align="center"><em><strong>Release</strong></em></div>
-               </td>
-               <td>
-               <div align="center"><em><strong>New Features</strong></em></div>
-               </td>
-               <td>
-               <div align="center"><em><strong>Issues Resolved</strong></em></div>
-               </td>
-       </tr>
+               <tr>
+                       <td width="60" nowrap>
+                               <div align="center">
+                                       <em><strong>Release</strong></em>
+                               </div>
+                       </td>
+                       <td>
+                               <div align="center">
+                                       <em><strong>New Features</strong></em>
+                               </div>
+                       </td>
+                       <td>
+                               <div align="center">
+                                       <em><strong>Issues Resolved</strong></em>
+                               </div>
+                       </td>
+               </tr>
+               <tr>
+                       <td><div align="center">
+                                       <strong><a name="Jalview.2.8.2">2.8.2</a><br /> <em>3/12/2014</em></strong>
+                               </div></td>
+                       <td><em>General</em>
+                               <ul>
+                               <li>Updated Java code signing certificate donated by Certum.PL.</li>
+                                       <li>Features and annotation preserved when performing pairwise
+                                               alignment</li>
+                                       <li>RNA pseudoknot annotation can be
+                                               imported/exported/displayed</li>
+                                       <li>&#39;colour by annotation&#39; can colour by RNA and
+                                               protein secondary structure</li>
+                               </ul> <em>Application</em>
+                               <ul>
+                                       <li>Extract and display secondary structure for sequences with
+                                               3D structures</li>
+                                       <li>Support for parsing RNAML</li>
+                                       <li>Annotations menu for layout
+                                               <ul>
+                                                       <li>sort sequence annotation rows by alignment</li>
+                                                       <li>place sequence annotation above/below alignment
+                                                               annotation</li>
+                                               </ul>
+                                       <li>Output in Stockholm format</li>
+                                       <li>Internationalisation: improved Spanish (es) translation</li>
+                                       <li>Structure viewer preferences tab</li>
+                                       <li>Disorder and Secondary Structure annotation tracks shared
+                                               between alignments</li>
+                                       <li>UCSF Chimera launch and linked highlighting from Jalview</li>
+                                       <li>Show/hide all sequence associated annotation rows for all
+                                               or current selection</li>
+                                       <li>disorder and secondary structure predictions available as
+                                               dataset annotation</li>
+                                       <li>Per-sequence rna helices colouring</li>
+
+
+                                       <li>Sequence database accessions imported when fetching
+                                               alignments from Rfam</li>
+                                       <li>update VARNA version to 3.91</li>
+
+                                       <li>New groovy scripts for exporting aligned positions,
+                                               conservation values, and calculating sum of pairs scores.</li>
+                                       <li>Command line argument to set default JABAWS server</li>
+                                       <li>include installation type in build properties and console
+                                               log output</li>
+                                       <li>Updated Jalview project format to preserve dataset annotation</li>
+                               </ul></td>
+                       <td>
+                               <!--  issues resolved --> <em>Application</em>
+                               <ul>
+                                       <li>Distinguish alignment and sequence associated RNA
+                                               structure in structure-&gt;view-&gt;VARNA</li>
+                                       <li>Raise dialog box if user deletes all sequences in an
+                                               alignment</li>
+                                       <li>Pressing F1 results in documentation opening twice</li>
+                                       <li>Sequence feature tooltip is wrapped</li>
+                                       <li>Double click on sequence associated annotation selects
+                                               only first column</li>
+                                       <li>Redundancy removal doesn&#39;t result in unlinked leaves
+                                               shown in tree</li>
+                                       <li>Undos after several redundancy removals don't undo
+                                               properly</li>
+                                       <li>Hide sequence doesn&#39;t hide associated annotation</li>
+                                       <li>User defined colours dialog box too big to fit on screen
+                                               and buttons not visible</li>
+                                       <li>author list isn't updated if already written to jalview
+                                               properties</li>
+                                       <li>Popup menu won&#39;t open after retrieving sequence from
+                                               database</li>
+                                       <li>File open window for associate PDB doesn&#39;t open</li>
+                                       <li>Left-then-right click on a sequence id opens a browser
+                                               search window</li>
+                                       <li>Cannot open sequence feature shading/sort popup menu in
+                                               feature settings dialog</li>
+                                       <li>better tooltip placement for some areas of Jalview desktop</li>
+                                       <li>Allow addition of JABAWS Server which doesn&#39;t pass
+                                               validation</li>
+                                       <li>Web services parameters dialog box is too large to fit on
+                                               screen</li>
+                                       <li>Muscle nucleotide alignment preset obscured by tooltip</li>
+                                       <li>JABAWS preset submenus don&#39;t contain newly defined
+                                               user preset</li>
+                                       <li>MSA web services warns user if they were launched with
+                                               invalid input</li>
+                                       <li>Jalview cannot contact DAS Registy when running on Java 8</li>
+                                       <li>
+                                               <!-- [<a href='http://issues.jalview.org/browse/JAL-1273'>JAL-1273</a>] -->
+                                               &#39;Superpose with&#39; submenu not shown when new view created
+                                       </li>
+
+                               </ul> <!--  <em>Applet</em>
+                               <ul>
+                               </ul> <em>General</em>
+                               <ul> 
+                               </ul>--> <em>Deployment and Documentation</em>
+                               <ul>
+                                       <li>2G and 1G options in launchApp have no effect on memory
+                                               allocation</li>
+                                       <li>launchApp service doesn't automatically open
+                                               www.jalview.org/examples/exampleFile.jar if no file is given</li>
+                                       <li>
+                                               <!-- [<a href='http://issues.jalview.org/browse/JAL-1511'>JAL-1511</a>] -->
+                                               InstallAnywhere reports cannot find valid JVM when Java 1.7_055 is
+                                               available
+                                       </li>
+                               </ul> <em>Application Known issues</em>
+                               <ul>
+                                       <li>
+                                               <!-- [<a href='http://issues.jalview.org/browse/JAL-830'>JAL-830</a>] -->
+                                               corrupted or unreadable alignment display when scrolling alignment
+                                               to right
+                                       </li>
+                                       <li>
+                                               <!-- [<a href='http://issues.jalview.org/browse/JAL-1329'>JAL-1329</a>] -->
+                                               retrieval fails but progress bar continues for DAS retrieval with
+                                               large number of ID
+                                       </li>
+                                       <li>
+                                               <!-- [<a href='http://issues.jalview.org/browse/JAL-1486'>JAL-1486</a>] -->
+                                               flatfile output of visible region has incorrect sequence start/end
+                                       </li>
+                                       <li>
+                                               <!-- [<a href='http://issues.jalview.org/browse/JAL-1487'>JAL-1487</a>] -->
+                                               rna structure consensus doesn&#39;t update when secondary
+                                               structure tracks are rearranged
+                                       </li>
+                                       <li>
+                                               <!-- [<a href='http://issues.jalview.org/browse/JAL-1591'>JAL-1591</a>] -->
+                                               invalid rna structure positional highlighting does not highlight
+                                               position of invalid base pairs
+                                       </li>
+                                       <li>
+                                               <!-- <a href='http://issues.jalview.org/browse/JAL-1539'>JAL-1539</a>] -->
+                                               out of memory errors are not raised when saving jalview project
+                                               from alignment window file menu
+                                       </li>
+                                       <li>
+                                               <!-- [<a href='http://issues.jalview.org/browse/JAL-1576'>JAL-1576</a>] -->
+                                               Switching to RNA Helices colouring doesn&#39;t propagate to
+                                               structures
+                                       </li>
+                                       <li>
+                                               <!-- [<a href='http://issues.jalview.org/browse/JAL-1577'>JAL-1577</a>] -->
+                                               colour by RNA Helices not enabled when user created annotation
+                                               added to alignment
+                                       </li>
+                                       <li>
+                                               <!-- [<a href='http://issues.jalview.org/browse/JAL-1439'>JAL-1439</a>] -->
+                                               Jalview icon not shown on dock in Mountain Lion/Webstart
+                                       </li>
+                               </ul> <em>Applet Known Issues</em>
+                               <ul>
+                                       <li>
+                                               <!-- [<a href='http://issues.jalview.org/browse/JAL-1394'>JAL-1394</a>] -->
+                                               JalviewLite needs JmolApplet and VARNA-3.91 jar dependencies
+                                       </li>
+                                       <li>
+                                               <!-- [<a href='http://issues.jalview.org/browse/JAL-1510'>JAL-1510</a>] -->
+                                               Jalview and Jmol example not compatible with IE9
+                                       </li>
+
+                                       <li>Sort by annotation score doesn&#39;t reverse order when
+                                               selected</li>
+                               </ul>
+                       </td>
+               </tr>
                <tr>
                        <td><div align="center">
                                        <strong><a name="Jalview.2.8.1">2.8.1</a><br /> <em>4/6/2014</em></strong>
index b34289c..fcc9b0c 100644 (file)
@@ -94,7 +94,7 @@ crashes or otherwise fails, the VAMSAS session it is connected to will
 whilst it is still connected to a session, that session can be recovered
 in a new Jalview instance using the <strong>Vamsas&#8594;&quot;Existing
 session&quot;</strong> sub menu.</p>
-<strong>A quick Demo</strong>
+<p><strong>A quick Demo</strong>
 <br>
 Jalview can talk to itself through VAMSAS. Simply start two copies of
 the application, create a new vamsas session in one, and connect to the
index a27a0d5..8c964b4 100644 (file)
@@ -60,5 +60,7 @@ Your JABAWS servers list is stored in your Jalview preferences, so you
 will only have to configure Jalview once for each new server.</p>
 <p><em>Support for accessing JABAWS servers was introduced in
 Jalview 2.6.</em></p>
+<p><em>Option for adding JABAWS servers which fails validation 
+was introduced from version 2.8.2 </em></p>
 </body>
 </html>
index 55fe70c..6c3c6b5 100644 (file)
@@ -62,7 +62,7 @@
                <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 pseudo bracket notation, as well as the centroid structure
+               form of a pseudo 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 labeled
index ad42153..b02f940 100644 (file)
@@ -49,7 +49,7 @@ reference, and any cross-references that its records contain.</p>
 <p><strong>The Sequence Identification Process</strong><br>
 The method of accession id discovery is derived from the method which
 earlier Jalview versions used for Uniprot sequence feature retrieval,
-and was originally restricted to the identifaction of valid Uniprot
+and was originally restricted to the identification of valid Uniprot
 accessions.<br>
 Essentially, Jalview will try to retrieve records from a subset of the databases
 accessible by the <a href="../features/seqfetch.html">sequence
index 9a7acd9..5555c73 100755 (executable)
@@ -110,10 +110,11 @@ The annotation bars below the alignment are as follows:
        invoked to rationalise significantly different primary predictions.</em></li>
 </ul>
 </p>
+<em>JNet annotation created in Jalview 2.8.2 and later versions can be displayed on other alignments via the <a href="">Add reference annotation</a></em>
 <em>As of Jalview 2.6, the Jnet service accessed accessed via the
 'Secondary structure prediction' submenu should be considered a legacy
 Jalview SOAP service, and will be replaced in the near future by a
-JABAWS Jnet service.</em>
+JABAWS Jnet service (now available in the Jalview 2.9 development version).</em>
 
 </body>
 </html>
index dd536b1..a5d5d4a 100755 (executable)
 </head>
 <body>
        <p>
-               <strong>What's new ?</strong></p>
+               <strong>What's new ?</strong>
+       </p>
+       <p>
+               Jalview 2.8.2 is the first release produced by our new core
+               development team.<br /> It incorporates many minor improvements and
+               bug-fixes, and new features for working with 3D structure data,
+               shading alignments by secondary structure and generation of alignment
+               figures as Scalable Vector Graphics. <br />The majority of
+               improvements in this version of Jalview concern the desktop
+               application. As ever, the highlights are detailed below,
+               and the full list is given in the <a
+                       href="releases.html#Jalview.2.8.2">Jalview 2.8.2 Release Notes</a>.
+       </p>
        <p>
-               Jalview 2.8.1 includes new features for group creation, RNA secondary
-               structure prediction and a host bug fixes. It also includes support
-               for <a href="http://www.compbio.dundee.ac.uk/JABAWS">version 2.1
-                       of JABA</a> and includes a Spanish translation of its user interface.<br />
-               The highlights are detailed below, and the full list is given in the <a
-                       href="releases.html#Jalview2.8.1">Jalview 2.8.1 Release Notes</a>.
+               <strong>Annotation visualisation</strong> <br /> The alignment window
+               includes a new <em>Annotations</em> menu which provides controls for
+               the layout and display of sequence, group and alignment associated
+               annotation rows. It also now includes the <em>Autocalculated
+                       Annotation</em> submenu (formerly located in the View menu), which
+               includes settings for the calculation and display of sequence
+               consensus, logos, and amino acid conservation for the alignment and
+               subgroups.
        </p>
-       <p>The Desktop and web based applet include new keystrokes for
-               defining and undefining groups, and PAM250 has been added to the range
-               of score models available for use by the tree and PCA calculations.
-               The Jalview project file format has also been extended for handling
-               RNA and protein secondary structure annotation, in anticipation for
-               new structure based secondary structure support in Jalview 2.8.2.</p>
-       <p><strong>Internationalisation</strong></p>
-       <p>Jalview 2.8.1 is the first release to include support for
-               displaying Jalview's user interface in different languages. In August
-               2013, David Rold&aacute;n-Martinez took on the task of
-               internationalising Jalview's user interface. He also recruited Sara
-               Hern&aacute;ndez D&iacute;az and Laura Ferrandis Martinez who created
-               Jalview's first spanish user interface translation.</p>
        <p>
-               If you notice any problems, or would like to help translate Jalview's
-               user interface into other languages, head over to <a
-                       href="http://issues.jalview.org">issues.jalview.org</a> and put in a
-               feature request describing the translations you can provide to the <a
-                       href="http://issues.jalview.org/browse/JAL/component/10682">i18n
-                       component</a>. David has also <a
-                       href="https://wiki.jalview.org/index.php/Development:i18n">documented
-                       the process of creating i18n translations</a> to help you get started.
+               <strong>Sequence associated annotation</strong><br /> New controls
+               have also been added to the Sequence ID popup menu for the propagation
+               and display of sequence associated annotation such as secondary
+               structure assignments and disorder predictions. Annotation associated
+               with one or a group of sequence already shown on the alignment may be
+               shown or hidden, and any available annotation from 3D structure or
+               calculations performed in other Jalview windows can be copied to the
+               alignment
+               <em>via</em> the <strong>Add Reference Annotation</strong> option.<br />
+               The <strong>Colour by annotation</strong> function has also been
+               improved, allowing secondary structure annotation to be used to shade
+               sequences and alignment columns. Protein sequences can be coloured
+               according to the presence of a helix or sheet at each position, and
+               RNA sequences can be shaded according to each structure's stem/helix
+               pattern - which enables different RNA folding topologies to be quickly
+               identified.
        </p>
-       <p><strong>RNA Secondary Structure Prediction with JABA 2.1</strong></p>
        <p>
-               This version of Jalview includes a client to access the new services available in <a
-                       href="http://www.compbio.dundee.ac.uk/jabaws/">JABA v2.1</a> , which
-               provides services for RNA consensus secondary structure prediction and
-               two new alignment programs (<a
-                       href="http://sourceforge.net/projects/glprobs/">GLProbs</a> and <a
-                       href="http://sourceforge.net/projects/msaprobs/">MSAProbs</a>).</p>
+               <strong>3D Structural data analysis and display</strong><br />
+               Jalview now employs Jmol's PDB data API to retrieve secondary
+               structure assignments made by the DSSP algorithm. It can also employ
+               web services to obtain secondary structure assignments from RNA
+               structures. These assignments are shown as sequence associated
+               annotation for sequences which have cross-references to the PDB, or
+               have had PDB files associated with them via the <em>Structures</em>
+               submenu of the sequence ID popup menu. The extraction and display of
+               secondary structure and B-factor column annotation is controlled <em>via</em>
+               a new <strong>Structure</strong> tab in the Jalview Desktop's
+               Preferences dialog box.
+       </p>
+       <p>
+               <Strong>Interoperation with UCSF Chimera</Strong><br /> The desktop
+               application can now be configured to employ UCSF Chimera for the
+               display of 3D structure data. UCSF Chimera is a python-based
+               high-performance molecular graphics and animation system developed by
+               the Resource for Biocomputing, Visualisation, and Informatics at the
+               University of California.<br />Jalview employs the 'StructureViz'
+               communication mechanism developed for Cytoscape by Morris et al.
+               (http://www.ncbi.nlm.nih.gov/pubmed/17623706) in 2007. This mechanism
+               allows Jalview to send commands to Chimera, enabling structures to be
+               superimposed and shaded according to associated multiple aligmment
+               views. <br />Support for Chimera in Jalview 2.8.2 is experimental, and we
+               would appreciate feedback ! Please send your comments to
+               jalview-discuss@jalview.org, and keep up to date with this feature's
+               development via http://issues.jalview.org/browse/JAL-1333.
+       </p>
        <p>
-               To see how to perform RNA secondary structure predictions like the one below, take a look at the <a href="webServices/RNAalifold.html">RNAAliFold
-                       client documentation</a>. 
+               <strong>Export of alignment figures as Scalable Vector
+                       Graphics</strong> <br />Scalable Vector Graphics (SVG) files are now widely
+               supported by web browsers and graphics design programs, and allow
+               high-quality graphics for interactive exploration and publication.
+               Jalview now supports the generation of SVGs interactively (via the
+               Export) menu, and from the command line for server-side figure
+               generation.
        </p>
-  <div align="center">
-    <img src="webServices/RNAalifoldAnnotationRows.png" width="500" height="216"> <br> <em>The RNAalifold client was implemented by Jalview's 2013
-                       summer student, Dan Barton.</em>
-       </div>
+
 </body>
 </html>
index e57ce3e..d41c2ca 100644 (file)
@@ -1,4 +1,4 @@
 YEAR=2014
-AUTHORS=J Procter, AM Waterhouse, J Engelhardt, LM Lui, A Menard, D Barton, N Sherstnev, D Roldan-Martinez, M Clamp, S Searle, G Barton
-AUTHORFNAMES=Jim Procter, Andrew Waterhouse, Jan Engelhardt, Lauren Lui, Anne Menard, Daniel Barton, Natasha Sherstnev, David Roldan-Martinez, Michele Clamp, James Cuff, Steve Searle, David Martin & Geoff Barton
+AUTHORS=J Procter, AM Waterhouse, M Carstairs, TC Ofoegbu, J Engelhardt, LM Lui, A Menard, D Barton, N Sherstnev, D Roldan-Martinez, M Clamp, S Searle, G Barton
+AUTHORFNAMES=Jim Procter, Andrew Waterhouse, Mungo Carstairs, Tochukwu 'Charles' Ofoegbu, Jan Engelhardt, Lauren Lui, Anne Menard, Daniel Barton, Natasha Sherstnev, David Roldan-Martinez, Michele Clamp, James Cuff, Steve Searle, David Martin & Geoff Barton
  
\ No newline at end of file
index 511e5e9..fce8470 100644 (file)
@@ -107,7 +107,7 @@ action.change_params = Change Parameters
 action.apply = Apply
 action.apply_threshold_all_groups = Apply threshold to all groups
 action.apply_all_groups = Apply to all Groups
-action.by_chain = By chain
+action.by_chain = By Chain
 action.by_sequence = By Sequence
 action.paste_annotations = Paste Annotations
 action.format = Format
@@ -249,8 +249,9 @@ label.autoadd_secstr = Add secondary structure annotation to alignment
 label.autoadd_temp = Add Temperature Factor annotation to alignment
 label.structure_viewer = Default structure viewer
 label.chimera_path = Path to Chimera program
-label.chimera_path_tip = Jalview will try standard locations, plus any path entered here.
-label.invalid_path = File not found or not executable
+label.chimera_path_tip = Jalview will first try any path entered here, else standard installation locations.<br>Double-click to browse for file.
+label.invalid_chimera_path = Chimera path not found or not executable
+label.chimera_missing = Chimera structure viewer not found.<br/>Please enter the path to Chimera (if installed),<br/>or download and install UCSF Chimera.
 label.min_colour = Minimum Colour
 label.max_colour = Maximum Colour
 label.use_original_colours = Use Original Colours
@@ -344,7 +345,7 @@ label.dont_ask_me_again = Don't ask me again
 label.select_eps_character_rendering_style = Select EPS character rendering style
 label.invert_selection = Invert Selection
 label.optimise_order = Optimise Order
-label.seq_sort_by_score = Seq sort by Score
+label.seq_sort_by_score = Sequence sort by Score
 label.load_colours = Load Colours
 label.save_colours = Save Colours
 label.fetch_das_features = Fetch DAS Features
@@ -438,8 +439,8 @@ label.redundancy_threshold_selection = Redundancy threshold selection
 label.user_defined_colours = User defined colours
 label.jalviewLite_release = JalviewLite - Release {0}
 label.jaview_build_date = Build date: {0}
-label.jalview_authors_1 = Authors: :  Jim Procter, Andrew Waterhouse, Lauren Lui, Jan Engelhardt, Natasha Sherstnev,
-label.jalview_authors_2 = Daniel Barton, Michele Clamp, James Cuff, Steve Searle, David Martin & Geoff Barton.
+label.jalview_authors_1 = Authors: Jim Procter, Andrew Waterhouse, Mungo Carstairs, Tochukwu Ofoegbu, Lauren Lui, Jan Engelhardt,
+label.jalview_authors_2 = Natasha Sherstnev, Daniel Barton, Michele Clamp, James Cuff, Steve Searle, David Martin & Geoff Barton.
 label.jalview_dev_managers = Development managed by The Barton Group, University of Dundee, Scotland, UK.
 label.jalview_distribution_lists = For help, see the FAQ at www.jalview.org and/or join the jalview-discuss@jalview.org mailing list
 label.jalview_please_cite = If  you use Jalview, please cite:
@@ -778,7 +779,9 @@ label.services_at = Services at {0}
 label.rest_client_submit = {0} using {1}
 label.fetch_retrieve_from =Retrieve from {0}</html>
 label.fetch_retrieve_from_all_sources = Retrieve from all {0} sources in {1}<br>First is :{2}<html> 
-label.feature_settings_click_drag = <html>Click/drag feature types up or down to change render order.<br/>Double click to select columns containing feature in alignment/current selection<br/>Pressing Alt will select columns outside features rather than inside<br/>Pressing Shift to modify current selection (rather than clear current selection)<br/>Press CTRL or Command/Meta to toggle columns in/outside features<br/></html>
+#label.feature_settings_click_drag = <html>Click/drag feature types up or down to change render order.<br/>Double click to select columns containing feature in alignment/current selection<br/>Pressing Alt will select columns outside features rather than inside<br/>Pressing Shift to modify current selection (rather than clear current selection)<br/>Press CTRL or Command/Meta to toggle columns in/outside features<br/></html>
+label.feature_settings_click_drag = Drag up or down to change render order.<br/>Double click to select columns containing feature.
+label.transparency_tip = Adjust transparency to 'see through' feature colours.
 label.opt_and_params_further_details = see further details by right-clicking
 label.opt_and_params_show_brief_desc_image_link = <html>Click to show brief description<br><img src="{0}"/> Right click for further information.</html> 
 label.opt_and_params_show_brief_desc = <html>Click to show brief description<br></html>
@@ -1092,6 +1095,7 @@ warn.job_cannot_be_cancelled_close_window = This job cannot be cancelled.\nJust
 warn.service_not_supported = Service not supported!
 warn.input_is_too_big = Input is too big!
 warn.invalid_job_param_set = Invalid job parameter set!
+warn.oneseq_msainput_selection = The current selection only contains a single sequence. Do you want to submit all sequences for alignment instead ?   
 info.job_couldnt_be_run_server_doesnt_support_program = Job could not be run because the server doesn't support this program.\n{0}
 info.job_couldnt_be_run_exceeded_hard_limit = Job could not be run because it exceeded a hard limit on the server.\n{0}
 info.job_couldnt_be_run_incorrect_param_setting = Job could not be run because some of the parameter settings are not supported by the server.\n{0}\nPlease check to make sure you have used the correct parameter set for this service\!\n
@@ -1101,6 +1105,8 @@ info.invalid_jnet_job_result_data ={0}\n{1}\nInvalid JNet job result data\!\n{2}
 info.failed_to_submit_sequences_for_alignment = Failed to submit sequences for alignment.\nIt is most likely that there is a problem with the server.\nJust close the window\n
 info.alignment_object_method_notes = \nAlignment Object Method Notes\n
 info.server_exception = \n{0} Server exception\!\n{1}
+info.invalid_msa_input_mininfo = Need at least two sequences with at least 3 residues each, with no hidden regions between them.  
+info.invalid_msa_notenough = Not enough sequence data to align
 status.processing_commandline_args = Processing commandline arguments...
 status.das_features_being_retrived = DAS features being retrieved...
 status.searching_for_sequences_from = Searching for sequences from {0}
index a1663d9..241fff2 100644 (file)
@@ -418,8 +418,8 @@ label.redundancy_threshold_selection = Selecci
 label.user_defined_colours = Colores definidos del usuario
 label.jalviewLite_release = JalviewLite - versión {0}
 label.jaview_build_date = Fecha de creación: {0}
-label.jalview_authors_1 = Authors:  Jim Procter, Andrew Waterhouse, Jan Engelhardt, Lauren Lui,
-label.jalview_authors_2 = Michele Clamp, James Cuff, Steve Searle, David Martin & Geoff Barton.
+label.jalview_authors_1 = Authors: Jim Procter, Andrew Waterhouse, Mungo Carstairs, Tochukwu Ofoegbu, Lauren Lui, Jan Engelhardt,
+label.jalview_authors_2 = Natasha Sherstnev, Daniel Barton, Michele Clamp, James Cuff, Steve Searle, David Martin & Geoff Barton.
 label.jalview_dev_managers = Desarrollo gestionado por The Barton Group, University of Dundee, Scotland, UK.
 label.jalview_distribution_lists = Para ayuda, ver el FAQ at www.jalview.org y/o adjuntar la lista de envío jalview-discuss@jalview.org
 label.jalview_please_cite = Si usa Jalview incluya la siguiente cita, por favor:
@@ -748,7 +748,7 @@ label.services_at = Servicios en {0}
 label.rest_client_submit = {0} utilizando {1}
 label.fetch_retrieve_from =Recuperar de {0}
 label.fetch_retrieve_from_all_sources = Recuperar de todas las fuentes {0} en {1}<br>La primera es :{2}
-label.feature_settings_click_drag = Haga clic o arrastre los tipos de las características hacia arriba o hacia abajo para cambiar el orden de visualización.<br/>Haga doble clic para seleccionar las columnas que contienen las características del alineamiento/selección actual.<br/>Presionando Alt seleccionará las columnas exteriores a las características en lugar de las interiores<br/>Presione Shift para modificar la selección actual (en lugar de borrarla)<br/>Presione CTRL o Command/Meta para cambiar las columans externas o internas a las características<br/>
+label.feature_settings_click_drag = Haga clic o arrastre los tipos de las características hacia arriba o hacia abajo para cambiar el orden de visualización.<br/>Haga doble clic para seleccionar las columnas que contienen las características del alineamiento/selección actual.<br/>
 label.opt_and_params_further_details = ver los detalles adicionales haciendo clic en el botón derecho
 label.opt_and_params_show_brief_desc_image_link = Haga clic para ver una descripción breve<br><img src="{0}"/>Haga clic en el botón derecho para obtener información adicional.
 label.opt_and_params_show_brief_desc = Haga clic para ver una descripción breve<br>
index d86fa65..bf780bb 100644 (file)
@@ -7,15 +7,15 @@
 <!-- <script src="https://s3-eu-west-1.amazonaws.com/biojs/msa/latest/msa.js"></script> -->
 <!-- <link type=text/css rel=stylesheet href=https://s3-eu-west-1.amazonaws.com/biojs/msa/latest/msa.css /> -->
  
- <img src="#jalview_logo#" alt="Jalview Logo" title="This html page was generated from Jalview, to import the data back to Jalview, please drag the generated html file and drop it unto the Jalview workbench.
+ <img src="http://www.jalview.org/help/html/Jalview_Logo.png" alt="Jalview Logo" title="This html page was generated from Jalview, to import the data back to Jalview, please drag the generated html file and drop it unto the Jalview workbench.
  
  Alternatively, you could copy the url from the address bar and use Jalview's url importer (main menu-> File-> Input Alignment-> from URL) to import back the alignment jalview." >
 
 </br>
 </br>
 
-<button onclick="javascipt:openJalviewUsingCurrentUrl();">Launch in Jalview</button>
 <input type="button" name="divToggleButton" id="divToggleButton" onclick="javascipt:toggleMenuVisibility();" value="Show Menu"></input>
+<button onclick="javascipt:openJalviewUsingCurrentUrl();">Launch in Jalview</button>
 
 </br>
 </br> 
@@ -31,8 +31,6 @@
 <script>
 
 function toggleMenuVisibility(){
-       //alert("toggleMenuVisibility called!");
-       
        var menu = document.getElementsByClassName("biojs_msa_menubar");
        var divToggleButton = document.getElementById("divToggleButton");
        if(menu[0].style.display == 'block'){
@@ -43,52 +41,29 @@ function toggleMenuVisibility(){
           divToggleButton.value="Hide Menu";
           }
 }
-function openJalviewUsingCurrentUrl2(){
-var jnpl = "<!--"+
-"Hi!"+
-"If you have downloaded this file after pressing \"Launch Full Application\" from Jalview on a web page and you don't know what to do with this file, you must install Java from http://www.java.sun.com then try opening this file again."+
-" \n"+
-"      JNLP generated by /jalviewServlet/services/launchAppDev"+
-"      JNLP generated from http://www.jalview.org/builds/develop/webstart/jalview.jnlp"+
-"Available servlet parameters (please URLEncode):"+
-"      open=<alignment file URL>"+
-"      jvm-max-heap=heap size in M or G"+
-"      features maps to        '-features'"+
-"      treeFile maps to        '-tree'"+
-"      tree maps to    '-tree'"+
-"      annotations maps to     '-annotations'"+
-"      colour maps to  '-colour'"+
-" "+
-"-->"+
-"<?xml version=\"1.0\" encoding=\"UTF-8\"?><jnlp spec=\"1.0+\" codebase=\"http://www.jalview.org/builds/develop/webstart\">    <information>           <title>Jalview</title>          <vendor>The Barton Group</vendor>               <homepage href=\"http://www.jalview.org\"/>             <description>Jalview Multiple Alignment Editor</description>            <description kind=\"short\">Jalview</description>               <icon href=\"JalviewLogo_big.png\"/>            <offline-allowed/>      </information>  <security>              <all-permissions/>      </security>     <resources>             <j2se version=\"1.7+\" initial-heap-size=\"10M\" max-heap-size=\"2G\"/>         <jar href=\"jalview.jar\"/>             <jar href=\"JGoogleAnalytics_0.3.jar\"/>                <jar href=\"Jmol-12.2.4.jar\"/>         <jar href=\"VARNAv3-91.jar\"/>          <jar href=\"activation.jar\"/>          <jar href=\"apache-mime4j-0.6.jar\"/>           <jar href=\"axis.jar\"/>                <jar href=\"castor-1.1-cycle-xml.jar\"/>                <jar href=\"commons-codec-1.3.jar\"/>           <jar href=\"commons-discovery.jar\"/>           <jar href=\"commons-logging-1.1.1.jar\"/>               <jar href=\"groovy-all-1.8.2.jar\"/>            <jar href=\"httpclient-4.0.3.jar\"/>            <jar href=\"httpcore-4.0.1.jar\"/>              <jar href=\"httpmime-4.0.3.jar\"/>              <jar href=\"jalview_jnlp_vm.jar\"/>             <jar href=\"jaxrpc.jar\"/>              <jar href=\"jdas-1.0.4.jar\"/>          <jar href=\"jhall.jar\"/>               <jar href=\"json_simple-1.1.jar\"/>             <jar href=\"jsoup-1.8.1.jar\"/>         <jar href=\"jswingreader-0.3.jar\"/>            <jar href=\"log4j-to-slf4j-2.0-rc2.jar\"/>              <jar href=\"mail.jar\"/>                <jar href=\"miglayout-4.0-swing.jar\"/>         <jar href=\"min-jabaws-client-2.1.0.jar\"/>             <jar href=\"regex.jar\"/>               <jar href=\"saaj.jar\"/>                <jar href=\"slf4j-api-1.7.7.jar\"/>             <jar href=\"slf4j-log4j12-1.7.7.jar\"/>         <jar href=\"spring-core-3.0.5.RELEASE.jar\"/>           <jar href=\"spring-web-3.0.5.RELEASE.jar\"/>            <jar href=\"vamsas-client.jar\"/>               <jar href=\"wsdl4j.jar\"/>              <jar href=\"xercesImpl.jar\"/>          <jar href=\"xml-apis.jar\"/>            <property name=\"jalview.version\" value=\"Development Branch Build\"/> </resources>"+
-"<application-desc main-class=\"jalview.bin.Jalview\">"+
-"<argument>-open</argument>"+
-"<argument>file:///Users/tcnofoegbu/Documents/workspace/java/dev/jalview/examples/example_biojs.html</argument>"+
-"</application-desc>"+
-"      <security>"+
-"              <all-permissions/>"+
-"      </security>"+
-"</jnlp>"
-
-var encodedUri = encodeURI(jnpl);
-window.open(encodedUri)
-//alert(jnpl)
-}
+
 
 function openJalviewUsingCurrentUrl(){
-       var url = "http://webservices.compbio.dundee.ac.uk:38080/jalviewServlet/services/launchAppDev";
+       var jalviewData = JSON.parse(document.getElementById("seqData").value)
+    var jalviewVersion = jalviewData['jalviewVersion'];
+    var url = jalviewData['webStartUrl'];
        var myForm = document.createElement("form");
        myForm.action = url;
        
-    var myInput = document.createElement("input") ;
-    myInput.setAttribute("name", "jvm-max-heap") ;
-    myInput.setAttribute("value", "2G");
-    myForm.appendChild(myInput) ;
+    var heap = document.createElement("input") ;
+    heap.setAttribute("name", "jvm-max-heap") ;
+    heap.setAttribute("value", "2G");
+    myForm.appendChild(heap) ;
+    
+    var target = document.createElement("input") ;
+    target.setAttribute("name", "open") ;
+    target.setAttribute("value", document.URL);
+    myForm.appendChild(target) ;
     
-    var myInput1 = document.createElement("input") ;
-    myInput1.setAttribute("name", "open") ;
-    myInput1.setAttribute("value", document.URL);
-    myForm.appendChild(myInput1) ;
+    var jvVersion = document.createElement("input") ;
+    jvVersion.setAttribute("name", "version") ;
+    jvVersion.setAttribute("value", jalviewVersion);
+    myForm.appendChild(jvVersion) ;
     
 
        document.body.appendChild(myForm) ;
@@ -9051,7 +9026,6 @@ m.addView("menu", defMenu);
 
 // call render at the end to display the whole MSA
 m.render();
 toggleMenuVisibility(); 
 toggleMenuVisibility(); 
 });
index 2dd6d37..49d7d4a 100755 (executable)
@@ -267,7 +267,7 @@ public class PDBChain
     bonds.addElement(new Bond(start, end, at1, at2));
   }
 
-  public void makeResidueList()
+  public void makeResidueList(boolean visibleChainAnnotation)
   {
     int count = 0;
     Object symbol;
@@ -377,23 +377,27 @@ public class PDBChain
               .elementAt(i));
       resFeatures.setElementAt(null, i);
     }
-    Annotation[] annots = new Annotation[resAnnotation.size()];
-    float max = 0;
-    for (i = 0, iSize = annots.length; i < iSize; i++)
+    if (visibleChainAnnotation)
     {
-      annots[i] = (Annotation) resAnnotation.elementAt(i);
-      if (annots[i].value > max)
+      Annotation[] annots = new Annotation[resAnnotation.size()];
+      float max = 0;
+      for (i = 0, iSize = annots.length; i < iSize; i++)
       {
-        max = annots[i].value;
+        annots[i] = (Annotation) resAnnotation.elementAt(i);
+        if (annots[i].value > max)
+        {
+          max = annots[i].value;
+        }
+        resAnnotation.setElementAt(null, i);
       }
-      resAnnotation.setElementAt(null, i);
+
+      AlignmentAnnotation tfactorann = new AlignmentAnnotation(
+              "Temperature Factor", "Temperature Factor for " + pdbid + id,
+              annots, 0, max,
+              AlignmentAnnotation.LINE_GRAPH);
+      tfactorann.setSequenceRef(sequence);
+      sequence.addAlignmentAnnotation(tfactorann);
     }
-    AlignmentAnnotation tfactorann = new AlignmentAnnotation(
-            "PDB.TempFactor", "Temperature Factor for "
-                    + sequence.getName(), annots, 0, max,
-            AlignmentAnnotation.LINE_GRAPH);
-    tfactorann.setSequenceRef(sequence);
-    sequence.addAlignmentAnnotation(tfactorann);
   }
 
   public void setChargeColours()
@@ -518,6 +522,7 @@ public class PDBChain
                   ana.getCalcId(), ana.label);
           if (transfer == null || transfer.size() == 0)
           {
+            ana = new AlignmentAnnotation(ana);
             ana.liftOver(sequence, shadowMap);
             ana.liftOver(dsq, sqmpping);
             dsq.addAlignmentAnnotation(ana);
@@ -530,52 +535,56 @@ public class PDBChain
       }
       else
       {
-      if (sequence != null && sequence.getAnnotation() != null)
-      {
-        for (AlignmentAnnotation ana : sequence.getAnnotation())
+        if (sequence != null && sequence.getAnnotation() != null)
         {
-          List<AlignmentAnnotation> transfer = sq.getAlignmentAnnotations(
-                  ana.getCalcId(), ana.label);
-          if (transfer == null || transfer.size() == 0)
-          {
-            ana.liftOver(dsq, sqmpping);
-            // mapping.transfer(ana);
-          }
-          else
+          for (AlignmentAnnotation ana : sequence.getAnnotation())
           {
-            continue;
+            List<AlignmentAnnotation> transfer = sq
+                    .getAlignmentAnnotations(ana.getCalcId(), ana.label);
+            if (transfer == null || transfer.size() == 0)
+            {
+              ana = new AlignmentAnnotation(ana);
+              ana.liftOver(dsq, sqmpping);
+              // mapping.transfer(ana);
+            }
+            else
+            {
+              continue;
+            }
           }
         }
       }
-      }
-      float min = -1, max = 0;
-      Annotation[] an = new Annotation[sq.getEnd() - sq.getStart() + 1];
-      for (int i = sq.getStart(), j = sq.getEnd(), k = 0; i <= j; i++, k++)
+      if (false)
       {
-        int prn = mapping.getPDBResNum(k + 1);
-
-        an[k] = new Annotation(prn);
-        if (min == -1)
-        {
-          min = k;
-          max = k;
-        }
-        else
+        // Useful for debugging mappings - adds annotation for mapped position
+        float min = -1, max = 0;
+        Annotation[] an = new Annotation[sq.getEnd() - sq.getStart() + 1];
+        for (int i = sq.getStart(), j = sq.getEnd(), k = 0; i <= j; i++, k++)
         {
-          if (min > k)
+          int prn = mapping.getPDBResNum(k + 1);
+
+          an[k] = new Annotation(prn);
+          if (min == -1)
           {
             min = k;
+            max = k;
           }
-          else if (max < k)
+          else
           {
-            max = k;
+            if (min > k)
+            {
+              min = k;
+            }
+            else if (max < k)
+            {
+              max = k;
+            }
           }
         }
+        sq.addAlignmentAnnotation(new AlignmentAnnotation("PDB.RESNUM",
+                "PDB Residue Numbering for " + this.pdbid + ":" + this.id,
+                an, min, max, AlignmentAnnotation.LINE_GRAPH));
       }
-      sq.addAlignmentAnnotation(new AlignmentAnnotation("PDB.RESNUM",
-              "PDB Residue Numbering for " + this.pdbid + ":" + this.id,
-              an, min, max, AlignmentAnnotation.LINE_GRAPH));
-
     }
   }
 }
index d3535c0..bf285b9 100755 (executable)
@@ -113,7 +113,7 @@ public class PDBViewer extends JInternalFrame implements Runnable
       try
       {
         tmpPDBFile = pdbentry.getFile();
-        PDBfile pdbfile = new PDBfile(false,false,tmpPDBFile,
+        PDBfile pdbfile = new PDBfile(false, false, false, tmpPDBFile,
                 jalview.io.AppletFormatAdapter.FILE);
 
         pdbcanvas.init(pdbentry, seq, chains, ap, protocol);
index b22eb29..691fdcd 100755 (executable)
@@ -47,32 +47,38 @@ public class PDBfile extends jalview.io.AlignFile
    */
   boolean VisibleChainAnnotation = false;
 
-  boolean processSecondaryStructure=true;
-  
+  boolean processSecondaryStructure = true;
+
+  boolean externalSecondaryStructure = false;
 
   public PDBfile(boolean visibleChainAnnotation,
-          boolean processSecondaryStructure)
+          boolean processSecondaryStructure, boolean externalSecStr)
   {
     super();
     VisibleChainAnnotation = visibleChainAnnotation;
     this.processSecondaryStructure = processSecondaryStructure;
+    this.externalSecondaryStructure = externalSecStr;
   }
 
   public PDBfile(boolean visibleChainAnnotation,
-          boolean processSecondaryStructure, String file, String protocol) throws IOException
+          boolean processSecondaryStructure, boolean externalSecStr,
+          String file, String protocol) throws IOException
   {
     super(false, file, protocol);
     VisibleChainAnnotation = visibleChainAnnotation;
     this.processSecondaryStructure = processSecondaryStructure;
+    this.externalSecondaryStructure = externalSecStr;
     doParse();
   }
 
   public PDBfile(boolean visibleChainAnnotation,
-          boolean processSecondaryStructure, FileParse source) throws IOException
+          boolean processSecondaryStructure, boolean externalSecStr,
+          FileParse source) throws IOException
   {
     super(false, source);
     VisibleChainAnnotation = visibleChainAnnotation;
     this.processSecondaryStructure = processSecondaryStructure;
+    this.externalSecondaryStructure = externalSecStr;
     doParse();
   }
 
@@ -189,8 +195,7 @@ public class PDBfile extends jalview.io.AlignFile
         entry.setProperty(new Hashtable());
         if (chains.elementAt(i).id != null)
         {
-          entry.getProperty().put("CHAIN",
-                  chains.elementAt(i).id);
+          entry.getProperty().put("CHAIN", chains.elementAt(i).id);
         }
         if (inFile != null)
         {
@@ -217,7 +222,7 @@ public class PDBfile extends jalview.io.AlignFile
 
         AlignmentAnnotation[] chainannot = chainseq.getAnnotation();
 
-        if (chainannot != null)
+        if (chainannot != null && VisibleChainAnnotation)
         {
           for (int ai = 0; ai < chainannot.length; ai++)
           {
@@ -228,34 +233,34 @@ public class PDBfile extends jalview.io.AlignFile
       }
       if (processSecondaryStructure)
       {
-      if (rna.size() > 0)
-      {
-        try
+        if (externalSecondaryStructure && rna.size() > 0)
         {
-          processPdbFileWithAnnotate3d(rna);
-        } catch (Exception x)
-        {
-          System.err
-                  .println("Exceptions when dealing with RNA in pdb file");
-          x.printStackTrace();
+          try
+          {
+            processPdbFileWithAnnotate3d(rna);
+          } catch (Exception x)
+          {
+            System.err
+                    .println("Exceptions when dealing with RNA in pdb file");
+            x.printStackTrace();
 
+          }
         }
-      }
-      ;
-      if (prot.size() > 0)
-      {
-        try
+        ;
+        if (prot.size() > 0)
         {
-          processPdbFileWithJmol(prot);
-        } catch (Exception x)
-        {
-          System.err
-                  .println("Exceptions from Jmol when processing data in pdb file");
-          x.printStackTrace();
+          try
+          {
+            processPdbFileWithJmol(prot);
+          } catch (Exception x)
+          {
+            System.err
+                    .println("Exceptions from Jmol when processing data in pdb file");
+            x.printStackTrace();
 
+          }
         }
       }
-      }
     } catch (OutOfMemoryError er)
     {
       System.out.println("OUT OF MEMORY LOADING PDB FILE");
@@ -277,11 +282,11 @@ public class PDBfile extends jalview.io.AlignFile
 
   public static boolean isCalcIdHandled(String calcId)
   {
-    return calcId != null
- && (calcIdPrefix.equals(calcId));
+    return calcId != null && (calcIdPrefix.equals(calcId));
   }
 
-  public static boolean isCalcIdForFile(AlignmentAnnotation alan, String pdbFile)
+  public static boolean isCalcIdForFile(AlignmentAnnotation alan,
+          String pdbFile)
   {
     return alan.getCalcId() != null
             && calcIdPrefix.equals(alan.getCalcId())
@@ -301,19 +306,23 @@ public class PDBfile extends jalview.io.AlignFile
   {
     for (SequenceI sq : seqs)
     {
-      for (AlignmentAnnotation aa : sq.getAnnotation())
+      if (sq.getAnnotation() != null)
       {
-        String oldId = aa.getCalcId();
-        if (oldId == null)
+        for (AlignmentAnnotation aa : sq.getAnnotation())
         {
-          oldId = "";
+          String oldId = aa.getCalcId();
+          if (oldId == null)
+          {
+            oldId = "";
+          }
+          aa.setCalcId(calcIdPrefix);
+          aa.setProperty("PDBID", id);
+          aa.setProperty("oldCalcId", oldId);
         }
-        aa.setCalcId(calcIdPrefix);
-        aa.setProperty("PDBID", id);
-        aa.setProperty("oldCalcId", oldId);
       }
     }
   }
+
   private void processPdbFileWithJmol(ArrayList<SequenceI> prot)
           throws Exception
   {
@@ -352,8 +361,8 @@ public class PDBfile extends jalview.io.AlignFile
           AlignmentI al, String pep, boolean b)
   {
     List<List<? extends Object>> replaced = AlignSeq
-            .replaceMatchingSeqsWith(seqs,
-            annotations, prot, al, AlignSeq.PEP, false);
+            .replaceMatchingSeqsWith(seqs, annotations, prot, al, pep,
+                    false);
     for (PDBChain ch : chains)
     {
       int p = 0;
@@ -371,8 +380,7 @@ public class PDBfile extends jalview.io.AlignFile
         p = -p - 1;
         // set shadow entry for chains
         ch.shadow = (SequenceI) replaced.get(1).get(p);
-        ch.shadowMap = ((AlignSeq) replaced.get(2)
-.get(p))
+        ch.shadowMap = ((AlignSeq) replaced.get(2).get(p))
                 .getMappingFromS1(false);
       }
     }
@@ -445,7 +453,7 @@ public class PDBfile extends jalview.io.AlignFile
   {
     for (int i = 0; i < chains.size(); i++)
     {
-      chains.elementAt(i).makeResidueList();
+      chains.elementAt(i).makeResidueList(VisibleChainAnnotation);
     }
   }
 
@@ -490,8 +498,8 @@ public class PDBfile extends jalview.io.AlignFile
   {
     for (int i = 0; i < chains.size(); i++)
     {
-      chains.elementAt(i).setChainColours(Color.getHSBColor(
-              1.0f / i, .4f, 1.0f));
+      chains.elementAt(i).setChainColours(
+              Color.getHSBColor(1.0f / i, .4f, 1.0f));
     }
   }
 
index 1208638..4797b37 100644 (file)
@@ -864,22 +864,24 @@ public class StructureManager
   StructureSettings defaultSettings = null;
 
   // TODO: [Optional] Change priority of Chimera paths
-  public List<String> getChimeraPaths()
+  public static List<String> getChimeraPaths()
   {
     List<String> pathList = new ArrayList<String>();
 
     // if no network is available and the settings have been modified by the
     // user, check for a
     // path to chimera
-    if (defaultSettings != null)
-    {
-      String defaultPath = defaultSettings.getChimeraPath();
-      if (defaultPath != null && !defaultPath.equals(""))
-      {
-        pathList.add(defaultPath);
-        return pathList;
-      }
-    }
+    //
+    // For Jalview, Preferences/Cache plays this role instead
+    // if (defaultSettings != null)
+    // {
+    // String defaultPath = defaultSettings.getChimeraPath();
+    // if (defaultPath != null && !defaultPath.equals(""))
+    // {
+    // pathList.add(defaultPath);
+    // return pathList;
+    // }
+    // }
 
     /*
      * Jalview addition: check if path set in user preferences.
@@ -887,7 +889,7 @@ public class StructureManager
     String userPath = Cache.getDefault(Preferences.CHIMERA_PATH, null);
     if (userPath != null)
     {
-      pathList.add(userPath);
+      pathList.add(0, userPath);
     }
 
     // Add default installation paths
index 307a06f..ba7e520 100755 (executable)
@@ -1153,7 +1153,7 @@ public class AlignSeq
               ap++;
             }
           }
-          if (sq.getAnnotation() != null)
+          if (sq.getAnnotation() != null && sq.getAnnotation().length > 0)
           {
             annotations.addAll(inspos, Arrays.asList(sq.getAnnotation()));
           }
index 929a855..6385fa7 100644 (file)
@@ -20,6 +20,7 @@
  */
 package jalview.analysis;
 
+import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.SequenceI;
 
@@ -121,6 +122,16 @@ public class AlignmentUtils
     }
     AlignmentI newAl = new jalview.datamodel.Alignment(
             sq.toArray(new SequenceI[0]));
+    for (SequenceI s : sq)
+    {
+      if (s.getAnnotation() != null)
+      {
+        for (AlignmentAnnotation aa : s.getAnnotation())
+        {
+          newAl.addAnnotation(aa);
+        }
+      }
+    }
     newAl.setDataset(core.getDataset());
     return newAl;
   }
index a5d2164..81398eb 100644 (file)
@@ -209,6 +209,10 @@ public class AnnotationSorter
   public void sort(AlignmentAnnotation[] alignmentAnnotations,
           SequenceAnnotationOrder order)
   {
+    if (alignmentAnnotations == null)
+    {
+      return;
+    }
     // cache 'alignment sequence position' for the annotations
     saveSequenceIndices(alignmentAnnotations);
 
index e4a0d76..227bf09 100644 (file)
 
 package jalview.analysis;
 
+import jalview.analysis.SecStrConsensus.SimpleBP;
+import jalview.datamodel.SequenceFeature;
+import jalview.util.MessageManager;
+
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashSet;
@@ -33,10 +37,6 @@ import java.util.Hashtable;
 import java.util.Stack;
 import java.util.Vector;
 
-import jalview.analysis.SecStrConsensus.SimpleBP;
-import jalview.datamodel.SequenceFeature;
-import jalview.util.MessageManager;
-
 public class Rna
 {
 
@@ -65,7 +65,7 @@ public class Rna
     {
       for (int i = 0; i < openingPars.length; i++)
       {
-        System.out.println(closingPars[i] + "->" + openingPars[i]);
+        // System.out.println(closingPars[i] + "->" + openingPars[i]);
         put(closingPars[i], openingPars[i]);
       }
     }
@@ -107,7 +107,6 @@ public class Rna
   public static Vector<SimpleBP> GetSimpleBPs(CharSequence line)
           throws WUSSParseException
   {
-    System.out.println(line);
     Hashtable<Character, Stack<Integer>> stacks = new Hashtable<Character, Stack<Integer>>();
     Vector<SimpleBP> pairs = new Vector<SimpleBP>();
     int i = 0;
index a6eaba2..a68c1f6 100644 (file)
@@ -55,4 +55,9 @@ public interface AlignmentViewPanel extends OOMHandlerI
 
   FeatureRenderer cloneFeatureRenderer();
   
+  /**
+   * 
+   * @return displayed name for the view
+   */
+  String getViewName();
 }
index 5e72242..aa1ab21 100644 (file)
  */
 package jalview.appletgui;
 
-import java.util.*;
-
-import java.awt.*;
-import java.awt.event.*;
-
-import jalview.analysis.*;
-import jalview.commands.*;
-import jalview.datamodel.*;
-import jalview.schemes.*;
-import jalview.util.MessageManager;
-import jalview.util.UrlLink;
+import jalview.analysis.AAFrequency;
+import jalview.analysis.Conservation;
+import jalview.commands.ChangeCaseCommand;
+import jalview.commands.EditCommand;
+import jalview.commands.EditCommand.Action;
+import jalview.datamodel.DBRefEntry;
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
 import jalview.io.AppletFormatAdapter;
 import jalview.io.SequenceAnnotationReport;
+import jalview.schemes.Blosum62ColourScheme;
+import jalview.schemes.BuriedColourScheme;
+import jalview.schemes.ClustalxColourScheme;
+import jalview.schemes.HelixColourScheme;
+import jalview.schemes.HydrophobicColourScheme;
+import jalview.schemes.NucleotideColourScheme;
+import jalview.schemes.PIDColourScheme;
+import jalview.schemes.ResidueProperties;
+import jalview.schemes.StrandColourScheme;
+import jalview.schemes.TaylorColourScheme;
+import jalview.schemes.TurnColourScheme;
+import jalview.schemes.ZappoColourScheme;
+import jalview.util.MessageManager;
+import jalview.util.UrlLink;
+
+import java.awt.CheckboxMenuItem;
+import java.awt.Frame;
+import java.awt.Menu;
+import java.awt.MenuItem;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.util.Vector;
 
 public class APopupMenu extends java.awt.PopupMenu implements
         ActionListener, ItemListener
@@ -549,7 +573,9 @@ public class APopupMenu extends java.awt.PopupMenu implements
       if (sg != null)
       {
         if (seq == null)
+        {
           seq = (Sequence) sg.getSequenceAt(0);
+        }
 
         EditNameDialog dialog = new EditNameDialog(seq.getSequenceAsString(
                 sg.getStartRes(), sg.getEndRes() + 1), null,
@@ -560,7 +586,7 @@ public class APopupMenu extends java.awt.PopupMenu implements
         if (dialog.accept)
         {
           EditCommand editCommand = new EditCommand(MessageManager.getString("label.edit_sequences"),
-                  EditCommand.REPLACE, dialog.getName().replace(' ',
+                  Action.REPLACE, dialog.getName().replace(' ',
                           ap.av.getGapCharacter()),
                   sg.getSequencesAsArray(ap.av.getHiddenRepSequences()),
                   sg.getStartRes(), sg.getEndRes() + 1,
@@ -742,11 +768,15 @@ public class APopupMenu extends java.awt.PopupMenu implements
       PDBEntry entry = (PDBEntry) seq.getPDBId().firstElement();
 
       if (ap.av.applet.jmolAvailable)
+      {
         new jalview.appletgui.AppletJmol(entry, new Sequence[]
         { seq }, null, ap, AppletFormatAdapter.URL);
+      }
       else
+      {
         new MCview.AppletPDBViewer(entry, new Sequence[]
         { seq }, null, ap, AppletFormatAdapter.URL);
+      }
 
     }
     else
index cad4de3..9fb91ed 100644 (file)
@@ -28,6 +28,7 @@ import jalview.api.FeatureRenderer;
 import jalview.bin.JalviewLite;
 import jalview.commands.CommandI;
 import jalview.commands.EditCommand;
+import jalview.commands.EditCommand.Action;
 import jalview.commands.OrderCommand;
 import jalview.commands.RemoveGapColCommand;
 import jalview.commands.RemoveGapsCommand;
@@ -1836,7 +1837,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     }
 
     // !newAlignment
-    addHistoryItem(new EditCommand(MessageManager.getString("label.add_sequences"), EditCommand.PASTE,
+    addHistoryItem(new EditCommand(
+            MessageManager.getString("label.add_sequences"), Action.PASTE,
             seqs, 0, viewport.getAlignment().getWidth(),
             viewport.getAlignment()));
 
@@ -1886,8 +1888,9 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     /*
      * //ADD HISTORY ITEM
      */
-    addHistoryItem(new EditCommand(MessageManager.getString("label.cut_sequences"), EditCommand.CUT, cut,
-            sg.getStartRes(), sg.getEndRes() - sg.getStartRes() + 1,
+    addHistoryItem(new EditCommand(
+            MessageManager.getString("label.cut_sequences"), Action.CUT,
+            cut, sg.getStartRes(), sg.getEndRes() - sg.getStartRes() + 1,
             viewport.getAlignment()));
 
     viewport.setSelectionGroup(null);
index a398e66..5308a42 100644 (file)
  */
 package jalview.appletgui;
 
-import java.awt.*;
-import java.awt.event.*;
-
 import jalview.api.AlignmentViewPanel;
-import jalview.datamodel.*;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.SearchResults;
+import jalview.datamodel.SequenceI;
 import jalview.structure.StructureSelectionManager;
 
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.FontMetrics;
+import java.awt.Frame;
+import java.awt.Graphics;
+import java.awt.Panel;
+import java.awt.Scrollbar;
+import java.awt.event.AdjustmentEvent;
+import java.awt.event.AdjustmentListener;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+
 public class AlignmentPanel extends Panel implements AdjustmentListener,
         AlignmentViewPanel
 {
@@ -971,6 +983,12 @@ public class AlignmentPanel extends Panel implements AdjustmentListener,
   }
 
   @Override
+  public String getViewName()
+  {
+    return getName();
+  }
+
+  @Override
   public StructureSelectionManager getStructureSelectionManager()
   {
     return StructureSelectionManager
index 4b9fa67..22996f7 100755 (executable)
@@ -256,7 +256,9 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI,
           anot[index] = new Annotation(label, "", type, 0);
         }
 
-        anot[index].secondaryStructure = type;
+        
+        anot[index].secondaryStructure = type != 'S' ? type : label
+                .length() == 0 ? ' ' : label.charAt(0);
         anot[index].displayCharacter = label;
       }
     }
index 9afc70b..5a3b56c 100644 (file)
  */
 package jalview.appletgui;
 
-import java.util.*;
-
-import java.awt.*;
-import java.awt.event.*;
-
-import jalview.analysis.*;
-import jalview.datamodel.*;
+import jalview.analysis.AlignSeq;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceI;
 import jalview.util.MessageManager;
 
+import java.awt.BorderLayout;
+import java.awt.Button;
+import java.awt.Panel;
+import java.awt.ScrollPane;
+import java.awt.TextArea;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Vector;
+
 public class PairwiseAlignPanel extends Panel implements ActionListener
 {
   Vector sequences = new Vector();
@@ -89,13 +95,8 @@ public class PairwiseAlignPanel extends Panel implements ActionListener
         totscore = totscore + scores[i][j];
 
         textarea.append(as.getOutput());
-        seq = new Sequence(as.getS1().getName(), as.getAStr1(), as.getS1()
-                .getStart(), as.getS1().getEnd());
-        sequences.addElement(seq);
-
-        seq = new Sequence(as.getS2().getName(), as.getAStr2(), as.getS2()
-                .getStart(), as.getS2().getEnd());
-        sequences.addElement(seq);
+        sequences.add(as.getAlignedSeq1());
+        sequences.add(as.getAlignedSeq1());
       }
     }
 
index 1547862..8e364f0 100644 (file)
  */
 package jalview.appletgui;
 
-import java.util.*;
-import java.util.List;
-import java.awt.*;
-import java.awt.event.*;
-
 import jalview.analysis.AlignSeq;
-import jalview.commands.*;
-import jalview.datamodel.*;
+import jalview.commands.CommandI;
+import jalview.commands.EditCommand;
+import jalview.commands.EditCommand.Action;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
 import jalview.util.MessageManager;
 
+import java.awt.Frame;
+import java.awt.event.ActionEvent;
+import java.awt.event.AdjustmentEvent;
+import java.awt.event.AdjustmentListener;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Stack;
+import java.util.Vector;
+
 public class RedundancyPanel extends SliderPanel implements Runnable,
         WindowListener
 {
@@ -197,7 +207,7 @@ public class RedundancyPanel extends SliderPanel implements Runnable,
       }
 
       EditCommand cut = new EditCommand(MessageManager.getString("action.remove_redundancy"),
-              EditCommand.CUT, deleted, 0, width, ap.av.getAlignment());
+              Action.CUT, deleted, 0, width, ap.av.getAlignment());
       AlignmentI alignment = ap.av.getAlignment();
       for (int i = 0; i < del.size(); i++)
       {
index b6e6081..a95dd27 100644 (file)
  */
 package jalview.appletgui;
 
-import java.util.*;
-
-import java.awt.*;
-import java.awt.event.*;
-
-import jalview.commands.*;
-import jalview.datamodel.*;
-import jalview.schemes.*;
+import jalview.commands.EditCommand;
+import jalview.commands.EditCommand.Action;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.SearchResults;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.schemes.ResidueProperties;
 import jalview.structure.SelectionSource;
 import jalview.structure.SequenceListener;
 import jalview.structure.StructureSelectionManager;
 import jalview.util.MessageManager;
 
+import java.awt.BorderLayout;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Panel;
+import java.awt.Point;
+import java.awt.event.InputEvent;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+import java.util.Vector;
+
 public class SeqPanel extends Panel implements MouseMotionListener,
         MouseListener, SequenceListener
 {
@@ -147,7 +159,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
 
   void setCursorPosition()
   {
-    SequenceI sequence = (Sequence) av.getAlignment().getSequenceAt(
+    SequenceI sequence = av.getAlignment().getSequenceAt(
             seqCanvas.cursorY);
 
     seqCanvas.cursorX = sequence.findIndex(getKeyboardNo1()) - 1;
@@ -240,7 +252,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
 
   void setSelectionAreaAtCursor(boolean topLeft)
   {
-    SequenceI sequence = (Sequence) av.getAlignment().getSequenceAt(
+    SequenceI sequence = av.getAlignment().getSequenceAt(
             seqCanvas.cursorY);
 
     if (av.getSelectionGroup() != null)
@@ -648,7 +660,9 @@ public class SeqPanel extends Panel implements MouseMotionListener,
   {
     String tmp = sequence.hashCode() + index + "";
     if (lastMessage == null || !lastMessage.equals(tmp))
+    {
       ssm.mouseOverSequence(sequence, index, pos, av);
+    }
 
     lastMessage = tmp;
   }
@@ -698,7 +712,9 @@ public class SeqPanel extends Panel implements MouseMotionListener,
 
     int respos = sequence.findPosition(res);
     if (ssm != null)
+    {
       mouseOverSequence(sequence, res, respos);
+    }
 
     StringBuffer text = new StringBuffer("Sequence " + (seq + 1) + " ID: "
             + sequence.getName());
@@ -936,7 +952,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
     {
       if (av.isHiddenRepSequence(seq))
       {
-        sg = (SequenceGroup) av.getRepresentedSequences(seq);
+        sg = av.getRepresentedSequences(seq);
         groupEditing = true;
       }
     }
@@ -1162,7 +1178,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
         }
         else
         {
-          editCommand.appendEdit(EditCommand.INSERT_GAP, groupSeqs,
+          editCommand.appendEdit(Action.INSERT_GAP, groupSeqs,
                   startres, startres - lastres, av.getAlignment(), true);
         }
       }
@@ -1178,7 +1194,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
         }
         else
         {
-          editCommand.appendEdit(EditCommand.DELETE_GAP, groupSeqs,
+          editCommand.appendEdit(Action.DELETE_GAP, groupSeqs,
                   startres, lastres - startres, av.getAlignment(), true);
         }
 
@@ -1200,7 +1216,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
         }
         else
         {
-          editCommand.appendEdit(EditCommand.INSERT_GAP, new SequenceI[]
+          editCommand.appendEdit(Action.INSERT_GAP, new SequenceI[]
           { seq }, lastres, startres - lastres, av.getAlignment(), true);
         }
       }
@@ -1235,7 +1251,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
 
           if (max > 0)
           {
-            editCommand.appendEdit(EditCommand.DELETE_GAP, new SequenceI[]
+            editCommand.appendEdit(Action.DELETE_GAP, new SequenceI[]
             { seq }, startres, max, av.getAlignment(), true);
           }
         }
@@ -1271,10 +1287,10 @@ public class SeqPanel extends Panel implements MouseMotionListener,
       }
     }
 
-    editCommand.appendEdit(EditCommand.DELETE_GAP, seq, blankColumn, 1,
+    editCommand.appendEdit(Action.DELETE_GAP, seq, blankColumn, 1,
             av.getAlignment(), true);
 
-    editCommand.appendEdit(EditCommand.INSERT_GAP, seq, j, 1,
+    editCommand.appendEdit(Action.INSERT_GAP, seq, j, 1,
             av.getAlignment(), true);
 
   }
@@ -1282,10 +1298,10 @@ public class SeqPanel extends Panel implements MouseMotionListener,
   void deleteChar(int j, SequenceI[] seq, int fixedColumn)
   {
 
-    editCommand.appendEdit(EditCommand.DELETE_GAP, seq, j, 1,
+    editCommand.appendEdit(Action.DELETE_GAP, seq, j, 1,
             av.getAlignment(), true);
 
-    editCommand.appendEdit(EditCommand.INSERT_GAP, seq, fixedColumn, 1,
+    editCommand.appendEdit(Action.INSERT_GAP, seq, fixedColumn, 1,
             av.getAlignment(), true);
   }
 
@@ -1310,7 +1326,7 @@ public class SeqPanel extends Panel implements MouseMotionListener,
       return;
     }
 
-    SequenceI sequence = (Sequence) av.getAlignment().getSequenceAt(seq);
+    SequenceI sequence = av.getAlignment().getSequenceAt(seq);
 
     if (sequence == null || res > sequence.getLength())
     {
index 24ed1b4..3dea84e 100755 (executable)
@@ -150,6 +150,7 @@ import org.apache.log4j.SimpleLayout;
  * <li>FOLLOW_SELECTIONS (true) Controls whether a new alignment view should
  * respond to selections made in other alignments containing the same sequences.
  * </li>
+ * <li>JWS2HOSTURLS comma-separated list of URLs to try for JABAWS services</li>
  * <li>SHOW_WSDISCOVERY_ERRORS (true) Controls if the web service URL discovery
  * warning dialog box is displayed.</li>
  * <li>ANNOTATIONCOLOUR_MIN (orange) Shade used for minimum value of annotation
@@ -378,15 +379,21 @@ public class Cache
 
     String jnlpVersion = System.getProperty("jalview.version");
     String codeVersion = getProperty("VERSION");
-
+    String codeInstallation = getProperty("INSTALLATION");
     if (codeVersion == null)
     {
       // THIS SHOULD ONLY BE THE CASE WHEN TESTING!!
       codeVersion = "Test";
       jnlpVersion = "Test";
+      codeInstallation = "";
+    }
+    else
+    {
+      codeInstallation = " (" + codeInstallation + ")";
     }
 
-    System.out.println("Jalview Version: " + codeVersion);
+    System.out
+            .println("Jalview Version: " + codeVersion + codeInstallation);
 
     // jnlpVersion will be null if we're using InstallAnywhere
     // Dont do this check if running in headless mode
@@ -476,6 +483,8 @@ public class Cache
     applicationProperties.remove("AUTHORS");
     applicationProperties.remove("AUTHORFNAMES");
     applicationProperties.remove("YEAR");
+    applicationProperties.remove("BUILD_DATE");
+    applicationProperties.remove("INSTALLATION");
   }
 
   /**
index 046d132..50e3559 100755 (executable)
  */
 package jalview.bin;
 
-import java.awt.FlowLayout;
-import java.awt.Frame;
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.io.HtmlSvgOutput;
+import jalview.util.MessageManager;
+import jalview.util.Platform;
+import jalview.ws.jws2.Jws2Discoverer;
+
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.io.BufferedReader;
@@ -31,6 +36,7 @@ import java.io.IOException;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 import java.lang.reflect.Constructor;
+import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
 import java.net.URLDecoder;
@@ -39,13 +45,11 @@ import java.security.CodeSource;
 import java.security.PermissionCollection;
 import java.security.Permissions;
 import java.security.Policy;
-import java.util.*;
-
-import javax.swing.*;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Vector;
 
-import jalview.gui.*;
-import jalview.util.MessageManager;
-import jalview.util.Platform;
+import javax.swing.UIManager;
 
 /**
  * Main class for Jalview Application <br>
@@ -76,11 +80,6 @@ public class Jalview
   }
 
   /**
-   * Put protein=true for get a protein example
-   */
-  private static boolean protein = false;
-
-  /**
    * main class for Jalview application
    * 
    * @param args
@@ -105,40 +104,7 @@ public class Jalview
 
     if (aparser.contains("help") || aparser.contains("h"))
     {
-      System.out
-              .println("Usage: jalview -open [FILE] [OUTPUT_FORMAT] [OUTPUT_FILE]\n\n"
-                      + "-nodisplay\tRun Jalview without User Interface.\n"
-                      + "-props FILE\tUse the given Jalview properties file instead of users default.\n"
-                      + "-colour COLOURSCHEME\tThe colourscheme to be applied to the alignment\n"
-                      + "-annotations FILE\tAdd precalculated annotations to the alignment.\n"
-                      + "-tree FILE\tLoad the given newick format tree file onto the alignment\n"
-                      + "-features FILE\tUse the given file to mark features on the alignment.\n"
-                      + "-fasta FILE\tCreate alignment file FILE in Fasta format.\n"
-                      + "-clustal FILE\tCreate alignment file FILE in Clustal format.\n"
-                      + "-pfam FILE\tCreate alignment file FILE in PFAM format.\n"
-                      + "-msf FILE\tCreate alignment file FILE in MSF format.\n"
-                      + "-pileup FILE\tCreate alignment file FILE in Pileup format\n"
-                      + "-pir FILE\tCreate alignment file FILE in PIR format.\n"
-                      + "-blc FILE\tCreate alignment file FILE in BLC format.\n"
-                      + "-jalview FILE\tCreate alignment file FILE in Jalview format.\n"
-                      + "-png FILE\tCreate PNG image FILE from alignment.\n"
-                      + "-imgMap FILE\tCreate HTML file FILE with image map of PNG image.\n"
-                      + "-eps FILE\tCreate EPS file FILE from alignment.\n"
-                      + "-questionnaire URL\tQueries the given URL for information about any Jalview user questionnaires.\n"
-                      + "-noquestionnaire\tTurn off questionnaire check.\n"
-                      + "-nousagestats\tTurn off google analytics tracking for this session.\n"
-                      + "-sortbytree OR -nosortbytree\tEnable or disable sorting of the given alignment by the given tree\n"
-                      // +
-                      // "-setprop PROPERTY=VALUE\tSet the given Jalview property, after all other properties files have been read\n\t (quote the 'PROPERTY=VALUE' pair to ensure spaces are passed in correctly)"
-                      + "-dasserver nickname=URL\tAdd and enable a das server with given nickname\n\t\t\t(alphanumeric or underscores only) for retrieval of features for all alignments.\n"
-                      + "\t\t\tSources that also support the sequence command may be specified by prepending the URL with sequence:\n"
-                      + "\t\t\t e.g. sequence:http://localdas.somewhere.org/das/source)\n"
-                      + "-fetchfrom nickname\tQuery nickname for features for the alignments and display them.\n"
-                      // +
-                      // "-vdoc vamsas-document\tImport vamsas document into new session or join existing session with same URN\n"
-                      // + "-vses vamsas-session\tJoin session with given URN\n"
-                      + "-groovy FILE\tExecute groovy script in FILE, after all other arguments have been processed (if FILE is the text 'STDIN' then the file will be read from STDIN)\n"
-                      + "\n~Read documentation in Application or visit http://www.jalview.org for description of Features and Annotations file~\n\n");
+      showUsage();
       System.exit(0);
     }
     if (aparser.contains("nodisplay") || aparser.contains("nogui")
@@ -149,6 +115,20 @@ public class Jalview
     }
     Cache.loadProperties(aparser.getValue("props")); // must do this before
     // anything else!
+
+    final String jabawsUrl = aparser.getValue("jabaws");
+    if (jabawsUrl != null)
+    {
+      try
+      {
+        Jws2Discoverer.getDiscoverer().setPreferredUrl(jabawsUrl);
+      } catch (MalformedURLException e)
+      {
+        System.err.println("Invalid jabaws parameter: " + jabawsUrl
+                + " ignored");
+      }
+    }
+
     String defs = aparser.getValue("setprop");
     while (defs != null)
     {
@@ -418,6 +398,10 @@ public class Jalview
         {
           af.getViewport().setSortByTree(true);
         }
+        if (aparser.contains("no-annotation"))
+        {
+          af.getViewport().setShowAnnotation(false);
+        }
         if (aparser.contains("nosortbytree"))
         {
           af.getViewport().setSortByTree(false);
@@ -451,6 +435,7 @@ public class Jalview
         {
           FeatureFetcher ff = startFeatureFetching(getFeatures);
           if (ff != null)
+          {
             while (!ff.allFinished() || af.operationInProgress())
             {
               // wait around until fetching is finished.
@@ -462,6 +447,7 @@ public class Jalview
 
               }
             }
+          }
           getFeatures = null; // have retrieved features - forget them now.
         }
         if (groovyscript != null)
@@ -495,6 +481,22 @@ public class Jalview
             System.out.println("Creating PNG image: " + file);
             continue;
           }
+          else if (format.equalsIgnoreCase("svg"))
+          {
+            File imageFile = new java.io.File(file);
+            imageName = imageFile.getName();
+            af.createSVG(imageFile);
+            System.out.println("Creating SVG image: " + file);
+            continue;
+          }
+          else if (format.equalsIgnoreCase("html"))
+          {
+            File imageFile = new java.io.File(file);
+            imageName = imageFile.getName();
+            new HtmlSvgOutput(new java.io.File(file), af.alignPanel);
+            System.out.println("Creating HTML image: " + file);
+            continue;
+          }
           else if (format.equalsIgnoreCase("imgMap"))
           {
             af.createImageMap(new java.io.File(file), imageName);
@@ -533,8 +535,7 @@ public class Jalview
     // ////////////////////
 
     if (!headless && file == null && vamsasImport == null
-            && jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true)
-            && protein == true)
+            && jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true))
     {
       file = jalview.bin.Cache.getDefault(
               "STARTUP_FILE",
@@ -608,6 +609,47 @@ public class Jalview
     }
   }
 
+  private static void showUsage()
+  {
+    System.out
+            .println("Usage: jalview -open [FILE] [OUTPUT_FORMAT] [OUTPUT_FILE]\n\n"
+                    + "-nodisplay\tRun Jalview without User Interface.\n"
+                    + "-props FILE\tUse the given Jalview properties file instead of users default.\n"
+                    + "-colour COLOURSCHEME\tThe colourscheme to be applied to the alignment\n"
+                    + "-annotations FILE\tAdd precalculated annotations to the alignment.\n"
+                    + "-tree FILE\tLoad the given newick format tree file onto the alignment\n"
+                    + "-features FILE\tUse the given file to mark features on the alignment.\n"
+                    + "-fasta FILE\tCreate alignment file FILE in Fasta format.\n"
+                    + "-clustal FILE\tCreate alignment file FILE in Clustal format.\n"
+                    + "-pfam FILE\tCreate alignment file FILE in PFAM format.\n"
+                    + "-msf FILE\tCreate alignment file FILE in MSF format.\n"
+                    + "-pileup FILE\tCreate alignment file FILE in Pileup format\n"
+                    + "-pir FILE\tCreate alignment file FILE in PIR format.\n"
+                    + "-blc FILE\tCreate alignment file FILE in BLC format.\n"
+                    + "-jalview FILE\tCreate alignment file FILE in Jalview format.\n"
+                    + "-png FILE\tCreate PNG image FILE from alignment.\n"
+                    + "-svg FILE\tCreate SVG image FILE from alignment.\n"
+                    + "-html FILE\tCreate HTML file from alignment.\n"
+                    + "-imgMap FILE\tCreate HTML file FILE with image map of PNG image.\n"
+                    + "-eps FILE\tCreate EPS file FILE from alignment.\n"
+                    + "-questionnaire URL\tQueries the given URL for information about any Jalview user questionnaires.\n"
+                    + "-noquestionnaire\tTurn off questionnaire check.\n"
+                    + "-nousagestats\tTurn off google analytics tracking for this session.\n"
+                    + "-sortbytree OR -nosortbytree\tEnable or disable sorting of the given alignment by the given tree\n"
+                    // +
+                    // "-setprop PROPERTY=VALUE\tSet the given Jalview property, after all other properties files have been read\n\t (quote the 'PROPERTY=VALUE' pair to ensure spaces are passed in correctly)"
+                    + "-jabaws URL\tSpecify URL for Jabaws services (e.g. for a local installation).\n"
+                    + "-dasserver nickname=URL\tAdd and enable a das server with given nickname\n\t\t\t(alphanumeric or underscores only) for retrieval of features for all alignments.\n"
+                    + "\t\t\tSources that also support the sequence command may be specified by prepending the URL with sequence:\n"
+                    + "\t\t\t e.g. sequence:http://localdas.somewhere.org/das/source)\n"
+                    + "-fetchfrom nickname\tQuery nickname for features for the alignments and display them.\n"
+                    // +
+                    // "-vdoc vamsas-document\tImport vamsas document into new session or join existing session with same URN\n"
+                    // + "-vses vamsas-session\tJoin session with given URN\n"
+                    + "-groovy FILE\tExecute groovy script in FILE, after all other arguments have been processed (if FILE is the text 'STDIN' then the file will be read from STDIN)\n"
+                    + "\n~Read documentation in Application or visit http://www.jalview.org for description of Features and Annotations file~\n\n");
+  }
+
   private static void startUsageStats(final Desktop desktop)
   {
     /**
@@ -625,7 +667,7 @@ public class Jalview
               public void run()
               {
                 Cache.log
-                        .info("Initialising googletracker for usage stats.");
+                        .debug("Initialising googletracker for usage stats.");
                 Cache.initGoogleTracker();
                 Cache.log.debug("Tracking enabled.");
               }
@@ -633,7 +675,7 @@ public class Jalview
             {
               public void run()
               {
-                Cache.log.info("Not enabling Google Tracking.");
+                Cache.log.debug("Not enabling Google Tracking.");
               }
             }, null, true);
     desktop.addDialogThread(prompter);
index ef48bf9..833dd7e 100644 (file)
@@ -1269,7 +1269,7 @@ public class JalviewLite extends Applet implements
 
   public static boolean debug = false;
 
-  static String builddate = null, version = null;
+  static String builddate = null, version = null, installation = null;
 
   private static void initBuildDetails()
   {
@@ -1277,6 +1277,7 @@ public class JalviewLite extends Applet implements
     {
       builddate = "unknown";
       version = "test";
+      installation = "Webstart";
       java.net.URL url = JalviewLite.class
               .getResource("/.build_properties");
       if (url != null)
@@ -1296,6 +1297,10 @@ public class JalviewLite extends Applet implements
             {
               builddate = line.substring(line.indexOf("=") + 1);
             }
+            if (line.indexOf("INSTALLATION") > -1)
+            {
+              installation = line.substring(line.indexOf("=") + 1);
+            }
           }
         } catch (Exception ex)
         {
@@ -1311,6 +1316,12 @@ public class JalviewLite extends Applet implements
     return builddate;
   }
 
+  public static String getInstallation()
+  {
+    initBuildDetails();
+    return installation;
+  }
+
   public static String getVersion()
   {
     initBuildDetails();
@@ -1360,6 +1371,7 @@ public class JalviewLite extends Applet implements
 
       System.err.println("JalviewLite Version " + getVersion());
       System.err.println("Build Date : " + getBuildDate());
+      System.err.println("Installation : " + getInstallation());
 
     }
     String externalsviewer = getParameter("externalstructureviewer");
index 5c698a8..82de3b2 100644 (file)
@@ -27,8 +27,10 @@ import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
 
+import java.util.ArrayList;
 import java.util.Hashtable;
 import java.util.List;
+import java.util.ListIterator;
 
 /**
  * 
@@ -54,19 +56,12 @@ import java.util.List;
  */
 public class EditCommand implements CommandI
 {
-  public static final int INSERT_GAP = 0;
-
-  public static final int DELETE_GAP = 1;
-
-  public static final int CUT = 2;
-
-  public static final int PASTE = 3;
-
-  public static final int REPLACE = 4;
-
-  public static final int INSERT_NUC = 5;
+  public enum Action
+  {
+    INSERT_GAP, DELETE_GAP, CUT, PASTE, REPLACE, INSERT_NUC
+  };
 
-  Edit[] edits;
+  private List<Edit> edits = new ArrayList<Edit>();
 
   String description;
 
@@ -79,32 +74,75 @@ public class EditCommand implements CommandI
     this.description = description;
   }
 
-  public EditCommand(String description, int command, SequenceI[] seqs,
+  public EditCommand(String description, Action command, SequenceI[] seqs,
           int position, int number, AlignmentI al)
   {
     this.description = description;
-    if (command == CUT || command == PASTE)
+    if (command == Action.CUT || command == Action.PASTE)
     {
-      edits = new Edit[]
-      { new Edit(command, seqs, position, number, al) };
+      setEdit(new Edit(command, seqs, position, number, al));
     }
 
     performEdit(0, null);
   }
 
-  public EditCommand(String description, int command, String replace,
+  public EditCommand(String description, Action command, String replace,
           SequenceI[] seqs, int position, int number, AlignmentI al)
   {
     this.description = description;
-    if (command == REPLACE)
+    if (command == Action.REPLACE)
     {
-      edits = new Edit[]
-      { new Edit(command, seqs, position, number, al, replace) };
+      setEdit(new Edit(command, seqs, position, number, al, replace));
     }
 
     performEdit(0, null);
   }
 
+  /**
+   * Set the list of edits to the specified item (only).
+   * 
+   * @param e
+   */
+  protected void setEdit(Edit e)
+  {
+    edits.clear();
+    edits.add(e);
+  }
+
+  /**
+   * Add the given edit command to the stored list of commands.
+   * 
+   * @param e
+   */
+  protected void addEdit(Edit e)
+  {
+    edits.add(e);
+  }
+
+  /**
+   * Clear the list of stored edit commands.
+   * 
+   */
+  protected void clearEdits()
+  {
+    edits.clear();
+  }
+
+  /**
+   * Returns the i'th stored Edit command.
+   * 
+   * @param i
+   * @return
+   */
+  protected Edit getEdit(int i)
+  {
+    if (i >= 0 && i < edits.size())
+    {
+      return edits.get(i);
+    }
+    return null;
+  }
+
   @Override
   final public String getDescription()
   {
@@ -114,12 +152,17 @@ public class EditCommand implements CommandI
   @Override
   public int getSize()
   {
-    return edits == null ? 0 : edits.length;
+    return edits.size();
   }
 
+  /**
+   * Return the alignment for the first edit (or null if no edit).
+   * 
+   * @return
+   */
   final public AlignmentI getAlignment()
   {
-    return edits[0].al;
+    return (edits.isEmpty() ? null : edits.get(0).al);
   }
 
   /**
@@ -135,7 +178,8 @@ public class EditCommand implements CommandI
    * @param al
    * @param performEdit
    */
-  final public void appendEdit(int command, SequenceI[] seqs, int position,
+  final public void appendEdit(Action command, SequenceI[] seqs,
+          int position,
           int number, AlignmentI al, boolean performEdit)
   {
     appendEdit(command, seqs, position, number, al, performEdit, null);
@@ -153,7 +197,8 @@ public class EditCommand implements CommandI
    * @param performEdit
    * @param views
    */
-  final public void appendEdit(int command, SequenceI[] seqs, int position,
+  final public void appendEdit(Action command, SequenceI[] seqs,
+          int position,
           int number, AlignmentI al, boolean performEdit, AlignmentI[] views)
   {
     Edit edit = new Edit(command, seqs, position, number,
@@ -164,52 +209,62 @@ public class EditCommand implements CommandI
       edit.fullAlignmentHeight = true;
     }
 
-    if (edits != null)
-    {
-      Edit[] temp = new Edit[edits.length + 1];
-      System.arraycopy(edits, 0, temp, 0, edits.length);
-      edits = temp;
-      edits[edits.length - 1] = edit;
-    }
-    else
-    {
-      edits = new Edit[]
-      { edit };
-    }
+    edits.add(edit);
 
     if (performEdit)
     {
-      performEdit(edits.length - 1, views);
+      performEdit(edit, views);
     }
   }
 
+  /**
+   * Execute all the edit commands, starting at the given commandIndex
+   * 
+   * @param commandIndex
+   * @param views
+   */
   final void performEdit(int commandIndex, AlignmentI[] views)
   {
-    int eSize = edits.length;
-    for (int e = commandIndex; e < eSize; e++)
+    ListIterator<Edit> iterator = edits.listIterator(commandIndex);
+    while (iterator.hasNext())
     {
-      switch (edits[e].command)
-      {
-      case INSERT_GAP:
-        insertGap(edits[e]);
-        break;
-      case DELETE_GAP:
-        deleteGap(edits[e]);
-        break;
-      case CUT:
-        cut(edits[e], views);
-        break;
-      case PASTE:
-        paste(edits[e], views);
-        break;
-      case REPLACE:
-        replace(edits[e]);
-        break;
+      Edit edit = iterator.next();
+      performEdit(edit, views);
+    }
+  }
+
+  /**
+   * Execute one edit command in all the specified alignment views
+   * 
+   * @param edit
+   * @param views
+   */
+  protected void performEdit(Edit edit, AlignmentI[] views)
+  {
+    switch (edit.command)
+    {
+    case INSERT_GAP:
+      insertGap(edit);
+      break;
+    case DELETE_GAP:
+      deleteGap(edit);
+      break;
+    case CUT:
+      cut(edit, views);
+      break;
+    case PASTE:
+      paste(edit, views);
+      break;
+    case REPLACE:
+      replace(edit);
+      break;
+    case INSERT_NUC:
       // TODO:add deleteNuc for UNDO
       // case INSERT_NUC:
       // insertNuc(edits[e]);
-      // break;
-      }
+      break;
+    default:
+      break;
     }
   }
 
@@ -219,32 +274,49 @@ public class EditCommand implements CommandI
     performEdit(0, views);
   }
 
+  /**
+   * Undo the stored list of commands, in reverse order.
+   */
   @Override
   final public void undoCommand(AlignmentI[] views)
   { 
-    for(Edit e : edits){
-       switch (e.command)
-        {
-        case INSERT_GAP:
-          deleteGap(e);
-          break;
-        case DELETE_GAP:
-          insertGap(e);
-          break;
-        case CUT:
-          paste(e, views);
-          break;
-        case PASTE:
-          cut(e, views);
-          break;
-        case REPLACE:
-          replace(e);
-          break;
-        }
+    ListIterator<Edit> iterator = edits.listIterator(edits.size());
+    while (iterator.hasPrevious())
+    {
+      Edit e = iterator.previous();
+      switch (e.command)
+      {
+      case INSERT_GAP:
+        deleteGap(e);
+        break;
+      case DELETE_GAP:
+        insertGap(e);
+        break;
+      case CUT:
+        paste(e, views);
+        break;
+      case PASTE:
+        cut(e, views);
+        break;
+      case REPLACE:
+        replace(e);
+        break;
+      case INSERT_NUC:
+        // not implemented
+        break;
+      default:
+        break;
+      }
     }
   }
 
-  final void insertGap(Edit command)
+  /**
+   * Insert gap(s) in sequences as specified by the command, and adjust
+   * annotations.
+   * 
+   * @param command
+   */
+  final private void insertGap(Edit command)
   {
 
     for (int s = 0; s < command.seqs.length; s++)
@@ -270,7 +342,13 @@ public class EditCommand implements CommandI
   // adjustAnnotations(command, true, false, null);
   // }
 
-  final void deleteGap(Edit command)
+  /**
+   * Delete gap(s) in sequences as specified by the command, and adjust
+   * annotations.
+   * 
+   * @param command
+   */
+  final private void deleteGap(Edit command)
   {
     for (int s = 0; s < command.seqs.length; s++)
     {
@@ -281,6 +359,13 @@ public class EditCommand implements CommandI
     adjustAnnotations(command, false, false, null);
   }
 
+  /**
+   * Carry out a Cut action. The cut characters are saved in case Undo is
+   * requested.
+   * 
+   * @param command
+   * @param views
+   */
   void cut(Edit command, AlignmentI[] views)
   {
     boolean seqDeleted = false;
@@ -288,29 +373,30 @@ public class EditCommand implements CommandI
 
     for (int i = 0; i < command.seqs.length; i++)
     {
-      if (command.seqs[i].getLength() > command.position)
+      final SequenceI sequence = command.seqs[i];
+      if (sequence.getLength() > command.position)
       {
-        command.string[i] = command.seqs[i].getSequence(command.position,
+        command.string[i] = sequence.getSequence(command.position,
                 command.position + command.number);
-        SequenceI oldds = command.seqs[i].getDatasetSequence();
+        SequenceI oldds = sequence.getDatasetSequence();
         if (command.oldds != null && command.oldds[i] != null)
         {
           // we are redoing an undone cut.
-          command.seqs[i].setDatasetSequence(null);
+          sequence.setDatasetSequence(null);
         }
-        command.seqs[i].deleteChars(command.position, command.position
+        sequence.deleteChars(command.position, command.position
                 + command.number);
         if (command.oldds != null && command.oldds[i] != null)
         {
           // oldds entry contains the cut dataset sequence.
-          command.seqs[i].setDatasetSequence(command.oldds[i]);
+          sequence.setDatasetSequence(command.oldds[i]);
           command.oldds[i] = oldds;
         }
         else
         {
           // modify the oldds if necessary
-          if (oldds != command.seqs[i].getDatasetSequence()
-                  || command.seqs[i].getSequenceFeatures() != null)
+          if (oldds != sequence.getDatasetSequence()
+                  || sequence.getSequenceFeatures() != null)
           {
             if (command.oldds == null)
             {
@@ -320,16 +406,16 @@ public class EditCommand implements CommandI
             adjustFeatures(
                     command,
                     i,
-                    command.seqs[i].findPosition(command.position),
-                    command.seqs[i].findPosition(command.position
+                    sequence.findPosition(command.position),
+                    sequence.findPosition(command.position
                             + command.number), false);
           }
         }
       }
 
-      if (command.seqs[i].getLength() < 1)
+      if (sequence.getLength() < 1)
       {
-        command.al.deleteSequence(command.seqs[i]);
+        command.al.deleteSequence(sequence);
         seqDeleted = true;
       }
     }
@@ -337,6 +423,13 @@ public class EditCommand implements CommandI
     adjustAnnotations(command, false, seqDeleted, views);
   }
 
+  /**
+   * Perform the given Paste command. This may be to add cut or copied sequences
+   * to an alignment, or to undo a 'Cut' action on a region of the alignment.
+   * 
+   * @param command
+   * @param views
+   */
   void paste(Edit command, AlignmentI[] views)
   {
     StringBuffer tmp;
@@ -540,7 +633,7 @@ public class EditCommand implements CommandI
     if (modifyVisibility && !insert)
     {
       // only occurs if a sequence was added or deleted.
-      command.deletedAnnotationRows = new Hashtable();
+      command.deletedAnnotationRows = new Hashtable<SequenceI, AlignmentAnnotation[]>();
     }
     if (command.fullAlignmentHeight)
     {
@@ -624,7 +717,7 @@ public class EditCommand implements CommandI
                     && command.deletedAnnotationRows
                             .containsKey(command.seqs[s]))
             {
-              AlignmentAnnotation[] revealed = (AlignmentAnnotation[]) command.deletedAnnotationRows
+              AlignmentAnnotation[] revealed = command.deletedAnnotationRows
                       .get(command.seqs[s]);
               command.seqs[s].setAlignmentAnnotation(revealed);
               if (revealed != null)
@@ -695,7 +788,7 @@ public class EditCommand implements CommandI
 
     if (!insert)
     {
-      command.deletedAnnotations = new Hashtable();
+      command.deletedAnnotations = new Hashtable<String, Annotation[]>();
     }
 
     int aSize;
@@ -758,7 +851,7 @@ public class EditCommand implements CommandI
                   && command.deletedAnnotations
                           .containsKey(annotations[a].annotationId))
           {
-            Annotation[] restore = (Annotation[]) command.deletedAnnotations
+            Annotation[] restore = command.deletedAnnotations
                     .get(annotations[a].annotationId);
 
             System.arraycopy(restore, 0, temp, command.position,
@@ -776,7 +869,7 @@ public class EditCommand implements CommandI
                   && command.deletedAnnotations
                           .containsKey(annotations[a].annotationId))
           {
-            Annotation[] restore = (Annotation[]) command.deletedAnnotations
+            Annotation[] restore = command.deletedAnnotations
                     .get(annotations[a].annotationId);
 
             temp = new Annotation[annotations[a].annotations.length
@@ -871,7 +964,7 @@ public class EditCommand implements CommandI
       if (command.editedFeatures != null
               && command.editedFeatures.containsKey(seq))
       {
-        sequence.setSequenceFeatures((SequenceFeature[]) command.editedFeatures
+        sequence.setSequenceFeatures(command.editedFeatures
                 .get(seq));
       }
 
@@ -927,7 +1020,7 @@ public class EditCommand implements CommandI
 
     if (command.editedFeatures == null)
     {
-      command.editedFeatures = new Hashtable();
+      command.editedFeatures = new Hashtable<SequenceI, SequenceFeature[]>();
     }
 
     command.editedFeatures.put(seq, oldsf);
@@ -940,15 +1033,15 @@ public class EditCommand implements CommandI
 
     boolean fullAlignmentHeight = false;
 
-    Hashtable deletedAnnotationRows;
+    Hashtable<SequenceI, AlignmentAnnotation[]> deletedAnnotationRows;
 
-    Hashtable deletedAnnotations;
+    Hashtable<String, Annotation[]> deletedAnnotations;
 
-    Hashtable editedFeatures;
+    Hashtable<SequenceI, SequenceFeature[]> editedFeatures;
 
     AlignmentI al;
 
-    int command;
+    Action command;
 
     char[][] string;
 
@@ -960,7 +1053,7 @@ public class EditCommand implements CommandI
 
     char gapChar;
 
-    Edit(int command, SequenceI[] seqs, int position, int number,
+    Edit(Action command, SequenceI[] seqs, int position, int number,
             char gapChar)
     {
       this.command = command;
@@ -970,7 +1063,7 @@ public class EditCommand implements CommandI
       this.gapChar = gapChar;
     }
 
-    Edit(int command, SequenceI[] seqs, int position, int number,
+    Edit(Action command, SequenceI[] seqs, int position, int number,
             AlignmentI al)
     {
       this.gapChar = al.getGapCharacter();
@@ -989,7 +1082,7 @@ public class EditCommand implements CommandI
       fullAlignmentHeight = (al.getHeight() == seqs.length);
     }
 
-    Edit(int command, SequenceI[] seqs, int position, int number,
+    Edit(Action command, SequenceI[] seqs, int position, int number,
             AlignmentI al, String replace)
     {
       this.command = command;
index 6172ce8..ac93d4e 100644 (file)
@@ -39,7 +39,8 @@ package jalview.commands;
  * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-import jalview.datamodel.*;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.SequenceI;
 
 public class RemoveGapColCommand extends EditCommand
 {
@@ -55,7 +56,7 @@ public class RemoveGapColCommand extends EditCommand
     int startCol = -1, endCol = -1;
     columnsDeleted = 0;
 
-    edits = new Edit[0];
+    clearEdits();
 
     boolean delete = true;
     for (int i = start; i <= end; i++)
@@ -86,7 +87,8 @@ public class RemoveGapColCommand extends EditCommand
 
       if (!delete && startCol > -1)
       {
-        this.appendEdit(DELETE_GAP, seqs, startCol - columnsDeleted, endCol
+        this.appendEdit(Action.DELETE_GAP, seqs, startCol - columnsDeleted,
+                endCol
                 - startCol, al, false, null);
 
         columnsDeleted += (endCol - startCol);
@@ -100,7 +102,8 @@ public class RemoveGapColCommand extends EditCommand
       // This is for empty columns at the
       // end of the alignment
 
-      this.appendEdit(DELETE_GAP, seqs, startCol - columnsDeleted, end
+      this.appendEdit(Action.DELETE_GAP, seqs, startCol - columnsDeleted,
+              end
               - startCol + 1, al, false, null);
 
       columnsDeleted += (end - startCol + 1);
index 2e8d744..60d09f7 100644 (file)
@@ -39,7 +39,8 @@ package jalview.commands;
  * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-import jalview.datamodel.*;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.SequenceI;
 
 public class RemoveGapsCommand extends EditCommand
 {
@@ -74,7 +75,7 @@ public class RemoveGapsCommand extends EditCommand
 
     int j, jSize;
 
-    edits = new Edit[0];
+    clearEdits();
 
     boolean delete = true;
     char[] sequence;
@@ -108,7 +109,7 @@ public class RemoveGapsCommand extends EditCommand
 
         if (!delete && startCol > -1)
         {
-          this.appendEdit(DELETE_GAP, new SequenceI[]
+          this.appendEdit(Action.DELETE_GAP, new SequenceI[]
           { seqs[s] }, start + startCol - deletedCols, endCol - startCol,
                   al, false, null);
 
@@ -119,7 +120,7 @@ public class RemoveGapsCommand extends EditCommand
       }
       if (delete && startCol > -1)
       {
-        this.appendEdit(DELETE_GAP, new SequenceI[]
+        this.appendEdit(Action.DELETE_GAP, new SequenceI[]
         { seqs[s] }, start + startCol - deletedCols, jSize - startCol, al,
                 false, null);
       }
index 1ad3d9e..382085c 100644 (file)
@@ -20,7 +20,7 @@
  */
 package jalview.commands;
 
-import jalview.datamodel.*;
+import jalview.datamodel.SequenceI;
 
 public class SlideSequencesCommand extends EditCommand
 {
@@ -37,21 +37,29 @@ public class SlideSequencesCommand extends EditCommand
     for (i = 0; i < lSize; i++)
     {
       for (j = 0; j < slideSize; j++)
+      {
         if (!jalview.util.Comparison.isGap(seqsLeft[i].getCharAt(j)))
         {
           gapsInsertedBegin = true;
           break;
         }
+      }
     }
 
+    Edit e = null;
+
     if (!gapsInsertedBegin)
-      edits = new Edit[]
-      { new Edit(DELETE_GAP, seqsLeft, 0, slideSize, gapChar) };
+    {
+      e = new Edit(Action.DELETE_GAP, seqsLeft, 0, slideSize, gapChar);
+      setEdit(e);
+    }
     else
-      edits = new Edit[]
-      { new Edit(INSERT_GAP, seqsRight, 0, slideSize, gapChar) };
+    {
+      e = new Edit(Action.INSERT_GAP, seqsRight, 0, slideSize, gapChar);
+      setEdit(e);
+    }
 
-    performEdit(0, null);
+    performEdit(e, null);
   }
 
   public boolean getGapsInsertedBegin()
@@ -63,12 +71,12 @@ public class SlideSequencesCommand extends EditCommand
   {
     boolean same = false;
 
-    if (command.edits[0].seqs.length == edits[0].seqs.length)
+    if (command.getEdit(0).seqs.length == getEdit(0).seqs.length)
     {
       same = true;
-      for (int i = 0; i < command.edits[0].seqs.length; i++)
+      for (int i = 0; i < command.getEdit(0).seqs.length; i++)
       {
-        if (edits[0].seqs[i] != command.edits[0].seqs[i])
+        if (getEdit(0).seqs[i] != command.getEdit(0).seqs[i])
         {
           same = false;
         }
@@ -77,10 +85,7 @@ public class SlideSequencesCommand extends EditCommand
 
     if (same)
     {
-      Edit[] temp = new Edit[command.edits.length + 1];
-      System.arraycopy(command.edits, 0, temp, 0, command.edits.length);
-      command.edits = temp;
-      command.edits[command.edits.length - 1] = edits[0];
+      command.addEdit(getEdit(0));
     }
 
     return same;
index a757d1a..ebbe827 100644 (file)
  */
 package jalview.commands;
 
-import java.util.*;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.util.ShiftList;
 
-import jalview.datamodel.*;
-import jalview.util.*;
+import java.util.List;
 
 public class TrimRegionCommand extends EditCommand
 {
@@ -39,7 +42,7 @@ public class TrimRegionCommand extends EditCommand
 
   SequenceGroup selectionGroup;
 
-  Vector deletedHiddenColumns;
+  List<int[]> deletedHiddenColumns;
 
   int columnsDeleted;
 
@@ -59,8 +62,7 @@ public class TrimRegionCommand extends EditCommand
 
       columnsDeleted = column;
 
-      edits = new Edit[]
-      { new Edit(CUT, seqs, 0, column, al) };
+      setEdit(new Edit(Action.CUT, seqs, 0, column, al));
     }
     else if (command.equalsIgnoreCase(TRIM_RIGHT))
     {
@@ -72,17 +74,16 @@ public class TrimRegionCommand extends EditCommand
 
       columnsDeleted = width - 1;
 
-      edits = new Edit[]
-      { new Edit(CUT, seqs, column + 1, width, al) };
+      setEdit(new Edit(Action.CUT, seqs, column + 1, width, al));
     }
 
     // We need to keep a record of the sequence start
     // in order to restore the state after a redo
-    int i, isize = edits[0].seqs.length;
+    int i, isize = getEdit(0).seqs.length;
     start = new int[isize];
     for (i = 0; i < isize; i++)
     {
-      start[i] = edits[0].seqs[i].getStart();
+      start[i] = getEdit(0).seqs[i].getStart();
     }
 
     performEdit(0, null);
@@ -160,7 +161,7 @@ public class TrimRegionCommand extends EditCommand
       int[] region;
       for (int i = 0; i < deletedHiddenColumns.size(); i++)
       {
-        region = (int[]) deletedHiddenColumns.elementAt(i);
+        region = deletedHiddenColumns.get(i);
         colSel.hideColumns(region[0], region[1]);
       }
     }
index b2d4f0f..9c5914f 100755 (executable)
@@ -147,7 +147,9 @@ public class Alignment implements AlignmentI
   public SequenceI[] getSequencesArray()
   {
     if (sequences == null)
+    {
       return null;
+    }
     synchronized (sequences)
     {
       return sequences.toArray(new SequenceI[sequences.size()]);
@@ -211,7 +213,9 @@ public class Alignment implements AlignmentI
       }
     }
     if (hiddenSequences != null)
+    {
       hiddenSequences.adjustHeightSequenceAdded();
+    }
   }
 
   /**
@@ -245,7 +249,9 @@ public class Alignment implements AlignmentI
   public void finalize()
   {
     if (getDataset() != null)
+    {
       getDataset().removeAlignmentRef();
+    }
 
     dataset = null;
     sequences = null;
@@ -754,7 +760,9 @@ public class Alignment implements AlignmentI
         continue;
       }
       if (tIndex < temp.length)
+      {
         temp[tIndex++] = annotations[i];
+      }
     }
 
     if (swap)
@@ -950,6 +958,27 @@ public class Alignment implements AlignmentI
     else if (dataset == null && data != null)
     {
       dataset = data;
+      for (int i = 0; i < getHeight(); i++)
+      {
+        SequenceI currentSeq = getSequenceAt(i);
+        SequenceI dsq = currentSeq.getDatasetSequence();
+        if (dsq == null)
+        {
+          dsq = currentSeq.createDatasetSequence();
+          dataset.addSequence(dsq);
+        }
+        else
+        {
+          while (dsq.getDatasetSequence() != null)
+          {
+            dsq = dsq.getDatasetSequence();
+          }
+          if (dataset.findIndex(dsq) == -1)
+          {
+            dataset.addSequence(dsq);
+          }
+        }
+      }
     }
     dataset.addAlignmentRef();
   }
@@ -1150,7 +1179,9 @@ public class Alignment implements AlignmentI
   public void setProperty(Object key, Object value)
   {
     if (alignmentProperties == null)
+    {
       alignmentProperties = new Hashtable();
+    }
 
     alignmentProperties.put(key, value);
   }
@@ -1159,9 +1190,13 @@ public class Alignment implements AlignmentI
   public Object getProperty(Object key)
   {
     if (alignmentProperties != null)
+    {
       return alignmentProperties.get(key);
+    }
     else
+    {
       return null;
+    }
   }
 
   @Override
@@ -1183,7 +1218,9 @@ public class Alignment implements AlignmentI
   public void addCodonFrame(AlignedCodonFrame codons)
   {
     if (codons == null)
+    {
       return;
+    }
     if (codonFrameList == null)
     {
       codonFrameList = new AlignedCodonFrame[]
@@ -1217,15 +1254,21 @@ public class Alignment implements AlignmentI
   public AlignedCodonFrame[] getCodonFrame(SequenceI seq)
   {
     if (seq == null || codonFrameList == null)
+    {
       return null;
+    }
     Vector cframes = new Vector();
     for (int f = 0; f < codonFrameList.length; f++)
     {
       if (codonFrameList[f].involvesSequence(seq))
+      {
         cframes.addElement(codonFrameList[f]);
+      }
     }
     if (cframes.size() == 0)
+    {
       return null;
+    }
     AlignedCodonFrame[] cfr = new AlignedCodonFrame[cframes.size()];
     cframes.copyInto(cfr);
     return cfr;
@@ -1252,7 +1295,9 @@ public class Alignment implements AlignmentI
   public boolean removeCodonFrame(AlignedCodonFrame codons)
   {
     if (codons == null || codonFrameList == null)
+    {
       return false;
+    }
     boolean removed = false;
     int i = 0, iSize = codonFrameList.length;
     while (i < iSize)
@@ -1444,6 +1489,27 @@ public class Alignment implements AlignmentI
     return aa;
   }
 
+  /**
+   * Returns an iterable collection of any annotations that match on given
+   * sequence ref, calcId and label (ignoring null values).
+   */
+  @Override
+  public Iterable<AlignmentAnnotation> findAnnotations(SequenceI seq,
+          String calcId, String label)
+  {
+    ArrayList<AlignmentAnnotation> aa = new ArrayList<AlignmentAnnotation>();
+    for (AlignmentAnnotation ann : getAlignmentAnnotation())
+    {
+      if (ann.getCalcId() != null && ann.getCalcId().equals(calcId)
+              && ann.sequenceRef != null && ann.sequenceRef == seq
+              && ann.label != null && ann.label.equals(label))
+      {
+        aa.add(ann);
+      }
+    }
+    return aa;
+  }
+
   @Override
   public void moveSelectedSequencesByOne(SequenceGroup sg,
           Map<SequenceI, SequenceCollectionI> map, boolean up)
index 0731991..e137225 100755 (executable)
@@ -75,9 +75,10 @@ public class AlignmentAnnotation
   public SequenceFeature[] _rnasecstr = null;
 
   /**
-   * position of annotation resulting in invalid WUSS parsing or -1
+   * position of annotation resulting in invalid WUSS parsing or -1. -2 means
+   * there was no RNA structure in this annotation
    */
-  private long invalidrnastruc = -1;
+  private long invalidrnastruc = -2;
 
   /**
    * Updates the _rnasecstr field Determines the positions that base pair and
@@ -110,10 +111,47 @@ public class AlignmentAnnotation
       isrna = true;
       showAllColLabels = true;
       scaleColLabel = true;
+      _markRnaHelices();
     }
     // System.out.println("featuregroup " + _rnasecstr[0].getFeatureGroup());
+
   }
 
+  private void _markRnaHelices()
+  {
+    int mxval = 0;
+    // Figure out number of helices
+    // Length of rnasecstr is the number of pairs of positions that base pair
+    // with each other in the secondary structure
+    for (int x = 0; x < _rnasecstr.length; x++)
+    {
+
+      /*
+       * System.out.println(this.annotation._rnasecstr[x] + " Begin" +
+       * this.annotation._rnasecstr[x].getBegin());
+       */
+      // System.out.println(this.annotation._rnasecstr[x].getFeatureGroup());
+      int val = 0;
+      try
+      {
+        val = Integer.valueOf(_rnasecstr[x].getFeatureGroup());
+        if (mxval < val)
+        {
+          mxval = val;
+        }
+      } catch (NumberFormatException q)
+      {
+      }
+      ;
+
+      annotations[_rnasecstr[x].getBegin()].value = val;
+      annotations[_rnasecstr[x].getEnd()].value = val;
+
+      // annotations[_rnasecstr[x].getBegin()].displayCharacter = "" + val;
+      // annotations[_rnasecstr[x].getEnd()].displayCharacter = "" + val;
+    }
+    setScore(mxval);
+  }
   /**
    * map of positions in the associated annotation
    */
@@ -455,11 +493,10 @@ public class AlignmentAnnotation
     @Override
     public char charAt(int index)
     {
-      String dc;
       return ((index + offset < 0) || (index + offset) >= max
-              || annotations[index + offset] == null || (dc = annotations[index
-              + offset].displayCharacter.trim()).length() < 1) ? '.' : dc
-              .charAt(0);
+              || annotations[index + offset] == null || (annotations[index
+ + offset].secondaryStructure < ' ') ? ' '
+              : annotations[index + offset].secondaryStructure);
     }
 
     public String toString()
@@ -469,9 +506,8 @@ public class AlignmentAnnotation
 
       for (int i = offset; i < mx; i++)
       {
-        String dc;
-        string[i] = (annotations[i] == null || (dc = annotations[i].displayCharacter
-                .trim()).length() < 1) ? '.' : dc.charAt(0);
+        string[i] = (annotations[i] == null || (annotations[i].secondaryStructure < 32)) ? ' '
+                : annotations[i].secondaryStructure;
       }
       return new String(string);
     }
index 0b4c117..6814b7e 100644 (file)
@@ -33,6 +33,9 @@ public interface AnnotatedCollectionI extends SequenceCollectionI
 
   Iterable<AlignmentAnnotation> findAnnotation(String calcId);
 
+  Iterable<AlignmentAnnotation> findAnnotations(SequenceI seq,
+          String calcId, String label);
+
   /**
    * context for this annotated collection
    * 
index 35d467a..f414d13 100644 (file)
  */
 package jalview.datamodel;
 
-import java.util.*;
+import jalview.util.ShiftList;
 
-import jalview.util.*;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Vector;
 
 /**
  * NOTE: Columns are zero based.
@@ -186,9 +189,9 @@ public class ColumnSelection
    * @param left
    *          shift in edit (+ve for removal, or -ve for inserts)
    */
-  public Vector compensateForEdit(int start, int change)
+  public List<int[]> compensateForEdit(int start, int change)
   {
-    Vector deletedHiddenColumns = null;
+    List<int[]> deletedHiddenColumns = null;
     for (int i = 0; i < size(); i++)
     {
       int temp = columnAt(i);
@@ -201,14 +204,14 @@ public class ColumnSelection
 
     if (hiddenColumns != null)
     {
-      deletedHiddenColumns = new Vector();
+      deletedHiddenColumns = new ArrayList<int[]>();
       int hSize = hiddenColumns.size();
       for (int i = 0; i < hSize; i++)
       {
         int[] region = (int[]) hiddenColumns.elementAt(i);
         if (region[0] > start && start + change > region[1])
         {
-          deletedHiddenColumns.addElement(hiddenColumns.elementAt(i));
+          deletedHiddenColumns.add(region);
 
           hiddenColumns.removeElementAt(i);
           i--;
@@ -752,6 +755,7 @@ public class ColumnSelection
   public boolean isVisible(int column)
   {
     if (hiddenColumns != null)
+    {
       for (int i = 0; i < hiddenColumns.size(); i++)
       {
         int[] region = (int[]) hiddenColumns.elementAt(i);
@@ -760,6 +764,7 @@ public class ColumnSelection
           return false;
         }
       }
+    }
 
     return true;
   }
@@ -1018,7 +1023,9 @@ public class ColumnSelection
         w += els.length;
       }
       if (w == 0)
+      {
         return;
+      }
       Enumeration e = annels.elements();
       alignmentAnnotation.annotations = new Annotation[w];
       w = 0;
index aefb5cc..bfeafd6 100755 (executable)
@@ -20,7 +20,9 @@
  */
 package jalview.datamodel;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
 
 public class HiddenSequences
 {
@@ -143,34 +145,34 @@ public class HiddenSequences
     alignment.deleteSequence(sequence);
   }
 
-  public Vector showAll(
+  public List<SequenceI> showAll(
           Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
   {
-    Vector revealedSeqs = new Vector();
+    List<SequenceI> revealedSeqs = new ArrayList<SequenceI>();
     for (int i = 0; i < hiddenSequences.length; i++)
     {
       if (hiddenSequences[i] != null)
       {
-        Vector tmp = showSequence(i, hiddenRepSequences);
-        for (int t = 0; t < tmp.size(); t++)
+        List<SequenceI> tmp = showSequence(i, hiddenRepSequences);
+        for (SequenceI seq : tmp)
         {
-          revealedSeqs.addElement(tmp.elementAt(t));
+          revealedSeqs.add(seq);
         }
       }
     }
     return revealedSeqs;
   }
 
-  public Vector showSequence(int alignmentIndex,
+  public List<SequenceI> showSequence(int alignmentIndex,
           Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
   {
-    Vector revealedSeqs = new Vector();
+    List<SequenceI> revealedSeqs = new ArrayList<SequenceI>();
     SequenceI repSequence = alignment.getSequenceAt(alignmentIndex);
     if (repSequence != null && hiddenRepSequences != null
             && hiddenRepSequences.containsKey(repSequence))
     {
       hiddenRepSequences.remove(repSequence);
-      revealedSeqs.addElement(repSequence);
+      revealedSeqs.add(repSequence);
     }
 
     int start = adjustForHiddenSeqs(alignmentIndex - 1);
@@ -192,7 +194,7 @@ public class HiddenSequences
         {
           if (seq.getLength() > 0)
           {
-            revealedSeqs.addElement(seq);
+            revealedSeqs.add(seq);
             asequences.add(alignmentIndex, seq);
           }
           else
index 69d6da2..0652fb5 100755 (executable)
@@ -879,22 +879,30 @@ public class Sequence implements SequenceI
     return datasetSequence;
   }
 
+  /**
+   * Returns a new array containing this sequence's annotations, or null.
+   */
   public AlignmentAnnotation[] getAnnotation()
   {
-    if (annotation == null)
-    {
-      return null;
-    }
-
-    AlignmentAnnotation[] ret = new AlignmentAnnotation[annotation.size()];
-    for (int r = 0; r < ret.length; r++)
-    {
-      ret[r] = annotation.elementAt(r);
-    }
+    return annotation == null ? null : annotation
+            .toArray(new AlignmentAnnotation[annotation.size()]);
+  }
 
-    return ret;
+  /**
+   * Returns true if this sequence has the given annotation (by object
+   * identity).
+   */
+  @Override
+  public boolean hasAnnotation(AlignmentAnnotation ann)
+  {
+    return annotation == null ? false : annotation.contains(ann);
   }
 
+  /**
+   * Add the given annotation, if not already added, and set its sequence ref to
+   * be this sequence. Does nothing if this sequence's annotations already
+   * include this annotation (by identical object reference).
+   */
   public void addAlignmentAnnotation(AlignmentAnnotation annotation)
   {
     if (this.annotation == null)
index 17348c2..752c6d4 100755 (executable)
@@ -178,7 +178,9 @@ public class SequenceGroup implements AnnotatedCollectionI
       endRes = seqsel.endRes;
       cs = seqsel.cs;
       if (seqsel.description != null)
+      {
         description = new String(seqsel.description);
+      }
       hidecols = seqsel.hidecols;
       hidereps = seqsel.hidereps;
       idColour = seqsel.idColour;
@@ -238,7 +240,9 @@ public class SequenceGroup implements AnnotatedCollectionI
                 }
               }
               if (!found)
+              {
                 continue;
+              }
             }
             AlignmentAnnotation newannot = new AlignmentAnnotation(
                     seq.getAnnotation()[a]);
@@ -1261,6 +1265,29 @@ public class SequenceGroup implements AnnotatedCollectionI
   }
 
   /**
+   * Returns a list of annotations that match the specified sequenceRef, calcId
+   * and label, ignoring null values.
+   * 
+   * @return list of AlignmentAnnotation objects
+   */
+  @Override
+  public Iterable<AlignmentAnnotation> findAnnotations(SequenceI seq,
+          String calcId, String label)
+  {
+    ArrayList<AlignmentAnnotation> aa = new ArrayList<AlignmentAnnotation>();
+    for (AlignmentAnnotation ann : getAlignmentAnnotation())
+    {
+      if (ann.getCalcId() != null && ann.getCalcId().equals(calcId)
+              && ann.sequenceRef != null && ann.sequenceRef == seq
+              && ann.label != null && ann.label.equals(label))
+      {
+        aa.add(ann);
+      }
+    }
+    return aa;
+  }
+
+  /**
    * Answer true if any annotation matches the calcId passed in (if not null).
    * 
    * @param calcId
index 8376047..fc67efd 100755 (executable)
@@ -317,6 +317,8 @@ public interface SequenceI
 
   public AlignmentAnnotation[] getAnnotation();
 
+  public boolean hasAnnotation(AlignmentAnnotation ann);
+
   public void addAlignmentAnnotation(AlignmentAnnotation annotation);
 
   public void removeAlignmentAnnotation(AlignmentAnnotation annotation);
diff --git a/src/jalview/exceptions/JalviewException.java b/src/jalview/exceptions/JalviewException.java
new file mode 100644 (file)
index 0000000..80e0b08
--- /dev/null
@@ -0,0 +1,25 @@
+package jalview.exceptions;
+
+@SuppressWarnings("serial")
+public class JalviewException extends Exception
+{
+  public JalviewException(String exceptionMessage)
+  {
+    super(exceptionMessage);
+  }
+
+  public JalviewException()
+  {
+    super();
+  }
+
+  public JalviewException(String exceptionMessage, Throwable cause)
+  {
+    super(exceptionMessage, cause);
+  }
+
+  public JalviewException(Throwable cause)
+  {
+    super(cause);
+  }
+}
diff --git a/src/jalview/exceptions/NoFileSelectedException.java b/src/jalview/exceptions/NoFileSelectedException.java
new file mode 100644 (file)
index 0000000..5c56f47
--- /dev/null
@@ -0,0 +1,10 @@
+package jalview.exceptions;
+
+@SuppressWarnings("serial")
+public class NoFileSelectedException extends JalviewException
+{
+  public NoFileSelectedException(String msg)
+  {
+    super(msg);
+  }
+}
index 9fa6bf4..92dce36 100644 (file)
@@ -186,9 +186,15 @@ public class PDBFileWithJmol extends AlignFile implements
                   seqs.add(sq);
                   if (!isNa)
                   {
+                    String mt = model.getModelTitle() == null ? getDataName()
+                            : model.getModelTitle();
+                    if (_lastChainId >= ' ')
+                    {
+                      mt += _lastChainId;
+                    }
                     AlignmentAnnotation ann = new AlignmentAnnotation(
                             "Secondary Structure",
-                            "Secondary Structure from PDB File", asecstr);
+                            "Secondary Structure for " + mt, asecstr);
                     ann.belowAlignment=true;
                     ann.visible=true;
                     ann.autoCalculated=false;
index 7033ba7..82f5e5c 100644 (file)
@@ -74,13 +74,14 @@ public abstract class JalviewChimeraBinding extends
   private boolean loadingFromArchive = false;
 
   /**
-   * second flag to indicate if the jmol viewer should ignore sequence colouring
-   * events from the structure manager because the GUI is still setting up
+   * second flag to indicate if the Chimera viewer should ignore sequence
+   * colouring events from the structure manager because the GUI is still
+   * setting up
    */
   private boolean loadingFinished = true;
 
   /**
-   * state flag used to check if the Jmol viewer's paint method can be called
+   * state flag used to check if the Chimera viewer's paint method can be called
    */
   private boolean finishedInit = false;
 
@@ -173,7 +174,7 @@ public abstract class JalviewChimeraBinding extends
         } catch (Error e)
         {
         }
-        // Explicitly map to the filename used by Jmol ;
+        // Explicitly map to the filename used by Chimera ;
         // pdbentry[pe].getFile(), protocol);
 
         if (ssm != null)
@@ -236,13 +237,6 @@ public abstract class JalviewChimeraBinding extends
     }
     viewer = new ChimeraManager(
             csm = new ext.edu.ucsf.rbvi.strucviz2.StructureManager(true));
-    /*
-     * viewer = JmolViewer.allocateViewer(renderPanel, new SmarterJmolAdapter(),
-     * "jalviewJmol", ap.av.applet .getDocumentBase(),
-     * ap.av.applet.getCodeBase(), "", this);
-     * 
-     * jmolpopup = JmolPopup.newJmolPopup(viewer, true, "Jmol", true);
-     */
   }
 
   public JalviewChimeraBinding(StructureSelectionManager ssm,
@@ -335,15 +329,13 @@ public abstract class JalviewChimeraBinding extends
     {
       viewer.exitChimera();
     }
-    // viewer.evalStringQuiet("zap");
-    // viewer.setJmolStatusListener(null);
     lastCommand = null;
     viewer = null;
     releaseUIResources();
   }
 
   /**
-   * called by JalviewJmolbinding after closeViewer is called - release any
+   * called by JalviewChimerabinding after closeViewer is called - release any
    * resources and references so they can be garbage collected.
    */
   protected abstract void releaseUIResources();
@@ -351,17 +343,15 @@ public abstract class JalviewChimeraBinding extends
   public void colourByChain()
   {
     colourBySequence = false;
-    // TODO: colour by chain should colour each chain distinctly across all
-    // visible models
-    // TODO: http://issues.jalview.org/browse/JAL-628
-    evalStateCommand("select *;color chain",false);
+    evalStateCommand("rainbow chain", false);
   }
 
   public void colourByCharge()
   {
     colourBySequence = false;
-    evalStateCommand("colour *;color white;select ASP,GLU;color red;"
-            + "select LYS,ARG;color blue;select CYS;color yellow", false);
+    evalStateCommand(
+            "color white;color red ::ASP;color red ::GLU;color blue ::LYS;color blue ::ARG;color yellow ::CYS",
+            false);
   }
 
   /**
@@ -411,7 +401,7 @@ public abstract class JalviewChimeraBinding extends
     assert (_alignment.length == _refStructure.length && _alignment.length != _hiddenCols.length);
     StringBuilder allComs = new StringBuilder(128); // Chimera superposition cmd
     String[] files = getPdbFile();
-    // check to see if we are still waiting for Jmol files
+    // check to see if we are still waiting for Chimera files
     long starttime = System.currentTimeMillis();
     boolean waiting = true;
     do
@@ -792,7 +782,7 @@ public abstract class JalviewChimeraBinding extends
 
   private void waitForChimera()
   {
-    while (viewer.isBusy())
+    while (viewer != null && viewer.isBusy())
     {
       try {
         Thread.sleep(15);
@@ -964,7 +954,7 @@ public abstract class JalviewChimeraBinding extends
     }
   }
 
-  boolean debug = true;
+  boolean debug = false;
 
   private void log(String message)
   {
@@ -973,8 +963,8 @@ public abstract class JalviewChimeraBinding extends
 
   private void viewerCommandHistory(boolean enable)
   {
-    log("(Not yet implemented) History "
-            + ((debug || enable) ? "on" : "off"));
+    // log("(Not yet implemented) History "
+    // + ((debug || enable) ? "on" : "off"));
   }
 
   public void loadInline(String string)
@@ -1225,10 +1215,13 @@ public abstract class JalviewChimeraBinding extends
     String res;
     int index;
     Color col;
+    // Chimera expects RBG values in the range 0-1
+    final double normalise = 255D;
     viewerCommandHistory(false);
     // TODO: Switch between nucleotide or aa selection expressions
     Enumeration en = ResidueProperties.aa3Hash.keys();
-    StringBuffer command = new StringBuffer("select *;color white;");
+    StringBuilder command = new StringBuilder(128);
+    command.append("color white;");
     while (en.hasMoreElements())
     {
       res = en.nextElement().toString();
@@ -1239,32 +1232,19 @@ public abstract class JalviewChimeraBinding extends
       }
 
       col = cs.findColour(ResidueProperties.aa[index].charAt(0));
-      // TODO: need colour string function and res selection here
-      command.append("select " + res + ";color[" + col.getRed() + ","
-              + col.getGreen() + "," + col.getBlue() + "];");
+      command.append("color " + col.getRed() / normalise + ","
+              + col.getGreen() / normalise + "," + col.getBlue()
+              / normalise + " ::" + res + ";");
     }
 
     evalStateCommand(command.toString(),false);
     viewerCommandHistory(true);
   }
 
-  public void showHelp()
-  {
-    // chimera help
-    showUrl("http://jmol.sourceforge.net/docs/JmolUserGuide/", "jmolHelp");
-  }
-
   /**
-   * open the URL somehow
-   * 
-   * @param target
-   */
-  public abstract void showUrl(String url, String target);
-
-  /**
-   * called when the binding thinks the UI needs to be refreshed after a Jmol
+   * called when the binding thinks the UI needs to be refreshed after a Chimera
    * state change. this could be because structures were loaded, or because an
-   * error has occured.
+   * error has occurred.
    */
   public abstract void refreshGUI();
 
@@ -1293,8 +1273,8 @@ public abstract class JalviewChimeraBinding extends
 
   /**
    * 
-   * @return true if Jmol is still restoring state or loading is still going on
-   *         (see setFinsihedLoadingFromArchive)
+   * @return true if Chimeral is still restoring state or loading is still going
+   *         on (see setFinsihedLoadingFromArchive)
    */
   public boolean isLoadingFromArchive()
   {
@@ -1312,13 +1292,22 @@ public abstract class JalviewChimeraBinding extends
     loadingFinished = finishedLoading;
   }
 
-  public void setBackgroundColour(java.awt.Color col)
+  /**
+   * Send the Chimera 'background solid <color>" command.
+   * 
+   * @see https
+   *      ://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/midas/background
+   *      .html
+   * @param col
+   */
+  public void setBackgroundColour(Color col)
   {
     viewerCommandHistory(false);
-    // todo set background colour
-    viewer.sendChimeraCommand(
-            "background [" + col.getRed() + "," + col.getGreen() + ","
-                    + col.getBlue() + "];", false);
+    double normalise = 255D;
+    final String command = "background solid " + col.getRed() / normalise + ","
+            + col.getGreen() / normalise + "," + col.getBlue()
+            / normalise + ";";
+    viewer.sendChimeraCommand(command, false);
     viewerCommandHistory(true);
   }
 
index 4b7f2f8..015b95b 100644 (file)
@@ -30,10 +30,12 @@ import jalview.analysis.ParseProperties;
 import jalview.analysis.SequenceIdMatcher;
 import jalview.api.AlignViewControllerGuiI;
 import jalview.api.AlignViewControllerI;
+import jalview.api.AlignmentViewPanel;
 import jalview.api.analysis.ScoreModelI;
 import jalview.bin.Cache;
 import jalview.commands.CommandI;
 import jalview.commands.EditCommand;
+import jalview.commands.EditCommand.Action;
 import jalview.commands.OrderCommand;
 import jalview.commands.RemoveGapColCommand;
 import jalview.commands.RemoveGapsCommand;
@@ -57,7 +59,7 @@ import jalview.io.BioJsHTMLOutput;
 import jalview.io.FeaturesFile;
 import jalview.io.FileLoader;
 import jalview.io.FormatAdapter;
-import jalview.io.HTMLOutput;
+import jalview.io.HtmlSvgOutput;
 import jalview.io.IdentifyFile;
 import jalview.io.JalviewFileChooser;
 import jalview.io.JalviewFileView;
@@ -115,6 +117,7 @@ import java.beans.PropertyChangeEvent;
 import java.io.File;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Enumeration;
 import java.util.Hashtable;
 import java.util.List;
@@ -379,7 +382,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                         .getKeyCode() <= KeyEvent.VK_NUMPAD9))
                 && Character.isDigit(evt.getKeyChar()))
         {
-          alignPanel.seqPanel.numberPressed(evt.getKeyChar());
+          alignPanel.getSeqPanel().numberPressed(evt.getKeyChar());
         }
 
         switch (evt.getKeyCode())
@@ -397,7 +400,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           }
           if (viewport.cursorMode)
           {
-            alignPanel.seqPanel.moveCursor(0, 1);
+            alignPanel.getSeqPanel().moveCursor(0, 1);
           }
           break;
 
@@ -408,7 +411,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           }
           if (viewport.cursorMode)
           {
-            alignPanel.seqPanel.moveCursor(0, -1);
+            alignPanel.getSeqPanel().moveCursor(0, -1);
           }
 
           break;
@@ -416,11 +419,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         case KeyEvent.VK_LEFT:
           if (evt.isAltDown() || !viewport.cursorMode)
           {
-            slideSequences(false, alignPanel.seqPanel.getKeyboardNo1());
+            slideSequences(false, alignPanel.getSeqPanel().getKeyboardNo1());
           }
           else
           {
-            alignPanel.seqPanel.moveCursor(-1, 0);
+            alignPanel.getSeqPanel().moveCursor(-1, 0);
           }
 
           break;
@@ -428,18 +431,18 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         case KeyEvent.VK_RIGHT:
           if (evt.isAltDown() || !viewport.cursorMode)
           {
-            slideSequences(true, alignPanel.seqPanel.getKeyboardNo1());
+            slideSequences(true, alignPanel.getSeqPanel().getKeyboardNo1());
           }
           else
           {
-            alignPanel.seqPanel.moveCursor(1, 0);
+            alignPanel.getSeqPanel().moveCursor(1, 0);
           }
           break;
 
         case KeyEvent.VK_SPACE:
           if (viewport.cursorMode)
           {
-            alignPanel.seqPanel.insertGapAtCursor(evt.isControlDown()
+            alignPanel.getSeqPanel().insertGapAtCursor(evt.isControlDown()
                     || evt.isShiftDown() || evt.isAltDown());
           }
           break;
@@ -463,7 +466,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           }
           else
           {
-            alignPanel.seqPanel.deleteGapAtCursor(evt.isControlDown()
+            alignPanel.getSeqPanel().deleteGapAtCursor(evt.isControlDown()
                     || evt.isShiftDown() || evt.isAltDown());
           }
 
@@ -472,19 +475,19 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         case KeyEvent.VK_S:
           if (viewport.cursorMode)
           {
-            alignPanel.seqPanel.setCursorRow();
+            alignPanel.getSeqPanel().setCursorRow();
           }
           break;
         case KeyEvent.VK_C:
           if (viewport.cursorMode && !evt.isControlDown())
           {
-            alignPanel.seqPanel.setCursorColumn();
+            alignPanel.getSeqPanel().setCursorColumn();
           }
           break;
         case KeyEvent.VK_P:
           if (viewport.cursorMode)
           {
-            alignPanel.seqPanel.setCursorPosition();
+            alignPanel.getSeqPanel().setCursorPosition();
           }
           break;
 
@@ -492,20 +495,20 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         case KeyEvent.VK_COMMA:
           if (viewport.cursorMode)
           {
-            alignPanel.seqPanel.setCursorRowAndColumn();
+            alignPanel.getSeqPanel().setCursorRowAndColumn();
           }
           break;
 
         case KeyEvent.VK_Q:
           if (viewport.cursorMode)
           {
-            alignPanel.seqPanel.setSelectionAreaAtCursor(true);
+            alignPanel.getSeqPanel().setSelectionAreaAtCursor(true);
           }
           break;
         case KeyEvent.VK_M:
           if (viewport.cursorMode)
           {
-            alignPanel.seqPanel.setSelectionAreaAtCursor(false);
+            alignPanel.getSeqPanel().setSelectionAreaAtCursor(false);
           }
           break;
 
@@ -516,10 +519,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                   { (viewport.cursorMode ? "on" : "off") }));
           if (viewport.cursorMode)
           {
-            alignPanel.seqPanel.seqCanvas.cursorX = viewport.startRes;
-            alignPanel.seqPanel.seqCanvas.cursorY = viewport.startSeq;
+            alignPanel.getSeqPanel().seqCanvas.cursorX = viewport.startRes;
+            alignPanel.getSeqPanel().seqCanvas.cursorY = viewport.startSeq;
           }
-          alignPanel.seqPanel.seqCanvas.repaint();
+          alignPanel.getSeqPanel().seqCanvas.repaint();
           break;
 
         case KeyEvent.VK_F1:
@@ -738,14 +741,14 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     abovePIDThreshold.setSelected(av.getAbovePIDThreshold());
     conservationMenuItem.setSelected(av.getConservationSelected());
     seqLimits.setSelected(av.getShowJVSuffix());
-    idRightAlign.setSelected(av.rightAlignIds);
+    idRightAlign.setSelected(av.isRightAlignIds());
     centreColumnLabelsMenuItem.setState(av.centreColumnLabels);
     renderGapsMenuItem.setSelected(av.renderGaps);
     wrapMenuItem.setSelected(av.wrapAlignment);
     scaleAbove.setVisible(av.wrapAlignment);
     scaleLeft.setVisible(av.wrapAlignment);
     scaleRight.setVisible(av.wrapAlignment);
-    annotationPanelMenuItem.setState(av.showAnnotation);
+    annotationPanelMenuItem.setState(av.isShowAnnotation());
     /*
      * Show/hide annotations only enabled if annotation panel is shown
      */
@@ -896,7 +899,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
   public FeatureRenderer getFeatureRenderer()
   {
-    return alignPanel.seqPanel.seqCanvas.getFeatureRenderer();
+    return alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer();
   }
 
   @Override
@@ -1227,17 +1230,17 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   @Override
   protected void htmlMenuItem_actionPerformed(ActionEvent e)
   {
-    new HTMLOutput(alignPanel,
-            alignPanel.seqPanel.seqCanvas.getSequenceRenderer(),
-            alignPanel.seqPanel.seqCanvas.getFeatureRenderer());
+    // new HTMLOutput(alignPanel,
+    // alignPanel.getSeqPanel().seqCanvas.getSequenceRenderer(),
+    // alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer());
+    new HtmlSvgOutput(null, alignPanel);
   }
 
   @Override
   public void bioJSMenuItem_actionPerformed(ActionEvent e)
   {
     new BioJsHTMLOutput(alignPanel,
-            alignPanel.seqPanel.seqCanvas.getSequenceRenderer(),
-            alignPanel.seqPanel.seqCanvas.getFeatureRenderer());
+            alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer());
   }
   public void createImageMap(File file, String image)
   {
@@ -1303,7 +1306,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   public void exportAnnotations_actionPerformed(ActionEvent e)
   {
     new AnnotationExporter().exportAnnotations(alignPanel,
-            viewport.showAnnotation ? viewport.getAlignment()
+            viewport.isShowAnnotation() ? viewport.getAlignment()
                     .getAlignmentAnnotation() : null, viewport
                     .getAlignment().getGroups(), ((Alignment) viewport
                     .getAlignment()).alignmentProperties);
@@ -1418,7 +1421,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     if (viewport.historyList.size() > 0)
     {
       undoMenuItem.setEnabled(true);
-      CommandI command = (CommandI) viewport.historyList.peek();
+      CommandI command = viewport.historyList.peek();
       undoMenuItem.setText(MessageManager.formatMessage(
               "label.undo_command", new String[]
               { command.getDescription() }));
@@ -1433,7 +1436,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     {
       redoMenuItem.setEnabled(true);
 
-      CommandI command = (CommandI) viewport.redoList.peek();
+      CommandI command = viewport.redoList.peek();
       redoMenuItem.setText(MessageManager.formatMessage(
               "label.redo_command", new String[]
               { command.getDescription() }));
@@ -1497,7 +1500,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     {
       return;
     }
-    CommandI command = (CommandI) viewport.historyList.pop();
+    CommandI command = viewport.historyList.pop();
     viewport.redoList.push(command);
     command.undoCommand(getViewAlignments());
 
@@ -1536,7 +1539,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
       return;
     }
 
-    CommandI command = (CommandI) viewport.redoList.pop();
+    CommandI command = viewport.redoList.pop();
     viewport.historyList.push(command);
     command.doCommand(getViewAlignments());
 
@@ -1629,7 +1632,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     if (viewport.cursorMode)
     {
       sg.add(viewport.getAlignment().getSequenceAt(
-              alignPanel.seqPanel.seqCanvas.cursorY));
+              alignPanel.getSeqPanel().seqCanvas.cursorY));
     }
     else if (viewport.getSelectionGroup() != null
             && viewport.getSelectionGroup().getSize() != viewport
@@ -1679,7 +1682,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     {
       if (viewport.cursorMode)
       {
-        alignPanel.seqPanel.moveCursor(size, 0);
+        alignPanel.getSeqPanel().moveCursor(size, 0);
       }
       else
       {
@@ -1690,7 +1693,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     {
       if (viewport.cursorMode)
       {
-        alignPanel.seqPanel.moveCursor(-size, 0);
+        alignPanel.getSeqPanel().moveCursor(-size, 0);
       }
       else
       {
@@ -1998,7 +2001,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         // /////
         // ADD HISTORY ITEM
         //
-        addHistoryItem(new EditCommand(MessageManager.getString("label.add_sequences"), EditCommand.PASTE,
+        addHistoryItem(new EditCommand(
+                MessageManager.getString("label.add_sequences"),
+                Action.PASTE,
                 sequences, 0, alignment.getWidth(), alignment));
       }
       // Add any annotations attached to sequences
@@ -2116,9 +2121,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
         // >>>This is a fix for the moment, until a better solution is
         // found!!<<<
-        af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer()
+        af.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer()
                 .transferSettings(
-                        alignPanel.seqPanel.seqCanvas.getFeatureRenderer());
+                        alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer());
 
         // TODO: maintain provenance of an alignment, rather than just make the
         // title a concatenation of operations.
@@ -2176,9 +2181,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
       // >>>This is a fix for the moment, until a better solution is
       // found!!<<<
-      af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer()
+      af.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer()
               .transferSettings(
-                      alignPanel.seqPanel.seqCanvas.getFeatureRenderer());
+                      alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer());
 
       // TODO: maintain provenance of an alignment, rather than just make the
       // title a concatenation of operations.
@@ -2269,8 +2274,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     /*
      * //ADD HISTORY ITEM
      */
-    addHistoryItem(new EditCommand(MessageManager.getString("label.cut_sequences"), EditCommand.CUT, cut,
-            sg.getStartRes(), sg.getEndRes() - sg.getStartRes() + 1,
+    addHistoryItem(new EditCommand(
+            MessageManager.getString("label.cut_sequences"), Action.CUT,
+            cut, sg.getStartRes(), sg.getEndRes() - sg.getStartRes() + 1,
             viewport.getAlignment()));
 
     viewport.setSelectionGroup(null);
@@ -2341,14 +2347,14 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   {
     if (viewport.cursorMode)
     {
-      alignPanel.seqPanel.keyboardNo1 = null;
-      alignPanel.seqPanel.keyboardNo2 = null;
+      alignPanel.getSeqPanel().keyboardNo1 = null;
+      alignPanel.getSeqPanel().keyboardNo2 = null;
     }
     viewport.setSelectionGroup(null);
     viewport.getColumnSelection().clear();
     viewport.setSelectionGroup(null);
-    alignPanel.seqPanel.seqCanvas.highlightSearchResults(null);
-    alignPanel.idPanel.idCanvas.searchResults = null;
+    alignPanel.getSeqPanel().seqCanvas.highlightSearchResults(null);
+    alignPanel.getIdPanel().getIdCanvas().searchResults = null;
     alignPanel.paintAlignment(true);
     PaintRefresher.Refresh(alignPanel, viewport.getSequenceSetId());
     viewport.sendSelection();
@@ -2749,7 +2755,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   {
     viewport.setShowJVSuffix(seqLimits.isSelected());
 
-    alignPanel.idPanel.idCanvas.setPreferredSize(alignPanel
+    alignPanel.getIdPanel().getIdCanvas().setPreferredSize(alignPanel
             .calculateIdWidth());
     alignPanel.paintAlignment(true);
   }
@@ -2757,7 +2763,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   @Override
   public void idRightAlign_actionPerformed(ActionEvent e)
   {
-    viewport.rightAlignIds = idRightAlign.isSelected();
+    viewport.setRightAlignIds(idRightAlign.isSelected());
     alignPanel.paintAlignment(true);
   }
 
@@ -2779,7 +2785,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     if (viewport.followHighlight = this.followHighlightMenuItem.getState())
     {
       alignPanel.scrollToPosition(
-              alignPanel.seqPanel.seqCanvas.searchResults, false);
+              alignPanel.getSeqPanel().seqCanvas.searchResults, false);
     }
   }
 
@@ -4188,16 +4194,20 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
        */
       msa = viewport.getAlignmentView(true);
     }
+    else if (viewport.getSelectionGroup() != null
+            && viewport.getSelectionGroup().getSize() == 1)
+    {
+      int option = JOptionPane.showConfirmDialog(this,
+              MessageManager.getString("warn.oneseq_msainput_selection"),
+              MessageManager.getString("label.invalid_selection"),
+              JOptionPane.OK_CANCEL_OPTION);
+      if (option == JOptionPane.OK_OPTION)
+      {
+        msa = viewport.getAlignmentView(false);
+      }
+    }
     else
     {
-      /*
-       * Vector seqs = viewport.getAlignment().getSequences();
-       * 
-       * if (seqs.size() > 1) { msa = new SequenceI[seqs.size()];
-       * 
-       * for (int i = 0; i < seqs.size(); i++) { msa[i] = (SequenceI)
-       * seqs.elementAt(i); } }
-       */
       msa = viewport.getAlignmentView(false);
     }
     return msa;
@@ -4871,7 +4881,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     try
     {
       featuresFile = new FeaturesFile(file, type).parse(viewport
-              .getAlignment().getDataset(), alignPanel.seqPanel.seqCanvas
+              .getAlignment().getDataset(), alignPanel.getSeqPanel().seqCanvas
               .getFeatureRenderer().getFeatureColours(), false,
               jalview.bin.Cache.getDefault("RELAXEDSEQIDMATCHING", false));
     } catch (Exception ex)
@@ -4883,10 +4893,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     {
       viewport.setShowSequenceFeatures(true);
       showSeqFeatures.setSelected(true);
-      if (alignPanel.seqPanel.seqCanvas.fr != null)
+      if (alignPanel.getSeqPanel().seqCanvas.fr != null)
       {
         // update the min/max ranges where necessary
-        alignPanel.seqPanel.seqCanvas.fr.findAllFeatures(true);
+        alignPanel.getSeqPanel().seqCanvas.fr.findAllFeatures(true);
       }
       if (featureSettings != null)
       {
@@ -5805,7 +5815,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         aa.visible = visible;
       }
     }
-    this.alignPanel.paintAlignment(true);
+    alignPanel.validateAnnotationDimensions(false);
+    alignPanel.alignmentChanged();
   }
 
   /**
@@ -5819,6 +5830,15 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
             .setShowAutocalculatedAbove(isShowAutoCalculatedAbove());
     alignPanel.paintAlignment(true);
   }
+
+  /**
+   * 
+   * @return alignment panels in this alignemnt frame
+   */
+  public List<AlignmentViewPanel> getAlignPanels()
+  {
+    return alignPanels == null ? Arrays.asList(alignPanel) : alignPanels;
+  }
 }
 
 class PrintThread extends Thread
index d6df385..38f0ea1 100644 (file)
@@ -42,9 +42,8 @@ import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
 import jalview.analysis.NJTree;
 import jalview.api.AlignViewportI;
 import jalview.bin.Cache;
-import jalview.datamodel.AlignmentAnnotation;
+import jalview.commands.CommandI;
 import jalview.datamodel.AlignmentI;
-import jalview.datamodel.Annotation;
 import jalview.datamodel.ColumnSelection;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.Sequence;
@@ -96,8 +95,6 @@ public class AlignViewport extends AlignmentViewport implements
 
   boolean renderGaps = true;
 
-  boolean showAnnotation = true;
-
   SequenceAnnotationOrder sortAnnotationsBy = null;
 
   int charHeight;
@@ -132,18 +129,15 @@ public class AlignViewport extends AlignmentViewport implements
 
   boolean gatherViewsHere = false;
 
-  Stack historyList = new Stack();
+  Stack<CommandI> historyList = new Stack<CommandI>();
 
-  Stack redoList = new Stack();
+  Stack<CommandI> redoList = new Stack<CommandI>();
 
   int thresholdTextColour = 0;
 
   Color textColour = Color.black;
 
   Color textColour2 = Color.white;
-
-  boolean rightAlignIds = false;
-
   /**
    * Creates a new AlignViewport object.
    * 
@@ -279,9 +273,9 @@ public class AlignViewport extends AlignmentViewport implements
     antiAlias = Cache.getDefault("ANTI_ALIAS", false);
 
     showJVSuffix = Cache.getDefault("SHOW_JVSUFFIX", true);
-    showAnnotation = Cache.getDefault("SHOW_ANNOTATIONS", true);
+    setShowAnnotation(Cache.getDefault("SHOW_ANNOTATIONS", true));
 
-    rightAlignIds = Cache.getDefault("RIGHT_ALIGN_IDS", false);
+    setRightAlignIds(Cache.getDefault("RIGHT_ALIGN_IDS", false));
     centreColumnLabels = Cache.getDefault("CENTRE_COLUMN_LABELS", false);
     autoCalculateConsensus = Cache.getDefault("AUTO_CALC_CONSENSUS", true);
 
@@ -329,10 +323,6 @@ public class AlignViewport extends AlignmentViewport implements
               false);
       showGroupConsensus = Cache.getDefault("SHOW_GROUP_CONSENSUS", false);
       showConsensus = Cache.getDefault("SHOW_IDENTITY", true);
-      consensus = new AlignmentAnnotation("Consensus", "PID",
-              new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH);
-      consensus.hasText = true;
-      consensus.autoCalculated = true;
     }
     initAutoAnnotation();
     if (jalview.bin.Cache.getProperty("DEFAULT_COLOUR") != null)
@@ -818,27 +808,6 @@ public class AlignViewport extends AlignmentViewport implements
    * 
    * @return DOCUMENT ME!
    */
-  public boolean getShowAnnotation()
-  {
-    return showAnnotation;
-  }
-
-  /**
-   * DOCUMENT ME!
-   * 
-   * @param b
-   *          DOCUMENT ME!
-   */
-  public void setShowAnnotation(boolean b)
-  {
-    showAnnotation = b;
-  }
-
-  /**
-   * DOCUMENT ME!
-   * 
-   * @return DOCUMENT ME!
-   */
   public boolean getScaleAboveWrapped()
   {
     return scaleAboveWrapped;
index 47d6309..e859fb1 100644 (file)
@@ -29,6 +29,7 @@ import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
 import jalview.jbgui.GAlignmentPanel;
+import jalview.math.AlignmentDimension;
 import jalview.schemes.ResidueProperties;
 import jalview.structure.StructureSelectionManager;
 import jalview.util.MessageManager;
@@ -66,20 +67,21 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
   OverviewPanel overviewPanel;
 
-  SeqPanel seqPanel;
+  private SeqPanel seqPanel;
 
-  IdPanel idPanel;
+  private IdPanel idPanel;
 
+  private boolean headless;
   IdwidthAdjuster idwidthAdjuster;
 
   /** DOCUMENT ME!! */
   public AlignFrame alignFrame;
 
-  ScalePanel scalePanel;
+  private ScalePanel scalePanel;
 
-  AnnotationPanel annotationPanel;
+  private AnnotationPanel annotationPanel;
 
-  AnnotationLabels alabels;
+  private AnnotationLabels alabels;
 
   // this value is set false when selection area being dragged
   boolean fastPaint = true;
@@ -100,23 +102,23 @@ public class AlignmentPanel extends GAlignmentPanel implements
   {
     alignFrame = af;
     this.av = av;
-    seqPanel = new SeqPanel(av, this);
-    idPanel = new IdPanel(av, this);
+    setSeqPanel(new SeqPanel(av, this));
+    setIdPanel(new IdPanel(av, this));
 
-    scalePanel = new ScalePanel(av, this);
+    setScalePanel(new ScalePanel(av, this));
 
-    idPanelHolder.add(idPanel, BorderLayout.CENTER);
+    idPanelHolder.add(getIdPanel(), BorderLayout.CENTER);
     idwidthAdjuster = new IdwidthAdjuster(this);
     idSpaceFillerPanel1.add(idwidthAdjuster, BorderLayout.CENTER);
 
-    annotationPanel = new AnnotationPanel(this);
-    alabels = new AnnotationLabels(this);
+    setAnnotationPanel(new AnnotationPanel(this));
+    setAlabels(new AnnotationLabels(this));
 
-    annotationScroller.setViewportView(annotationPanel);
-    annotationSpaceFillerHolder.add(alabels, BorderLayout.CENTER);
+    annotationScroller.setViewportView(getAnnotationPanel());
+    annotationSpaceFillerHolder.add(getAlabels(), BorderLayout.CENTER);
 
-    scalePanelHolder.add(scalePanel, BorderLayout.CENTER);
-    seqPanelHolder.add(seqPanel, BorderLayout.CENTER);
+    scalePanelHolder.add(getScalePanel(), BorderLayout.CENTER);
+    seqPanelHolder.add(getSeqPanel(), BorderLayout.CENTER);
 
     setScrollValues(0, 0);
 
@@ -166,13 +168,13 @@ public class AlignmentPanel extends GAlignmentPanel implements
     idSpaceFillerPanel1.setPreferredSize(new Dimension(10, av.charHeight
             + fm.getDescent()));
 
-    idPanel.idCanvas.gg = null;
-    seqPanel.seqCanvas.img = null;
-    annotationPanel.adjustPanelHeight();
+    getIdPanel().getIdCanvas().gg = null;
+    getSeqPanel().seqCanvas.img = null;
+    getAnnotationPanel().adjustPanelHeight();
 
     Dimension d = calculateIdWidth();
     d.setSize(d.width + 4, d.height);
-    idPanel.idCanvas.setPreferredSize(d);
+    getIdPanel().getIdCanvas().setPreferredSize(d);
     hscrollFillerPanel.setPreferredSize(d);
 
     if (overviewPanel != null)
@@ -240,7 +242,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
     if (al.getAlignmentAnnotation() != null)
     {
-      fm = c.getFontMetrics(alabels.getFont());
+      fm = c.getFontMetrics(getAlabels().getFont());
 
       while (i < al.getAlignmentAnnotation().length)
       {
@@ -266,7 +268,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
   public void highlightSearchResults(SearchResults results)
   {
     scrollToPosition(results);
-    seqPanel.seqCanvas.highlightSearchResults(results);
+    getSeqPanel().seqCanvas.highlightSearchResults(results);
   }
 
   /**
@@ -371,8 +373,8 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
   void scrollToWrappedVisible(int res)
   {
-    int cwidth = seqPanel.seqCanvas
-            .getWrappedCanvasWidth(seqPanel.seqCanvas.getWidth());
+    int cwidth = getSeqPanel().seqCanvas
+            .getWrappedCanvasWidth(getSeqPanel().seqCanvas.getWidth());
     if (res < av.getStartRes() || res >= (av.getStartRes() + cwidth))
     {
       vscroll.setValue((res / cwidth));
@@ -441,7 +443,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
    */
   protected void validateAnnotationDimensions(boolean adjustPanelHeight)
   {
-    int height = annotationPanel.adjustPanelHeight();
+    int height = getAnnotationPanel().adjustPanelHeight();
 
     int theight = av.getCharHeight()
             * (av.getAlignment().getHeight() + (!av.hasHiddenRows() ? 0
@@ -503,7 +505,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
       annotationScroller.setVisible(false);
       annotationSpaceFillerHolder.setVisible(false);
     }
-    else if (av.showAnnotation)
+    else if (av.isShowAnnotation())
     {
       annotationScroller.setVisible(true);
       annotationSpaceFillerHolder.setVisible(true);
@@ -603,10 +605,10 @@ public class AlignmentPanel extends GAlignmentPanel implements
       width = av.getColumnSelection().findColumnPosition(width);
     }
 
-    av.setEndRes((x + (seqPanel.seqCanvas.getWidth() / av.charWidth)) - 1);
+    av.setEndRes((x + (getSeqPanel().seqCanvas.getWidth() / av.charWidth)) - 1);
 
-    hextent = seqPanel.seqCanvas.getWidth() / av.charWidth;
-    vextent = seqPanel.seqCanvas.getHeight() / av.charHeight;
+    hextent = getSeqPanel().seqCanvas.getWidth() / av.charWidth;
+    vextent = getSeqPanel().seqCanvas.getHeight() / av.charHeight;
 
     if (hextent > width)
     {
@@ -658,7 +660,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
     {
       int x = hscroll.getValue();
       av.setStartRes(x);
-      av.setEndRes((x + (seqPanel.seqCanvas.getWidth() / av.getCharWidth())) - 1);
+      av.setEndRes((x + (getSeqPanel().seqCanvas.getWidth() / av.getCharWidth())) - 1);
     }
 
     if (evt.getSource() == vscroll)
@@ -669,8 +671,8 @@ public class AlignmentPanel extends GAlignmentPanel implements
       {
         if (offy > -1)
         {
-          int rowSize = seqPanel.seqCanvas
-                  .getWrappedCanvasWidth(seqPanel.seqCanvas.getWidth());
+          int rowSize = getSeqPanel().seqCanvas
+                  .getWrappedCanvasWidth(getSeqPanel().seqCanvas.getWidth());
           av.setStartRes(offy * rowSize);
           av.setEndRes((offy + 1) * rowSize);
         }
@@ -692,7 +694,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
       {
         av.setStartSeq(offy);
         av.setEndSeq(offy
-                + (seqPanel.seqCanvas.getHeight() / av.getCharHeight()));
+                + (getSeqPanel().seqCanvas.getHeight() / av.getCharHeight()));
       }
     }
 
@@ -723,13 +725,13 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
       if (scrollX != 0 || scrollY != 0)
       {
-        idPanel.idCanvas.fastPaint(scrollY);
-        seqPanel.seqCanvas.fastPaint(scrollX, scrollY);
-        scalePanel.repaint();
+        getIdPanel().getIdCanvas().fastPaint(scrollY);
+        getSeqPanel().seqCanvas.fastPaint(scrollX, scrollY);
+        getScalePanel().repaint();
 
         if (av.getShowAnnotation() && scrollX != 0)
         {
-          annotationPanel.fastPaint(scrollX);
+          getAnnotationPanel().fastPaint(scrollX);
         }
       }
     }
@@ -769,7 +771,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
   {
     invalidate();
 
-    Dimension d = idPanel.idCanvas.getPreferredSize();
+    Dimension d = getIdPanel().getIdCanvas().getPreferredSize();
     idPanelHolder.setPreferredSize(d);
     hscrollFillerPanel.setPreferredSize(new Dimension(d.width, 12));
     validate();
@@ -783,13 +785,13 @@ public class AlignmentPanel extends GAlignmentPanel implements
         maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
       }
 
-      int canvasWidth = seqPanel.seqCanvas
-              .getWrappedCanvasWidth(seqPanel.seqCanvas.getWidth());
+      int canvasWidth = getSeqPanel().seqCanvas
+              .getWrappedCanvasWidth(getSeqPanel().seqCanvas.getWidth());
       if (canvasWidth > 0)
       {
         int max = maxwidth
-                / seqPanel.seqCanvas
-                        .getWrappedCanvasWidth(seqPanel.seqCanvas
+                / getSeqPanel().seqCanvas
+                        .getWrappedCanvasWidth(getSeqPanel().seqCanvas
                                 .getWidth()) + 1;
         vscroll.setMaximum(max);
         vscroll.setUnitIncrement(1);
@@ -905,9 +907,9 @@ public class AlignmentPanel extends GAlignmentPanel implements
     int pagesHigh = ((av.getAlignment().getHeight() / totalSeq) + 1)
             * pheight;
 
-    if (av.showAnnotation)
+    if (av.isShowAnnotation())
     {
-      pagesHigh += annotationPanel.adjustPanelHeight() + 3;
+      pagesHigh += getAnnotationPanel().adjustPanelHeight() + 3;
     }
 
     pagesHigh /= pheight;
@@ -919,7 +921,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
     // draw Scale
     pg.translate(idWidth, 0);
-    scalePanel.drawScale(pg, startRes, endRes, pwidth - idWidth,
+    getScalePanel().drawScale(pg, startRes, endRes, pwidth - idWidth,
             scaleHeight);
     pg.translate(-idWidth, scaleHeight);
 
@@ -928,7 +930,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
     Color currentColor = null;
     Color currentTextColor = null;
 
-    pg.setFont(idPanel.idCanvas.idfont);
+    pg.setFont(getIdPanel().getIdCanvas().getIdfont());
 
     SequenceI seq;
     for (int i = startSeq; i < endSeq; i++)
@@ -953,7 +955,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
       pg.setColor(currentTextColor);
 
       int xPos = 0;
-      if (av.rightAlignIds)
+      if (av.isRightAlignIds())
       {
         fm = pg.getFontMetrics();
         xPos = idWidth
@@ -972,17 +974,17 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
     // draw main sequence panel
     pg.translate(idWidth, 0);
-    seqPanel.seqCanvas.drawPanel(pg, startRes, endRes, startSeq, endSeq, 0);
+    getSeqPanel().seqCanvas.drawPanel(pg, startRes, endRes, startSeq, endSeq, 0);
 
-    if (av.showAnnotation && (endSeq == av.getAlignment().getHeight()))
+    if (av.isShowAnnotation() && (endSeq == av.getAlignment().getHeight()))
     {
       // draw annotation - need to offset for current scroll position
-      int offset = -alabels.scrollOffset;
+      int offset = -getAlabels().getScrollOffset();
       pg.translate(0, offset);
       pg.translate(-idWidth - 3, (endSeq - startSeq) * av.charHeight + 3);
-      alabels.drawComponent(pg, idWidth);
+      getAlabels().drawComponent(pg, idWidth);
       pg.translate(idWidth + 3, 0);
-      annotationPanel.renderer.drawComponent(annotationPanel, av,
+      getAnnotationPanel().renderer.drawComponent(getAnnotationPanel(), av,
               pg, -1, startRes, endRes + 1);
       pg.translate(0, -offset);
     }
@@ -1013,9 +1015,9 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
     int annotationHeight = 0;
     AnnotationLabels labels = null;
-    if (av.showAnnotation)
+    if (av.isShowAnnotation())
     {
-      annotationHeight = annotationPanel.adjustPanelHeight();
+      annotationHeight = getAnnotationPanel().adjustPanelHeight();
       labels = new AnnotationLabels(av);
     }
 
@@ -1036,7 +1038,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
       maxwidth = av.getColumnSelection().findColumnPosition(maxwidth) - 1;
     }
 
-    int resWidth = seqPanel.seqCanvas.getWrappedCanvasWidth(pwidth
+    int resWidth = getSeqPanel().seqCanvas.getWrappedCanvasWidth(pwidth
             - idWidth);
 
     int totalHeight = cHeight * (maxwidth / resWidth + 1);
@@ -1059,11 +1061,11 @@ public class AlignmentPanel extends GAlignmentPanel implements
     {
       for (int i = 0; i < av.getAlignment().getHeight(); i++)
       {
-        pg.setFont(idPanel.idCanvas.idfont);
+        pg.setFont(getIdPanel().getIdCanvas().getIdfont());
         SequenceI s = av.getAlignment().getSequenceAt(i);
         String string = s.getDisplayId(av.getShowJVSuffix());
         int xPos = 0;
-        if (av.rightAlignIds)
+        if (av.isRightAlignIds())
         {
           FontMetrics fm = pg.getFontMetrics();
           xPos = idWidth - fm.stringWidth(string) - 4;
@@ -1088,7 +1090,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
     pg.translate(idWidth, 0);
 
-    seqPanel.seqCanvas.drawWrappedPanel(pg, pwidth - idWidth, totalHeight,
+    getSeqPanel().seqCanvas.drawWrappedPanel(pg, pwidth - idWidth, totalHeight,
             0);
 
     if ((pi * pheight) < totalHeight)
@@ -1108,7 +1110,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
    * 
    * @return
    */
-  int getVisibleIdWidth()
+  public int getVisibleIdWidth()
   {
     return getVisibleIdWidth(true);
   }
@@ -1122,7 +1124,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
    *          be returned
    * @return
    */
-  int getVisibleIdWidth(boolean onscreen)
+  public int getVisibleIdWidth(boolean onscreen)
   {
     // see if rendering offscreen - check preferences and calc width accordingly
     if (!onscreen && Cache.getDefault("FIGURE_AUTOIDWIDTH", false))
@@ -1133,7 +1135,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
     if (onscreen
             || (idwidth = Cache.getIntegerProperty("FIGURE_FIXEDIDWIDTH")) == null)
     {
-      return (idPanel.getWidth() > 0 ? idPanel.getWidth()
+      return (getIdPanel().getWidth() > 0 ? getIdPanel().getWidth()
               : calculateIdWidth().width + 4);
     }
     return idwidth.intValue() + 4;
@@ -1142,7 +1144,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
   void makeAlignmentImage(jalview.util.ImageMaker.TYPE type, File file)
   {
     long progress = System.currentTimeMillis();
-    boolean headless = (System.getProperty("java.awt.headless") != null && System
+    headless = (System.getProperty("java.awt.headless") != null && System
             .getProperty("java.awt.headless").equals("true"));
     if (alignFrame != null && !headless)
     {
@@ -1153,44 +1155,9 @@ public class AlignmentPanel extends GAlignmentPanel implements
     }
     try
     {
-      int maxwidth = av.getAlignment().getWidth();
-      if (av.hasHiddenColumns())
-      {
-        maxwidth = av.getColumnSelection().findColumnPosition(maxwidth);
-      }
-
-      int height = ((av.getAlignment().getHeight() + 1) * av.charHeight)
-              + scalePanel.getHeight();
-      int width = getVisibleIdWidth(false) + (maxwidth * av.charWidth);
-
-      if (av.getWrapAlignment())
-      {
-        height = getWrappedHeight();
-        if (headless)
-        {
-          // need to obtain default alignment width and then add in any
-          // additional allowance for id margin
-          // this duplicates the calculation in getWrappedHeight but adjusts for
-          // offscreen idWith
-          width = alignFrame.getWidth() - vscroll.getPreferredSize().width
-                  - alignFrame.getInsets().left
-                  - alignFrame.getInsets().right - getVisibleIdWidth()
-                  + getVisibleIdWidth(false);
-        }
-        else
-        {
-          width = seqPanel.getWidth() + getVisibleIdWidth(false);
-        }
-
-      }
-      else if (av.getShowAnnotation())
-      {
-        height += annotationPanel.adjustPanelHeight() + 3;
-      }
-
+      AlignmentDimension aDimension = getAlignmentDimension();
       try
       {
-
         jalview.util.ImageMaker im;
         final String imageAction, imageTitle;
         if (type == jalview.util.ImageMaker.TYPE.PNG)
@@ -1209,13 +1176,15 @@ public class AlignmentPanel extends GAlignmentPanel implements
           imageTitle = alignFrame.getTitle();
         }
 
-        im = new jalview.util.ImageMaker(this, type, imageAction, width,
-                height, file, imageTitle);
+        im = new jalview.util.ImageMaker(this, type, imageAction,
+                aDimension.getWidth(), aDimension.getHeight(), file,
+                imageTitle);
         if (av.getWrapAlignment())
         {
           if (im.getGraphics() != null)
           {
-            printWrappedAlignment(im.getGraphics(), width, height, 0);
+            printWrappedAlignment(im.getGraphics(), aDimension.getWidth(),
+                    aDimension.getHeight(), 0);
             im.writeImage();
           }
         }
@@ -1223,7 +1192,8 @@ public class AlignmentPanel extends GAlignmentPanel implements
         {
           if (im.getGraphics() != null)
           {
-            printUnwrapped(im.getGraphics(), width, height, 0);
+            printUnwrapped(im.getGraphics(), aDimension.getWidth(),
+                    aDimension.getHeight(), 0);
             im.writeImage();
           }
         }
@@ -1247,6 +1217,46 @@ public class AlignmentPanel extends GAlignmentPanel implements
     }
   }
 
+  public AlignmentDimension getAlignmentDimension()
+  {
+    int maxwidth = av.getAlignment().getWidth();
+    if (av.hasHiddenColumns())
+    {
+      maxwidth = av.getColumnSelection().findColumnPosition(maxwidth);
+    }
+
+    int height = ((av.getAlignment().getHeight() + 1) * av.charHeight)
+            + getScalePanel().getHeight();
+    int width = getVisibleIdWidth(false) + (maxwidth * av.charWidth);
+
+    if (av.getWrapAlignment())
+    {
+      height = getWrappedHeight();
+      if (headless)
+      {
+        // need to obtain default alignment width and then add in any
+        // additional allowance for id margin
+        // this duplicates the calculation in getWrappedHeight but adjusts for
+        // offscreen idWith
+        width = alignFrame.getWidth() - vscroll.getPreferredSize().width
+                - alignFrame.getInsets().left
+                - alignFrame.getInsets().right - getVisibleIdWidth()
+                + getVisibleIdWidth(false);
+      }
+      else
+      {
+        width = getSeqPanel().getWidth() + getVisibleIdWidth(false);
+      }
+
+    }
+    else if (av.getShowAnnotation())
+    {
+      height += getAnnotationPanel().adjustPanelHeight() + 3;
+    }
+    return new AlignmentDimension(width, height);
+
+  }
+
   /**
    * DOCUMENT ME!
    */
@@ -1410,7 +1420,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
 
   int getWrappedHeight()
   {
-    int seqPanelWidth = seqPanel.seqCanvas.getWidth();
+    int seqPanelWidth = getSeqPanel().seqCanvas.getWidth();
 
     if (System.getProperty("java.awt.headless") != null
             && System.getProperty("java.awt.headless").equals("true"))
@@ -1420,7 +1430,7 @@ public class AlignmentPanel extends GAlignmentPanel implements
               - alignFrame.getInsets().left - alignFrame.getInsets().right;
     }
 
-    int chunkWidth = seqPanel.seqCanvas
+    int chunkWidth = getSeqPanel().seqCanvas
             .getWrappedCanvasWidth(seqPanelWidth);
 
     int hgap = av.charHeight;
@@ -1430,9 +1440,9 @@ public class AlignmentPanel extends GAlignmentPanel implements
     }
 
     int annotationHeight = 0;
-    if (av.showAnnotation)
+    if (av.isShowAnnotation())
     {
-      annotationHeight = annotationPanel.adjustPanelHeight();
+      annotationHeight = getAnnotationPanel().adjustPanelHeight();
     }
 
     int cHeight = av.getAlignment().getHeight() * av.charHeight + hgap
@@ -1455,15 +1465,15 @@ public class AlignmentPanel extends GAlignmentPanel implements
    */
   public void closePanel()
   {
-    PaintRefresher.RemoveComponent(seqPanel.seqCanvas);
-    PaintRefresher.RemoveComponent(idPanel.idCanvas);
+    PaintRefresher.RemoveComponent(getSeqPanel().seqCanvas);
+    PaintRefresher.RemoveComponent(getIdPanel().getIdCanvas());
     PaintRefresher.RemoveComponent(this);
     if (av != null)
     {
       jalview.structure.StructureSelectionManager ssm = av
               .getStructureSelectionManager();
-      ssm.removeStructureViewerListener(seqPanel, null);
-      ssm.removeSelectionListener(seqPanel);
+      ssm.removeStructureViewerListener(getSeqPanel(), null);
+      ssm.removeSelectionListener(getSeqPanel());
       av.setAlignment(null);
       av = null;
     }
@@ -1503,11 +1513,8 @@ public class AlignmentPanel extends GAlignmentPanel implements
     return av.getAlignment();
   }
 
-  /**
-   * get the name for this view
-   * 
-   * @return
-   */
+
+  @Override
   public String getViewName()
   {
     return av.viewName;
@@ -1559,14 +1566,64 @@ public class AlignmentPanel extends GAlignmentPanel implements
   }
   public void updateFeatureRenderer(jalview.renderer.seqfeatures.FeatureRenderer fr)
   {
-    fr.transferSettings(seqPanel.seqCanvas.getFeatureRenderer());
+    fr.transferSettings(getSeqPanel().seqCanvas.getFeatureRenderer());
   }
 
   public void updateFeatureRendererFrom(jalview.api.FeatureRenderer fr)
   {
-    if (seqPanel.seqCanvas.getFeatureRenderer() != null)
+    if (getSeqPanel().seqCanvas.getFeatureRenderer() != null)
     {
-      seqPanel.seqCanvas.getFeatureRenderer().transferSettings(fr);
+      getSeqPanel().seqCanvas.getFeatureRenderer().transferSettings(fr);
     }
   }
+
+  public ScalePanel getScalePanel()
+  {
+    return scalePanel;
+  }
+
+  public void setScalePanel(ScalePanel scalePanel)
+  {
+    this.scalePanel = scalePanel;
+  }
+
+  public SeqPanel getSeqPanel()
+  {
+    return seqPanel;
+  }
+
+  public void setSeqPanel(SeqPanel seqPanel)
+  {
+    this.seqPanel = seqPanel;
+  }
+
+  public AnnotationPanel getAnnotationPanel()
+  {
+    return annotationPanel;
+  }
+
+  public void setAnnotationPanel(AnnotationPanel annotationPanel)
+  {
+    this.annotationPanel = annotationPanel;
+  }
+
+  public AnnotationLabels getAlabels()
+  {
+    return alabels;
+  }
+
+  public void setAlabels(AnnotationLabels alabels)
+  {
+    this.alabels = alabels;
+  }
+
+  public IdPanel getIdPanel()
+  {
+    return idPanel;
+  }
+
+  public void setIdPanel(IdPanel idPanel)
+  {
+    this.idPanel = idPanel;
+  }
 }
index 2ad748e..e43c06b 100644 (file)
  */
 package jalview.gui;
 
-import java.util.*;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.SequenceGroup;
+import jalview.io.AnnotationFile;
+import jalview.io.FeaturesFile;
+import jalview.io.JalviewFileChooser;
+import jalview.io.JalviewFileView;
+import jalview.util.MessageManager;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Hashtable;
 import java.util.List;
 
-import java.awt.*;
-import java.awt.event.*;
-import javax.swing.*;
-
-import jalview.datamodel.*;
-import jalview.io.*;
-import jalview.util.MessageManager;
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JButton;
+import javax.swing.JInternalFrame;
+import javax.swing.JLabel;
+import javax.swing.JLayeredPane;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.SwingConstants;
 
 /**
  * 
@@ -208,7 +223,6 @@ public class AnnotationExporter extends JPanel
 
     close_actionPerformed(null);
   }
-
   public void close_actionPerformed(ActionEvent e)
   {
     try
index ad6f9e5..501df8a 100755 (executable)
@@ -99,7 +99,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
 
   int selectedRow;
 
-  int scrollOffset = 0;
+  private int scrollOffset = 0;
 
   Font font = new Font("Arial", Font.PLAIN, 11);
 
@@ -143,7 +143,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
 
     addMouseListener(this);
     addMouseMotionListener(this);
-    addMouseWheelListener(ap.annotationPanel);
+    addMouseWheelListener(ap.getAnnotationPanel());
   }
 
   public AnnotationLabels(AlignViewport av)
@@ -325,7 +325,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
    */
   public void mousePressed(MouseEvent evt)
   {
-    getSelectedRow(evt.getY() - scrollOffset);
+    getSelectedRow(evt.getY() - getScrollOffset());
     oldY = evt.getY();
   }
 
@@ -338,7 +338,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
   public void mouseReleased(MouseEvent evt)
   {
     int start = selectedRow;
-    getSelectedRow(evt.getY() - scrollOffset);
+    getSelectedRow(evt.getY() - getScrollOffset());
     int end = selectedRow;
 
     if (start != end)
@@ -360,7 +360,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
     resizePanel = false;
     dragEvent = null;
     repaint();
-    ap.annotationPanel.repaint();
+    ap.getAnnotationPanel().repaint();
   }
 
   /**
@@ -439,7 +439,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
   {
     resizePanel = evt.getY() < 10;
 
-    getSelectedRow(evt.getY() - scrollOffset);
+    getSelectedRow(evt.getY() - getScrollOffset());
 
     if (selectedRow > -1
             && ap.av.getAlignment().getAlignmentAnnotation().length > selectedRow)
@@ -478,20 +478,29 @@ public class AnnotationLabels extends JPanel implements MouseListener,
         {
           desc.append("<br/>");
         }
-
+        // if (aa.hasProperties())
+        // {
+        // desc.append("<table>");
+        // for (String prop : aa.getProperties())
+        // {
+        // desc.append("<tr><td>" + prop + "</td><td>"
+        // + aa.getProperty(prop) + "</td><tr>");
+        // }
+        // desc.append("</table>");
+        // }
       }
       else
       {
         // begin the tooltip's html fragment
         desc.append("<html>");
+        if (aa.hasScore())
+        {
+          // TODO: limit precision of score to avoid noise from imprecise
+          // doubles
+          // (64.7 becomes 64.7+/some tiny value).
+          desc.append(" Score: " + aa.score);
+        }
       }
-      if (aa.hasScore())
-      {
-        // TODO: limit precision of score to avoid noise from imprecise doubles
-        // (64.7 becomes 64.7+/some tiny value).
-        desc.append(" Score: " + aa.score);
-      }
-
       if (desc.length() > 6)
       {
         desc.append("</html>");
@@ -502,7 +511,6 @@ public class AnnotationLabels extends JPanel implements MouseListener,
         this.setToolTipText(null);
       }
     }
-
   }
 
   /**
@@ -525,7 +533,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
           {
             // todo: make the ap scroll to the selection - not necessary, first
             // click highlights/scrolls, second selects
-            ap.seqPanel.ap.idPanel.highlightSearchResults(null);
+            ap.getSeqPanel().ap.getIdPanel().highlightSearchResults(null);
             ap.av.setSelectionGroup(// new SequenceGroup(
             aa[selectedRow].groupRef); // );
             ap.paintAlignment(false);
@@ -534,7 +542,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
           }
           else
           {
-            ap.seqPanel.ap.idPanel
+            ap.getSeqPanel().ap.getIdPanel()
                     .highlightSearchResults(aa[selectedRow].groupRef
                             .getSequences(null));
           }
@@ -544,13 +552,13 @@ public class AnnotationLabels extends JPanel implements MouseListener,
         {
           if (evt.getClickCount() == 1)
           {
-            ap.seqPanel.ap.idPanel.highlightSearchResults(Arrays
+            ap.getSeqPanel().ap.getIdPanel().highlightSearchResults(Arrays
                     .asList(new SequenceI[]
                     { aa[selectedRow].sequenceRef }));
           }
           else if (evt.getClickCount() >= 2)
           {
-            ap.seqPanel.ap.idPanel.highlightSearchResults(null);
+            ap.getSeqPanel().ap.getIdPanel().highlightSearchResults(null);
             SequenceGroup sg = ap.av.getSelectionGroup();
             if (sg!=null)
             {
@@ -688,7 +696,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
             {
               // TODO: pass on reference to ap so the view can be updated.
               aaa.groupRef.setIgnoreGapsConsensus(cbmi.getState());
-              ap.annotationPanel.paint(ap.annotationPanel.getGraphics());
+              ap.getAnnotationPanel().paint(ap.getAnnotationPanel().getGraphics());
             }
             else
             {
@@ -954,7 +962,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
     g.setColor(Color.white);
     g.fillRect(0, 0, getWidth(), getHeight());
 
-    g.translate(0, scrollOffset);
+    g.translate(0, getScrollOffset());
     g.setColor(Color.black);
 
     AlignmentAnnotation[] aa = av.getAlignment().getAlignmentAnnotation();
@@ -968,7 +976,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
     int ofontH = fontHeight;
     int sOffset = 0;
     int visHeight = 0;
-    int[] visr = (ap != null && ap.annotationPanel != null) ? ap.annotationPanel
+    int[] visr = (ap != null && ap.getAnnotationPanel() != null) ? ap.getAnnotationPanel()
             .getVisibleVRange() : null;
     if (clip && visr != null)
     {
@@ -1108,13 +1116,13 @@ public class AnnotationLabels extends JPanel implements MouseListener,
 
     if (resizePanel)
     {
-      g.drawImage(image, 2, 0 - scrollOffset, this);
+      g.drawImage(image, 2, 0 - getScrollOffset(), this);
     }
     else if (dragEvent != null && aa != null)
     {
       g.setColor(Color.lightGray);
       g.drawString(aa[selectedRow].label, dragEvent.getX(),
-              dragEvent.getY() - scrollOffset);
+              dragEvent.getY() - getScrollOffset());
     }
 
     if (!av.wrapAlignment && ((aa == null) || (aa.length < 1)))
@@ -1124,4 +1132,9 @@ public class AnnotationLabels extends JPanel implements MouseListener,
               18);
     }
   }
+
+  public int getScrollOffset()
+  {
+    return scrollOffset;
+  }
 }
index 4adeb83..3a97f96 100755 (executable)
  */
 package jalview.gui;
 
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.image.*;
-
-import javax.swing.*;
-
-import jalview.datamodel.*;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.Annotation;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.SequenceI;
 import jalview.renderer.AnnotationRenderer;
 import jalview.renderer.AwtRenderPanelI;
 import jalview.util.MessageManager;
 
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.Rectangle;
+import java.awt.RenderingHints;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.AdjustmentEvent;
+import java.awt.event.AdjustmentListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+import java.awt.event.MouseWheelEvent;
+import java.awt.event.MouseWheelListener;
+import java.awt.image.BufferedImage;
+
+import javax.swing.JColorChooser;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import javax.swing.Scrollable;
+import javax.swing.SwingUtilities;
+import javax.swing.ToolTipManager;
+
 /**
  * AnnotationPanel displays visible portion of annotation rows below unwrapped
  * alignment
@@ -215,7 +241,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
   public void adjustmentValueChanged(AdjustmentEvent evt)
   {
     // update annotation label display
-    ap.alabels.setScrollOffset(-evt.getValue());
+    ap.getAlabels().setScrollOffset(-evt.getValue());
   }
 
   /**
@@ -289,7 +315,9 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
         int index = av.getColumnSelection().columnAt(i);
 
         if (!av.getColumnSelection().isVisible(index))
+        {
           continue;
+        }
 
         if (anot[index] == null)
         {
@@ -314,7 +342,9 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
         int index = av.getColumnSelection().columnAt(i);
 
         if (!av.getColumnSelection().isVisible(index))
+        {
           continue;
+        }
 
         if (anot[index] == null)
         {
@@ -373,14 +403,18 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
         int index = av.getColumnSelection().columnAt(i);
 
         if (!av.getColumnSelection().isVisible(index))
+        {
           continue;
+        }
 
         if (anot[index] == null)
         {
           anot[index] = new Annotation(label, "", type, 0);
         }
 
-        anot[index].secondaryStructure = type;
+        
+        anot[index].secondaryStructure = type != 'S' ? type : label
+                .length() == 0 ? ' ' : label.charAt(0);
         anot[index].displayCharacter = label;
 
       }
@@ -406,7 +440,9 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
       int index = columnSelection.columnAt(i);
       // always check for current display state - just in case
       if (!viscols.isVisible(index))
+      {
         continue;
+      }
       String tlabel = null;
       if (anot[index] != null)
       { // LML added stem code
@@ -530,7 +566,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
       return;
     }
 
-    ap.scalePanel.mousePressed(evt);
+    ap.getScalePanel().mousePressed(evt);
 
   }
 
@@ -546,7 +582,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
     graphStretch = -1;
     graphStretchY = -1;
     mouseDragging = false;
-    ap.scalePanel.mouseReleased(evt);
+    ap.getScalePanel().mouseReleased(evt);
   }
 
   /**
@@ -558,7 +594,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
   @Override
   public void mouseEntered(MouseEvent evt)
   {
-    ap.scalePanel.mouseEntered(evt);
+    ap.getScalePanel().mouseEntered(evt);
   }
 
   /**
@@ -570,7 +606,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
   @Override
   public void mouseExited(MouseEvent evt)
   {
-    ap.scalePanel.mouseExited(evt);
+    ap.getScalePanel().mouseExited(evt);
   }
 
   /**
@@ -596,7 +632,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
     }
     else
     {
-      ap.scalePanel.mouseDragged(evt);
+      ap.getScalePanel().mouseDragged(evt);
     }
   }
 
@@ -765,13 +801,15 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
     }
     imgWidth = (av.endRes - av.startRes + 1) * av.charWidth;
     if (imgWidth < 1)
+    {
       return;
+    }
     if (image == null || imgWidth != image.getWidth(this)
             || image.getHeight(this) != getHeight())
     {
       try
       {
-        image = new BufferedImage(imgWidth, ap.annotationPanel.getHeight(),
+        image = new BufferedImage(imgWidth, ap.getAnnotationPanel().getHeight(),
                 BufferedImage.TYPE_INT_RGB);
       } catch (OutOfMemoryError oom)
       {
@@ -975,15 +1013,17 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI,
   @Override
   public int[] getVisibleVRange()
   {
-    if (ap != null && ap.alabels != null)
+    if (ap != null && ap.getAlabels() != null)
     {
-      int sOffset = -ap.alabels.scrollOffset;
+      int sOffset = -ap.getAlabels().getScrollOffset();
       int visHeight = sOffset + ap.annotationSpaceFillerHolder.getHeight();
       bounds[0] = sOffset;
       bounds[1] = visHeight;
       return bounds;
     }
     else
+    {
       return null;
+    }
   }
 }
index 669a52f..09b0fdd 100644 (file)
@@ -315,9 +315,9 @@ public class AppJmol extends GStructureViewer implements Runnable,
         // TODO : Fix multiple seq to one chain issue here.
         ap.getStructureSelectionManager().setMapping(seq, chains,
                 alreadyMapped, AppletFormatAdapter.FILE);
-        if (ap.seqPanel.seqCanvas.fr != null)
+        if (ap.getSeqPanel().seqCanvas.fr != null)
         {
-          ap.seqPanel.seqCanvas.fr.featuresAdded();
+          ap.getSeqPanel().seqCanvas.fr.featuresAdded();
           ap.paintAlignment(true);
         }
 
index 7a1065d..7d4399d 100644 (file)
@@ -25,10 +25,10 @@ import jalview.util.MessageManager;
 
 import java.awt.BorderLayout;
 import java.awt.Component;
+import java.awt.Dialog.ModalExclusionType;
 import java.awt.Dimension;
 import java.awt.Font;
 import java.awt.Rectangle;
-import java.awt.Dialog.ModalExclusionType;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.awt.event.KeyEvent;
@@ -198,7 +198,7 @@ public class BlogReader extends JPanel
       {
         if (parent != null)
         {
-          Cache.log.info("News window closed.");
+          Cache.log.debug("News window closed.");
           jd = null;
           parent.showNews(false);
         }
@@ -246,7 +246,7 @@ public class BlogReader extends JPanel
 
   public BlogReader(Desktop desktop)
   {
-    Cache.log.info("Constructing news reader.");
+    Cache.log.debug("Constructing news reader.");
 
     parent = desktop;
     _channelModel = new ChannelListModel();
@@ -275,10 +275,10 @@ public class BlogReader extends JPanel
     if (setvisible)
     {
 
-      Cache.log.info("Will show jalview news automatically");
+      Cache.log.debug("Will show jalview news automatically");
       showNews();
     }
-    Cache.log.info("Completed construction of reader.");
+    Cache.log.debug("Completed construction of reader.");
 
   }
 
@@ -334,7 +334,7 @@ public class BlogReader extends JPanel
           jd.initDialogFrame(me, false, false, MessageManager.getString("label.news_from_jalview"),
                   bounds.width, bounds.height);
           jd.frame.setModalExclusionType(ModalExclusionType.NO_EXCLUDE);
-          Cache.log.info("Displaying news.");
+          Cache.log.debug("Displaying news.");
           jd.waitForInput();
         }
       }
@@ -421,7 +421,7 @@ public class BlogReader extends JPanel
       {
         jalview.bin.Cache.setDateProperty("JALVIEW_NEWS_RSS_LASTMODIFIED",
                 lastDate);
-        jalview.bin.Cache.log.info("Saved last read date as "
+        jalview.bin.Cache.log.debug("Saved last read date as "
                 + jalview.bin.Cache.date_format.format(lastDate));
 
       }
@@ -758,16 +758,16 @@ public class BlogReader extends JPanel
               + jalview.bin.Cache.date_format.format(lastread.getTime()));
       if (me.isNewsNew())
       {
-        Cache.log.info("There is news to read.");
+        Cache.log.debug("There is news to read.");
       }
       else
       {
-        Cache.log.info("There is no new news.");
+        Cache.log.debug("There is no new news.");
         me.xf.setTitle("Testing : Last read is " + me.lastDate);
         me.showNews();
         me.xf.toFront();
       }
-      Cache.log.info("Waiting for closure.");
+      Cache.log.debug("Waiting for closure.");
       do
       {
         try
@@ -781,11 +781,11 @@ public class BlogReader extends JPanel
 
       if (me.isNewsNew())
       {
-        Cache.log.info("Still new news after reader displayed.");
+        Cache.log.debug("Still new news after reader displayed.");
       }
       if (lastread.getTime().before(me.lastDate))
       {
-        Cache.log.info("The news was read.");
+        Cache.log.debug("The news was read.");
         lastread.setTime(me.lastDate);
       }
       else
index 75aed5d..48123fa 100644 (file)
@@ -144,6 +144,9 @@ public class ChimeraViewFrame extends GStructureViewer implements Runnable,
       _alignwith = new Vector<AlignmentPanel>();
     }
 
+    // save As not yet implemented
+    savemenu.setVisible(false);
+
     ViewSelectionMenu seqColourBy = new ViewSelectionMenu(
             MessageManager.getString("label.colour_by"), this, _colourwith,
             new ItemListener()
@@ -241,9 +244,9 @@ public class ChimeraViewFrame extends GStructureViewer implements Runnable,
         // TODO : Fix multiple seq to one chain issue here.
         ap.getStructureSelectionManager().setMapping(seq, chains,
                 alreadyMapped, AppletFormatAdapter.FILE);
-        if (ap.seqPanel.seqCanvas.fr != null)
+        if (ap.getSeqPanel().seqCanvas.fr != null)
         {
-          ap.seqPanel.seqCanvas.fr.featuresAdded();
+          ap.getSeqPanel().seqCanvas.fr.featuresAdded();
           ap.paintAlignment(true);
         }
 
@@ -837,8 +840,13 @@ public class ChimeraViewFrame extends GStructureViewer implements Runnable,
     {
       if (progressBar != null)
       {
-        progressBar.setProgressBar(
-                MessageManager.getString("label.state_completed"), hdl);
+        progressBar
+                .setProgressBar(
+                        pdbid
+                                + " "
+                                + MessageManager
+                                        .getString("label.state_completed"),
+                        hdl);
       }
     }
     /*
index faffd89..b8f629a 100644 (file)
@@ -26,6 +26,7 @@ import jalview.io.FormatAdapter;
 import jalview.io.IdentifyFile;
 import jalview.io.JalviewFileChooser;
 import jalview.io.JalviewFileView;
+import jalview.structure.StructureSelectionManager;
 import jalview.util.ImageMaker;
 import jalview.util.MessageManager;
 import jalview.ws.params.ParamManager;
@@ -286,7 +287,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     instance = this;
     doVamsasClientCheck();
     doGroovyCheck();
-
+    doConfigureStructurePrefs();
     setTitle("Jalview " + jalview.bin.Cache.getProperty("VERSION"));
     setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     boolean selmemusage = jalview.bin.Cache.getDefault("SHOW_MEMUSAGE",
@@ -322,8 +323,11 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     }
     jconsole = new Console(this, showjconsole);
     // add essential build information
-    jconsole.setHeader("Jalview Desktop "
+    jconsole.setHeader("Jalview Version: "
             + jalview.bin.Cache.getProperty("VERSION") + "\n"
+            + "Jalview Installation: "
+            + jalview.bin.Cache.getDefault("INSTALLATION", "unknown")
+            + "\n"
             + "Build Date: "
             + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown") + "\n"
             + "Java version: " + System.getProperty("java.version") + "\n"
@@ -416,6 +420,27 @@ public class Desktop extends jalview.jbgui.GDesktop implements
             });
   }
 
+  public void doConfigureStructurePrefs()
+  {
+    // configure services
+    StructureSelectionManager ssm = StructureSelectionManager
+            .getStructureSelectionManager(this);
+    if (jalview.bin.Cache.getDefault(Preferences.ADD_SS_ANN, true))
+    {
+      ssm.setAddTempFacAnnot(jalview.bin.Cache.getDefault(
+              Preferences.ADD_TEMPFACT_ANN, true));
+    ssm.setProcessSecondaryStructure(jalview.bin.Cache.getDefault(Preferences.STRUCT_FROM_PDB, true));
+    ssm.setSecStructServices(jalview.bin.Cache.getDefault(Preferences.USE_RNAVIEW,
+            true));
+    }
+    else
+    {
+      ssm.setAddTempFacAnnot(false);
+      ssm.setProcessSecondaryStructure(false);
+      ssm.setSecStructServices(false);
+    }
+  }
+
   public void checkForNews()
   {
     final Desktop me = this;
@@ -606,38 +631,85 @@ public class Desktop extends jalview.jbgui.GDesktop implements
    * Adds and opens the given frame to the desktop
    * 
    * @param frame
-   *          DOCUMENT ME!
+   *          Frame to show
    * @param title
-   *          DOCUMENT ME!
+   *          Visible Title
    * @param w
-   *          DOCUMENT ME!
+   *          width
    * @param h
-   *          DOCUMENT ME!
+   *          height
    */
   public static synchronized void addInternalFrame(
           final JInternalFrame frame, String title, int w, int h)
   {
-    addInternalFrame(frame, title, w, h, true);
+    addInternalFrame(frame, title, true, w, h, true);
   }
 
+
   /**
-   * DOCUMENT ME!
+   * Add an internal frame to the Jalview desktop
    * 
    * @param frame
-   *          DOCUMENT ME!
+   *          Frame to show
    * @param title
-   *          DOCUMENT ME!
+   *          Visible Title
+   * @param makeVisible
+   *          When true, display frame immediately, otherwise, caller must call
+   *          setVisible themselves.
    * @param w
-   *          DOCUMENT ME!
+   *          width
    * @param h
-   *          DOCUMENT ME!
+   *          height
+   */
+  public static synchronized void addInternalFrame(
+          final JInternalFrame frame, String title, boolean makeVisible,
+          int w, int h)
+  {
+    addInternalFrame(frame, title, makeVisible, w, h, true);
+  }
+
+  /**
+   * Add an internal frame to the Jalview desktop and make it visible
+   * 
+   * @param frame
+   *          Frame to show
+   * @param title
+   *          Visible Title
+   * @param w
+   *          width
+   * @param h
+   *          height
    * @param resizable
-   *          DOCUMENT ME!
+   *          Allow resize
    */
   public static synchronized void addInternalFrame(
           final JInternalFrame frame, String title, int w, int h,
           boolean resizable)
   {
+    addInternalFrame(frame, title, true, w, h, resizable);
+  }
+
+  /**
+   * Add an internal frame to the Jalview desktop
+   * 
+   * @param frame
+   *          Frame to show
+   * @param title
+   *          Visible Title
+   * @param makeVisible
+   *          When true, display frame immediately, otherwise, caller must call
+   *          setVisible themselves.
+   * @param w
+   *          width
+   * @param h
+   *          height
+   * @param resizable
+   *          Allow resize
+   */
+  public static synchronized void addInternalFrame(
+          final JInternalFrame frame, String title, boolean makeVisible,
+          int w, int h, boolean resizable)
+  {
 
     // TODO: allow callers to determine X and Y position of frame (eg. via
     // bounds object).
@@ -662,7 +734,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
 
     openFrameCount++;
 
-    frame.setVisible(true);
+    frame.setVisible(makeVisible);
     frame.setClosable(true);
     frame.setResizable(resizable);
     frame.setMaximizable(resizable);
@@ -1039,7 +1111,9 @@ public class Desktop extends jalview.jbgui.GDesktop implements
   {
     CutAndPasteTransfer cap = new CutAndPasteTransfer();
     cap.setForInput(viewport);
-    Desktop.addInternalFrame(cap, MessageManager.getString("label.cut_paste_alignmen_file"), 600, 500);
+    Desktop.addInternalFrame(cap,
+            MessageManager.getString("label.cut_paste_alignmen_file"),
+            true, 600, 500);
   }
 
   /*
@@ -2580,7 +2654,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
                                                 + ermsg
                                                 + "</td></tr></table>"
                                                 + "<p>It may be that you have invalid JABA URLs<br/>in your web service preferences,"
-                                                + " or mis-configured HTTP proxy settings.</p>"
+                                                + "<br>or as a command-line argument, or mis-configured HTTP proxy settings.</p>"
                                                 + "<p>Check the <em>Connections</em> and <em>Web services</em> tab<br/>of the"
                                                 + " Tools->Preferences dialog box to change them.</p></html>"),
                                 "Web Service Configuration Problem",
index 0e0e2cb..9f5f3af 100644 (file)
@@ -55,10 +55,10 @@ public class FeatureRenderer extends jalview.renderer.seqfeatures.FeatureRendere
     super();
     this.ap = ap;
     this.av = ap.av;
-    if (ap != null && ap.seqPanel != null && ap.seqPanel.seqCanvas != null
-            && ap.seqPanel.seqCanvas.fr != null)
+    if (ap != null && ap.getSeqPanel() != null && ap.getSeqPanel().seqCanvas != null
+            && ap.getSeqPanel().seqCanvas.fr != null)
     {
-      transferSettings(ap.seqPanel.seqCanvas.fr);
+      transferSettings(ap.getSeqPanel().seqCanvas.fr);
     }
   }
 
@@ -177,7 +177,7 @@ public class FeatureRenderer extends jalview.renderer.seqfeatures.FeatureRendere
             highlight.addResult(sequences[0], features[index].getBegin(),
                     features[index].getEnd());
 
-            ap.seqPanel.seqCanvas.highlightSearchResults(highlight);
+            ap.getSeqPanel().seqCanvas.highlightSearchResults(highlight);
 
           }
           Object col = getFeatureStyle(name.getText());
index 66bd2fe..dc0a127 100644 (file)
@@ -23,6 +23,7 @@ package jalview.gui;
 import jalview.bin.Cache;
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
+import jalview.gui.Help.HelpId;
 import jalview.io.JalviewFileChooser;
 import jalview.schemes.AnnotationColourGradient;
 import jalview.schemes.GraduatedColor;
@@ -57,6 +58,7 @@ import java.util.List;
 import java.util.Set;
 import java.util.Vector;
 
+import javax.help.HelpSetException;
 import javax.swing.AbstractCellEditor;
 import javax.swing.BorderFactory;
 import javax.swing.Icon;
@@ -130,7 +132,19 @@ public class FeatureSettings extends JPanel
       ex.printStackTrace();
     }
 
-    table = new JTable();
+    table = new JTable() {
+      @Override
+      public String getToolTipText(MouseEvent e) {
+        if (table.columnAtPoint(e.getPoint()) == 0) {
+          /*
+           * Tooltip for feature name only
+           */
+          return JvSwingUtils.wrapTooltip(true,
+                MessageManager.getString("label.feature_settings_click_drag"));
+        }
+        return null;
+      }
+    };
     table.getTableHeader().setFont(new Font("Verdana", Font.PLAIN, 12));
     table.setFont(new Font("Verdana", Font.PLAIN, 12));
     table.setDefaultRenderer(Color.class, new ColorRenderer());
@@ -200,8 +214,8 @@ public class FeatureSettings extends JPanel
         }
       }
     });
-    table.setToolTipText(JvSwingUtils
-                    .wrapTooltip(true, MessageManager.getString("label.feature_settings_click_drag")));
+//    table.setToolTipText(JvSwingUtils.wrapTooltip(true,
+//            MessageManager.getString("label.feature_settings_click_drag")));
     scrollPane.setViewportView(table);
 
     dassourceBrowser = new DasSourceBrowser(this);
@@ -494,7 +508,7 @@ public class FeatureSettings extends JPanel
       public void itemStateChanged(ItemEvent evt)
       {
         fr.setGroupVisibility(check.getText(), check.isSelected());
-        af.alignPanel.seqPanel.seqCanvas.repaint();
+        af.alignPanel.getSeqPanel().seqCanvas.repaint();
         if (af.alignPanel.overviewPanel != null)
         {
           af.alignPanel.overviewPanel.updateOverviewImage();
@@ -997,7 +1011,9 @@ public class FeatureSettings extends JPanel
 
   JButton sortByDens = new JButton();
 
-  JPanel transbuttons = new JPanel(new GridLayout(4, 1));
+  JButton help = new JButton();
+
+  JPanel transbuttons = new JPanel(new GridLayout(5, 1));
 
   private void jbInit() throws Exception
   {
@@ -1043,6 +1059,21 @@ public class FeatureSettings extends JPanel
         af.avc.sortAlignmentByFeatureDensity(null);
       }
     });
+    help.setFont(JvSwingUtils.getLabelFont());
+    help.setText(MessageManager.getString("action.help"));
+    help.addActionListener(new ActionListener()
+    {
+      public void actionPerformed(ActionEvent e)
+      {
+        try
+        {
+          Help.showHelpWindow(HelpId.SequenceFeatureSettings);
+        } catch (HelpSetException e1)
+        {
+          e1.printStackTrace();
+        }
+      }
+    });
     cancel.setFont(JvSwingUtils.getLabelFont());
     cancel.setText(MessageManager.getString("action.cancel"));
     cancel.addActionListener(new ActionListener()
@@ -1091,6 +1122,8 @@ public class FeatureSettings extends JPanel
     });
 
     transparency.setMaximum(70);
+    transparency.setToolTipText(MessageManager
+            .getString("label.transparency_tip"));
     fetchDAS.setText(MessageManager.getString("label.fetch_das_features"));
     fetchDAS.addActionListener(new ActionListener()
     {
@@ -1126,6 +1159,9 @@ public class FeatureSettings extends JPanel
     transbuttons.add(invert);
     transbuttons.add(sortByScore);
     transbuttons.add(sortByDens);
+    transbuttons.add(help);
+    JPanel sliderPanel = new JPanel();
+    sliderPanel.add(transparency);
     transPanel.add(transparency);
     transPanel.add(transbuttons);
     buttonPanel.add(ok);
index 8eddc06..acdaf92 100755 (executable)
@@ -182,7 +182,7 @@ public class Finder extends GFinder
               searchResults.getResultEnd(i), "Search Results");
     }
 
-    if (ap.seqPanel.seqCanvas.getFeatureRenderer().amendFeatures(seqs,
+    if (ap.getSeqPanel().seqCanvas.getFeatureRenderer().amendFeatures(seqs,
             features, true, ap))
     {
       ap.alignFrame.showSeqFeatures.setSelected(true);
@@ -229,11 +229,11 @@ public class Finder extends GFinder
     if ((idMatch.size() > 0))
     {
       haveResults = true;
-      ap.idPanel.highlightSearchResults(idMatch);
+      ap.getIdPanel().highlightSearchResults(idMatch);
     }
     else
     {
-      ap.idPanel.highlightSearchResults(null);
+      ap.getIdPanel().highlightSearchResults(null);
     }
 
     if (searchResults.getSize() > 0)
index b6116d9..36e4c52 100755 (executable)
@@ -129,7 +129,7 @@ public class FontChooser extends GFontChooser
   public void smoothFont_actionPerformed(ActionEvent e)
   {
     ap.av.antiAlias = smoothFont.isSelected();
-    ap.annotationPanel.image = null;
+    ap.getAnnotationPanel().image = null;
     ap.paintAlignment(true);
   }
 
diff --git a/src/jalview/gui/HTMLOptions.java b/src/jalview/gui/HTMLOptions.java
new file mode 100644 (file)
index 0000000..0ef4710
--- /dev/null
@@ -0,0 +1,143 @@
+package jalview.gui;
+
+import jalview.util.MessageManager;
+
+import java.awt.BorderLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+
+public class HTMLOptions extends JPanel
+{
+  JDialog dialog;
+
+  public boolean cancelled = false;
+
+  String value;
+
+  public HTMLOptions()
+  {
+    try
+    {
+      jbInit();
+    } catch (Exception ex)
+    {
+      ex.printStackTrace();
+    }
+
+    ButtonGroup bg = new ButtonGroup();
+    bg.add(lineart);
+    bg.add(text);
+
+    JOptionPane pane = new JOptionPane(null, JOptionPane.DEFAULT_OPTION,
+            JOptionPane.DEFAULT_OPTION, null, new Object[]
+            { this });
+
+    dialog = pane.createDialog(Desktop.desktop, "HTML Rendering options");
+    dialog.setVisible(true);
+
+  }
+
+  private void jbInit() throws Exception
+  {
+    lineart.setFont(JvSwingUtils.getLabelFont());
+    lineart.setText(MessageManager.getString("label.lineart"));
+    text.setFont(JvSwingUtils.getLabelFont());
+    text.setText(MessageManager.getString("action.text"));
+    text.setSelected(true);
+    askAgain.setFont(JvSwingUtils.getLabelFont());
+    askAgain.setText(MessageManager.getString("label.dont_ask_me_again"));
+    ok.setText(MessageManager.getString("action.ok"));
+    ok.addActionListener(new ActionListener()
+    {
+      public void actionPerformed(ActionEvent e)
+      {
+        ok_actionPerformed(e);
+      }
+    });
+    cancel.setText(MessageManager.getString("action.cancel"));
+    cancel.addActionListener(new ActionListener()
+    {
+      public void actionPerformed(ActionEvent e)
+      {
+        cancel_actionPerformed(e);
+      }
+    });
+    jLabel1.setFont(JvSwingUtils.getLabelFont());
+    jLabel1.setText("Select HTML character rendering style");
+    this.setLayout(borderLayout1);
+    jPanel3.setBorder(BorderFactory.createEtchedBorder());
+    jPanel2.add(text);
+    jPanel2.add(lineart);
+    jPanel2.add(askAgain);
+    jPanel1.add(ok);
+    jPanel1.add(cancel);
+    jPanel3.add(jLabel1);
+    jPanel3.add(jPanel2);
+    this.add(jPanel3, java.awt.BorderLayout.CENTER);
+    this.add(jPanel1, java.awt.BorderLayout.SOUTH);
+  }
+
+  JRadioButton lineart = new JRadioButton();
+
+  JRadioButton text = new JRadioButton();
+
+  JCheckBox askAgain = new JCheckBox();
+
+  JButton ok = new JButton();
+
+  JButton cancel = new JButton();
+
+  JPanel jPanel1 = new JPanel();
+
+  JLabel jLabel1 = new JLabel();
+
+  JPanel jPanel2 = new JPanel();
+
+  JPanel jPanel3 = new JPanel();
+
+  BorderLayout borderLayout1 = new BorderLayout();
+
+  public void ok_actionPerformed(ActionEvent e)
+  {
+    if (lineart.isSelected())
+    {
+      value = "Lineart";
+    }
+    else
+    {
+      value = "Text";
+    }
+
+    if (!askAgain.isSelected())
+    {
+      jalview.bin.Cache.applicationProperties.remove("HTML_RENDERING");
+    }
+    else
+    {
+      jalview.bin.Cache.setProperty("HTML_RENDERING", value);
+    }
+
+    dialog.setVisible(false);
+  }
+
+  public void cancel_actionPerformed(ActionEvent e)
+  {
+    cancelled = true;
+    dialog.setVisible(false);
+  }
+
+  public String getValue()
+  {
+    return value;
+  }
+}
index dac17c0..b07cc4e 100644 (file)
@@ -2,6 +2,7 @@ package jalview.gui;
 
 import java.net.URL;
 
+import javax.help.BadIDException;
 import javax.help.HelpBroker;
 import javax.help.HelpSet;
 import javax.help.HelpSetException;
@@ -14,6 +15,24 @@ import javax.help.HelpSetException;
  */
 public class Help
 {
+  public enum HelpId
+  {
+    Home("home"), SequenceFeatureSettings("seqfeatures.settings"), StructureViewer(
+            "viewingpdbs");
+
+    private String id;
+
+    private HelpId(String loc)
+    {
+      this.id = loc;
+    }
+
+    @Override
+    public String toString()
+    {
+      return this.id;
+    }
+  }
 
   private static final long HALF_A_MO = 500; // half a second
 
@@ -33,10 +52,11 @@ public class Help
    * 
    * This is a workaround for issue JAL-914 - both Desktop and AlignFrame
    * responding to F1 key, resulting in duplicate help windows opened.
+   * @param id TODO
    * 
    * @throws HelpSetException
    */
-  public static void showHelpWindow() throws HelpSetException
+  public static void showHelpWindow(HelpId id) throws HelpSetException
   {
     long timeNow = System.currentTimeMillis();
 
@@ -48,8 +68,21 @@ public class Help
       HelpSet hs = new HelpSet(cl, url);
 
       HelpBroker hb = hs.createHelpBroker();
-      hb.setCurrentID("home");
+      try
+      {
+        hb.setCurrentID(id.toString());
+      } catch (BadIDException bad)
+      {
+        System.out.println("Bad help link: " + id.toString()
+                + ": must match a target in help.jhm");
+        throw bad;
+      }
       hb.setDisplayed(true);
     }
   }
+
+  public static void showHelpWindow() throws HelpSetException
+  {
+    showHelpWindow(HelpId.Home);
+  }
 }
index 91b23e4..6810fed 100755 (executable)
@@ -60,7 +60,7 @@ public class IdCanvas extends JPanel
 
   AnnotationPanel ap;
 
-  Font idfont;
+  private Font idfont;
 
   /**
    * Creates a new IdCanvas object.
@@ -119,7 +119,7 @@ public class IdCanvas extends JPanel
       gg.setColor(Color.black);
     }
 
-    if (av.rightAlignIds)
+    if (av.isRightAlignIds())
     {
       xPos = panelWidth
               - fm.stringWidth(s.getDisplayId(av.getShowJVSuffix())) - 4;
@@ -247,15 +247,15 @@ public class IdCanvas extends JPanel
   {
     if (av.seqNameItalics)
     {
-      idfont = new Font(av.getFont().getName(), Font.ITALIC, av.getFont()
-              .getSize());
+      setIdfont(new Font(av.getFont().getName(), Font.ITALIC, av.getFont()
+              .getSize()));
     }
     else
     {
-      idfont = av.getFont();
+      setIdfont(av.getFont());
     }
 
-    gg.setFont(idfont);
+    gg.setFont(getIdfont());
     fm = gg.getFontMetrics();
 
     if (av.antiAlias)
@@ -279,7 +279,7 @@ public class IdCanvas extends JPanel
 
       int annotationHeight = 0;
 
-      if (av.showAnnotation)
+      if (av.isShowAnnotation())
       {
         if (ap == null)
         {
@@ -316,13 +316,13 @@ public class IdCanvas extends JPanel
           }
           else
           {
-            gg.setFont(idfont);
+            gg.setFont(getIdfont());
           }
 
           drawIdString(gg, s, i, 0, ypos);
         }
 
-        if (labels != null && av.showAnnotation)
+        if (labels != null && av.isShowAnnotation())
         {
           gg.translate(0, ypos + (alheight * av.charHeight));
           labels.drawComponent(gg, getWidth());
@@ -383,7 +383,7 @@ public class IdCanvas extends JPanel
 
         String string = sequence.getDisplayId(av.getShowJVSuffix());
 
-        if (av.rightAlignIds)
+        if (av.isRightAlignIds())
         {
           xPos = panelWidth - fm.stringWidth(string) - 4;
         }
@@ -474,7 +474,7 @@ public class IdCanvas extends JPanel
     }
     else
     {
-      gg.setFont(idfont);
+      gg.setFont(getIdfont());
     }
   }
 
@@ -489,4 +489,14 @@ public class IdCanvas extends JPanel
     searchResults = list;
     repaint();
   }
+
+  public Font getIdfont()
+  {
+    return idfont;
+  }
+
+  public void setIdfont(Font idfont)
+  {
+    this.idfont = idfont;
+  }
 }
index 94017cd..a22e918 100755 (executable)
@@ -52,7 +52,7 @@ import javax.swing.ToolTipManager;
 public class IdPanel extends JPanel implements MouseListener,
         MouseMotionListener, MouseWheelListener
 {
-  protected IdCanvas idCanvas;
+  private IdCanvas idCanvas;
 
   protected AlignViewport av;
 
@@ -81,11 +81,11 @@ public class IdPanel extends JPanel implements MouseListener,
   {
     this.av = av;
     alignPanel = parent;
-    idCanvas = new IdCanvas(av);
+    setIdCanvas(new IdCanvas(av));
     linkImageURL = getClass().getResource("/images/link.gif").toString();
     seqAnnotReport = new SequenceAnnotationReport(linkImageURL);
     setLayout(new BorderLayout());
-    add(idCanvas, BorderLayout.CENTER);
+    add(getIdCanvas(), BorderLayout.CENTER);
     addMouseListener(this);
     addMouseMotionListener(this);
     addMouseWheelListener(this);
@@ -102,7 +102,7 @@ public class IdPanel extends JPanel implements MouseListener,
   @Override
   public void mouseMoved(MouseEvent e)
   {
-    SeqPanel sp = alignPanel.seqPanel;
+    SeqPanel sp = alignPanel.getSeqPanel();
     int seq = Math.max(0, sp.findSeq(e));
     if (seq > -1 && seq < av.getAlignment().getHeight())
     {
@@ -128,7 +128,7 @@ public class IdPanel extends JPanel implements MouseListener,
   {
     mouseDragging = true;
 
-    int seq = Math.max(0, alignPanel.seqPanel.findSeq(e));
+    int seq = Math.max(0, alignPanel.getSeqPanel().findSeq(e));
 
     if (seq < lastid)
     {
@@ -202,7 +202,7 @@ public class IdPanel extends JPanel implements MouseListener,
       return;
     }
 
-    int seq = alignPanel.seqPanel.findSeq(e);
+    int seq = alignPanel.getSeqPanel().findSeq(e);
     String url = null;
     int i = 0;
     String id = av.getAlignment().getSequenceAt(seq).getName();
@@ -315,7 +315,7 @@ public class IdPanel extends JPanel implements MouseListener,
       return;
     }
 
-    int seq = alignPanel.seqPanel.findSeq(e);
+    int seq = alignPanel.getSeqPanel().findSeq(e);
 
     if (SwingUtilities.isRightMouseButton(e))
     {
@@ -443,7 +443,7 @@ public class IdPanel extends JPanel implements MouseListener,
    */
   public void highlightSearchResults(List<SequenceI> list)
   {
-    idCanvas.setHighlighted(list);
+    getIdCanvas().setHighlighted(list);
 
     if (list == null)
     {
@@ -459,6 +459,16 @@ public class IdPanel extends JPanel implements MouseListener,
     }
   }
 
+  public IdCanvas getIdCanvas()
+  {
+    return idCanvas;
+  }
+
+  public void setIdCanvas(IdCanvas idCanvas)
+  {
+    this.idCanvas = idCanvas;
+  }
+
   // this class allows scrolling off the bottom of the visible alignment
   class ScrollThread extends Thread
   {
index 0c53c58..6c9c400 100755 (executable)
@@ -119,12 +119,12 @@ public class IdwidthAdjuster extends JPanel implements MouseListener,
   {
     active = true;
 
-    Dimension d = ap.idPanel.idCanvas.getPreferredSize();
+    Dimension d = ap.getIdPanel().getIdCanvas().getPreferredSize();
     int dif = evt.getX() - oldX;
 
     if (((d.width + dif) > 20) || (dif > 0))
     {
-      ap.idPanel.idCanvas.setPreferredSize(new Dimension(d.width + dif,
+      ap.getIdPanel().getIdCanvas().setPreferredSize(new Dimension(d.width + dif,
               d.height));
       ap.paintAlignment(true);
     }
index 2ceb245..5d11901 100644 (file)
@@ -500,7 +500,7 @@ public class Jalview2XML
     for (String dssids : dsses.keySet())
     {
       AlignFrame _af = dsses.get(dssids);
-      String jfileName = MessageManager.formatMessage("label.dataset_for", new String[]{fileName,_af.getTitle()});
+      String jfileName = fileName + " Dataset for " + _af.getTitle();
       if (!jfileName.endsWith(".xml"))
       {
         jfileName = jfileName + ".xml";
@@ -1129,7 +1129,7 @@ public class Jalview2XML
       view.setShowBoxes(av.getShowBoxes());
       view.setShowColourText(av.getColourText());
       view.setShowFullId(av.getShowJVSuffix());
-      view.setRightAlignIds(av.rightAlignIds);
+      view.setRightAlignIds(av.isRightAlignIds());
       view.setShowSequenceFeatures(av.isShowSequenceFeatures());
       view.setShowText(av.getShowText());
       view.setShowUnconserved(av.getShowUnconserved());
@@ -1151,7 +1151,7 @@ public class Jalview2XML
       {
         jalview.schemabinding.version2.FeatureSettings fs = new jalview.schemabinding.version2.FeatureSettings();
 
-        String[] renderOrder = ap.seqPanel.seqCanvas.getFeatureRenderer()
+        String[] renderOrder = ap.getSeqPanel().seqCanvas.getFeatureRenderer()
                 .getRenderOrder().toArray(new String[0]);
 
         Vector settingsAdded = new Vector();
@@ -1161,7 +1161,7 @@ public class Jalview2XML
         {
           for (int ro = 0; ro < renderOrder.length; ro++)
           {
-            gstyle = ap.seqPanel.seqCanvas.getFeatureRenderer()
+            gstyle = ap.getSeqPanel().seqCanvas.getFeatureRenderer()
                     .getFeatureStyle(renderOrder[ro]);
             Setting setting = new Setting();
             setting.setType(renderOrder[ro]);
@@ -1179,13 +1179,13 @@ public class Jalview2XML
             }
             else
             {
-              setting.setColour(ap.seqPanel.seqCanvas.getFeatureRenderer()
+              setting.setColour(ap.getSeqPanel().seqCanvas.getFeatureRenderer()
                       .getColour(renderOrder[ro]).getRGB());
             }
 
             setting.setDisplay(av.getFeaturesDisplayed().isVisible(
                     renderOrder[ro]));
-            float rorder = ap.seqPanel.seqCanvas.getFeatureRenderer()
+            float rorder = ap.getSeqPanel().seqCanvas.getFeatureRenderer()
                     .getOrder(renderOrder[ro]);
             if (rorder > -1)
             {
@@ -1197,7 +1197,7 @@ public class Jalview2XML
         }
 
         // Make sure we save none displayed feature settings
-        Iterator en = ap.seqPanel.seqCanvas.getFeatureRenderer()
+        Iterator en = ap.getSeqPanel().seqCanvas.getFeatureRenderer()
                 .getFeatureColours().keySet().iterator();
         while (en.hasNext())
         {
@@ -1209,11 +1209,11 @@ public class Jalview2XML
 
           Setting setting = new Setting();
           setting.setType(key);
-          setting.setColour(ap.seqPanel.seqCanvas.getFeatureRenderer()
+          setting.setColour(ap.getSeqPanel().seqCanvas.getFeatureRenderer()
                   .getColour(key).getRGB());
 
           setting.setDisplay(false);
-          float rorder = ap.seqPanel.seqCanvas.getFeatureRenderer()
+          float rorder = ap.getSeqPanel().seqCanvas.getFeatureRenderer()
                   .getOrder(key);
           if (rorder > -1)
           {
@@ -1223,7 +1223,7 @@ public class Jalview2XML
           settingsAdded.addElement(key);
         }
         // is groups actually supposed to be a map here ?
-        en = ap.seqPanel.seqCanvas.getFeatureRenderer().getFeatureGroups()
+        en = ap.getSeqPanel().seqCanvas.getFeatureRenderer().getFeatureGroups()
                 .iterator();
         Vector groupsAdded = new Vector();
         while (en.hasNext())
@@ -1235,7 +1235,7 @@ public class Jalview2XML
           }
           Group g = new Group();
           g.setName(grp);
-          g.setDisplay(((Boolean) ap.seqPanel.seqCanvas
+          g.setDisplay(((Boolean) ap.getSeqPanel().seqCanvas
                   .getFeatureRenderer().checkGroupVisibility(grp, false))
                   .booleanValue());
           fs.addGroup(g);
@@ -1461,8 +1461,7 @@ public class Jalview2XML
           }
 
           ae.setPosition(a);
-          if (aa[i].annotations[a].secondaryStructure != ' '
-                  && aa[i].annotations[a].secondaryStructure != '\0')
+          if (aa[i].annotations[a].secondaryStructure > ' ')
           {
             ae.setSecondaryStructure(aa[i].annotations[a].secondaryStructure
                     + "");
@@ -2319,7 +2318,10 @@ public class Jalview2XML
     }
     else
     {
-      recoverDatasetFor(vamsasSet, al);
+      // recover dataset - passing on flag indicating if this a 'viewless'
+      // sequence set (a.k.a. a stored dataset for the project)
+      recoverDatasetFor(vamsasSet, al, object.getJalviewModelSequence()
+              .getViewportCount() == 0);
     }
     // ///////////////////////////////
 
@@ -3477,7 +3479,7 @@ public class Jalview2XML
 
     af.viewport.setConservationSelected(view.getConservationSelected());
     af.viewport.setShowJVSuffix(view.getShowFullId());
-    af.viewport.rightAlignIds = view.getRightAlignIds();
+    af.viewport.setRightAlignIds(view.getRightAlignIds());
     af.viewport.setFont(new java.awt.Font(view.getFontName(), view
             .getFontStyle(), view.getFontSize()));
     af.alignPanel.fontChanged();
@@ -3674,7 +3676,7 @@ public class Jalview2XML
       // jms.getFeatureSettings().getTransparency() : 0.0, featureOrder);
       FeatureRendererSettings frs = new FeatureRendererSettings(
               renderOrder, fgtable, featureColours, 1.0f, featureOrder);
-      af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer()
+      af.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer()
               .transferSettings(frs);
 
     }
@@ -3995,7 +3997,8 @@ public class Jalview2XML
     }
   }
 
-  private void recoverDatasetFor(SequenceSet vamsasSet, Alignment al)
+  private void recoverDatasetFor(SequenceSet vamsasSet, Alignment al,
+          boolean ignoreUnrefed)
   {
     jalview.datamodel.Alignment ds = getDatasetFor(vamsasSet.getDatasetId());
     Vector dseqs = null;
@@ -4007,7 +4010,7 @@ public class Jalview2XML
     for (int i = 0, iSize = vamsasSet.getSequenceCount(); i < iSize; i++)
     {
       Sequence vamsasSeq = vamsasSet.getSequence(i);
-      ensureJalviewDatasetSequence(vamsasSeq, ds, dseqs);
+      ensureJalviewDatasetSequence(vamsasSeq, ds, dseqs, ignoreUnrefed);
     }
     // create a new dataset
     if (ds == null)
@@ -4020,7 +4023,7 @@ public class Jalview2XML
       addDatasetRef(vamsasSet.getDatasetId(), ds);
     }
     // set the dataset for the newly imported alignment.
-    if (al.getDataset() == null)
+    if (al.getDataset() == null && !ignoreUnrefed)
     {
       al.setDataset(ds);
     }
@@ -4036,7 +4039,7 @@ public class Jalview2XML
    *          vector to add new dataset sequence to
    */
   private void ensureJalviewDatasetSequence(Sequence vamsasSeq,
-          AlignmentI ds, Vector dseqs)
+          AlignmentI ds, Vector dseqs, boolean ignoreUnrefed)
   {
     // JBP TODO: Check this is called for AlCodonFrames to support recovery of
     // xRef Codon Maps
@@ -4047,7 +4050,10 @@ public class Jalview2XML
     {
       dsq = sq.getDatasetSequence();
     }
-
+    if (sq == null && ignoreUnrefed)
+    {
+      return;
+    }
     String sqid = vamsasSeq.getDsseqid();
     if (dsq == null)
     {
index f1879c1..885d42a 100755 (executable)
@@ -438,7 +438,7 @@ public class Jalview2XML_V1
         }
       }
       FeatureRendererSettings frs = new FeatureRendererSettings(renderOrder, new Hashtable(), featureColours, 1.0f, null);
-      af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().transferSettings(frs);
+      af.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer().transferSettings(frs);
     }
 
     af.setMenusFromViewport(af.viewport);
index d22c46c..ece8856 100644 (file)
@@ -94,11 +94,4 @@ public class JalviewChimeraBindingModel extends JalviewChimeraBinding
     // TODO Auto-generated method stub
 
   }
-
-  @Override
-  public void showUrl(String url, String target)
-  {
-    // TODO Auto-generated method stub
-
-  }
 }
index d546584..e433243 100644 (file)
@@ -53,14 +53,14 @@ public final class JvSwingUtils
    */
   public static String wrapTooltip(boolean enclose, String ttext)
   {
-         
     if (ttext.length() < 60)
     {
-      return enclose ? "<html>"+ttext+"</html>" : ttext;
+      return enclose ? "<html>" + ttext + "</html>" : ttext;
     }
     else
     {
-      return (enclose ? "<html>" : "") + "<table width=350 border=0><tr><td>" + ttext
+      return (enclose ? "<html>" : "")
+              + "<table width=350 border=0><tr><td>" + ttext
               + "</td></tr></table>" + ((enclose ? "</html>" : ""));
     }
   }
index b4c2923..5df60d2 100755 (executable)
@@ -256,7 +256,7 @@ public class OverviewPanel extends JPanel implements Runnable
 
     if (av.isShowSequenceFeatures())
     {
-      fr.transferSettings(ap.seqPanel.seqCanvas.getFeatureRenderer());
+      fr.transferSettings(ap.getSeqPanel().seqCanvas.getFeatureRenderer());
     }
 
     int alwidth = av.getAlignment().getWidth();
index dcddf88..bc2c27c 100755 (executable)
  */
 package jalview.gui;
 
-import java.util.*;
-import java.awt.event.*;
-
-import jalview.analysis.*;
-import jalview.datamodel.*;
-import jalview.jbgui.*;
+import jalview.analysis.AlignSeq;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceI;
+import jalview.jbgui.GPairwiseAlignPanel;
 import jalview.util.MessageManager;
 
+import java.awt.event.ActionEvent;
+import java.util.Vector;
+
 /**
  * DOCUMENT ME!
  * 
@@ -97,13 +99,8 @@ public class PairwiseAlignPanel extends GPairwiseAlignPanel
         totscore = totscore + scores[i][j];
 
         textarea.append(as.getOutput());
-        seq = new Sequence(as.getS1().getName(), as.getAStr1(), as.getS1()
-                .getStart(), as.getS1().getEnd());
-        sequences.add(seq);
-
-        seq = new Sequence(as.getS2().getName(), as.getAStr2(), as.getS2()
-                .getStart(), as.getS2().getEnd());
-        sequences.add(seq);
+        sequences.add(as.getAlignedSeq1());
+        sequences.add(as.getAlignedSeq2());
       }
     }
 
index 9057dcb..3ea689f 100644 (file)
@@ -25,7 +25,9 @@ import jalview.analysis.AlignmentAnnotationUtils;
 import jalview.analysis.Conservation;
 import jalview.commands.ChangeCaseCommand;
 import jalview.commands.EditCommand;
+import jalview.commands.EditCommand.Action;
 import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
 import jalview.datamodel.Annotation;
 import jalview.datamodel.DBRefEntry;
 import jalview.datamodel.PDBEntry;
@@ -372,12 +374,12 @@ public class PopupMenu extends JPopupMenu
       {
         AlignmentAnnotation[] aa = ap.av.getAlignment()
                 .getAlignmentAnnotation();
-        for (int i = 0; i < aa.length; i++)
+        for (int i = 0; aa != null && i < aa.length; i++)
         {
-          if (aa[i].getRNAStruc() != null)
+          if (aa[i].isValidStruc() && aa[i].sequenceRef == null)
           {
             final String rnastruc = aa[i].getRNAStruc();
-            final String structureLine = aa[i].label;
+            final String structureLine = aa[i].label + " (alignment)";
             menuItem = new JMenuItem();
             menuItem.setText(MessageManager.formatMessage(
                     "label.2d_rna_structure_line", new String[]
@@ -387,15 +389,15 @@ public class PopupMenu extends JPopupMenu
               @Override
               public void actionPerformed(ActionEvent e)
               {
-                // System.out.println("1:"+structureLine);
-                System.out.println("1:sname" + seq.getName());
-                System.out.println("2:seq" + seq);
-
-                // System.out.println("3:"+seq.getSequenceAsString());
-                System.out.println("3:strucseq" + rnastruc);
-                // System.out.println("4:struc"+seq.getRNA());
-                System.out.println("5:name" + seq.getName());
-                System.out.println("6:ap" + ap);
+                // // System.out.println("1:"+structureLine);
+                // System.out.println("1:sname" + seq.getName());
+                // System.out.println("2:seq" + seq);
+                //
+                // // System.out.println("3:"+seq.getSequenceAsString());
+                // System.out.println("3:strucseq" + rnastruc);
+                // // System.out.println("4:struc"+seq.getRNA());
+                // System.out.println("5:name" + seq.getName());
+                // System.out.println("6:ap" + ap);
                 new AppVarna(structureLine, seq, seq.getSequenceAsString(),
                         rnastruc, seq.getName(), ap);
                 // new AppVarna(seq.getName(),seq,rnastruc,seq.getRNA(),
@@ -414,7 +416,7 @@ public class PopupMenu extends JPopupMenu
           AlignmentAnnotation seqAnno[] = seq.getAnnotation();
           for (int i = 0; i < seqAnno.length; i++)
           {
-            if (seqAnno[i].getRNAStruc() != null)
+            if (seqAnno[i].isValidStruc())
             {
               final String rnastruc = seqAnno[i].getRNAStruc();
 
@@ -1764,12 +1766,13 @@ public class PopupMenu extends JPopupMenu
 
   /**
    * Check for any annotations on the underlying dataset sequences (for the
-   * current selection group) which are not on the alignment annotations for the
-   * sequence. If any are found, enable the option to add them to the alignment.
-   * The criteria for 'on the alignment' is finding an alignment annotation on
-   * the sequence, that matches on calcId and label. A tooltip is also
-   * constructed that displays the source (calcId) and type (label) of the
-   * annotations that can be added.
+   * current selection group) which are not 'on the alignment'.If any are found,
+   * enable the option to add them to the alignment. The criteria for 'on the
+   * alignment' is finding an alignment annotation on the alignment, matched on
+   * calcId, label and sequenceRef.
+   * 
+   * A tooltip is also constructed that displays the source (calcId) and type
+   * (label) of the annotations that can be added.
    * 
    * @param menuItem
    * @param forSequences
@@ -1796,10 +1799,11 @@ public class PopupMenu extends JPopupMenu
     /*
      * For each sequence selected in the alignment, make a list of any
      * annotations on the underlying dataset sequence which are not already on
-     * the sequence in the alignment.
+     * the alignment.
      * 
      * Build a map of { alignmentSequence, <List of annotations to add> }
      */
+    AlignmentI al = this.ap.av.getAlignment();
     final Map<SequenceI, List<AlignmentAnnotation>> candidates = new LinkedHashMap<SequenceI, List<AlignmentAnnotation>>();
     for (SequenceI seq : forSequences)
     {
@@ -1817,11 +1821,12 @@ public class PopupMenu extends JPopupMenu
       for (AlignmentAnnotation dsann : datasetAnnotations)
       {
         /*
-         * If the sequence has no annotation that matches this one, then add
-         * this one to the results list.
+         * Find matching annotations on the alignment.
          */
-        if (seq.getAlignmentAnnotations(dsann.getCalcId(), dsann.label)
-                .isEmpty())
+        final Iterable<AlignmentAnnotation> matchedAlignmentAnnotations = al
+                .findAnnotations(seq, dsann.getCalcId(),
+                        dsann.label);
+        if (!matchedAlignmentAnnotations.iterator().hasNext())
         {
           result.add(dsann);
           tipEntries.put(dsann.getCalcId(), dsann.label);
@@ -1890,8 +1895,14 @@ public class PopupMenu extends JPopupMenu
         }
         copyAnn.restrict(startRes, endRes);
 
-        // add to the sequence (sets copyAnn.datasetSequence)
-        seq.addAlignmentAnnotation(copyAnn);
+        /*
+         * Add to the sequence (sets copyAnn.datasetSequence), unless the
+         * original annotation is already on the sequence.
+         */
+        if (!seq.hasAnnotation(ann))
+        {
+          seq.addAlignmentAnnotation(copyAnn);
+        }
         // adjust for gaps
         copyAnn.adjustForAlignment();
         // add to the alignment and set visible
@@ -1932,7 +1943,9 @@ public class PopupMenu extends JPopupMenu
                       true,
                       true,
                       false,
-                      (ap.seqPanel.seqCanvas.fr != null) ? ap.seqPanel.seqCanvas.fr.getMinMax()
+                      (ap.getSeqPanel().seqCanvas.fr != null) ? ap
+                              .getSeqPanel().seqCanvas.fr
+                              .getMinMax()
                               : null);
       contents.append("</p>");
     }
@@ -2649,7 +2662,7 @@ public class PopupMenu extends JPopupMenu
     System.arraycopy(features, 0, tfeatures, 0, rsize);
     features = tfeatures;
     seqs = rseqs;
-    if (ap.seqPanel.seqCanvas.getFeatureRenderer().amendFeatures(seqs,
+    if (ap.getSeqPanel().seqCanvas.getFeatureRenderer().amendFeatures(seqs,
             features, true, ap))
     {
       ap.alignFrame.setShowSeqFeatures(true);
@@ -2707,7 +2720,7 @@ public class PopupMenu extends JPopupMenu
       {
         EditCommand editCommand = new EditCommand(
                 MessageManager.getString("label.edit_sequences"),
-                EditCommand.REPLACE, dialog.getName().replace(' ',
+                Action.REPLACE, dialog.getName().replace(' ',
                         ap.av.getGapCharacter()),
                 sg.getSequencesAsArray(ap.av.getHiddenRepSequences()),
                 sg.getStartRes(), sg.getEndRes() + 1, ap.av.getAlignment());
index ab4f94f..bdc83e5 100755 (executable)
@@ -22,6 +22,7 @@ package jalview.gui;
 
 import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
 import jalview.bin.Cache;
+import jalview.gui.Help.HelpId;
 import jalview.gui.StructureViewer.Viewer;
 import jalview.io.JalviewFileChooser;
 import jalview.io.JalviewFileView;
@@ -39,15 +40,19 @@ import java.awt.event.ActionListener;
 import java.awt.event.MouseEvent;
 import java.io.File;
 import java.util.Collection;
+import java.util.List;
 import java.util.StringTokenizer;
 import java.util.Vector;
 
+import javax.help.HelpSetException;
 import javax.swing.JColorChooser;
 import javax.swing.JFileChooser;
 import javax.swing.JInternalFrame;
 import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 
+import ext.edu.ucsf.rbvi.strucviz2.StructureManager;
+
 /**
  * DOCUMENT ME!
  * 
@@ -291,17 +296,7 @@ public class Preferences extends GPreferences
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        if (chimeraPath.getText().trim().length() > 0)
-        {
-          File f = new File(chimeraPath.getText());
-          if (!f.canExecute())
-          {
-            JOptionPane.showInternalMessageDialog(Desktop.desktop,
-                    MessageManager.getString("label.invalid_path"),
-                    MessageManager.getString("label.invalid_name"),
-                    JOptionPane.ERROR_MESSAGE);
-          }
-        }
+        validateChimeraPath();
       }
     });
 
@@ -376,6 +371,11 @@ public class Preferences extends GPreferences
    */
   public void ok_actionPerformed(ActionEvent e)
   {
+    if (!validateSettings())
+    {
+      return;
+    }
+
     /*
      * Save Visual settings
      */
@@ -590,9 +590,8 @@ public class Preferences extends GPreferences
 
     dasSource.saveProperties(Cache.applicationProperties);
     wsPrefs.updateAndRefreshWsMenuConfig(false);
-
     Cache.saveProperties();
-
+    Desktop.instance.doConfigureStructurePrefs();
     try
     {
       frame.setClosed(true);
@@ -602,6 +601,28 @@ public class Preferences extends GPreferences
   }
 
   /**
+   * Do any necessary validation before saving settings. Return focus to the
+   * first tab which fails validation.
+   * 
+   * @return
+   */
+  private boolean validateSettings()
+  {
+    if (!validateStructure())
+    {
+      structureTab.requestFocusInWindow();
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  protected boolean validateStructure()
+  {
+    return validateChimeraPath();
+
+  }
+  /**
    * DOCUMENT ME!
    */
   public void startupFileTextfield_mouseClicked()
@@ -843,4 +864,74 @@ public class Preferences extends GPreferences
     userIdWidthlabel.setEnabled(!autoIdWidth.isSelected());
   }
 
+  /**
+   * Returns true if chimera path is to a valid executable, else show an error
+   * dialog.
+   */
+  private boolean validateChimeraPath()
+  {
+    if (chimeraPath.getText().trim().length() > 0)
+    {
+      File f = new File(chimeraPath.getText());
+      if (!f.canExecute())
+      {
+        JOptionPane.showInternalMessageDialog(Desktop.desktop,
+                MessageManager.getString("label.invalid_chimera_path"),
+                MessageManager.getString("label.invalid_name"),
+                JOptionPane.ERROR_MESSAGE);
+        return false;
+      }
+    }
+    return true;
+  }
+
+  /**
+   * If Chimera is selected, check it can be found on default or user-specified
+   * path, if not show a warning/help dialog.
+   */
+  @Override
+  protected void structureViewer_actionPerformed(String selectedItem)
+  {
+    if (!selectedItem.equals(Viewer.CHIMERA.name()))
+    {
+      return;
+    }
+    boolean found = false;
+
+    /*
+     * Try user-specified and standard paths for Chimera executable.
+     */
+    List<String> paths = StructureManager.getChimeraPaths();
+    paths.add(0, chimeraPath.getText());
+    for (String path : paths)
+    {
+      if (new File(path.trim()).canExecute())
+      {
+        found = true;
+        break;
+      }
+    }
+    if (!found)
+    {
+      String[] options =
+      { "OK", "Help" };
+      int showHelp = JOptionPane.showInternalOptionDialog(
+              Desktop.desktop,
+              JvSwingUtils.wrapTooltip(true,
+                      MessageManager.getString("label.chimera_missing")),
+              "", JOptionPane.YES_NO_OPTION,
+              JOptionPane.WARNING_MESSAGE, null, options, options[0]);
+      if (showHelp == JOptionPane.NO_OPTION)
+      {
+        try
+        {
+          Help.showHelpWindow(HelpId.StructureViewer);
+        } catch (HelpSetException e)
+        {
+          e.printStackTrace();
+        }
+      }
+    }
+  }
+
 }
index 0e55cf8..c8a0ec7 100755 (executable)
  */
 package jalview.gui;
 
-import java.util.*;
-
-import java.awt.event.*;
-import javax.swing.*;
-import javax.swing.event.*;
-
 import jalview.analysis.AlignSeq;
-import jalview.commands.*;
-import jalview.datamodel.*;
-import jalview.jbgui.*;
+import jalview.commands.CommandI;
+import jalview.commands.EditCommand;
+import jalview.commands.EditCommand.Action;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.jbgui.GSliderPanel;
 import jalview.util.MessageManager;
 
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Stack;
+import java.util.Vector;
+
+import javax.swing.JInternalFrame;
+import javax.swing.JProgressBar;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.InternalFrameAdapter;
+import javax.swing.event.InternalFrameEvent;
+
 /**
  * DOCUMENT ME!
  * 
@@ -44,7 +54,9 @@ public class RedundancyPanel extends GSliderPanel implements Runnable
 
   AlignmentPanel ap;
 
-  Stack historyList = new Stack(); // simpler than synching with alignFrame.
+  Stack<CommandI> historyList = new Stack<CommandI>();
+
+  // simpler than synching with alignFrame.
 
   float[] redundancy;
 
@@ -95,7 +107,7 @@ public class RedundancyPanel extends GSliderPanel implements Runnable
     {
       public void internalFrameClosing(InternalFrameEvent evt)
       {
-        ap.idPanel.idCanvas.setHighlighted(null);
+        ap.getIdPanel().getIdCanvas().setHighlighted(null);
       }
     });
 
@@ -185,7 +197,7 @@ public class RedundancyPanel extends GSliderPanel implements Runnable
         redundantSequences.add(originalSequences[i]);
       }
     }
-    ap.idPanel.idCanvas.setHighlighted(redundantSequences);
+    ap.getIdPanel().getIdCanvas().setHighlighted(redundantSequences);
   }
 
   /**
@@ -229,7 +241,7 @@ public class RedundancyPanel extends GSliderPanel implements Runnable
       }
 
       EditCommand cut = new EditCommand(MessageManager.getString("action.remove_redundancy"),
-              EditCommand.CUT, deleted, 0, width, ap.av.getAlignment());
+              Action.CUT, deleted, 0, width, ap.av.getAlignment());
 
       for (int i = 0; i < del.size(); i++)
       {
@@ -263,7 +275,7 @@ public class RedundancyPanel extends GSliderPanel implements Runnable
        return;
     }
     
-    CommandI command = (CommandI) historyList.pop();
+    CommandI command = historyList.pop();
     if (ap.av.historyList.contains(command))
     {
       command.undoCommand(af.getViewAlignments());
diff --git a/src/jalview/gui/SVGOptions.java b/src/jalview/gui/SVGOptions.java
new file mode 100644 (file)
index 0000000..b5e194b
--- /dev/null
@@ -0,0 +1,163 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
+ * Copyright (C) 2014 The Jalview Authors
+ * 
+ * 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/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+package jalview.gui;
+
+import jalview.util.MessageManager;
+
+import java.awt.BorderLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+
+public class SVGOptions extends JPanel
+{
+  JDialog dialog;
+
+  public boolean cancelled = false;
+
+  String value;
+
+  public SVGOptions()
+  {
+    try
+    {
+      jbInit();
+    } catch (Exception ex)
+    {
+      ex.printStackTrace();
+    }
+
+    ButtonGroup bg = new ButtonGroup();
+    bg.add(lineart);
+    bg.add(text);
+
+    JOptionPane pane = new JOptionPane(null, JOptionPane.DEFAULT_OPTION,
+            JOptionPane.DEFAULT_OPTION, null, new Object[]
+            { this });
+
+    dialog = pane.createDialog(Desktop.desktop, "SVG Rendering options");
+    dialog.setVisible(true);
+
+  }
+
+  private void jbInit() throws Exception
+  {
+    lineart.setFont(JvSwingUtils.getLabelFont());
+    lineart.setText(MessageManager.getString("label.lineart"));
+    text.setFont(JvSwingUtils.getLabelFont());
+    text.setText(MessageManager.getString("action.text"));
+    text.setSelected(true);
+    askAgain.setFont(JvSwingUtils.getLabelFont());
+    askAgain.setText(MessageManager.getString("label.dont_ask_me_again"));
+    ok.setText(MessageManager.getString("action.ok"));
+    ok.addActionListener(new ActionListener()
+    {
+      public void actionPerformed(ActionEvent e)
+      {
+        ok_actionPerformed(e);
+      }
+    });
+    cancel.setText(MessageManager.getString("action.cancel"));
+    cancel.addActionListener(new ActionListener()
+    {
+      public void actionPerformed(ActionEvent e)
+      {
+        cancel_actionPerformed(e);
+      }
+    });
+    jLabel1.setFont(JvSwingUtils.getLabelFont());
+    jLabel1.setText("Select SVG character rendering style");
+    this.setLayout(borderLayout1);
+    jPanel3.setBorder(BorderFactory.createEtchedBorder());
+    jPanel2.add(text);
+    jPanel2.add(lineart);
+    jPanel2.add(askAgain);
+    jPanel1.add(ok);
+    jPanel1.add(cancel);
+    jPanel3.add(jLabel1);
+    jPanel3.add(jPanel2);
+    this.add(jPanel3, java.awt.BorderLayout.CENTER);
+    this.add(jPanel1, java.awt.BorderLayout.SOUTH);
+  }
+
+  JRadioButton lineart = new JRadioButton();
+
+  JRadioButton text = new JRadioButton();
+
+  JCheckBox askAgain = new JCheckBox();
+
+  JButton ok = new JButton();
+
+  JButton cancel = new JButton();
+
+  JPanel jPanel1 = new JPanel();
+
+  JLabel jLabel1 = new JLabel();
+
+  JPanel jPanel2 = new JPanel();
+
+  JPanel jPanel3 = new JPanel();
+
+  BorderLayout borderLayout1 = new BorderLayout();
+
+  public void ok_actionPerformed(ActionEvent e)
+  {
+    if (lineart.isSelected())
+    {
+      value = "Lineart";
+    }
+    else
+    {
+      value = "Text";
+    }
+
+    if (!askAgain.isSelected())
+    {
+      jalview.bin.Cache.applicationProperties.remove("SVG_RENDERING");
+    }
+    else
+    {
+      jalview.bin.Cache.setProperty("SVG_RENDERING", value);
+    }
+
+    dialog.setVisible(false);
+  }
+
+  public void cancel_actionPerformed(ActionEvent e)
+  {
+    cancelled = true;
+    dialog.setVisible(false);
+  }
+
+  public String getValue()
+  {
+    return value;
+  }
+}
index f2c5154..568062b 100755 (executable)
@@ -327,7 +327,7 @@ public class ScalePanel extends JPanel implements MouseMotionListener,
   {
     if (mouseDragging)
     {
-      ap.seqPanel.scrollCanvas(null);
+      ap.getSeqPanel().scrollCanvas(null);
     }
   }
 
@@ -335,7 +335,7 @@ public class ScalePanel extends JPanel implements MouseMotionListener,
   {
     if (mouseDragging)
     {
-      ap.seqPanel.scrollCanvas(evt);
+      ap.getSeqPanel().scrollCanvas(evt);
     }
   }
 
index 03231c5..4d1546b 100755 (executable)
  */
 package jalview.gui;
 
-import java.awt.*;
-import java.awt.image.*;
-import javax.swing.*;
-
-import jalview.datamodel.*;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.SearchResults;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+
+import java.awt.BasicStroke;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.Shape;
+import java.awt.image.BufferedImage;
+
+import javax.swing.JComponent;
 
 /**
  * DOCUMENT ME!
@@ -247,16 +258,11 @@ public class SeqCanvas extends JComponent
    */
   public void fastPaint(int horizontal, int vertical)
   {
-    if (fastpainting)
+    if (fastpainting || gg == null)
     {
       return;
     }
     fastpainting = true;
-    if (gg == null)
-    {
-      return;
-    }
-
     fastPaint = true;
 
     gg.copyArea(horizontal * av.charWidth, vertical * av.charHeight,
@@ -567,7 +573,7 @@ public class SeqCanvas extends JComponent
 
       drawPanel(g, startRes, endx, 0, al.getHeight(), ypos);
 
-      if (av.showAnnotation)
+      if (av.isShowAnnotation())
       {
         g.translate(0, cHeight + ypos + 3);
         if (annotations == null)
@@ -575,7 +581,7 @@ public class SeqCanvas extends JComponent
           annotations = new AnnotationPanel(av);
         }
 
-        annotations.renderer.drawComponent(annotations, av, (Graphics2D) g,
+        annotations.renderer.drawComponent(annotations, av, g,
                 -1, startRes, endx + 1);
         g.translate(0, -cHeight - ypos - 3);
       }
@@ -592,7 +598,7 @@ public class SeqCanvas extends JComponent
 
   int getAnnotationHeight()
   {
-    if (!av.showAnnotation)
+    if (!av.isShowAnnotation())
     {
       return 0;
     }
@@ -621,7 +627,8 @@ public class SeqCanvas extends JComponent
    * @param offset
    *          DOCUMENT ME!
    */
-  void drawPanel(Graphics g1, int startRes, int endRes, int startSeq,
+  public void drawPanel(Graphics g1, int startRes, int endRes,
+          int startSeq,
           int endSeq, int offset)
   {
     if (!av.hasHiddenColumns())
@@ -763,7 +770,7 @@ public class SeqCanvas extends JComponent
 
     if ((group == null) && (av.getAlignment().getGroups().size() > 0))
     {
-      group = (SequenceGroup) av.getAlignment().getGroups().get(0);
+      group = av.getAlignment().getGroups().get(0);
       groupIndex = 0;
     }
 
@@ -924,7 +931,7 @@ public class SeqCanvas extends JComponent
           break;
         }
 
-        group = (SequenceGroup) av.getAlignment().getGroups()
+        group = av.getAlignment().getGroups()
                 .get(groupIndex);
 
       } while (groupIndex < av.getAlignment().getGroups().size());
index 4836915..7c6a202 100644 (file)
  */
 package jalview.gui;
 
-import java.util.*;
-import java.util.List;
-
-import java.awt.*;
-import java.awt.event.*;
-
-import javax.swing.*;
-
-import jalview.commands.*;
-import jalview.datamodel.*;
+import jalview.commands.EditCommand;
+import jalview.commands.EditCommand.Action;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.SearchResults;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceFeature;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
 import jalview.io.SequenceAnnotationReport;
-import jalview.schemes.*;
-import jalview.structure.*;
+import jalview.schemes.ResidueProperties;
+import jalview.structure.SelectionListener;
+import jalview.structure.SelectionSource;
+import jalview.structure.SequenceListener;
+import jalview.structure.StructureSelectionManager;
 import jalview.util.MessageManager;
 
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Point;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+import java.awt.event.MouseWheelEvent;
+import java.awt.event.MouseWheelListener;
+import java.util.List;
+import java.util.Vector;
+
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.ToolTipManager;
+
 /**
  * DOCUMENT ME!
  * 
@@ -95,7 +113,7 @@ public class SeqPanel extends JPanel implements MouseListener,
 
   private final SequenceAnnotationReport seqARep;
 
-  StringBuffer tooltipText = new StringBuffer("<html>");
+  StringBuffer tooltipText = new StringBuffer();
 
   String tmpString;
 
@@ -659,7 +677,9 @@ public class SeqPanel extends JPanel implements MouseListener,
 
     pos = setStatusMessage(sequence, res, seq);
     if (ssm != null && pos > -1)
+    {
       mouseOverSequence(sequence, res, pos);
+    }
 
     tooltipText.setLength(6); // Cuts the buffer back to <html>
 
@@ -670,11 +690,6 @@ public class SeqPanel extends JPanel implements MouseListener,
       {
         if (groups[g].getStartRes() <= res && groups[g].getEndRes() >= res)
         {
-          if (tooltipText.length() > 6)
-          {
-            tooltipText.append("<br>");
-          }
-
           if (!groups[g].getName().startsWith("JTreeGroup")
                   && !groups[g].getName().startsWith("JGroup"))
           {
@@ -697,7 +712,7 @@ public class SeqPanel extends JPanel implements MouseListener,
               sequence.getDatasetSequence(),
               rpos = sequence.findPosition(res));
       seqARep.appendFeatures(tooltipText, rpos, features,
-              this.ap.seqPanel.seqCanvas.fr.getMinMax());
+              this.ap.getSeqPanel().seqCanvas.fr.getMinMax());
     }
     if (tooltipText.length() == 6) // <html></html>
     {
@@ -706,11 +721,13 @@ public class SeqPanel extends JPanel implements MouseListener,
     }
     else
     {
-      tooltipText.append("</html>");
       if (lastTooltip == null
               || !lastTooltip.equals(tooltipText.toString()))
       {
-        setToolTipText(tooltipText.toString());
+        String formatedTooltipText = JvSwingUtils.wrapTooltip(true,
+                tooltipText.toString());
+        // String formatedTooltipText = tooltipText.toString();
+        setToolTipText(formatedTooltipText);
         lastTooltip = tooltipText.toString();
       }
 
@@ -1132,7 +1149,7 @@ public class SeqPanel extends JPanel implements MouseListener,
         }
         else
         {
-          editCommand.appendEdit(EditCommand.INSERT_GAP, groupSeqs,
+          editCommand.appendEdit(Action.INSERT_GAP, groupSeqs,
                   startres, startres - lastres, av.getAlignment(), true);
         }
       }
@@ -1148,7 +1165,7 @@ public class SeqPanel extends JPanel implements MouseListener,
         }
         else
         {
-          editCommand.appendEdit(EditCommand.DELETE_GAP, groupSeqs,
+          editCommand.appendEdit(Action.DELETE_GAP, groupSeqs,
                   startres, lastres - startres, av.getAlignment(), true);
         }
 
@@ -1170,7 +1187,7 @@ public class SeqPanel extends JPanel implements MouseListener,
         }
         else
         {
-          editCommand.appendEdit(EditCommand.INSERT_GAP, new SequenceI[]
+          editCommand.appendEdit(Action.INSERT_GAP, new SequenceI[]
           { seq }, lastres, startres - lastres, av.getAlignment(), true);
         }
       }
@@ -1207,7 +1224,7 @@ public class SeqPanel extends JPanel implements MouseListener,
 
             if (max > 0)
             {
-              editCommand.appendEdit(EditCommand.DELETE_GAP,
+              editCommand.appendEdit(Action.DELETE_GAP,
                       new SequenceI[]
                       { seq }, startres, max, av.getAlignment(), true);
             }
@@ -1225,7 +1242,7 @@ public class SeqPanel extends JPanel implements MouseListener,
           }
           else
           {
-            editCommand.appendEdit(EditCommand.INSERT_NUC, new SequenceI[]
+            editCommand.appendEdit(Action.INSERT_NUC, new SequenceI[]
             { seq }, lastres, startres - lastres, av.getAlignment(), true);
           }
         }
@@ -1261,10 +1278,10 @@ public class SeqPanel extends JPanel implements MouseListener,
       }
     }
 
-    editCommand.appendEdit(EditCommand.DELETE_GAP, seq, blankColumn, 1,
+    editCommand.appendEdit(Action.DELETE_GAP, seq, blankColumn, 1,
             av.getAlignment(), true);
 
-    editCommand.appendEdit(EditCommand.INSERT_GAP, seq, j, 1,
+    editCommand.appendEdit(Action.INSERT_GAP, seq, j, 1,
             av.getAlignment(), true);
 
   }
@@ -1272,10 +1289,10 @@ public class SeqPanel extends JPanel implements MouseListener,
   void deleteChar(int j, SequenceI[] seq, int fixedColumn)
   {
 
-    editCommand.appendEdit(EditCommand.DELETE_GAP, seq, j, 1,
+    editCommand.appendEdit(Action.DELETE_GAP, seq, j, 1,
             av.getAlignment(), true);
 
-    editCommand.appendEdit(EditCommand.INSERT_GAP, seq, fixedColumn, 1,
+    editCommand.appendEdit(Action.INSERT_GAP, seq, fixedColumn, 1,
             av.getAlignment(), true);
   }
 
index 81b3bd3..cbd0d58 100755 (executable)
@@ -300,7 +300,7 @@ public class SliderPanel extends GSliderPanel
       }
     }
 
-    ap.seqPanel.seqCanvas.repaint();
+    ap.getSeqPanel().seqCanvas.repaint();
   }
 
   /**
index 8dcf72a..cd93277 100644 (file)
  */
 package jalview.gui;
 
-import java.util.*;
+import jalview.jbgui.GWebserviceInfo;
+import jalview.util.MessageManager;
+import jalview.ws.WSClientI;
 
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.image.*;
-import javax.swing.*;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.GridLayout;
+import java.awt.Image;
+import java.awt.MediaTracker;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.image.BufferedImage;
+import java.util.Hashtable;
+import java.util.Vector;
+
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JInternalFrame;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JProgressBar;
+import javax.swing.JScrollPane;
+import javax.swing.JTabbedPane;
+import javax.swing.JTextArea;
 import javax.swing.event.HyperlinkEvent;
 import javax.swing.event.HyperlinkListener;
 import javax.swing.text.html.HTMLEditorKit;
 import javax.swing.text.html.StyleSheet;
 
-import jalview.jbgui.*;
-import jalview.util.MessageManager;
-import jalview.ws.WSClientI;
-
 /**
  * Base class for web service client thread and gui TODO: create StAX parser to
  * extract html body content reliably when preparing html formatted job statuses
@@ -78,6 +97,13 @@ public class WebserviceInfo extends GWebserviceInfo implements
 
   JInternalFrame frame;
 
+  @Override
+  public void setVisible(boolean aFlag)
+  {
+    super.setVisible(aFlag);
+    frame.setVisible(aFlag);
+  };
+
   JTabbedPane subjobs = null;
 
   java.util.Vector jobPanes = null;
@@ -210,10 +236,13 @@ public class WebserviceInfo extends GWebserviceInfo implements
    *          short name and job type
    * @param info
    *          reference or other human readable description
+   * @param makeVisible
+   *          true to display the webservices window immediatly (otherwise need
+   *          to call setVisible(true))
    */
-  public WebserviceInfo(String title, String info)
+  public WebserviceInfo(String title, String info, boolean makeVisible)
   {
-    init(title, info, 520, 500);
+    init(title, info, 520, 500, makeVisible);
   }
 
   /**
@@ -228,9 +257,10 @@ public class WebserviceInfo extends GWebserviceInfo implements
    * @param height
    *          DOCUMENT ME!
    */
-  public WebserviceInfo(String title, String info, int width, int height)
+  public WebserviceInfo(String title, String info, int width, int height,
+          boolean makeVisible)
   {
-    init(title, info, width, height);
+    init(title, info, width, height, makeVisible);
   }
 
   /**
@@ -288,11 +318,12 @@ public class WebserviceInfo extends GWebserviceInfo implements
    * @param height
    *          DOCUMENT ME!
    */
-  void init(String title, String info, int width, int height)
+  void init(String title, String info, int width, int height,
+          boolean makeVisible)
   {
     frame = new JInternalFrame();
     frame.setContentPane(this);
-    Desktop.addInternalFrame(frame, title, width, height);
+    Desktop.addInternalFrame(frame, title, makeVisible, width, height);
     frame.setClosable(false);
 
     this.title = title;
index 23645df..4a74c9c 100644 (file)
@@ -218,7 +218,9 @@ public class WsJobParameters extends JPanel implements ItemListener,
 
     frame = new JDialog(Desktop.instance, true);
 
-    frame.setTitle(MessageManager.formatMessage("label.edit_params_for", new String[]{service.getActionText()}));
+    frame.setTitle(MessageManager.formatMessage("label.edit_params_for",
+            new String[]
+            { service.getActionText() }));
     Rectangle deskr = Desktop.instance.getBounds();
     Dimension pref = this.getPreferredSize();
     frame.setBounds(new Rectangle(
@@ -342,7 +344,6 @@ public class WsJobParameters extends JPanel implements ItemListener,
     setDescr.setToolTipText(MessageManager
             .getString("label.edit_notes_parameter_set"));
     JScrollPane setDescrView = new JScrollPane();
-    // setDescrView.setPreferredSize(new Dimension(350, 200));
     setDescrView.getViewport().setView(setDescr);
     setName.setEditable(true);
     setName.addItemListener(this);
@@ -426,6 +427,8 @@ public class WsJobParameters extends JPanel implements ItemListener,
     JPanel dialogpanel = new JPanel();
     dialogpanel.add(startjob);
     dialogpanel.add(canceljob);
+    // JAL-1580: setMaximumSize() doesn't work, so just size for the worst case:
+    setPreferredSize(new Dimension(540, Desktop.instance.getHeight()));
     add(dialogpanel, BorderLayout.SOUTH);
     validate();
   }
@@ -433,7 +436,7 @@ public class WsJobParameters extends JPanel implements ItemListener,
   protected void revert_actionPerformed(ActionEvent e)
   {
     reInitDialog(lastParmSet);
-
+    updateWebServiceMenus();
   }
 
   protected void update_actionPerformed(ActionEvent e)
@@ -462,6 +465,7 @@ public class WsJobParameters extends JPanel implements ItemListener,
       _deleteUserPreset(lastParmSet);
     }
     reInitDialog(null); // service default
+    updateWebServiceMenus();
   }
 
   protected void create_actionPerformed(ActionEvent e)
@@ -472,7 +476,9 @@ public class WsJobParameters extends JPanel implements ItemListener,
       _storeCurrentPreset(curname);
       lastParmSet = curname;
       isUserPreset = true;
+      reInitDialog(curname);
       initArgSetModified();
+      updateWebServiceMenus();
     }
     else
     {
@@ -527,7 +533,7 @@ public class WsJobParameters extends JPanel implements ItemListener,
     Hashtable exnames = new Hashtable();
     for (int i = 0, iSize = setName.getItemCount(); i < iSize; i++)
     {
-      exnames.put((String) setName.getItemAt(i), setName.getItemAt(i));
+      exnames.put(setName.getItemAt(i), setName.getItemAt(i));
     }
     servicePresets = new Hashtable();
     // Add the default entry - if not present already.
@@ -950,7 +956,7 @@ public class WsJobParameters extends JPanel implements ItemListener,
     {
       Vector<String> services = new Vector<String>();
       services.addElement(args[p++]);
-      Jws2Discoverer.setServiceUrls(services);
+      Jws2Discoverer.getDiscoverer().setServiceUrls(services);
     }
     try
     {
@@ -1091,7 +1097,9 @@ public class WsJobParameters extends JPanel implements ItemListener,
             }
             WsJobParameters pgui = new WsJobParameters(lastserv,
                     new JabaPreset(lastserv, pr));
-            JFrame jf = new JFrame(MessageManager.formatMessage("label.ws_parameters_for", new String[]{lastserv.getActionText()}));
+            JFrame jf = new JFrame(MessageManager.formatMessage(
+                    "label.ws_parameters_for", new String[]
+                    { lastserv.getActionText() }));
             JPanel cont = new JPanel(new BorderLayout());
             pgui.validate();
             cont.setPreferredSize(pgui.getPreferredSize());
@@ -1290,7 +1298,18 @@ public class WsJobParameters extends JPanel implements ItemListener,
     SetNamePanel.validate();
     validate();
     settingDialog = false;
+  }
 
+  /**
+   * Rebuild the AlignFrame web service menus (after add/delete of a preset
+   * option).
+   */
+  protected void updateWebServiceMenus()
+  {
+    for (AlignFrame alignFrame : Desktop.getAlignframes())
+    {
+      alignFrame.BuildWebServiceMenu();
+    }
   }
 
   String curSetName = null;
@@ -1401,7 +1420,7 @@ public class WsJobParameters extends JPanel implements ItemListener,
       if (src.getParent() == setName)
       {
         // rename any existing records we know about for this set.
-        String newname = (String) e.getActionCommand().trim();
+        String newname = e.getActionCommand().trim();
         String msg = null;
         if (isServicePreset(newname))
         {
@@ -1415,9 +1434,10 @@ public class WsJobParameters extends JPanel implements ItemListener,
           {
             public void run()
             {
-              JOptionPane.showMessageDialog(ourframe,
-                      MessageManager.getString("label.invalid_name_preset_exists"),
-                      MessageManager.getString("label.invalid_name"), JOptionPane.WARNING_MESSAGE);
+              JOptionPane.showMessageDialog(ourframe, MessageManager
+                      .getString("label.invalid_name_preset_exists"),
+                      MessageManager.getString("label.invalid_name"),
+                      JOptionPane.WARNING_MESSAGE);
             }
           });
 
index 3322d6a..2db19a2 100644 (file)
  */
 package jalview.gui;
 
+import jalview.bin.Cache;
+import jalview.io.JalviewFileChooser;
+import jalview.util.MessageManager;
+import jalview.ws.params.ParamDatastoreI;
+import jalview.ws.params.ParamManager;
+import jalview.ws.params.WsParamSetI;
+
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -33,13 +40,6 @@ import java.util.StringTokenizer;
 
 import javax.swing.JOptionPane;
 
-import jalview.bin.Cache;
-import jalview.io.JalviewFileChooser;
-import jalview.util.MessageManager;
-import jalview.ws.params.ParamDatastoreI;
-import jalview.ws.params.ParamManager;
-import jalview.ws.params.WsParamSetI;
-
 /**
  * store and retrieve web service parameter sets.
  * 
@@ -159,7 +159,7 @@ public class WsParamSetManager implements ParamManager
     {
       if (filename != null && !((outfile = new File(filename)).canWrite()))
       {
-        Cache.log.info("Can't write to " + filename
+        Cache.log.warn("Can't write to " + filename
                 + " - Prompting for new file to write to.");
         filename = null;
       }
index 876d157..527750c 100644 (file)
@@ -33,6 +33,7 @@ import java.awt.Dimension;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.net.URL;
+import java.util.List;
 import java.util.Vector;
 
 import javax.swing.JLabel;
@@ -52,7 +53,9 @@ public class WsPreferences extends GWsPreferences
     initFromPreferences();
   }
 
-  Vector<String> wsUrls, oldUrls, rsbsUrls, oldRsbsUrls;
+  List<String> wsUrls;
+
+  Vector<String> oldUrls, rsbsUrls, oldRsbsUrls;
 
   private boolean needWsMenuUpdate;
 
@@ -62,8 +65,8 @@ public class WsPreferences extends GWsPreferences
   private void initFromPreferences()
   {
 
-    wsUrls = jalview.ws.jws2.Jws2Discoverer.getServiceUrls();
-    if (wsUrls != null)
+    wsUrls = Jws2Discoverer.getDiscoverer().getServiceUrls();
+    if (!wsUrls.isEmpty())
     {
       oldUrls = new Vector<String>(wsUrls);
     }
@@ -235,7 +238,7 @@ public class WsPreferences extends GWsPreferences
 
   private void updateServiceList()
   {
-    jalview.ws.jws2.Jws2Discoverer.setServiceUrls(wsUrls);
+    Jws2Discoverer.getDiscoverer().setServiceUrls(wsUrls);
   }
 
   private void updateRsbsServiceList()
@@ -256,7 +259,7 @@ public class WsPreferences extends GWsPreferences
     int sel = wsList.getSelectedRow();
     if (sel > -1)
     {
-      wsUrls.removeElementAt(sel);
+      wsUrls.remove(sel);
       update++;
       updateList();
     }
@@ -274,21 +277,22 @@ public class WsPreferences extends GWsPreferences
     int sel = wsList.getSelectedRow();
     if (sel > -1)
     {
-      String url = editUrl(wsUrls.elementAt(sel), MessageManager.getString("label.edit_jabaws_url"));
+      String url = editUrl(wsUrls.get(sel),
+              MessageManager.getString("label.edit_jabaws_url"));
       if (url != null)
       {
         int present = wsUrls.indexOf(url);
         if (present == -1)
         {
           update++;
-          wsUrls.setElementAt(url, sel);
+          wsUrls.set(sel, url);
           updateList();
         }
         else
         {
           if (present != sel)
           {
-            wsUrls.removeElementAt(sel);
+            wsUrls.remove(sel);
             updateList();
           }
         }
@@ -406,8 +410,8 @@ public class WsPreferences extends GWsPreferences
     if (p > -1 && p < wsUrls.size() - 1)
     {
       String t = wsUrls.get(p + 1);
-      wsUrls.setElementAt(wsUrls.elementAt(p), p + 1);
-      wsUrls.setElementAt(t, p);
+      wsUrls.set(p + 1, wsUrls.get(p));
+      wsUrls.set(p, t);
       updateList();
       wsList.getSelectionModel().setSelectionInterval(p + 1, p + 1);
       update++;
@@ -428,8 +432,8 @@ public class WsPreferences extends GWsPreferences
     if (p > 0)
     {
       String t = wsUrls.get(p - 1);
-      wsUrls.setElementAt(wsUrls.elementAt(p), p - 1);
-      wsUrls.setElementAt(t, p);
+      wsUrls.set(p - 1, wsUrls.get(p));
+      wsUrls.set(p, t);
       updateList();
       wsList.getSelectionModel().setSelectionInterval(p - 1, p - 1);
       update++;
@@ -484,18 +488,38 @@ public class WsPreferences extends GWsPreferences
                       Desktop.desktop,
                       MessageManager.getString("info.validate_jabaws_server"),
                       MessageManager.getString("label.test_server"), JOptionPane.YES_NO_OPTION);
+
       if (validate == JOptionPane.OK_OPTION)
       {
-        if (jalview.ws.jws2.Jws2Discoverer.testServiceUrl(foo))
+        if (Jws2Discoverer.testServiceUrl(foo))
         {
           return foo.toString();
         }
         else
         {
-          JOptionPane
-                  .showInternalMessageDialog(
+          int opt = JOptionPane
+                  .showInternalOptionDialog(
                           Desktop.desktop,
-                          MessageManager.getString("warn.server_didnt_pass_validation"));
+                          "The Server  '"
+                                  + foo.toString()
+                                  + "' failed validation,\ndo you want to add it anyway? ",
+                          "Server Validation Failed",
+                          JOptionPane.YES_NO_OPTION,
+                          JOptionPane.INFORMATION_MESSAGE, null, null, null);
+          if (opt == JOptionPane.YES_OPTION)
+          {
+            return foo.toString();
+          }
+          else
+          {
+            JOptionPane
+                    .showInternalMessageDialog(
+                            Desktop.desktop,
+                            MessageManager
+                                    .getString("warn.server_didnt_pass_validation"));
+          }
+
+
         }
       }
       else
@@ -524,11 +548,11 @@ public class WsPreferences extends GWsPreferences
         int selind = wsList.getSelectedRow();
         if (selind > -1)
         {
-          wsUrls.insertElementAt(url, selind);
+          wsUrls.add(selind, url);
         }
         else
         {
-          wsUrls.addElement(url);
+          wsUrls.add(url);
         }
         update++;
         updateList();
@@ -631,8 +655,8 @@ public class WsPreferences extends GWsPreferences
   @Override
   protected void resetWs_actionPerformed(ActionEvent e)
   {
-    jalview.ws.jws2.Jws2Discoverer.setServiceUrls(null);
-    Vector nwsUrls = jalview.ws.jws2.Jws2Discoverer.getServiceUrls();
+    Jws2Discoverer.getDiscoverer().setServiceUrls(null);
+    List<String> nwsUrls = Jws2Discoverer.getDiscoverer().getServiceUrls();
     if (!wsUrls.equals(nwsUrls))
     {
       update++;
index 2e94782..505f609 100755 (executable)
@@ -126,6 +126,21 @@ public class AppletFormatAdapter
 
   public static String CLASSLOADER = "ClassLoader";
 
+  /**
+   * add jalview-derived non-secondary structure annotation from PDB structure
+   */
+  boolean annotFromStructure = false;
+
+  /**
+   * add secondary structure from PDB data with built-in algorithms
+   */
+  boolean localSecondaryStruct = false;
+
+  /**
+   * process PDB data with web services
+   */
+  boolean serviceSecondaryStruct = false;
+
   AlignFile afile = null;
 
   String inFile;
@@ -239,7 +254,8 @@ public class AppletFormatAdapter
       }
       else if (format.equals("PDB"))
       {
-        afile = new MCview.PDBfile(true,true,inFile, type);
+        afile = new MCview.PDBfile(annotFromStructure,
+                localSecondaryStruct, serviceSecondaryStruct, inFile, type);
         // Uncomment to test Jmol data based PDB processing: JAL-1213
         // afile = new jalview.ext.jmol.PDBFileWithJmol(inFile, type);
       }
@@ -364,7 +380,8 @@ public class AppletFormatAdapter
       }
       else if (format.equals("PDB"))
       {
-        afile = new MCview.PDBfile(true,true,source);
+        afile = new MCview.PDBfile(annotFromStructure,
+                localSecondaryStruct, serviceSecondaryStruct, source);
       }
       else if (format.equals("STH"))
       {
index 068b4b2..163f311 100644 (file)
@@ -1,18 +1,20 @@
 package jalview.io;
 
+import jalview.api.FeaturesDisplayedI;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.SequenceFeature;
 import jalview.datamodel.SequenceI;
+import jalview.exceptions.NoFileSelectedException;
 import jalview.gui.AlignViewport;
 import jalview.gui.AlignmentPanel;
 import jalview.gui.FeatureRenderer;
-import jalview.gui.SequenceRenderer;
 import jalview.json.binding.v1.BioJsAlignmentPojo;
 import jalview.json.binding.v1.BioJsFeaturePojo;
 import jalview.json.binding.v1.BioJsSeqPojo;
 import jalview.schemes.ColourSchemeProperty;
 import jalview.util.MessageManager;
 
+import java.awt.Color;
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
@@ -26,78 +28,110 @@ public class BioJsHTMLOutput
 {
   private AlignViewport av;
 
-  private FeatureRenderer fr;
+  private jalview.api.FeatureRenderer fr;
 
-  public BioJsHTMLOutput(AlignmentPanel ap, SequenceRenderer sr,
+  private String globalColorScheme;
+
+  private FeaturesDisplayedI displayedFeatures;
+
+  private String jalviewVersion;
+
+  private String webStartLaunchServletUrl = "http://www.jalview.org/services/launchApp";
+
+  public BioJsHTMLOutput(AlignmentPanel ap,
           FeatureRenderer fr1)
   {
-    this.av = ap.av;
-    this.fr = new FeatureRenderer(ap);
-    fr.transferSettings(fr1);
 
-    exportAsBioJsHtml();
+    jalviewVersion = jalview.bin.Cache.getProperty("VERSION");
+    webStartLaunchServletUrl = jalview.bin.Cache.getDefault(
+            "www.jalview.org", "http://www.jalview.org")
+            + "/services/launchApp";
+    if (ap != null)
+    {
+      this.av = ap.av;
+      this.globalColorScheme = ColourSchemeProperty.getColourName(av
+              .getGlobalColourScheme());
+      this.fr = ap.cloneFeatureRenderer();
+      displayedFeatures = av.getFeaturesDisplayed();
+
+    exportJalviewAlignmentAsBioJsHtmlFile();
+  }
   }
 
-  private void exportAsBioJsHtml()
+  private void exportJalviewAlignmentAsBioJsHtmlFile()
   {
     try
     {
-      JalviewFileChooser jvFileChooser = getJalviewFileChooserOption();
-      int fileChooserOpt = jvFileChooser.showSaveDialog(null);
-      if (fileChooserOpt == JalviewFileChooser.APPROVE_OPTION)
-      {
-        jalview.bin.Cache.setProperty("LAST_DIRECTORY", jvFileChooser
-                .getSelectedFile().getParent());
-        String selectedFile = jvFileChooser.getSelectedFile().getPath();
-        String generartedBioJs = generateBioJsAlignmentData(av
-                .getAlignment());
-        PrintWriter out = new java.io.PrintWriter(new java.io.FileWriter(
-                selectedFile));
-        out.print(generartedBioJs);
-        out.close();
-        jalview.util.BrowserLauncher.openURL("file:///" + selectedFile);
-      }
-    } catch (Exception ex)
+      String outputFile = getOutputFile();
+      String jalviewAlignmentJson = getJalviewAlignmentAsJsonString(av
+              .getAlignment());
+      String bioJSTemplateString = getBioJsTemplateAsString(this);
+      String generatedBioJsWithJalviewAlignmentAsJson = bioJSTemplateString
+              .replaceAll(
+"#sequenceData#", jalviewAlignmentJson)
+              .toString();
+
+      PrintWriter out = new java.io.PrintWriter(new java.io.FileWriter(
+              outputFile));
+      out.print(generatedBioJsWithJalviewAlignmentAsJson);
+      out.flush();
+      out.close();
+      jalview.util.BrowserLauncher.openURL("file:///" + outputFile);
+    } catch (NoFileSelectedException ex)
+    {
+      // do noting if no file was selected
+    } catch (Exception e)
     {
-      ex.printStackTrace();
+      e.printStackTrace();
     }
   }
 
-  private JalviewFileChooser getJalviewFileChooserOption()
+  public String getOutputFile() throws NoFileSelectedException
   {
-    JalviewFileChooser chooser = new JalviewFileChooser(
+    String selectedFile = null;
+    JalviewFileChooser jvFileChooser = new JalviewFileChooser(
             jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
             { "html" }, new String[]
             { "HTML files" }, "HTML files");
-    chooser.setFileView(new JalviewFileView());
+    jvFileChooser.setFileView(new JalviewFileView());
 
     // TODO uncomment when supported by MassageManager
-    chooser.setDialogTitle(MessageManager
+    jvFileChooser.setDialogTitle(MessageManager
             .getString("label.save_as_biojs_html"));
-    chooser.setDialogTitle("save as BioJs HTML");
-    chooser.setToolTipText(MessageManager.getString("action.save"));
+    jvFileChooser.setDialogTitle("save as BioJs HTML");
+    jvFileChooser.setToolTipText(MessageManager.getString("action.save"));
+
+    int fileChooserOpt = jvFileChooser.showSaveDialog(null);
+    if (fileChooserOpt == JalviewFileChooser.APPROVE_OPTION)
+    {
+      jalview.bin.Cache.setProperty("LAST_DIRECTORY", jvFileChooser
+              .getSelectedFile().getParent());
+      selectedFile = jvFileChooser.getSelectedFile().getPath();
+    }
+    else
+    {
+      throw new NoFileSelectedException("No file was selected.");
+    }
 
-    return chooser;
+    return selectedFile;
   }
 
-  private String generateBioJsAlignmentData(AlignmentI alignment)
+  public String getJalviewAlignmentAsJsonString(AlignmentI alignment)
           throws IOException, JSONException
   {
     BioJsAlignmentPojo bjsAlignment = new BioJsAlignmentPojo();
-    bjsAlignment.setGlobalColorScheme(ColourSchemeProperty.getColourName(av
-            .getGlobalColourScheme()));
 
-    // av.setGlobalColourScheme(cs);
+    bjsAlignment.setGlobalColorScheme(getGlobalColorScheme());
+    bjsAlignment.setJalviewVersion(jalviewVersion);
+    bjsAlignment.setWebStartUrl(webStartLaunchServletUrl);
+
     int count = 0;
     for (SequenceI seq : alignment.getSequences())
     {
       StringBuilder name = new StringBuilder();
       name.append(seq.getName()).append("/").append(seq.getStart())
               .append("-").append(seq.getEnd());
-      // BioJsSeqPojo seqPojo = new BioJsSeqPojo(seq.getStart(), seq.getEnd(),
-      // String.valueOf(++count),
-      // name.toString(), seq.getSequenceAsString());
-      //
+
       BioJsSeqPojo seqPojo = new BioJsSeqPojo();
       seqPojo.setId(String.valueOf(++count));
       seqPojo.setEnd(seq.getEnd());
@@ -109,41 +143,32 @@ public class BioJsHTMLOutput
               .getSequenceFeatures();
       if (seqFeatures != null)
       {
-
         ArrayList<BioJsFeaturePojo> bjsSeqFeatures = new ArrayList<BioJsFeaturePojo>();
         for (SequenceFeature sf : seqFeatures)
         {
-
-          String featureColour = jalview.util.Format.getHexString(fr
-                  .getColour(sf));
-          BioJsFeaturePojo bjsFeature = new BioJsFeaturePojo();
-          bjsFeature.setFillColor(featureColour);
-          bjsFeature.setXstart(sf.getBegin());
-          bjsFeature.setXend(sf.getEnd());
-          bjsFeature.setText(sf.getType());
-
-          bjsSeqFeatures.add(bjsFeature);
-
+          if (displayedFeatures != null
+                  && displayedFeatures.isVisible(sf.getType()))
+          {
+
+            // TODO: translate graduated/complex colourschemes to biojs model
+            String featureColour = jalview.util.Format.getHexString(fr
+                    .findFeatureColour(Color.white, seq,
+                            seq.findIndex(sf.getBegin())));
+            BioJsFeaturePojo bjsFeature = new BioJsFeaturePojo();
+            bjsFeature.setFillColor(featureColour);
+            bjsFeature.setXstart(seq.findIndex(sf.getBegin()) - 1);
+            bjsFeature.setXend(seq.findIndex(sf.getEnd()));
+            bjsFeature.setText(sf.getType());
+            bjsSeqFeatures.add(bjsFeature);
+          }
         }
-
         seqPojo.setFeatures(bjsSeqFeatures);
       }
       bjsAlignment.getSeqs().add(seqPojo);
     }
 
-    String jalviewData = new com.json.JSONObject(bjsAlignment).toString()
+    return new com.json.JSONObject(bjsAlignment).toString()
             .replaceAll("xstart", "xStart").replaceAll("xend", "xEnd");
-    // String bioJSTemplate = new String(
-    // java.nio.file.Files.readAllBytes(java.nio.file.Paths
-    // .get("resources/templates/BioJSTemplate.txt")));
-    String bioJSTemplate = getBioJsTemplateAsString(this);
-
-    return bioJSTemplate.replaceAll("#sequenceData#", jalviewData)
-            .replaceAll(
-                    "#jalview_logo#",
-                    alignment.getClass()
-                            .getResource("/images/Jalview_Logo.png")
-                            .toString());
   }
 
   public static String getBioJsTemplateAsString(Object currentObj)
@@ -183,8 +208,17 @@ public class BioJsHTMLOutput
         }
       }
     }
-
     return sb.toString();
   }
 
+  public String getGlobalColorScheme()
+  {
+    return globalColorScheme;
+  }
+
+  public void setGlobalColorScheme(String globalColorScheme)
+  {
+    this.globalColorScheme = globalColorScheme;
+  }
+
 }
index 416773d..df5353c 100755 (executable)
@@ -38,6 +38,26 @@ import jalview.datamodel.SequenceI;
 public class FormatAdapter extends AppletFormatAdapter
 {
 
+  public FormatAdapter()
+  {
+    super();
+    if (jalview.bin.Cache.getDefault("STRUCT_FROM_PDB", true))
+    {
+      annotFromStructure = jalview.bin.Cache.getDefault("ADD_TEMPFACT_ANN",
+              true);
+      localSecondaryStruct = jalview.bin.Cache.getDefault("ADD_SS_ANN",
+            true);
+    serviceSecondaryStruct = jalview.bin.Cache.getDefault("USE_RNAVIEW",
+            true);
+    }
+    else
+    {
+      // disable all PDB annotation options
+      annotFromStructure = false;
+      localSecondaryStruct = false;
+      serviceSecondaryStruct = false;
+    }
+  }
   public String formatSequences(String format, SequenceI[] seqs,
           String[] omitHiddenColumns)
   {
index ee1b151..3cb7c3f 100644 (file)
@@ -70,10 +70,13 @@ public class HtmlFile extends AlignFile
         JSONObject sequence = sequenceIter.next();
         String sequcenceString = sequence.get("seq").toString();
         Sequence seq = new Sequence(sequence.get("name").toString(),
-                sequcenceString, 0, sequcenceString.length());
+                sequcenceString, Integer.valueOf(sequence.get("start")
+                        .toString()), Integer.valueOf(sequence.get("end")
+                        .toString()));
 
         JSONArray jsonSeqArray = (JSONArray) sequence.get("features");
-        SequenceFeature[] retrievedSeqFeatures = getJalviewSequenceFeatures(jsonSeqArray);
+        SequenceFeature[] retrievedSeqFeatures = getJalviewSequenceFeatures(
+                jsonSeqArray, seq);
         if (retrievedSeqFeatures != null)
         {
           seq.setSequenceFeatures(retrievedSeqFeatures);
@@ -88,14 +91,15 @@ public class HtmlFile extends AlignFile
   }
 
   public SequenceFeature[] getJalviewSequenceFeatures(
-          JSONArray jsonSeqFeatures)
+          JSONArray jsonSeqFeatures, Sequence seq)
   {
     SequenceFeature[] seqFeatures = null;
     int count = 0;
     if (jsonSeqFeatures != null)
     {
       seqFeatures = new SequenceFeature[jsonSeqFeatures.size()];
-      for (Iterator<JSONObject> seqFeatureItr = jsonSeqFeatures.iterator(); seqFeatureItr
+      for (@SuppressWarnings("unchecked")
+      Iterator<JSONObject> seqFeatureItr = jsonSeqFeatures.iterator(); seqFeatureItr
               .hasNext();)
       {
 
@@ -104,11 +108,10 @@ public class HtmlFile extends AlignFile
         Long begin = (Long) jsonFeature.get("xStart");
         Long end = (Long) jsonFeature.get("xEnd");
         String type = (String) jsonFeature.get("text");
+        // String color = (String) jsonFeature.get("fillColor");
 
-        String color = (String) jsonFeature.get("fillColor");
-
-        sequenceFeature.setBegin(begin.intValue());
-        sequenceFeature.setEnd(end.intValue());
+        sequenceFeature.setBegin(seq.findPosition(begin.intValue()));
+        sequenceFeature.setEnd(seq.findPosition(end.intValue()) - 1);
         sequenceFeature.setType(type);
         seqFeatures[count++] = sequenceFeature;
       }
diff --git a/src/jalview/io/HtmlSvgOutput.java b/src/jalview/io/HtmlSvgOutput.java
new file mode 100644 (file)
index 0000000..0ffbea1
--- /dev/null
@@ -0,0 +1,274 @@
+package jalview.io;
+
+import jalview.datamodel.SequenceI;
+import jalview.gui.AlignViewport;
+import jalview.gui.AlignmentPanel;
+import jalview.gui.AnnotationPanel;
+import jalview.gui.FeatureRenderer;
+import jalview.gui.HTMLOptions;
+import jalview.math.AlignmentDimension;
+import jalview.util.MessageManager;
+
+import java.awt.Color;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.print.Printable;
+import java.awt.print.PrinterException;
+import java.io.File;
+import java.io.FileOutputStream;
+
+import org.jfree.graphics2d.svg.SVGGraphics2D;
+import org.jfree.graphics2d.svg.SVGHints;
+
+public class HtmlSvgOutput
+{
+  AlignViewport av;
+
+  FeatureRenderer fr;
+  AlignmentPanel ap;
+
+  AnnotationPanel annotationPanel;
+
+  public HtmlSvgOutput(File file, AlignmentPanel ap)
+  {
+
+      this.av = ap.av;
+      this.ap = ap;
+      this.annotationPanel = ap.getAnnotationPanel();
+    generateHtmlSvgOutput(file);
+  }
+
+  public void generateHtmlSvgOutput(File file)
+  {
+    try
+    {
+      if (file == null /*
+                        * && !(System.getProperty("java.awt.headless") != null
+                        * && System
+                        * .getProperty("java.awt.headless").equals("true"))
+                        */)
+      {
+
+      JalviewFileChooser chooser = getHTMLChooser();
+      chooser.setFileView(new jalview.io.JalviewFileView());
+      chooser.setDialogTitle(ap.alignFrame.getTitle());
+      chooser.setToolTipText(MessageManager.getString("action.save"));
+      int value = chooser.showSaveDialog(ap.alignFrame);
+
+      if (value == jalview.io.JalviewFileChooser.APPROVE_OPTION)
+      {
+        jalview.bin.Cache.setProperty("LAST_DIRECTORY", chooser
+                .getSelectedFile().getParent());
+        file = chooser.getSelectedFile();
+      }
+      }
+
+      AlignmentDimension aDimension = ap.getAlignmentDimension();
+      SVGGraphics2D g1 = new SVGGraphics2D(aDimension.getWidth(),
+              aDimension.getHeight());
+      SVGGraphics2D g2 = new SVGGraphics2D(aDimension.getWidth(),
+              aDimension.getHeight());
+
+      String renderStyle = jalview.bin.Cache.getDefault("HTML_RENDERING",
+              "Prompt each time");
+
+      // If we need to prompt, and if the GUI is visible then
+      // Prompt for rendering style
+      if (renderStyle.equalsIgnoreCase("Prompt each time")
+              && !(System.getProperty("java.awt.headless") != null && System
+                      .getProperty("java.awt.headless").equals("true")))
+      {
+        HTMLOptions svgOption = new HTMLOptions();
+        renderStyle = svgOption.getValue();
+
+        if (renderStyle == null || svgOption.cancelled)
+        {
+          return;
+        }
+      }
+
+      if (renderStyle.equalsIgnoreCase("lineart"))
+      {
+        g1.setRenderingHint(SVGHints.KEY_DRAW_STRING_TYPE,
+                SVGHints.VALUE_DRAW_STRING_TYPE_VECTOR);
+        g2.setRenderingHint(SVGHints.KEY_DRAW_STRING_TYPE,
+                SVGHints.VALUE_DRAW_STRING_TYPE_VECTOR);
+      }
+      printUnwrapped(aDimension.getWidth(), aDimension.getHeight(), 0, g1,
+              g2);
+      FileOutputStream out = new FileOutputStream(file);
+
+      String titleSvgData = g1.getSVGDocument();
+      String alignSvgData = g2.getSVGDocument();
+      String htmlData = getHtml(titleSvgData, alignSvgData);
+
+      out.write(htmlData.getBytes());
+      out.flush();
+      out.close();
+      if (!(System.getProperty("java.awt.headless") != null && System
+              .getProperty("java.awt.headless").equals("true")))
+      {
+      jalview.util.BrowserLauncher.openURL("file:///" + file);
+      }
+    } catch (Exception e)
+    {
+      e.printStackTrace();
+    }
+  }
+  
+  static JalviewFileChooser getHTMLChooser()
+  {
+    return new jalview.io.JalviewFileChooser(
+            jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+            { "html" }, new String[]
+            { "Hypertext Markup Language" }, "Hypertext Markup Language");
+  }
+
+  public int printUnwrapped(int pwidth, int pheight, int pi, Graphics... pg)
+          throws PrinterException
+  {
+    int idWidth = ap.getVisibleIdWidth(false);
+    FontMetrics fm = ap.getFontMetrics(av.getFont());
+    int scaleHeight = av.getCharHeight() + fm.getDescent();
+
+    pg[0].setColor(Color.white);
+    pg[0].fillRect(0, 0, pwidth, pheight);
+    pg[0].setFont(av.getFont());
+
+    // //////////////////////////////////
+    // / How many sequences and residues can we fit on a printable page?
+    int totalRes = (pwidth - idWidth) / av.getCharWidth();
+    int totalSeq = (pheight - scaleHeight) / av.getCharHeight() - 1;
+    int pagesWide = (av.getAlignment().getWidth() / totalRes) + 1;
+
+    // ///////////////////////////
+    // / Only print these sequences and residues on this page
+    int startRes;
+
+    // ///////////////////////////
+    // / Only print these sequences and residues on this page
+    int endRes;
+
+    // ///////////////////////////
+    // / Only print these sequences and residues on this page
+    int startSeq;
+
+    // ///////////////////////////
+    // / Only print these sequences and residues on this page
+    int endSeq;
+    startRes = (pi % pagesWide) * totalRes;
+    endRes = (startRes + totalRes) - 1;
+
+    if (endRes > (av.getAlignment().getWidth() - 1))
+    {
+      endRes = av.getAlignment().getWidth() - 1;
+    }
+    startSeq = (pi / pagesWide) * totalSeq;
+    endSeq = startSeq + totalSeq;
+    if (endSeq > av.getAlignment().getHeight())
+    {
+      endSeq = av.getAlignment().getHeight();
+    }
+    int pagesHigh = ((av.getAlignment().getHeight() / totalSeq) + 1)
+            * pheight;
+    if (av.isShowAnnotation())
+    {
+      pagesHigh += ap.getAnnotationPanel().adjustPanelHeight() + 3;
+    }
+    pagesHigh /= pheight;
+    if (pi >= (pagesWide * pagesHigh))
+    {
+      return Printable.NO_SUCH_PAGE;
+    }
+
+    // draw Scale
+    pg[1].translate(0, 0);
+    ap.getScalePanel().drawScale(pg[1], startRes, endRes, pwidth - idWidth,
+            scaleHeight);
+    pg[1].translate(-idWidth, scaleHeight);
+
+    // //////////////
+    // Draw the ids
+    Color currentColor = null;
+    Color currentTextColor = null;
+    pg[0].translate(0, scaleHeight);
+    pg[0].setFont(ap.getIdPanel().getIdCanvas().getIdfont());
+    SequenceI seq;
+    for (int i = startSeq; i < endSeq; i++)
+    {
+      seq = av.getAlignment().getSequenceAt(i);
+      if ((av.getSelectionGroup() != null)
+              && av.getSelectionGroup().getSequences(null).contains(seq))
+      {
+        currentColor = Color.gray;
+        currentTextColor = Color.black;
+      }
+      else
+      {
+        currentColor = av.getSequenceColour(seq);
+        currentTextColor = Color.black;
+      }
+      pg[0].setColor(currentColor);
+      pg[0].fillRect(0, (i - startSeq) * av.getCharHeight(), idWidth,
+              av.getCharHeight());
+      pg[0].setColor(currentTextColor);
+      int xPos = 0;
+      if (av.isRightAlignIds())
+      {
+        fm = pg[0].getFontMetrics();
+        xPos = idWidth
+                - fm.stringWidth(seq.getDisplayId(av.getShowJVSuffix()))
+                - 4;
+      }
+      pg[0].drawString(
+              seq.getDisplayId(av.getShowJVSuffix()),
+              xPos,
+              (((i - startSeq) * av.getCharHeight()) + av.getCharHeight())
+                      - (av.getCharHeight() / 5));
+    }
+    pg[0].setFont(av.getFont());
+    pg[0].translate(idWidth, 0);
+
+    // draw main sequence panel
+    pg[1].translate(idWidth, 0);
+    ap.getSeqPanel().seqCanvas.drawPanel(pg[1], startRes, endRes, startSeq,
+            endSeq, 0);
+    if (av.isShowAnnotation() && (endSeq == av.getAlignment().getHeight()))
+    {
+      // draw annotation label - need to offset for current scroll position
+      int offset = -ap.getAlabels().getScrollOffset();
+      pg[0].translate(0, offset);
+      pg[0].translate(-idWidth - 3,
+              (endSeq - startSeq) * av.getCharHeight() + 3);
+      ap.getAlabels().drawComponent(pg[0], idWidth);
+      pg[0].translate(idWidth + 3, 0);
+      pg[0].translate(0, -offset);
+
+      // draw annotation - need to offset for current scroll position
+      pg[1].translate(0, offset);
+      pg[1].translate(-idWidth - 3,
+              (endSeq - startSeq) * av.getCharHeight() + 3);
+      pg[1].translate(idWidth + 3, 0);
+      ap.getAnnotationPanel().renderer.drawComponent(
+              ap.getAnnotationPanel(), av, pg[1], -1, startRes, endRes + 1);
+      pg[1].translate(0, -offset);
+    }
+
+    return Printable.PAGE_EXISTS;
+  }
+  
+  private String getHtml(String titleSvg, String alignmentSvg)
+  {
+    StringBuilder htmlSvg = new StringBuilder();
+    htmlSvg.append("<html><style type=\"text/css\"> div.title {"
+            + "height: 100%; width:11%; float: left; }"
+            + "div.align { height: 100%; width:89%;"
+            + "overflow: scroll; float: right; } </style>"
+            + "<div style=\"width:100%; height:100%; overflow: hidden\">"
+            + "<div class=\"title\">");
+    htmlSvg.append(titleSvg);
+    htmlSvg.append("</div><div class=\"align\">").append(alignmentSvg);
+    htmlSvg.append("</div>");
+    return htmlSvg.toString();
+  }
+}
index 365982e..4fb2516 100755 (executable)
@@ -136,13 +136,14 @@ public class IdentifyFile
 
           break;
         }
-        if (data.matches("<(\"[^\"]*\"|'[^']*'|[^'\">])*>"))
+        // if (data.matches("<(\"[^\"]*\"|'[^']*'|[^'\">])*>"))
+        if (data.matches("<(?i)html(\"[^\"]*\"|'[^']*'|[^'\">])*>"))
         {
           reply = "HTML";
           break;
         }
 
-        if ((data.indexOf("<") > -1))
+        if (data.matches("<(?i)rnaml (\"[^\"]*\"|'[^']*'|[^'\">])*>"))
         {
           reply = "RNAML";
 
index d366edc..c075fda 100644 (file)
  */
 package jalview.io;
 
-import java.io.BufferedReader;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.ArrayList;
-
 import jalview.analysis.SecStrConsensus.SimpleBP;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.Annotation;
@@ -33,6 +27,14 @@ import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceI;
 import jalview.util.MessageManager;
 
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+
+import com.stevesoft.pat.Regex;
+
 import fr.orsay.lri.varna.exceptions.ExceptionFileFormatOrSyntax;
 import fr.orsay.lri.varna.exceptions.ExceptionLoadingFailed;
 import fr.orsay.lri.varna.exceptions.ExceptionPermissionDenied;
@@ -139,6 +141,14 @@ public class RnamlFile extends AlignFile
       int end = seq.length();
 
       id = current.getName();
+      if (id == null || id.trim().length() == 0)
+      {
+        id = safeName(getDataName());
+        if (result.size() > 1)
+        {
+          id += "." + i;
+        }
+      }
       seqs[i] = new Sequence(id, seq, begin, end);
 
       seqs[i].setEnd(seqs[i].findPosition(seqs[i].getLength()));
@@ -157,8 +167,11 @@ public class RnamlFile extends AlignFile
                         annot[k]).charAt(0), 0f);
       }
 
-      AlignmentAnnotation align = new AlignmentAnnotation("Sec. str.",
-              current.getID(), ann);
+      AlignmentAnnotation align = new AlignmentAnnotation(
+              "Secondary Structure",
+              current.getID().trim().length() > 0 ? "Secondary Structure for "
+                      + current.getID()
+                      : "", ann);
 
       seqs[i].addAlignmentAnnotation(align);
       seqs[i].setRNA(result.get(i));
@@ -204,13 +217,18 @@ public class RnamlFile extends AlignFile
   private String safeName(String dataName)
   {
     int b = 0;
-    while ((b = dataName.indexOf("/")) > -1 && b < dataName.length())
+    if ((b = dataName.lastIndexOf(".")) > 0)
     {
-      dataName = dataName.substring(b + 1).trim();
-
+      dataName = dataName.substring(0, b - 1);
+    }
+    b = 0;
+    Regex m = new Regex("[\\/]?([-A-Za-z0-9]+)\\.?");
+    String mm = dataName;
+    while (m.searchFrom(dataName, b))
+    {
+      mm = m.stringMatched();
+      b = m.matchedTo();
     }
-    int e = (dataName.length() - dataName.indexOf(".")) + 1;
-    dataName = dataName.substring(1, e).trim();
-    return dataName;
+    return mm;
   }
 }
index 0a18be0..3b9fb00 100644 (file)
@@ -23,7 +23,6 @@
  */
 package jalview.io;
 
-import jalview.datamodel.AlignmentI;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.Annotation;
@@ -41,7 +40,9 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.Hashtable;
+import java.util.LinkedHashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.StringTokenizer;
 import java.util.Vector;
 
@@ -186,7 +187,7 @@ public class StockholmFile extends AlignFile
     String version;
     // String id;
     Hashtable seqAnn = new Hashtable(); // Sequence related annotations
-    Hashtable seqs = new Hashtable();
+    LinkedHashMap<String, String> seqs = new LinkedHashMap<String, String>();
     Regex p, r, rend, s, x;
     // Temporary line for processing RNA annotation
     // String RNAannot = "";
@@ -198,7 +199,9 @@ public class StockholmFile extends AlignFile
     r = new Regex("# STOCKHOLM ([\\d\\.]+)");
     if (!r.search(nextLine()))
     {
-      throw new IOException(MessageManager.getString("exception.stockholm_invalid_format"));
+      throw new IOException(
+              MessageManager
+                      .getString("exception.stockholm_invalid_format"));
     }
     else
     {
@@ -258,12 +261,11 @@ public class StockholmFile extends AlignFile
           }
         }
         // logger.debug("Number of sequences: " + this.noSeqs);
-        Enumeration accs = seqs.keys();
-        while (accs.hasMoreElements())
+        for (Map.Entry<String, String> skey : seqs.entrySet())
         {
-          String acc = (String) accs.nextElement();
           // logger.debug("Processing sequence " + acc);
-          String seq = (String) seqs.remove(acc);
+          String acc = skey.getKey();
+          String seq = skey.getValue();
           if (maxLength < seq.length())
           {
             maxLength = seq.length();
@@ -367,6 +369,7 @@ public class StockholmFile extends AlignFile
                     AlignmentAnnotation an = (AlignmentAnnotation) vv
                             .elementAt(ii);
                     seqO.addAlignmentAnnotation(an);
+                    annotations.add(an);
                   }
                 }
               }
@@ -416,9 +419,11 @@ public class StockholmFile extends AlignFile
         if (!x.search(line))
         {
           // logger.error("Could not parse sequence line: " + line);
-          throw new IOException(MessageManager.formatMessage("exception.couldnt_parse_sequence_line", new String[]{line}));
+          throw new IOException(MessageManager.formatMessage(
+                  "exception.couldnt_parse_sequence_line", new String[]
+                  { line }));
         }
-        String ns = (String) seqs.get(x.stringMatched(1));
+        String ns = seqs.get(x.stringMatched(1));
         if (ns == null)
         {
           ns = "";
@@ -528,7 +533,9 @@ public class StockholmFile extends AlignFile
           }
           else
           {
-            throw new IOException(MessageManager.formatMessage("exception.error_parsing_line", new String[]{line}));
+            throw new IOException(MessageManager.formatMessage(
+                    "exception.error_parsing_line", new String[]
+                    { line }));
           }
         }
         else if (annType.equals("GC"))
@@ -636,9 +643,13 @@ public class StockholmFile extends AlignFile
               strucAnn = new Hashtable();
             }
 
-            Vector newStruc = new Vector();
+            Vector<AlignmentAnnotation> newStruc = new Vector<AlignmentAnnotation>();
             parseAnnotationRow(newStruc, type, ns);
-
+            for (AlignmentAnnotation alan : newStruc)
+            {
+              alan.visible = false;
+            }
+            // annotations.addAll(newStruc);
             strucAnn.put(type, newStruc);
             seqAnn.put(acc, strucAnn);
           }
@@ -653,7 +664,9 @@ public class StockholmFile extends AlignFile
         }
         else
         {
-          throw new IOException(MessageManager.formatMessage("exception.unknown_annotation_detected", new String[]{annType,annContent}));
+          throw new IOException(MessageManager.formatMessage(
+                  "exception.unknown_annotation_detected", new String[]
+                  { annType, annContent }));
         }
       }
     }
@@ -813,25 +826,29 @@ public class StockholmFile extends AlignFile
       // be written out
       if (ss)
       {
-        if (detectbrackets.search(pos))
-        {
-          ann.secondaryStructure = jalview.schemes.ResidueProperties
-                  .getRNASecStrucState(pos).charAt(0);
-        }
-        else
+        //if (" .-_".indexOf(pos) == -1)
         {
-          ann.secondaryStructure = jalview.schemes.ResidueProperties
-                  .getDssp3state(pos).charAt(0);
-        }
+          if (detectbrackets.search(pos))
+          {
+            ann.secondaryStructure = jalview.schemes.ResidueProperties
+                    .getRNASecStrucState(pos).charAt(0);
+          }
+          else
+          {
+            ann.secondaryStructure = jalview.schemes.ResidueProperties
+                    .getDssp3state(pos).charAt(0);
+          }
 
-        if (ann.secondaryStructure == pos.charAt(0) || pos.charAt(0) == 'C')
-        {
-          ann.displayCharacter = ""; // null; // " ";
-        }
-        else
-        {
-          ann.displayCharacter = " " + ann.displayCharacter;
+          if (ann.secondaryStructure == pos.charAt(0))
+          {
+            ann.displayCharacter = ""; // null; // " ";
+          }
+          else
+          {
+            ann.displayCharacter = " " + ann.displayCharacter;
+          }
         }
+        
       }
 
       els[i] = ann;
@@ -842,7 +859,9 @@ public class StockholmFile extends AlignFile
     {
       annot = (AlignmentAnnotation) e.nextElement();
       if (annot.label.equals(type))
+      {
         break;
+      }
       annot = null;
     }
     if (annot == null)
@@ -887,7 +906,9 @@ public class StockholmFile extends AlignFile
         for (int idb = 0; idb < s[in].getDBRef().length; idb++)
         {
           if (dataRef == null)
+          {
             dataRef = new Hashtable();
+          }
 
           String datAs1 = s[in].getDBRef()[idb].getSource().toString()
                   + " ; "
@@ -960,39 +981,19 @@ public class StockholmFile extends AlignFile
             String key = type2id(feature);
 
             if (key == null)
+            {
               continue;
+            }
 
             // out.append("#=GR ");
             out.append(new Format("%-" + maxid + "s").form("#=GR "
                     + printId(s[i]) + " " + key + " "));
             ann = alAnot[j].annotations;
+            boolean isrna = alAnot[j].isValidStruc();
             String seq = "";
             for (int k = 0; k < ann.length; k++)
             {
-              annot = ann[k];
-              String ch = (annot == null) ? Character.toString(s[i]
-                      .getCharAt(k)) : annot.displayCharacter;
-              if (ch.length() == 0)
-              {
-                if (key.equals("SS"))
-                {
-                  char ll = annot.secondaryStructure;
-                  seq = (Character.toString(ll).equals(" ")) ? seq + "C"
-                          : seq + ll;
-                }
-                else
-                {
-                  seq += ".";
-                }
-              }
-              else if (ch.length() == 1)
-              {
-                seq += ch;
-              }
-              else if (ch.length() > 1)
-              {
-                seq += ch.charAt(1);
-              }
+              seq += outputCharacter(key, k, isrna, ann, s[i]);
             }
             out.append(seq);
             out.append(newline);
@@ -1013,43 +1014,41 @@ public class StockholmFile extends AlignFile
       for (int ia = 0; ia < al.getAlignmentAnnotation().length; ia++)
       {
         aa = al.getAlignmentAnnotation()[ia];
-        if (aa.autoCalculated || !aa.visible)
+        if (aa.autoCalculated || !aa.visible || aa.sequenceRef != null)
         {
           continue;
         }
         String seq = "";
         String label;
-
+        String key = "";
         if (aa.label.equals("seq"))
+        {
           label = "seq_cons";
+        }
         else
-          label = type2id(aa.label.toLowerCase()) + "_cons";
-
+        {
+          key = type2id(aa.label.toLowerCase());
+          if (key == null)
+          {
+            label = aa.label;
+          }
+          else
+          {
+            label = key + "_cons";
+          }
+        }
         if (label == null)
+        {
           label = aa.label;
+        }
+        label = label.replace(" ", "_");
 
         out.append(new Format("%-" + maxid + "s").form("#=GC " + label
                 + " "));
+        boolean isrna = aa.isValidStruc();
         for (int j = 0; j < aa.annotations.length; j++)
         {
-          String ch = (aa.annotations[j] == null) ? "-"
-                  : aa.annotations[j].displayCharacter;
-          if (ch.length() == 0)
-          {
-            char ll = aa.annotations[j].secondaryStructure;
-            if (Character.toString(ll).equals(" "))
-              seq += "C";
-            else
-              seq += ll;
-          }
-          else if (ch.length() == 1)
-          {
-            seq += ch;
-          }
-          else if (ch.length() > 1)
-          {
-            seq += ch.charAt(1);
-          }
+          seq += outputCharacter(key, j, isrna, aa.annotations, null);
         }
         out.append(seq);
         out.append(newline);
@@ -1058,6 +1057,57 @@ public class StockholmFile extends AlignFile
     return out.toString();
   }
 
+  /**
+   * add an annotation character to the output row
+   * 
+   * @param seq
+   * @param key
+   * @param k
+   * @param isrna
+   * @param ann
+   * @param sequenceI
+   */
+  private char outputCharacter(String key, int k,
+          boolean isrna, Annotation[] ann, SequenceI sequenceI)
+  {
+    char seq = ' ';
+    Annotation annot = ann[k];
+    String ch = (annot == null) ? ((sequenceI == null) ? "-" : Character
+            .toString(sequenceI.getCharAt(k)))
+            : annot.displayCharacter;
+    if (key != null && key.equals("SS"))
+    {
+      if (annot == null)
+      {
+        // sensible gap character if one is available or make one up
+        return sequenceI == null ? '-' : sequenceI
+                .getCharAt(k);
+      }
+      else
+      {
+        // valid secondary structure AND no alternative label (e.g. ' B')
+        if (annot.secondaryStructure > ' ' && ch.length() < 2)
+        {
+          return annot.secondaryStructure;
+        }
+      }
+    }
+
+    if (ch.length() == 0)
+    {
+      seq = '.';
+    }
+    else if (ch.length() == 1)
+    {
+      seq = ch.charAt(0);
+    }
+    else if (ch.length() > 1)
+    {
+      seq = ch.charAt(1);
+    }
+    return seq;
+  }
+
   public String print()
   {
     out = new StringBuffer();
@@ -1121,7 +1171,7 @@ public class StockholmFile extends AlignFile
     }
     if (key != null)
     {
-      return (String) key;
+      return key;
     }
     System.err.println("Warning : Unknown Stockholm annotation type: "
             + type);
index b75576e..4bf8176 100755 (executable)
@@ -1767,7 +1767,7 @@ public class GAlignFrame extends JInternalFrame
     sortByAnnotScore.setText(MessageManager
             .getString("label.sort_by_score"));
     sort.add(sortByAnnotScore);
-    sortByAnnotScore.addMenuListener(new javax.swing.event.MenuListener()
+    sort.addMenuListener(new javax.swing.event.MenuListener()
     {
 
       @Override
index 4751d25..97ec9fe 100755 (executable)
@@ -22,10 +22,16 @@ package jalview.jbgui;
 
 import jalview.util.MessageManager;
 
-import java.awt.*;
-import java.awt.event.*;
+import java.awt.FlowLayout;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 
-import javax.swing.*;
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JFrame;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
 
 /**
  * DOCUMENT ME!
@@ -374,7 +380,7 @@ public class GDesktop extends JFrame
     toolsMenu.add(showConsole);
     toolsMenu.add(showNews);
     toolsMenu.add(garbageCollect);
-    toolsMenu.add(snapShotWindow);
+    // toolsMenu.add(snapShotWindow);
     inputMenu.add(inputLocalFileMenuItem);
     inputMenu.add(inputURLMenuItem);
     inputMenu.add(inputTextboxMenuItem);
index a232377..610f32e 100755 (executable)
@@ -26,6 +26,7 @@ import jalview.util.MessageManager;
 
 import java.awt.BorderLayout;
 import java.awt.Color;
+import java.awt.Component;
 import java.awt.Dimension;
 import java.awt.FlowLayout;
 import java.awt.Font;
@@ -36,6 +37,7 @@ import java.awt.Insets;
 import java.awt.Rectangle;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
 import java.awt.event.KeyEvent;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
@@ -45,6 +47,7 @@ import javax.swing.DefaultListCellRenderer;
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
 import javax.swing.JComboBox;
+import javax.swing.JFileChooser;
 import javax.swing.JLabel;
 import javax.swing.JList;
 import javax.swing.JPanel;
@@ -56,6 +59,8 @@ import javax.swing.SwingConstants;
 import javax.swing.border.Border;
 import javax.swing.border.EmptyBorder;
 import javax.swing.border.TitledBorder;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
 
@@ -128,8 +133,10 @@ public class GPreferences extends JPanel
   protected JCheckBox showNpTooltip = new JCheckBox();
 
   /*
-   * Annotations tab components
+   * Structure tab and components
    */
+  protected JPanel structureTab;
+
   protected JCheckBox structFromPdb = new JCheckBox();
 
   protected JCheckBox useRnaView = new JCheckBox();
@@ -239,7 +246,7 @@ public class GPreferences extends JPanel
    */
   private void jbInit() throws Exception
   {
-    JTabbedPane tabbedPane = new JTabbedPane();
+    final JTabbedPane tabbedPane = new JTabbedPane();
     this.setLayout(new BorderLayout());
     JPanel okCancelPanel = initOkCancelPanel();
     this.add(tabbedPane, BorderLayout.CENTER);
@@ -273,6 +280,31 @@ public class GPreferences extends JPanel
      */
     wsTab.setLayout(new BorderLayout());
     tabbedPane.add(wsTab, MessageManager.getString("label.web_services"));
+
+    /*
+     * Handler to validate a tab before leaving it - currently only for
+     * Structure.
+     */
+    tabbedPane.addChangeListener(new ChangeListener()
+    {
+      private Component lastTab;
+
+      @Override
+      public void stateChanged(ChangeEvent e)
+      {
+        if (lastTab == structureTab
+                && tabbedPane.getSelectedComponent() != structureTab)
+        {
+          if (!validateStructure())
+          {
+            tabbedPane.setSelectedComponent(structureTab);
+            return;
+          }
+        }
+        lastTab = tabbedPane.getSelectedComponent();
+      }
+
+    });
   }
 
   /**
@@ -691,7 +723,8 @@ public class GPreferences extends JPanel
    */
   private JPanel initStructureTab()
   {
-    JPanel structureTab = new JPanel();
+    structureTab = new JPanel();
+
     structureTab.setBorder(new TitledBorder(MessageManager
             .getString("label.structure_options")));
     structureTab.setLayout(null);
@@ -749,6 +782,15 @@ public class GPreferences extends JPanel
     structViewer.setBounds(new Rectangle(160, ypos, 120, height));
     structViewer.addItem(Viewer.JMOL.name());
     structViewer.addItem(Viewer.CHIMERA.name());
+    structViewer.addActionListener(new ActionListener()
+    {
+      @Override
+      public void actionPerformed(ActionEvent e)
+      {
+        structureViewer_actionPerformed((String) structViewer
+                .getSelectedItem());
+      }
+    });
     structureTab.add(structViewer);
 
     ypos += lineSpacing;
@@ -756,20 +798,90 @@ public class GPreferences extends JPanel
     pathLabel.setFont(new java.awt.Font("SansSerif", 0, 11));
     pathLabel.setHorizontalAlignment(SwingConstants.LEFT);
     pathLabel.setText(MessageManager.getString("label.chimera_path"));
-    pathLabel.setToolTipText(MessageManager
-            .getString("label.chimera_path_tip"));
+    final String tooltip = JvSwingUtils.wrapTooltip(true,
+            MessageManager.getString("label.chimera_path_tip"));
+    pathLabel.setToolTipText(tooltip);
     pathLabel.setBounds(new Rectangle(10, ypos, 140, height));
     structureTab.add(pathLabel);
 
     chimeraPath.setFont(verdana11);
     chimeraPath.setText("");
     chimeraPath.setBounds(new Rectangle(160, ypos, 300, height));
+    chimeraPath.addMouseListener(new MouseAdapter()
+    {
+      @Override
+      public void mouseClicked(MouseEvent e)
+      {
+        if (e.getClickCount() == 2)
+        {
+          String chosen = openFileChooser();
+          if (chosen != null)
+          {
+            chimeraPath.setText(chosen);
+          }
+        }
+      }
+    });
     structureTab.add(chimeraPath);
 
     return structureTab;
   }
 
   /**
+   * Action on choosing a structure viewer from combobox options.
+   * 
+   * @param selectedItem
+   */
+  protected void structureViewer_actionPerformed(String selectedItem)
+  {
+  }
+
+  /**
+   * Show a dialog for the user to choose a file. Returns the chosen path, or
+   * null on Cancel.
+   * 
+   * @return
+   */
+  protected String openFileChooser()
+  {
+    String choice = null;
+    JFileChooser chooser = new JFileChooser();
+
+    // chooser.setFileView(new JalviewFileView());
+    chooser.setDialogTitle(MessageManager
+            .getString("label.open_local_file"));
+    chooser.setToolTipText(MessageManager.getString("action.open"));
+
+    int value = chooser.showOpenDialog(this);
+
+    if (value == JFileChooser.APPROVE_OPTION)
+    {
+      choice = chooser.getSelectedFile().getPath();
+    }
+    return choice;
+  }
+
+  /**
+   * Validate the structure tab preferences; if invalid, set focus on this tab.
+   * 
+   * @param e
+   */
+  protected boolean validateStructure(FocusEvent e)
+  {
+    if (!validateStructure())
+    {
+      e.getComponent().requestFocusInWindow();
+      return false;
+    }
+    return true;
+  }
+
+  protected boolean validateStructure()
+  {
+    return false;
+  }
+
+  /**
    * Initialises the Visual tabbed panel.
    * 
    * @return
index 7e1be58..58b2eb1 100644 (file)
@@ -283,7 +283,7 @@ public class GStructureViewer extends JInternalFrame
 
   JMenu fileMenu = new JMenu();
 
-  JMenu savemenu = new JMenu();
+  protected JMenu savemenu = new JMenu();
 
   JMenuItem pdbFile = new JMenuItem();
 
index 7c2fe10..8e8747f 100644 (file)
@@ -19,6 +19,10 @@ import java.util.ArrayList;
 public class BioJsAlignmentPojo
 {
   private String globalColorScheme = "none";
+
+  private String jalviewVersion;
+
+  private String webStartUrl;
   private ArrayList<BioJsSeqPojo> seqs = new ArrayList<BioJsSeqPojo>();
 
   public BioJsAlignmentPojo()
@@ -65,6 +69,26 @@ public class BioJsAlignmentPojo
   }
 
 
+  public String getJalviewVersion()
+  {
+    return jalviewVersion;
+  }
+
+  public void setJalviewVersion(String jalviewVersion)
+  {
+    this.jalviewVersion = jalviewVersion;
+  }
+
+  public String getWebStartUrl()
+  {
+    return webStartUrl;
+  }
+
+  public void setWebStartUrl(String webStartUrl)
+  {
+    this.webStartUrl = webStartUrl;
+  }
+
   public enum JalviewBioJsColorSchemeMapper
   {
     USER_DEFINED("User Defined", "user defined", null), NONE("None", "foo",
diff --git a/src/jalview/math/AlignmentDimension.java b/src/jalview/math/AlignmentDimension.java
new file mode 100644 (file)
index 0000000..ea3abf4
--- /dev/null
@@ -0,0 +1,35 @@
+package jalview.math;
+
+public class AlignmentDimension
+{
+  private int width;
+
+  private int height;
+
+  public AlignmentDimension(int width, int height)
+  {
+    this.width = width;
+    this.height = height;
+  }
+
+  public int getWidth()
+  {
+    return width;
+  }
+
+  public void setWidth(int width)
+  {
+    this.width = width;
+  }
+
+  public int getHeight()
+  {
+    return height;
+  }
+
+  public void setHeight(int height)
+  {
+    this.height = height;
+  }
+
+}
index e731910..d5b2f49 100644 (file)
@@ -27,6 +27,7 @@ import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.Annotation;
 import jalview.datamodel.ColumnSelection;
 import jalview.schemes.ColourSchemeI;
+import jalview.schemes.ResidueProperties;
 
 import java.awt.BasicStroke;
 import java.awt.Color;
@@ -77,17 +78,17 @@ public class AnnotationRenderer
     int x2 = (x * charWidth);
     Regex closeparen = new Regex("(\\))");
 
-    String dc = (column == 0 || row_annotations[column - 1] == null) ? ""
-            : row_annotations[column - 1].displayCharacter;
+    char dc = (column == 0 || row_annotations[column - 1] == null) ? ' '
+            : row_annotations[column - 1].secondaryStructure;
 
     boolean diffupstream = sCol == 0 || row_annotations[sCol - 1] == null
-            || !dc.equals(row_annotations[sCol - 1].displayCharacter);
+            || dc != row_annotations[sCol - 1].secondaryStructure;
     boolean diffdownstream = !validRes || !validEnd
             || row_annotations[column] == null
-            || !dc.equals(row_annotations[column].displayCharacter);
+            || dc != row_annotations[column].secondaryStructure;
     // System.out.println("Column "+column+" diff up: "+diffupstream+" down:"+diffdownstream);
     // If a closing base pair half of the stem, display a backward arrow
-    if (column > 0 && closeparen.search(dc))
+    if (column > 0 && ResidueProperties.isCloseParenRNA(dc))
     {
 
       if (diffupstream)
@@ -574,11 +575,15 @@ public class AnnotationRenderer
                 }
               }
             }
-            if (!row.isValidStruc())
+            if (row.getInvalidStrucPos() > x)
             {
               g.setColor(Color.orange);
-              g.fillRect((int) row.getInvalidStrucPos() * charWidth, y,
-                      charWidth, charHeight);
+              g.fillRect(x * charWidth, y, charWidth, charHeight);
+            }
+            else if (row.getInvalidStrucPos() == x)
+            {
+              g.setColor(Color.orange.darker());
+              g.fillRect(x * charWidth, y, charWidth, charHeight);
             }
             if (validCharWidth
                     && validRes
@@ -617,9 +622,13 @@ public class AnnotationRenderer
               charOffset = (int) ((charWidth - fmWidth) / 2f);
 
               if (row_annotations[column].colour == null)
+              {
                 g.setColor(Color.black);
+              }
               else
+              {
                 g.setColor(row_annotations[column].colour);
+              }
 
               if (column == 0 || row.graph > 0)
               {
@@ -1190,9 +1199,13 @@ public class AnnotationRenderer
       }
 
       if (aa_annotations[column].colour == null)
+      {
         g.setColor(Color.black);
+      }
       else
+      {
         g.setColor(aa_annotations[column].colour);
+      }
 
       y1 = y
               - (int) (((aa_annotations[column - 1].value - min) / range) * graphHeight);
@@ -1264,9 +1277,13 @@ public class AnnotationRenderer
         continue;
       }
       if (aa_annotations[column].colour == null)
+      {
         g.setColor(Color.black);
+      }
       else
+      {
         g.setColor(aa_annotations[column].colour);
+      }
 
       y1 = y
               - (int) (((aa_annotations[column].value - min) / (range)) * _aa.graphHeight);
@@ -1384,9 +1401,13 @@ public class AnnotationRenderer
       if (aa_annotations[j] != null)
       {
         if (aa_annotations[j].colour == null)
+        {
           g.setColor(Color.black);
+        }
         else
+        {
           g.setColor(aa_annotations[j].colour);
+        }
 
         height = (int) ((aa_annotations[j].value / _aa.graphMax) * y);
         if (height > y)
index 1a4d7d7..85ec3ae 100755 (executable)
@@ -53,7 +53,6 @@ public class AnnotationColourGradient extends FollowerColourScheme
   private boolean predefinedColours = false;
 
   private boolean seqAssociated = false;
-
   /**
    * false if the scheme was constructed without a minColour and maxColour used
    * to decide if existing colours should be taken from annotation elements when
@@ -141,6 +140,12 @@ public class AnnotationColourGradient extends FollowerColourScheme
     bb = maxColour.getBlue() - b1;
 
     noGradient = false;
+    aamax = annotation.graphMax;
+    aamin = annotation.graphMin;
+    if (annotation.isRNA())
+    {
+      ColourSchemeProperty.initRnaHelicesShading(1 + (int) aamax);
+    }
   }
 
   @Override
@@ -162,6 +167,7 @@ public class AnnotationColourGradient extends FollowerColourScheme
       // resolve the context containing all the annotation for the sequence
       AnnotatedCollectionI alcontext = alignment instanceof AlignmentI ? alignment
               : alignment.getContext();
+      boolean f = true,rna=false;
       for (AlignmentAnnotation alan : alcontext.findAnnotation(annotation
               .getCalcId()))
       {
@@ -169,12 +175,30 @@ public class AnnotationColourGradient extends FollowerColourScheme
                 && (alan.label != null && annotation != null && alan.label
                         .equals(annotation.label)))
         {
+          if (!rna && alan.isRNA())
+          {
+            rna = true;
+          }
           seqannot.put(alan.sequenceRef, alan);
+          if (f || alan.graphMax > aamax)
+          {
+            aamax = alan.graphMax;
+          }
+          if (f || alan.graphMin < aamin)
+          {
+            aamin = alan.graphMin;
+          }
+          f = false;
         }
       }
+      if (rna)
+      {
+        ColourSchemeProperty.initRnaHelicesShading(1 + (int) aamax);
+      }
     }
   }
 
+  float aamin = 0f, aamax = 0f;
   public String getAnnotation()
   {
     return annotation.label;
@@ -262,7 +286,8 @@ public class AnnotationColourGradient extends FollowerColourScheme
                 || (annotationThreshold != null && (aboveAnnotationThreshold == ABOVE_THRESHOLD ? aj.value >= annotationThreshold.value
                         : aj.value <= annotationThreshold.value)))
         {
-          if (predefinedColours && aj.colour != null)
+          if (predefinedColours && aj.colour != null
+                  && !aj.colour.equals(Color.black))
           {
             currentColour = aj.colour;
           }
@@ -278,9 +303,16 @@ public class AnnotationColourGradient extends FollowerColourScheme
               }
               else
               {
-              currentColour = annotation.annotations[j].secondaryStructure == 'H' ? jalview.renderer.AnnotationRenderer.HELIX_COLOUR
-                      : annotation.annotations[j].secondaryStructure == 'E' ? jalview.renderer.AnnotationRenderer.SHEET_COLOUR
-                              : jalview.renderer.AnnotationRenderer.STEM_COLOUR;
+                if (annotation.isRNA())
+                {
+                  currentColour = ColourSchemeProperty.rnaHelices[(int) aj.value];
+                }
+                else
+                {
+                  currentColour = annotation.annotations[j].secondaryStructure == 'H' ? jalview.renderer.AnnotationRenderer.HELIX_COLOUR
+                          : annotation.annotations[j].secondaryStructure == 'E' ? jalview.renderer.AnnotationRenderer.SHEET_COLOUR
+                                  : jalview.renderer.AnnotationRenderer.STEM_COLOUR;
+                }
               }
             }
             else
@@ -305,35 +337,7 @@ public class AnnotationColourGradient extends FollowerColourScheme
           }
           else
           {
-            // calculate a shade
-            float range = 1f;
-            if (thresholdIsMinMax
-                    && annotation.threshold != null
-                    && aboveAnnotationThreshold == ABOVE_THRESHOLD
-                    && annotation.annotations[j].value >= annotation.threshold.value)
-            {
-              range = (annotation.annotations[j].value - annotation.threshold.value)
-                      / (annotation.graphMax - annotation.threshold.value);
-            }
-            else if (thresholdIsMinMax
-                    && annotation.threshold != null
-                    && aboveAnnotationThreshold == BELOW_THRESHOLD
-                    && annotation.annotations[j].value >= annotation.graphMin)
-            {
-              range = (annotation.annotations[j].value - annotation.graphMin)
-                      / (annotation.threshold.value - annotation.graphMin);
-            }
-            else
-            {
-              range = (annotation.annotations[j].value - annotation.graphMin)
-                      / (annotation.graphMax - annotation.graphMin);
-            }
-
-            int dr = (int) (rr * range + r1), dg = (int) (gg * range + g1), db = (int) (bb
-                    * range + b1);
-
-            currentColour = new Color(dr, dg, db);
-
+            currentColour = shadeCalculation(annotation, j);
           }
         }
         if (conservationColouring)
@@ -345,6 +349,45 @@ public class AnnotationColourGradient extends FollowerColourScheme
     return currentColour;
   }
 
+  private Color shadeCalculation(AlignmentAnnotation annotation, int j)
+  {
+
+    // calculate a shade
+    float range = 1f;
+    if (thresholdIsMinMax
+            && annotation.threshold != null
+            && aboveAnnotationThreshold == ABOVE_THRESHOLD
+            && annotation.annotations[j].value >= annotation.threshold.value)
+    {
+      range = (annotation.annotations[j].value - annotation.threshold.value)
+              / (annotation.graphMax - annotation.threshold.value);
+    }
+    else if (thresholdIsMinMax && annotation.threshold != null
+            && aboveAnnotationThreshold == BELOW_THRESHOLD
+            && annotation.annotations[j].value >= annotation.graphMin)
+    {
+      range = (annotation.annotations[j].value - annotation.graphMin)
+              / (annotation.threshold.value - annotation.graphMin);
+    }
+    else
+    {
+      if (annotation.graphMax != annotation.graphMin)
+      {
+        range = (annotation.annotations[j].value - annotation.graphMin)
+                / (annotation.graphMax - annotation.graphMin);
+      }
+      else
+      {
+        range = 0f;
+      }
+    }
+
+    int dr = (int) (rr * range + r1), dg = (int) (gg * range + g1), db = (int) (bb
+            * range + b1);
+
+    return new Color(dr, dg, db);
+
+  }
   public boolean isPredefinedColours()
   {
     return predefinedColours;
index cc303d6..57a2dd9 100755 (executable)
@@ -597,4 +597,33 @@ public class ColourSchemeProperty
 
     return col;
   }
+
+  public static Color rnaHelices[] = null;
+
+  public static void initRnaHelicesShading(int n)
+  {
+    int j = 0;
+    if (rnaHelices == null)
+    {
+      rnaHelices = new Color[n + 1];
+    }
+    else if (rnaHelices != null && rnaHelices.length <= n)
+    {
+      Color[] t = new Color[n + 1];
+      System.arraycopy(rnaHelices, 0, t, 0, rnaHelices.length);
+      j = rnaHelices.length;
+      rnaHelices = t;
+    }
+    else
+    {
+      return;
+    }
+    // Generate random colors and store
+    for (; j <= n; j++)
+    {
+      rnaHelices[j] = jalview.util.ColorUtils
+              .generateRandomColor(Color.white);
+    }
+  }
+
 }
index 7ec9e1c..8acf1f2 100755 (executable)
@@ -23,9 +23,13 @@ package jalview.schemes;
 import jalview.analysis.scoremodels.PIDScoreModel;
 import jalview.api.analysis.ScoreModelI;
 
-import java.util.*;
+import java.awt.Color;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.Hashtable;
 import java.util.List;
-import java.awt.*;
+import java.util.Map;
+import java.util.Vector;
 
 public class ResidueProperties
 {
@@ -1451,7 +1455,7 @@ public class ResidueProperties
         propMatrixF[i][j] = 0;
         propMatrixPos[i][j] = 0;
         propMatrixEpos[i][j] = 0;
-        for (Enumeration<String> en = (Enumeration<String>) propHash.keys(); en
+        for (Enumeration<String> en = propHash.keys(); en
                 .hasMoreElements();)
         {
           String ph = en.nextElement();
@@ -1695,7 +1699,9 @@ public class ResidueProperties
    * Used by getRNASecStrucState
    * 
    */
-  public static Hashtable toRNAssState;
+  public static Hashtable<String, String> toRNAssState;
+
+  public static boolean RNAcloseParen[] = new boolean[255];
   static
   {
     toRNAssState = new Hashtable<String, String>();
@@ -1759,7 +1765,15 @@ public class ResidueProperties
     toRNAssState.put("y", "Y");
     toRNAssState.put("Z", "Z");
     toRNAssState.put("z", "Z");
-
+    for (int p = 0; p < RNAcloseParen.length; p++)
+    {
+      RNAcloseParen[p] = false;
+    }
+    for (String k : toRNAssState.keySet())
+    {
+      RNAcloseParen[k.charAt(0)] = k.charAt(0) != toRNAssState.get(k)
+              .charAt(0);
+    }
   }
 
   /**
@@ -1780,7 +1794,8 @@ public class ResidueProperties
       String ssc = ssstring.substring(i, i + 1);
       if (toRNAssState.containsKey(ssc))
       {
-        ss.append((String) toRNAssState.get(ssc));
+        // valid ss character - so return it
+        ss.append(ssc); // (String) toRNAssState.get(ssc));
       }
       else
       {
@@ -1790,6 +1805,11 @@ public class ResidueProperties
     return ss.toString();
   }
 
+  public static boolean isCloseParenRNA(char dc)
+  {
+    return RNAcloseParen[dc];
+  }
+
   // main method generates perl representation of residue property hash
   // / cut here
   public static void main(String[] args)
@@ -1839,4 +1859,5 @@ public class ResidueProperties
     System.out.println("};");
   }
   // to here
+
 }
index 175a249..af00798 100644 (file)
@@ -46,6 +46,70 @@ public class StructureSelectionManager
 
   StructureMapping[] mappings;
 
+  private boolean processSecondaryStructure = false,
+          secStructServices = false, addTempFacAnnot = false;
+
+  /**
+   * @return true if will try to use external services for processing secondary
+   *         structure
+   */
+  public boolean isSecStructServices()
+  {
+    return secStructServices;
+  }
+
+  /**
+   * control use of external services for processing secondary structure
+   * 
+   * @param secStructServices
+   */
+  public void setSecStructServices(boolean secStructServices)
+  {
+    this.secStructServices = secStructServices;
+  }
+
+  /**
+   * flag controlling addition of any kind of structural annotation
+   * 
+   * @return true if temperature factor annotation will be added
+   */
+  public boolean isAddTempFacAnnot()
+  {
+    return addTempFacAnnot;
+  }
+
+  /**
+   * set flag controlling addition of structural annotation
+   * 
+   * @param addTempFacAnnot
+   */
+  public void setAddTempFacAnnot(boolean addTempFacAnnot)
+  {
+    this.addTempFacAnnot = addTempFacAnnot;
+  }
+
+  /**
+   * 
+   * @return if true, the structure manager will attempt to add secondary
+   *         structure lines for unannotated sequences
+   */
+
+  public boolean isProcessSecondaryStructure()
+  {
+    return processSecondaryStructure;
+  }
+
+  /**
+   * Control whether structure manager will try to annotate mapped sequences
+   * with secondary structure from PDB data.
+   * 
+   * @param enable
+   */
+  public void setProcessSecondaryStructure(boolean enable)
+  {
+    processSecondaryStructure = enable;
+  }
+
   /**
    * debug function - write all mappings to stdout
    */
@@ -245,7 +309,7 @@ public class StructureSelectionManager
      * the tried and tested MCview pdb mapping
      */
     MCview.PDBfile pdb = null;
-    boolean parseSecStr=true;
+    boolean parseSecStr = processSecondaryStructure;
     if (isPDBFileRegistered(pdbFile))
     {
       for (SequenceI sq : sequence)
@@ -274,7 +338,8 @@ public class StructureSelectionManager
     }
     try
     {
-      pdb = new MCview.PDBfile(true, parseSecStr, pdbFile, protocol);
+      pdb = new MCview.PDBfile(addTempFacAnnot, parseSecStr,
+              secStructServices, pdbFile, protocol);
       if (pdb.id != null && pdb.id.trim().length() > 0
               && AppletFormatAdapter.FILE.equals(protocol))
       {
@@ -360,11 +425,13 @@ public class StructureSelectionManager
               + maxChain.residues.size() + "\n\n");
       PrintStream ps = new PrintStream(System.out)
       {
+        @Override
         public void print(String x)
         {
           mappingDetails.append(x);
         }
 
+        @Override
         public void println()
         {
           mappingDetails.append("\n");
@@ -455,7 +522,6 @@ public class StructureSelectionManager
     {
       return;
     }
-    boolean removeMapping = true;
     String[] handlepdbs;
     Vector pdbs = new Vector();
     for (int i = 0; i < pdbfiles.length; pdbs.addElement(pdbfiles[i++]))
index 61ef34f..b410be6 100755 (executable)
@@ -21,6 +21,7 @@
 package jalview.util;
 
 import jalview.gui.EPSOptions;
+import jalview.gui.SVGOptions;
 import jalview.io.JalviewFileChooser;
 
 import java.awt.Component;
@@ -34,6 +35,7 @@ import java.io.FileOutputStream;
 import javax.imageio.ImageIO;
 
 import org.jfree.graphics2d.svg.SVGGraphics2D;
+import org.jfree.graphics2d.svg.SVGHints;
 import org.jibble.epsgraphics.EpsGraphics2D;
 
 public class ImageMaker
@@ -219,11 +221,39 @@ public class ImageMaker
     Graphics2D ig2 = (Graphics2D) graphics;
     ig2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
             RenderingHints.VALUE_ANTIALIAS_ON);
+
   }
 
   void setupSVG(int width, int height, String title)
   {
+
     g2 = new SVGGraphics2D(width, height);
+    Graphics2D ig2 = g2;
+
+    String renderStyle = jalview.bin.Cache.getDefault("SVG_RENDERING",
+            "Prompt each time");
+
+    // If we need to prompt, and if the GUI is visible then
+    // Prompt for EPS rendering style
+    if (renderStyle.equalsIgnoreCase("Prompt each time")
+            && !(System.getProperty("java.awt.headless") != null && System
+                    .getProperty("java.awt.headless").equals("true")))
+    {
+      SVGOptions svgOption = new SVGOptions();
+      renderStyle = svgOption.getValue();
+
+      if (renderStyle == null || svgOption.cancelled)
+      {
+        return;
+      }
+    }
+
+    if (renderStyle.equalsIgnoreCase("lineart"))
+    {
+      ig2.setRenderingHint(SVGHints.KEY_DRAW_STRING_TYPE,
+              SVGHints.VALUE_DRAW_STRING_TYPE_VECTOR);
+    }
+
     graphics = g2;
   }
 
index 3fedb92..a2da591 100644 (file)
@@ -38,7 +38,6 @@ import jalview.schemes.Blosum62ColourScheme;
 import jalview.schemes.ColourSchemeI;
 import jalview.schemes.PIDColourScheme;
 import jalview.schemes.ResidueProperties;
-import jalview.viewmodel.seqfeatures.FeaturesDisplayed;
 import jalview.workers.AlignCalcManager;
 import jalview.workers.ConsensusThread;
 import jalview.workers.StrucConsensusThread;
@@ -447,7 +446,9 @@ public abstract class AlignmentViewport implements AlignViewportI
           AlignmentAnnotation alignmentAnnotation)
   {
     if (!alignmentAnnotation.autoCalculated)
+    {
       return false;
+    }
     if (calculator.workingInvolvedWith(alignmentAnnotation))
     {
       // System.err.println("grey out ("+alignmentAnnotation.label+")");
@@ -900,11 +901,12 @@ public abstract class AlignmentViewport implements AlignViewportI
         selectionGroup = new SequenceGroup();
         selectionGroup.setEndRes(alignment.getWidth() - 1);
       }
-      Vector tmp = alignment.getHiddenSequences().showAll(
+      List<SequenceI> tmp = alignment.getHiddenSequences().showAll(
               hiddenRepSequences);
-      for (int t = 0; t < tmp.size(); t++)
+      for (SequenceI seq : tmp)
       {
-        selectionGroup.addSequence((SequenceI) tmp.elementAt(t), false);
+        selectionGroup.addSequence(seq, false);
+        setSequenceAnnotationsVisible(seq, true);
       }
 
       hasHiddenRows = false;
@@ -919,7 +921,8 @@ public abstract class AlignmentViewport implements AlignViewportI
 
   public void showSequence(int index)
   {
-    Vector tmp = alignment.getHiddenSequences().showSequence(index,
+    List<SequenceI> tmp = alignment.getHiddenSequences().showSequence(
+            index,
             hiddenRepSequences);
     if (tmp.size() > 0)
     {
@@ -929,9 +932,10 @@ public abstract class AlignmentViewport implements AlignViewportI
         selectionGroup.setEndRes(alignment.getWidth() - 1);
       }
 
-      for (int t = 0; t < tmp.size(); t++)
+      for (SequenceI seq : tmp)
       {
-        selectionGroup.addSequence((SequenceI) tmp.elementAt(t), false);
+        selectionGroup.addSequence(seq, false);
+        setSequenceAnnotationsVisible(seq, true);
       }
       // JBPNote: refactor: only update flag if we modified visiblity (used to
       // do this regardless)
@@ -965,12 +969,30 @@ public abstract class AlignmentViewport implements AlignViewportI
       for (int i = 0; i < seq.length; i++)
       {
         alignment.getHiddenSequences().hideSequence(seq[i]);
+        setSequenceAnnotationsVisible(seq[i], false);
       }
       hasHiddenRows = true;
       firePropertyChange("alignment", null, alignment.getSequences());
     }
   }
 
+  /**
+   * Set visibility for any annotations for the given sequence.
+   * 
+   * @param sequenceI
+   */
+  protected void setSequenceAnnotationsVisible(SequenceI sequenceI,
+          boolean visible)
+  {
+    for (AlignmentAnnotation ann : alignment.getAlignmentAnnotation())
+    {
+      if (ann.sequenceRef == sequenceI)
+      {
+        ann.visible = visible;
+      }
+    }
+  }
+
   public void hideRepSequences(SequenceI repSequence, SequenceGroup sg)
   {
     int sSize = sg.getSize();
@@ -1692,5 +1714,44 @@ public abstract class AlignmentViewport implements AlignViewportI
     return showSeqFeaturesHeight;
   }
 
+  private boolean showAnnotation = true;
+
+  private boolean rightAlignIds = false;
+
+  /**
+   * DOCUMENT ME!
+   * 
+   * @return DOCUMENT ME!
+   */
+  public boolean getShowAnnotation()
+  {
+    return isShowAnnotation();
+  }
+
+  /**
+   * DOCUMENT ME!
+   * 
+   * @param b
+   *          DOCUMENT ME!
+   */
+  public void setShowAnnotation(boolean b)
+  {
+    showAnnotation = b;
+  }
+
+  public boolean isShowAnnotation()
+  {
+    return showAnnotation;
+  }
+
+  public boolean isRightAlignIds()
+  {
+    return rightAlignIds;
+  }
+
+  public void setRightAlignIds(boolean rightAlignIds)
+  {
+    this.rightAlignIds = rightAlignIds;
+  }
 
 }
index 8a7bcbc..a778ab1 100644 (file)
@@ -496,13 +496,13 @@ public class DasSequenceFeatureFetcher
                 } catch (Exception ex)
                 {
                   Cache.log
-                          .info("Error in 'experimental' mapping of features. Please try to reproduce and then report info to jalview-discuss@jalview.org.");
-                  Cache.log.info("Mapping feature from " + f.getBegin()
+                          .warn("Error in 'experimental' mapping of features. Please try to reproduce and then report info to jalview-discuss@jalview.org.");
+                  Cache.log.warn("Mapping feature from " + f.getBegin()
                           + " to " + f.getEnd() + " in dbref "
                           + dbref.getAccessionId() + " in "
                           + dbref.getSource());
-                  Cache.log.info("using das Source " + source);
-                  Cache.log.info("Exception", ex);
+                  Cache.log.warn("using das Source " + source);
+                  Cache.log.warn("Exception", ex);
                 }
 
                 if (vf != null)
@@ -626,7 +626,9 @@ public class DasSequenceFeatureFetcher
   Object[] nextSequence(jalviewSourceI dasSource, SequenceI seq)
   {
     if (cancelled)
+    {
       return null;
+    }
     DBRefEntry[] uprefs = jalview.util.DBRefUtils.selectRefs(
             seq.getDBRef(), new String[]
             {
@@ -668,7 +670,9 @@ public class DasSequenceFeatureFetcher
             qstring.add(uprefs[j].getAccessionId());
           }
           else
+          {
             System.out.println("IGNORE " + csys.getAuthority());
+          }
         }
       }
     }
@@ -839,7 +843,7 @@ public class DasSequenceFeatureFetcher
       {
         for (String note : feat.getNOTE())
         {
-          desc += (String) note;
+          desc += note;
         }
       }
 
index 229fa4e..1bdf64f 100644 (file)
@@ -29,6 +29,7 @@ import java.util.List;
 
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpResponse;
+import org.apache.http.HttpVersion;
 import org.apache.http.NameValuePair;
 import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.HttpClient;
@@ -40,6 +41,9 @@ import org.apache.http.entity.mime.content.FileBody;
 import org.apache.http.entity.mime.content.InputStreamBody;
 import org.apache.http.entity.mime.content.StringBody;
 import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.params.BasicHttpParams;
+import org.apache.http.params.CoreProtocolPNames;
+import org.apache.http.params.HttpParams;
 
 /**
  * Helpful procedures for working with services via HTTPClient
@@ -64,7 +68,10 @@ public class HttpClientUtils
           List<NameValuePair> vals) throws ClientProtocolException,
           IOException
   {
-    HttpClient httpclient = new DefaultHttpClient();
+    HttpParams params = new BasicHttpParams();
+    params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION,
+            HttpVersion.HTTP_1_1);
+    HttpClient httpclient = new DefaultHttpClient(params);
     HttpPost httppost = new HttpPost(postUrl);
     UrlEncodedFormEntity ue = new UrlEncodedFormEntity(vals, "UTF-8");
     httppost.setEntity(ue);
index 1a96464..df0e091 100644 (file)
  */
 package jalview.ws.jws1;
 
+import jalview.analysis.AlignSeq;
+import jalview.bin.Cache;
+import jalview.datamodel.AlignmentView;
+import jalview.datamodel.SeqCigar;
+import jalview.datamodel.SequenceI;
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.gui.WebserviceInfo;
+import jalview.util.MessageManager;
+
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
-import java.util.*;
+import java.util.Hashtable;
 
-import javax.swing.*;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
 
-import ext.vamsas.*;
-import jalview.analysis.*;
-import jalview.bin.*;
-import jalview.datamodel.*;
-import jalview.gui.*;
-import jalview.util.MessageManager;
+import ext.vamsas.Jpred;
+import ext.vamsas.JpredServiceLocator;
+import ext.vamsas.JpredSoapBindingStub;
+import ext.vamsas.ServiceHandle;
 
 public class JPredClient extends WS1Client
 {
@@ -291,7 +301,7 @@ public class JPredClient extends WS1Client
     WsURL = "http://www.compbio.dundee.ac.uk/JalviewWS/services/jpred";
 
     WebserviceInfo wsInfo = new WebserviceInfo(WebServiceJobTitle,
-            WebServiceReference);
+            WebServiceReference, true);
 
     return wsInfo;
   }
index 85969fc..4e95b14 100644 (file)
  */
 package jalview.ws.jws1;
 
-import java.util.*;
-
-import jalview.analysis.*;
-import jalview.bin.*;
-import jalview.datamodel.*;
-import jalview.gui.*;
-import jalview.io.*;
-import jalview.util.*;
+import jalview.analysis.AlignSeq;
+import jalview.bin.Cache;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentView;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.SequenceI;
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.gui.WebserviceInfo;
+import jalview.io.FormatAdapter;
+import jalview.util.Comparison;
+import jalview.util.MessageManager;
 import jalview.ws.AWsJob;
 import jalview.ws.JobStateSummary;
 import jalview.ws.WSClientI;
+
+import java.util.Hashtable;
+import java.util.List;
+
 import vamsas.objects.simple.JpredResult;
 
 class JPredThread extends JWS1Thread implements WSClientI
@@ -138,14 +147,21 @@ class JPredThread extends JWS1Thread implements WSClientI
               sqs[i] = al.getSequenceAt(i);
             }
             if (!jalview.analysis.SeqsetUtils.deuniquify(
-                    (Hashtable) SequenceInfo, sqs))
+                    SequenceInfo, sqs))
             {
               throw (new Exception(MessageManager.getString("exception.couldnt_recover_sequence_properties_for_alignment")));
             }
           }
           FirstSeq = 0;
-          al.setDataset(null);
+          if (currentView.getDataset() != null)
+          {
+            al.setDataset(currentView.getDataset());
 
+          }
+          else
+          {
+            al.setDataset(null);
+          }
           jalview.io.JnetAnnotationMaker.add_annotation(prediction, al,
                   FirstSeq, false, predMap);
 
@@ -162,8 +178,8 @@ class JPredThread extends JWS1Thread implements WSClientI
         if (predMap != null)
         {
           char gc = getGapChar();
-          SequenceI[] sqs = (SequenceI[]) ((java.lang.Object[]) input
-                  .getAlignmentAndColumnSelection(gc))[0];
+          SequenceI[] sqs = (SequenceI[]) input
+                  .getAlignmentAndColumnSelection(gc)[0];
           if (this.msaIndex >= sqs.length)
           {
             throw new Error(MessageManager.getString("error.implementation_error_invalid_msa_index_for_job"));
@@ -187,7 +203,15 @@ class JPredThread extends JWS1Thread implements WSClientI
         }
         else
         {
-          al.setDataset(null);
+          if (currentView.getDataset() != null)
+          {
+            al.setDataset(currentView.getDataset());
+
+          }
+          else
+          {
+            al.setDataset(null);
+          }
           jalview.io.JnetAnnotationMaker.add_annotation(prediction, al,
                   FirstSeq, true, predMap);
           SequenceI profileseq = al.getSequenceAt(0); // this includes any gaps.
@@ -201,11 +225,53 @@ class JPredThread extends JWS1Thread implements WSClientI
           }
         }
       }
+      // transfer to dataset
+      for (AlignmentAnnotation alant : al.getAlignmentAnnotation())
+      {
+        if (alant.sequenceRef != null)
+        {
+          replaceAnnotationOnAlignmentWith(alant, alant.label,
+                  "jalview.jws1.Jpred" + (this.msa == null ? "" : "MSA"),
+                  alant.sequenceRef);
+        }
+      }
       return new Object[]
       { al, alcsel }; // , FirstSeq, noMsa};
     }
 
     /**
+     * copied from JabawsCalcWorker
+     * 
+     * @param newAnnot
+     * @param typeName
+     * @param calcId
+     * @param aSeq
+     */
+    protected void replaceAnnotationOnAlignmentWith(
+            AlignmentAnnotation newAnnot, String typeName, String calcId,
+            SequenceI aSeq)
+    {
+      SequenceI dsseq = aSeq.getDatasetSequence();
+      while (dsseq.getDatasetSequence() != null)
+      {
+        dsseq = dsseq.getDatasetSequence();
+      }
+      // look for same annotation on dataset and lift this one over
+      List<AlignmentAnnotation> dsan = dsseq.getAlignmentAnnotations(
+              calcId, typeName);
+      if (dsan != null && dsan.size() > 0)
+      {
+        for (AlignmentAnnotation dssan : dsan)
+        {
+          dsseq.removeAlignmentAnnotation(dssan);
+        }
+      }
+      AlignmentAnnotation dssan = new AlignmentAnnotation(newAnnot);
+      dsseq.addAlignmentAnnotation(dssan);
+      dssan.adjustForAlignment();
+    }
+
+    /**
      * Given an alignment where all other sequences except profileseq are
      * aligned to the ungapped profileseq, insert gaps in the other sequences to
      * realign them with the residues in profileseq
@@ -372,7 +438,7 @@ class JPredThread extends JWS1Thread implements WSClientI
       {
         if (job.getJobId().startsWith("Broken"))
         {
-          job.result = (vamsas.objects.simple.Result) new JpredResult();
+          job.result = new JpredResult();
           job.result.setInvalid(true);
           job.result.setStatus(MessageManager.formatMessage("label.submission_params", new String[]{job.getJobId().toString()}));
           throw new Exception(job.getJobId());
index 210e520..9001c61 100644 (file)
@@ -92,7 +92,8 @@ public abstract class WS1Client extends WSClient implements
     WebserviceInfo wsInfo = null;
     if (!headless)
     {
-      wsInfo = new WebserviceInfo(WebServiceJobTitle, WebServiceReference);
+      wsInfo = new WebserviceInfo(WebServiceJobTitle, WebServiceReference,
+              true);
     }
     return wsInfo;
   }
index b2fe3bb..929581d 100644 (file)
@@ -279,10 +279,13 @@ public class AADisorderClient extends JabawsCalcWorker implements
               {
                 continue;
               }
+              String typename, calcName;
               AlignmentAnnotation annot = createAnnotationRowsForScores(
                       ourAnnot,
-                      service.serviceType + " (" + scr.getMethod() + ")",
-                      service.getServiceTypeURI() + "/" + scr.getMethod(),
+                      typename = service.serviceType + " ("
+                              + scr.getMethod() + ")",
+                      calcName = service.getServiceTypeURI() + "/"
+                              + scr.getMethod(),
                       aseq, base + 1, scr);
               annot.graph = AlignmentAnnotation.LINE_GRAPH;
 
@@ -333,6 +336,9 @@ public class AADisorderClient extends JabawsCalcWorker implements
                 }
               }
               annot._linecolour = col;
+              // finally, update any dataset annotation
+              replaceAnnotationOnAlignmentWith(annot, typename, calcName,
+                      aseq);
             }
           }
         }
index 2eb484b..b3aee55 100644 (file)
@@ -27,6 +27,9 @@ import jalview.bin.Cache;
 import jalview.ws.jws2.jabaws2.Jws2Instance;
 import jalview.ws.jws2.jabaws2.Jws2InstanceFactory;
 
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.util.HashSet;
 import java.util.Set;
 
@@ -44,7 +47,7 @@ public class JabaWsServerQuery implements Runnable
 
   Jws2Discoverer jws2Discoverer = null;
 
-  String jwsservers = null;
+  String jwsserver = null;
 
   boolean quit = false, running = false;
 
@@ -65,10 +68,10 @@ public class JabaWsServerQuery implements Runnable
     this.quit = quit;
   }
 
-  public JabaWsServerQuery(Jws2Discoverer jws2Discoverer, String jwsservers)
+  public JabaWsServerQuery(Jws2Discoverer jws2Discoverer, String server)
   {
     this.jws2Discoverer = jws2Discoverer;
-    this.jwsservers = jwsservers;
+    this.jwsserver = server;
   }
 
   Services[] JABAWS1SERVERS = new Services[]
@@ -92,7 +95,9 @@ public class JabaWsServerQuery implements Runnable
     running = true;
     try
     {
-      if (Jws2Client.validURL(jwsservers))
+      // TODO this test doesn't seem to attempt a connection - should it?
+      // would save a lot of failed tries with UnknownHostException
+      if (isValidUrl(jwsserver))
       {
         compbio.data.msa.RegistryWS registry = null;
         Set svccategories = null;
@@ -109,7 +114,7 @@ public class JabaWsServerQuery implements Runnable
         try
         {
           // JBPNote: why is RegistryWS in compbio.data.msa ?
-          registry = Jws2Client.connectToRegistry(jwsservers);
+          registry = Jws2Client.connectToRegistry(jwsserver);
           if (registry != null)
           {
             // System.err.println("Test Services Output\n"
@@ -137,13 +142,14 @@ public class JabaWsServerQuery implements Runnable
           ex.printStackTrace();
           // if that failed, then we are probably working with a JABAWS1 server.
           // in that case, look for each service endpoint
-          System.err.println("JWS2 Discoverer: " + jwsservers
+          System.err.println("JWS2 Discoverer: " + jwsserver
                   + " is a JABAWS1 server. Using hardwired list.");
           for (Services srv : JABAWS1SERVERS)
           {
             srv_set.add(srv);
           }
         }
+
         for (Category cat : categories)
         {
           for (Services srv : cat.getServices())
@@ -160,21 +166,22 @@ public class JabaWsServerQuery implements Runnable
             JABAService service = null;
             try
             {
-              service = Jws2Client.connect(jwsservers, srv);
+              service = Jws2Client.connect(jwsserver, srv);
             } catch (Exception e)
             {
               System.err.println("Jws2 Discoverer: Problem on "
-                      + jwsservers + " with service " + srv + ":\n"
+                      + jwsserver + " with service " + srv + ":\n"
                       + e.getMessage());
               if (!(e instanceof javax.xml.ws.WebServiceException))
               {
                 e.printStackTrace();
               }
               // For moment, report service as a problem.
-              jws2Discoverer.addInvalidServiceUrl(jwsservers);
+              jws2Discoverer.addInvalidServiceUrl(jwsserver);
             }
             ;
-            if (service != null)
+            if (service != null
+                    && !Jws2InstanceFactory.ignoreService(srv.toString()))
             {
               noservices = false;
               Jws2Instance svc = null;
@@ -183,16 +190,16 @@ public class JabaWsServerQuery implements Runnable
 
                 String description = registry.getServiceDescription(srv);
 
-                svc = Jws2InstanceFactory.newJws2Instance(jwsservers,
+                svc = Jws2InstanceFactory.newJws2Instance(jwsserver,
                         srv.toString(), cat.name, description, service);
               }
               if (svc == null)
               {
-                svc = Jws2InstanceFactory.newJws2Instance(jwsservers,
+                svc = Jws2InstanceFactory.newJws2Instance(jwsserver,
                         srv.toString(), cat.name,
                         "JABAWS 1 Alignment Service", service);
               }
-              jws2Discoverer.addService(jwsservers, svc);
+              jws2Discoverer.addService(jwsserver, svc);
             }
 
           }
@@ -200,25 +207,53 @@ public class JabaWsServerQuery implements Runnable
 
         if (noservices)
         {
-          jws2Discoverer.addUrlwithnoservices(jwsservers);
+          jws2Discoverer.addUrlwithnoservices(jwsserver);
         }
       }
       else
       {
-        jws2Discoverer.addInvalidServiceUrl(jwsservers);
-        Cache.log.info("Ignoring invalid Jws2 service url " + jwsservers);
+        jws2Discoverer.addInvalidServiceUrl(jwsserver);
+        Cache.log.warn("Ignoring invalid Jws2 service url " + jwsserver);
       }
     } catch (Exception e)
     {
       e.printStackTrace();
       Cache.log.warn("Exception when discovering Jws2 services.", e);
-      jws2Discoverer.addInvalidServiceUrl(jwsservers);
+      jws2Discoverer.addInvalidServiceUrl(jwsserver);
     } catch (Error e)
     {
       Cache.log.error("Exception when discovering Jws2 services.", e);
-      jws2Discoverer.addInvalidServiceUrl(jwsservers);
+      jws2Discoverer.addInvalidServiceUrl(jwsserver);
     }
     running = false;
   }
 
+  /**
+   * Check if the URL is valid and responding.
+   * 
+   * @return
+   */
+  private boolean isValidUrl(String server)
+  {
+    // return Jws2Client.validURL(jwsserver); // checks syntax only
+    boolean result = false;
+    if (server != null) {
+      try {
+        URL url = new URL(server);
+        url.openStream().close();
+        result = true;
+      } catch (MalformedURLException e)
+      {
+        System.err.println("Invalid server URL: " + server);
+        result = false;
+      } catch (IOException e)
+      {
+        System.err.println("Error connecting to server: " + server + ": "
+                + e.toString());
+        result = false;
+      }
+    }
+    return result;
+  }
+
 }
index e966886..e01c648 100644 (file)
@@ -158,6 +158,30 @@ public abstract class JabawsCalcWorker extends AbstractJabaCalcWorker
     return annotation;
   }
 
+  protected void replaceAnnotationOnAlignmentWith(
+          AlignmentAnnotation newAnnot, String typeName, String calcId,
+          SequenceI aSeq)
+  {
+    SequenceI dsseq = aSeq.getDatasetSequence();
+    while (dsseq.getDatasetSequence() != null)
+    {
+      dsseq = dsseq.getDatasetSequence();
+    }
+    // look for same annotation on dataset and lift this one over
+    List<AlignmentAnnotation> dsan = dsseq.getAlignmentAnnotations(calcId,
+            typeName);
+    if (dsan != null && dsan.size() > 0)
+    {
+      for (AlignmentAnnotation dssan : dsan)
+      {
+        dsseq.removeAlignmentAnnotation(dssan);
+      }
+    }
+    AlignmentAnnotation dssan = new AlignmentAnnotation(newAnnot);
+    dsseq.addAlignmentAnnotation(dssan);
+    dssan.adjustForAlignment();
+  }
+
   private void constructAnnotationFromScore(AlignmentAnnotation annotation,
           int base, int alWidth, Score scr)
   {
index afefe65..751d330 100644 (file)
  */
 package jalview.ws.jws2;
 
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.List;
-
-import javax.swing.JCheckBoxMenuItem;
-import javax.swing.JMenu;
-import javax.swing.JMenuItem;
-import javax.swing.event.MenuEvent;
-import javax.swing.event.MenuListener;
-
-import compbio.metadata.Argument;
 import jalview.api.AlignCalcWorkerI;
 import jalview.bin.Cache;
 import jalview.gui.AlignFrame;
@@ -45,6 +34,18 @@ 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;
+import java.util.List;
+
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.event.MenuEvent;
+import javax.swing.event.MenuListener;
+
+import compbio.metadata.Argument;
+
 /**
  * provides metadata for a jabaws2 service instance - resolves names, etc.
  * 
@@ -148,7 +149,7 @@ public abstract class Jws2Client extends jalview.ws.WSClient
     {
       return new WebserviceInfo(WebServiceJobTitle, WebServiceJobTitle
               + " using service hosted at " + serv.hosturl + "\n"
-              + (serv.description != null ? serv.description : ""));
+              + (serv.description != null ? serv.description : ""), false);
     }
     return null;
   }
index 910b749..7a8eee9 100644 (file)
@@ -34,6 +34,8 @@ import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
+import java.beans.PropertyChangeSupport;
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -60,9 +62,48 @@ import compbio.ws.client.Services;
  */
 public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
 {
-  private java.beans.PropertyChangeSupport changeSupport = new java.beans.PropertyChangeSupport(
+  public static final String COMPBIO_JABAWS = "http://www.compbio.dundee.ac.uk/jabaws";
+
+  /*
+   * the .jalview_properties entry for JWS2 URLS
+   */
+  final static String JWS2HOSTURLS = "JWS2HOSTURLS";
+
+  /*
+   * Singleton instance
+   */
+  private static Jws2Discoverer discoverer;
+
+  /*
+   * Override for testing only
+   */
+  private static List<String> testUrls = null;
+
+  // preferred url has precedence over others
+  private String preferredUrl;
+
+  private PropertyChangeSupport changeSupport = new PropertyChangeSupport(
           this);
 
+  Vector<String> invalidServiceUrls = null, urlsWithoutServices = null,
+          validServiceUrls = null;
+
+  boolean running = false, aborted = false;
+
+  Thread oldthread = null;
+
+  /**
+   * holds list of services.
+   */
+  protected Vector<Jws2Instance> services;
+
+  /**
+   * Private constructor enforces use of singleton via getDiscoverer()
+   */
+  private Jws2Discoverer()
+  {
+  }
+
   /**
    * change listeners are notified of "services" property changes
    * 
@@ -87,8 +128,6 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
     changeSupport.removePropertyChangeListener(listener);
   }
 
-  boolean running = false, aborted = false;
-
   /**
    * @return the aborted
    */
@@ -104,10 +143,8 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
   public void setAborted(boolean aborted)
   {
     this.aborted = aborted;
-  }
-
-  Thread oldthread = null;
 
+  }
   public void run()
   {
 
@@ -135,7 +172,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
 
     // first set up exclusion list if needed
     final Set<String> ignoredServices = new HashSet<String>();
-    for (String ignored : jalview.bin.Cache.getDefault(
+    for (String ignored : Cache.getDefault(
             "IGNORED_JABAWS_SERVICETYPES", "")
             .split("\\|"))
     {
@@ -176,9 +213,9 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
     ArrayList<String> svctypes = new ArrayList<String>();
 
     List<JabaWsServerQuery> qrys = new ArrayList<JabaWsServerQuery>();
-    for (final String jwsservers : getServiceUrls())
+    for (final String jwsserver : getServiceUrls())
     {
-      JabaWsServerQuery squery = new JabaWsServerQuery(this, jwsservers);
+      JabaWsServerQuery squery = new JabaWsServerQuery(this, jwsserver);
       if (svctypes.size() == 0)
       {
         // TODO: remove this ugly hack to get Canonical JABA service ordering
@@ -233,7 +270,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
         Jws2Instance[] svcs = new Jws2Instance[services.size()];
         int[] spos = new int[services.size()];
         int ipos = 0;
-        Vector svcUrls = getServiceUrls();
+        List<String> svcUrls = getServiceUrls();
         for (Jws2Instance svc : services)
         {
           svcs[ipos] = svc;
@@ -290,11 +327,6 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
   }
 
   /**
-   * holds list of services.
-   */
-  protected Vector<Jws2Instance> services;
-
-  /**
    * attach all available web services to the appropriate submenu in the given
    * JMenu
    */
@@ -545,7 +577,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
   {
     if (args.length > 0)
     {
-      testUrls = new Vector<String>();
+      testUrls = new ArrayList<String>();
       for (String url : args)
       {
         testUrls.add(url);
@@ -592,8 +624,11 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
     }
   }
 
-  private static Jws2Discoverer discoverer;
-
+  /**
+   * Returns the singleton instance of this class.
+   * 
+   * @return
+   */
   public static Jws2Discoverer getDiscoverer()
   {
     if (discoverer == null)
@@ -605,7 +640,6 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
 
   public boolean hasServices()
   {
-    // TODO Auto-generated method stub
     return !running && services != null && services.size() > 0;
   }
 
@@ -614,24 +648,19 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
     return running;
   }
 
-  /**
-   * the jalview .properties entry for JWS2 URLS
-   */
-  final static String JWS2HOSTURLS = "JWS2HOSTURLS";
-
-  public static void setServiceUrls(Vector<String> urls)
+  public void setServiceUrls(List<String> wsUrls)
   {
-    if (urls != null)
+    if (wsUrls != null && !wsUrls.isEmpty())
     {
-      StringBuffer urlbuffer = new StringBuffer();
+      StringBuilder urls = new StringBuilder(128);
       String sep = "";
-      for (String url : urls)
+      for (String url : wsUrls)
       {
-        urlbuffer.append(sep);
-        urlbuffer.append(url);
+        urls.append(sep);
+        urls.append(url);
         sep = ",";
       }
-      Cache.setProperty(JWS2HOSTURLS, urlbuffer.toString());
+      Cache.setProperty(JWS2HOSTURLS, urls.toString());
     }
     else
     {
@@ -639,18 +668,27 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
     }
   }
 
-  private static Vector<String> testUrls = null;
-
-  public static Vector<String> getServiceUrls()
+  /**
+   * Returns web service URLs, in the order in which they should be tried (or an
+   * empty list).
+   * 
+   * @return
+   */
+  public List<String> getServiceUrls()
   {
     if (testUrls != null)
     {
       // return test urls, if there are any, instead of touching cache
       return testUrls;
     }
-    String surls = Cache.getDefault(JWS2HOSTURLS,
-            "http://www.compbio.dundee.ac.uk/jabaws");
-    Vector<String> urls = new Vector<String>();
+    List<String> urls = new ArrayList<String>();
+
+    if (this.preferredUrl != null)
+    {
+      urls.add(preferredUrl);
+    }
+
+    String surls = Cache.getDefault(JWS2HOSTURLS, COMPBIO_JABAWS);
     try
     {
       StringTokenizer st = new StringTokenizer(surls, ",");
@@ -659,40 +697,37 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
         String url = null;
         try
         {
-          java.net.URL u = new java.net.URL(url = st.nextToken());
+          url = st.nextToken();
+          new URL(url);
           if (!urls.contains(url))
           {
             urls.add(url);
           }
           else
           {
-            jalview.bin.Cache.log.info("Ignoring duplicate url in "
+            Cache.log.warn("Ignoring duplicate url " + url + " in "
                     + JWS2HOSTURLS + " list");
           }
-        } catch (Exception ex)
+        } catch (MalformedURLException ex)
         {
-          jalview.bin.Cache.log
+          Cache.log
                   .warn("Problem whilst trying to make a URL from '"
                           + ((url != null) ? url : "<null>") + "'");
-          jalview.bin.Cache.log
+          Cache.log
                   .warn("This was probably due to a malformed comma separated list"
                           + " in the "
                           + JWS2HOSTURLS
                           + " entry of $(HOME)/.jalview_properties)");
-          jalview.bin.Cache.log.debug("Exception was ", ex);
+          Cache.log.debug("Exception was ", ex);
         }
       }
     } catch (Exception ex)
     {
-      jalview.bin.Cache.log.warn(
+      Cache.log.warn(
               "Error parsing comma separated list of urls in "
                       + JWS2HOSTURLS + " preference.", ex);
     }
-    if (urls.size() >= 0)
-    {
-      return urls;
-    }
-    return null;
+    return urls;
   }
 
   public Vector<Jws2Instance> getServices()
@@ -750,9 +785,6 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
     return thr;
   }
 
-  Vector<String> invalidServiceUrls = null, urlsWithoutServices = null,
-          validServiceUrls = null;
-
   /**
    * @return the invalidServiceUrls
    */
@@ -865,7 +897,9 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
       return 1;
     }
     if (urlsWithoutServices != null && urlsWithoutServices.contains(url))
+    {
       return 0;
+    }
     if (invalidServiceUrls != null && invalidServiceUrls.contains(url))
     {
       return -1;
@@ -979,4 +1013,21 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI
   {
     setPreferredServiceFor(null, serviceType, serviceAction, selectedServer);
   }
+
+  /**
+   * Set a URL to try before any others. For use with command-line parameter to
+   * configure a local Jabaws installation without the need to add to property
+   * files.
+   * 
+   * @param value
+   * @throws MalformedURLException
+   */
+  public void setPreferredUrl(String value) throws MalformedURLException
+  {
+    if (value != null && value.trim().length() > 0)
+    {
+      new URL(value);
+      preferredUrl = value;
+    }
+  }
 }
index 9ddc69a..e7301a6 100644 (file)
  */
 package jalview.ws.jws2;
 
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentView;
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.gui.JvSwingUtils;
+import jalview.util.MessageManager;
+import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.params.WsParamSetI;
+
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
 import java.util.List;
 
-import javax.swing.*;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.ToolTipManager;
 
-import jalview.datamodel.*;
-import jalview.gui.*;
 import compbio.data.msa.MsaWS;
 import compbio.metadata.Argument;
-import jalview.util.MessageManager;
-import jalview.ws.jws2.jabaws2.Jws2Instance;
-import jalview.ws.params.WsParamSetI;
 
 /**
  * DOCUMENT ME!
@@ -98,25 +107,30 @@ public class MsaWSClient extends Jws2Client
     if (!(sh.service instanceof MsaWS))
     {
       // redundant at mo - but may change
-      JOptionPane
-              .showMessageDialog(
-                      Desktop.desktop,
-                      MessageManager.formatMessage("label.service_called_is_not_msa_service", new String[]{sh.serviceType}),
-                      MessageManager.getString("label.internal_jalview_error"), JOptionPane.WARNING_MESSAGE);
+      JOptionPane.showMessageDialog(Desktop.desktop, MessageManager
+              .formatMessage("label.service_called_is_not_msa_service",
+                      new String[]
+                      { sh.serviceType }), MessageManager
+              .getString("label.internal_jalview_error"),
+              JOptionPane.WARNING_MESSAGE);
 
       return;
     }
     server = (MsaWS) sh.service;
     if ((wsInfo = setWebService(sh, false)) == null)
     {
-      JOptionPane.showMessageDialog(Desktop.desktop,
-                 MessageManager.formatMessage("label.msa_service_is_unknown", new String[]{sh.serviceType}),
-                 MessageManager.getString("label.internal_jalview_error"), JOptionPane.WARNING_MESSAGE);
+      JOptionPane.showMessageDialog(Desktop.desktop, MessageManager
+              .formatMessage("label.msa_service_is_unknown", new String[]
+              { sh.serviceType }), MessageManager
+              .getString("label.internal_jalview_error"),
+              JOptionPane.WARNING_MESSAGE);
 
       return;
     }
+
     startMsaWSClient(altitle, msa, submitGaps, preserveOrder, seqdataset);
 
+
   }
 
   public MsaWSClient()
@@ -160,10 +174,29 @@ public class MsaWSClient extends Jws2Client
     MsaWSThread msathread = new MsaWSThread(server, preset, paramset,
             WsURL, wsInfo, alignFrame, WebServiceName, jobtitle, msa,
             submitGaps, preserveOrder, seqdataset);
-    wsInfo.setthisService(msathread);
-    msathread.start();
+    if (msathread.hasValidInput())
+    {
+      wsInfo.setthisService(msathread);
+      wsInfo.setVisible(true);
+      msathread.start();
+    }
+    else
+    {
+      JOptionPane.showMessageDialog(alignFrame,
+              MessageManager.getString("info.invalid_msa_input_mininfo"),
+              MessageManager.getString("info.invalid_msa_notenough"),
+              JOptionPane.INFORMATION_MESSAGE);
+      wsInfo.setVisible(false);
+    }
+  }
+
+  public static void main(String[] args)
+  {
+    System.out.println("A".matches("(-*[a-zA-Z]-*){1}[a-zA-Z-]*"));
   }
 
+
+
   protected String getServiceActionKey()
   {
     return "MsaWS";
@@ -238,9 +271,13 @@ public class MsaWSClient extends Jws2Client
         public void actionPerformed(ActionEvent e)
         {
           AlignmentView msa = alignFrame.gatherSequencesForAlignment();
+
+          if (msa != null)
+          {
           new MsaWSClient(service, alignFrame.getTitle(), msa, withGaps,
                   true, alignFrame.getViewport().getAlignment()
                           .getDataset(), alignFrame);
+          }
 
         }
       });
@@ -259,9 +296,12 @@ public class MsaWSClient extends Jws2Client
           public void actionPerformed(ActionEvent e)
           {
             AlignmentView msa = alignFrame.gatherSequencesForAlignment();
-            new MsaWSClient(service, null, null, true, alignFrame
+            if (msa != null)
+            {
+              new MsaWSClient(service, null, null, true, alignFrame
                     .getTitle(), msa, withGaps, true, alignFrame
                     .getViewport().getAlignment().getDataset(), alignFrame);
+            }
 
           }
         });
@@ -273,22 +313,53 @@ public class MsaWSClient extends Jws2Client
                   "label.run_with_preset_params", new String[]
                   { calcName }));
 
+          final int showToolTipFor = ToolTipManager.sharedInstance()
+                  .getDismissDelay();
           for (final WsParamSetI preset : presets)
           {
             final JMenuItem methodR = new JMenuItem(preset.getName());
-            methodR.setToolTipText(JvSwingUtils.wrapTooltip(true, "<p><strong>"
-                            + (preset.isModifiable() ? MessageManager.getString("label.user_preset")
-                                    : MessageManager.getString("label.service_preset")) + "</strong><br/>"
-                            + preset.getDescription() + "</p>"));
+            final int QUICK_TOOLTIP = 1500;
+            // JAL-1582 shorten tooltip display time in these menu items as
+            // they can obscure other options
+            methodR.addMouseListener(new MouseAdapter()
+            {
+              @Override
+              public void mouseEntered(MouseEvent e)
+              {
+                ToolTipManager.sharedInstance().setDismissDelay(
+                        QUICK_TOOLTIP);
+              }
+
+              @Override
+              public void mouseExited(MouseEvent e)
+              {
+                ToolTipManager.sharedInstance().setDismissDelay(showToolTipFor);
+              }
+
+            });
+            methodR.setToolTipText(JvSwingUtils.wrapTooltip(
+                    true,
+                    "<p><strong>"
+                            + (preset.isModifiable() ? MessageManager
+                                    .getString("label.user_preset")
+                                    : MessageManager
+                                            .getString("label.service_preset"))
+                            + "</strong><br/>" + preset.getDescription()
+                            + "</p>"));
             methodR.addActionListener(new ActionListener()
             {
               public void actionPerformed(ActionEvent e)
               {
                 AlignmentView msa = alignFrame
                         .gatherSequencesForAlignment();
-                new MsaWSClient(service, preset, alignFrame.getTitle(),
+
+                if (msa != null)
+                {
+                  MsaWSClient msac = new MsaWSClient(service, preset,
+                          alignFrame.getTitle(),
                         msa, false, true, alignFrame.getViewport()
                                 .getAlignment().getDataset(), alignFrame);
+                }
 
               }
 
index 5e8cb98..2bae428 100644 (file)
  */
 package jalview.ws.jws2;
 
-import java.util.*;
+import jalview.analysis.AlignSeq;
+import jalview.bin.Cache;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentOrder;
+import jalview.datamodel.AlignmentView;
+import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceI;
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.gui.WebserviceInfo;
+import jalview.util.MessageManager;
+import jalview.ws.AWsJob;
+import jalview.ws.JobStateSummary;
+import jalview.ws.WSClientI;
+import jalview.ws.jws2.dm.JabaWsParamSet;
+import jalview.ws.params.WsParamSetI;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
+import java.util.Vector;
 
 import compbio.data.msa.MsaWS;
 import compbio.metadata.Argument;
@@ -28,17 +50,6 @@ import compbio.metadata.ChunkHolder;
 import compbio.metadata.JobStatus;
 import compbio.metadata.Preset;
 
-import jalview.analysis.*;
-import jalview.bin.*;
-import jalview.datamodel.*;
-import jalview.gui.*;
-import jalview.util.MessageManager;
-import jalview.ws.AWsJob;
-import jalview.ws.WSClientI;
-import jalview.ws.JobStateSummary;
-import jalview.ws.jws2.dm.JabaWsParamSet;
-import jalview.ws.params.WsParamSetI;
-
 class MsaWSThread extends AWS2Thread implements WSClientI
 {
   boolean submitGaps = false; // pass sequences including gaps to alignment
@@ -221,7 +232,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI
           int ow = w, nw = w;
           for (i = 0, w = emptySeqs.size(); i < w; i++)
           {
-            String[] es = (String[]) emptySeqs.get(i);
+            String[] es = emptySeqs.get(i);
             if (es != null && es[1] != null)
             {
               int sw = es[1].length();
@@ -252,7 +263,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI
           }
           for (i = 0, w = emptySeqs.size(); i < w; i++)
           {
-            String[] es = (String[]) emptySeqs.get(i);
+            String[] es = emptySeqs.get(i);
             if (es[1] == null)
             {
               t_alseqs[i + alseq_l] = new jalview.datamodel.Sequence(es[0],
@@ -474,7 +485,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI
     SequenceI[][] conmsa = _msa.getVisibleContigs('-');
     if (conmsa != null)
     {
-      int njobs = conmsa.length;
+      int nvalid = 0, njobs = conmsa.length;
       jobs = new MsaWSJob[njobs];
       for (int j = 0; j < njobs; j++)
       {
@@ -486,6 +497,10 @@ class MsaWSThread extends AWS2Thread implements WSClientI
         {
           jobs[j] = new MsaWSJob(0, conmsa[j]);
         }
+        if (((MsaWSJob) jobs[j]).hasValidInput())
+        {
+          nvalid++;
+        }
         ((MsaWSJob) jobs[j]).preset = preset;
         ((MsaWSJob) jobs[j]).arguments = paramset;
         ((MsaWSJob) jobs[j]).alignmentProgram = wsname;
@@ -496,9 +511,20 @@ class MsaWSThread extends AWS2Thread implements WSClientI
         }
         wsinfo.setProgressText(jobs[j].getJobnum(), OutputHeader);
       }
+      validInput = nvalid > 0;
     }
   }
 
+  boolean validInput = false;
+
+  /**
+   * 
+   * @return true if the thread will perform a calculation
+   */
+  public boolean hasValidInput()
+  {
+    return validInput;
+  }
   public boolean isCancellable()
   {
     return true;
index bcc7735..696dba3 100644 (file)
  */
 package jalview.ws.jws2.jabaws2;
 
-import java.util.HashMap;
-
-import compbio.data.msa.JABAService;
 import jalview.ws.jws2.AAConClient;
 import jalview.ws.jws2.JPred301Client;
 import jalview.ws.jws2.RNAalifoldClient;
 import jalview.ws.uimodel.AlignAnalysisUIText;
 
+import java.util.HashMap;
+import java.util.HashSet;
+
+import compbio.data.msa.JABAService;
+
 public class Jws2InstanceFactory
 {
   private static HashMap<String, AlignAnalysisUIText> aaConGUI;
 
+  private static HashSet<String> ignoreGUI;
   private static String category_rewrite(String cat_name)
   {
     return (cat_name != null && cat_name.equals("Prediction")) ? "Secondary Structure Prediction"
@@ -47,12 +50,27 @@ public class Jws2InstanceFactory
               AAConClient.getAlignAnalysisUITest());
       aaConGUI.put(compbio.ws.client.Services.RNAalifoldWS.toString(),
               RNAalifoldClient.getAlignAnalysisUITest());
+      // disable the JPred301 client in jalview ...
+      ignoreGUI = new HashSet<String>();
+      ignoreGUI.add(compbio.ws.client.Services.JpredWS.toString());
       aaConGUI.put(compbio.ws.client.Services.JpredWS.toString(),
               JPred301Client.getAlignAnalysisUITest());
     }
   }
 
   /**
+   * exclusion list to avoid creating GUI elements for services we don't fully
+   * support
+   * 
+   * @param serviceType
+   * @return
+   */
+  public static boolean ignoreService(String serviceType)
+  {
+    init();
+    return (ignoreGUI.contains(serviceType.toString()));
+  }
+  /**
    * construct a service instance and configure it with any additional
    * properties needed so Jalview can access it correctly
    * 
@@ -70,7 +88,6 @@ public class Jws2InstanceFactory
     init();
     Jws2Instance svc = new Jws2Instance(jwsservers, serviceType,
             category_rewrite(name), description, service);
-
     svc.aaui = aaConGUI.get(serviceType.toString());
     return svc;
   }
index cd4bb23..5ce1d5d 100644 (file)
  */
 package jalview.ws.rest;
 
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import javax.swing.JMenu;
-import javax.swing.JMenuItem;
-import javax.swing.JOptionPane;
-import javax.swing.event.MenuEvent;
-import javax.swing.event.MenuListener;
-
 import jalview.bin.Cache;
 import jalview.datamodel.AlignmentView;
 import jalview.gui.AlignFrame;
@@ -44,6 +33,17 @@ import jalview.ws.WSClient;
 import jalview.ws.WSClientI;
 import jalview.ws.WSMenuEntryProviderI;
 
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Hashtable;
+import java.util.Vector;
+
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.event.MenuEvent;
+import javax.swing.event.MenuListener;
+
 /**
  * @author JimP
  * 
@@ -107,7 +107,7 @@ public class RestClient extends WSClient implements WSClientI,
     if (!headless)
     {
       wsInfo = new WebserviceInfo(WebServiceJobTitle, WebServiceName + "\n"
-              + WebServiceReference);
+              + WebServiceReference, true);
       wsInfo.setRenderAsHtml(true);
     }
 
diff --git a/test/jalview/commands/EditCommandTest.java b/test/jalview/commands/EditCommandTest.java
new file mode 100644 (file)
index 0000000..fc821b9
--- /dev/null
@@ -0,0 +1,232 @@
+package jalview.commands;
+
+import static org.junit.Assert.assertEquals;
+import jalview.commands.EditCommand.Action;
+import jalview.commands.EditCommand.Edit;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceI;
+
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * Unit tests for EditCommand
+ * 
+ * @author gmcarstairs
+ *
+ */
+public class EditCommandTest
+{
+
+  private EditCommand testee;
+
+  private SequenceI[] seqs;
+
+  private Alignment al;
+
+  @Before
+  public void setUp()
+  {
+    testee = new EditCommand();
+    seqs = new SequenceI[4];
+    seqs[0] = new Sequence("seq0", "abcdefghjk");
+    seqs[1] = new Sequence("seq1", "fghjklmnopq");
+    seqs[2] = new Sequence("seq2", "qrstuvwxyz");
+    seqs[3] = new Sequence("seq3", "1234567890");
+    al = new Alignment(seqs);
+    al.setGapCharacter('?');
+  }
+
+  /**
+   * Test inserting gap characters
+   */
+  @Test
+  public void testAppendEdit_insertGap()
+  {
+    // set a non-standard gap character to prove it is actually used
+    testee.appendEdit(Action.INSERT_GAP, seqs, 4, 3, al, true);
+    assertEquals("abcd???efghjk", seqs[0].getSequenceAsString());
+    assertEquals("fghj???klmnopq", seqs[1].getSequenceAsString());
+    assertEquals("qrst???uvwxyz", seqs[2].getSequenceAsString());
+    assertEquals("1234???567890", seqs[3].getSequenceAsString());
+
+    // todo: test for handling out of range positions?
+  }
+
+  /**
+   * Test deleting characters from sequences. Note the deleteGap() action does
+   * not check that only gap characters are being removed.
+   */
+  @Test
+  public void testAppendEdit_deleteGap()
+  {
+    testee.appendEdit(Action.DELETE_GAP, seqs, 4, 3, al, true);
+    assertEquals("abcdhjk", seqs[0].getSequenceAsString());
+    assertEquals("fghjnopq", seqs[1].getSequenceAsString());
+    assertEquals("qrstxyz", seqs[2].getSequenceAsString());
+    assertEquals("1234890", seqs[3].getSequenceAsString());
+  }
+
+  /**
+   * Test a cut action. The command should store the cut characters to support
+   * undo.
+   */
+  @Test
+  public void testCut()
+  {
+    Edit ec = testee.new Edit(Action.CUT, seqs, 4, 3, al);
+    testee.cut(ec, new AlignmentI[]
+    { al });
+    assertEquals("abcdhjk", seqs[0].getSequenceAsString());
+    assertEquals("fghjnopq", seqs[1].getSequenceAsString());
+    assertEquals("qrstxyz", seqs[2].getSequenceAsString());
+    assertEquals("1234890", seqs[3].getSequenceAsString());
+
+    assertEquals("efg", new String(ec.string[0]));
+    assertEquals("klm", new String(ec.string[1]));
+    assertEquals("uvw", new String(ec.string[2]));
+    assertEquals("567", new String(ec.string[3]));
+    // TODO: case where whole sequence is deleted as nothing left; etc
+  }
+
+  /**
+   * Test a Paste action, where this adds sequences to an alignment.
+   */
+  @Test
+  @Ignore
+  // TODO fix so it works
+  public void testPaste_addToAlignment()
+  {
+    SequenceI[] newSeqs = new SequenceI[2];
+    newSeqs[0] = new Sequence("newseq0", "ACEFKL");
+    newSeqs[1] = new Sequence("newseq1", "JWMPDH");
+
+    Edit ec = testee.new Edit(Action.PASTE, newSeqs, 0, al.getWidth(), al);
+    testee.paste(ec, new AlignmentI[]
+    { al });
+    assertEquals(6, al.getSequences().size());
+    assertEquals("1234567890", seqs[3].getSequenceAsString());
+    assertEquals("ACEFKL", seqs[4].getSequenceAsString());
+    assertEquals("JWMPDH", seqs[5].getSequenceAsString());
+  }
+
+  /**
+   * Test insertGap followed by undo command
+   */
+  @Test
+  public void testUndo_insertGap()
+  {
+    // Edit ec = testee.new Edit(Action.INSERT_GAP, seqs, 4, 3, '?');
+    testee.appendEdit(Action.INSERT_GAP, seqs, 4, 3, al, true);
+    // check something changed
+    assertEquals("abcd???efghjk", seqs[0].getSequenceAsString());
+    testee.undoCommand(new AlignmentI[]
+    { al });
+    assertEquals("abcdefghjk", seqs[0].getSequenceAsString());
+    assertEquals("fghjklmnopq", seqs[1].getSequenceAsString());
+    assertEquals("qrstuvwxyz", seqs[2].getSequenceAsString());
+    assertEquals("1234567890", seqs[3].getSequenceAsString());
+  }
+
+  /**
+   * Test deleteGap followed by undo command
+   */
+  @Test
+  public void testUndo_deleteGap()
+  {
+    testee.appendEdit(Action.DELETE_GAP, seqs, 4, 3, al, true);
+    // check something changed
+    assertEquals("abcdhjk", seqs[0].getSequenceAsString());
+    testee.undoCommand(new AlignmentI[]
+    { al });
+    // deleteGap doesn't 'remember' deleted characters, only gaps get put back
+    assertEquals("abcd???hjk", seqs[0].getSequenceAsString());
+    assertEquals("fghj???nopq", seqs[1].getSequenceAsString());
+    assertEquals("qrst???xyz", seqs[2].getSequenceAsString());
+    assertEquals("1234???890", seqs[3].getSequenceAsString());
+  }
+
+  /**
+   * Test several commands followed by an undo command
+   */
+  @Test
+  public void testUndo_multipleCommands()
+  {
+    // delete positions 3/4/5 (counting from 1)
+    testee.appendEdit(Action.DELETE_GAP, seqs, 2, 3, al, true);
+    assertEquals("abfghjk", seqs[0].getSequenceAsString());
+    assertEquals("1267890", seqs[3].getSequenceAsString());
+
+    // insert 2 gaps after the second residue
+    testee.appendEdit(Action.INSERT_GAP, seqs, 2, 2, al, true);
+    assertEquals("ab??fghjk", seqs[0].getSequenceAsString());
+    assertEquals("12??67890", seqs[3].getSequenceAsString());
+
+    // delete positions 4/5/6
+    testee.appendEdit(Action.DELETE_GAP, seqs, 3, 3, al, true);
+    assertEquals("ab?hjk", seqs[0].getSequenceAsString());
+    assertEquals("12?890", seqs[3].getSequenceAsString());
+
+    // undo edit commands
+    testee.undoCommand(new AlignmentI[]
+    { al });
+    assertEquals("ab?????hjk", seqs[0].getSequenceAsString());
+    assertEquals("12?????890", seqs[3].getSequenceAsString());
+  }
+
+  /**
+   * Unit test for JAL-1594 bug: click and drag sequence right to insert gaps -
+   * undo did not remove them all.
+   */
+  @Test
+  public void testUndo_multipleInsertGaps()
+  {
+    testee.appendEdit(Action.INSERT_GAP, seqs, 4, 1, al, true);
+    testee.appendEdit(Action.INSERT_GAP, seqs, 5, 1, al, true);
+    testee.appendEdit(Action.INSERT_GAP, seqs, 6, 1, al, true);
+
+    // undo edit commands
+    testee.undoCommand(new AlignmentI[]
+    { al });
+    assertEquals("abcdefghjk", seqs[0].getSequenceAsString());
+    assertEquals("1234567890", seqs[3].getSequenceAsString());
+
+  }
+
+  /**
+   * Test cut followed by undo command
+   */
+  @Test
+  public void testUndo_cut()
+  {
+    testee.appendEdit(Action.CUT, seqs, 4, 3, al, true);
+    // check something changed
+    assertEquals("abcdhjk", seqs[0].getSequenceAsString());
+    testee.undoCommand(new AlignmentI[]
+    { al });
+    assertEquals("abcdefghjk", seqs[0].getSequenceAsString());
+    assertEquals("fghjklmnopq", seqs[1].getSequenceAsString());
+    assertEquals("qrstuvwxyz", seqs[2].getSequenceAsString());
+    assertEquals("1234567890", seqs[3].getSequenceAsString());
+  }
+
+  /**
+   * Test the replace command (used to manually edit a sequence)
+   */
+  @Test
+  public void testReplace()
+  {
+    // seem to need a dataset sequence on the edited sequence here
+    seqs[1].setDatasetSequence(seqs[1]);
+    new EditCommand("", Action.REPLACE, "ZXY", new SequenceI[]
+    { seqs[1] }, 4, 8, al);
+    assertEquals("abcdefghjk", seqs[0].getSequenceAsString());
+    assertEquals("qrstuvwxyz", seqs[2].getSequenceAsString());
+    assertEquals("1234567890", seqs[3].getSequenceAsString());
+    seqs[1] = new Sequence("seq1", "fghjZXYnopq");
+
+  }
+}
index d9101cf..3f91710 100644 (file)
@@ -88,7 +88,8 @@ public class SequenceTest
 
   /**
    * Tests for addAlignmentAnnotation. Note this method has the side-effect of
-   * setting the sequenceRef on the annotation.
+   * setting the sequenceRef on the annotation. Adding the same annotation twice
+   * should be ignored.
    */
   @Test
   public void testAddAlignmentAnnotation()
@@ -102,5 +103,21 @@ public class SequenceTest
     AlignmentAnnotation[] anns = seq.getAnnotation();
     assertEquals(1, anns.length);
     assertSame(annotation, anns[0]);
+
+    // re-adding does nothing
+    seq.addAlignmentAnnotation(annotation);
+    anns = seq.getAnnotation();
+    assertEquals(1, anns.length);
+    assertSame(annotation, anns[0]);
+
+    // an identical but different annotation can be added
+    final AlignmentAnnotation annotation2 = new AlignmentAnnotation("a",
+            "b", 2d);
+    seq.addAlignmentAnnotation(annotation2);
+    anns = seq.getAnnotation();
+    assertEquals(2, anns.length);
+    assertSame(annotation, anns[0]);
+    assertSame(annotation2, anns[1]);
+
   }
 }
index 79e3eae..7bcf902 100644 (file)
@@ -64,7 +64,7 @@ public class PDBFileWithJmolTest
   {
     for (String pdbStr : testFile)
     {
-      PDBfile mctest = new PDBfile(false, false, pdbStr,
+      PDBfile mctest = new PDBfile(false, false, false, pdbStr,
               AppletFormatAdapter.FILE);
       PDBFileWithJmol jtest = new PDBFileWithJmol(pdbStr,
               jalview.io.AppletFormatAdapter.FILE);
index d2322ef..a7c439f 100644 (file)
 package jalview.ext.paradise;
 
 import static org.junit.Assert.assertTrue;
-
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.SequenceI;
-import jalview.ext.paradise.Annotate3D;
 import jalview.io.FastaFile;
 import jalview.io.FormatAdapter;
 
@@ -72,9 +70,13 @@ public class TestAnnotate3D
         iline = id.readLine();
         fline = file.readLine();
         if (iline != null)
+        {
           System.out.println(iline);
+        }
         if (fline != null)
+        {
           System.out.println(fline);
+        }
         // next assert fails for latest RNAview - because the XMLID entries
         // change between file and ID based RNAML generation.
         assertTrue(
@@ -96,7 +98,8 @@ public class TestAnnotate3D
   @Test
   public void testPDBfileVsRNAML() throws Exception
   {
-    PDBfile pdbf = new PDBfile(true,true,"examples/2GIS.pdb", FormatAdapter.FILE);
+    PDBfile pdbf = new PDBfile(true, false, true, "examples/2GIS.pdb",
+            FormatAdapter.FILE);
     Assert.assertTrue(pdbf.isValid());
     // Comment - should add new FileParse constructor like new FileParse(Reader
     // ..). for direct reading
diff --git a/test/jalview/gui/HelpTest.java b/test/jalview/gui/HelpTest.java
new file mode 100644 (file)
index 0000000..e4068d7
--- /dev/null
@@ -0,0 +1,32 @@
+package jalview.gui;
+
+import static org.junit.Assert.assertTrue;
+import jalview.gui.Help.HelpId;
+
+import java.net.URL;
+
+import javax.help.HelpSet;
+import javax.help.HelpSetException;
+import javax.help.Map;
+
+import org.junit.Test;
+
+public class HelpTest
+{
+  @Test
+  public void checkHelpTargets() throws HelpSetException
+  {
+    ClassLoader cl = Desktop.class.getClassLoader();
+    URL url = HelpSet.findHelpSet(cl, "help/help"); // $NON-NLS-$
+    HelpSet hs = new HelpSet(cl, url);
+    Map targets = hs.getLocalMap();
+
+    for (HelpId id : HelpId.values())
+    {
+      String target = id.toString();
+      assertTrue("Unmatched target enum: " + target,
+              targets.isValidID(target, hs));
+    }
+
+  }
+}
index 1d219df..f7b1482 100644 (file)
@@ -7,6 +7,7 @@ import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.SequenceI;
 import jalview.io.AppletFormatAdapter;
+import jalview.io.FormatAdapter;
 import jalview.util.MessageManager;
 
 import java.awt.Component;
@@ -42,7 +43,7 @@ public class PopupMenuTest
   @Before
   public void setUp() throws IOException
   {
-    alignment = new jalview.io.FormatAdapter().readFile(TEST_DATA,
+    alignment = new FormatAdapter().readFile(TEST_DATA,
             AppletFormatAdapter.PASTE, "FASTA");
     AlignFrame af = new AlignFrame(alignment, 700, 500);
     parentPanel = new AlignmentPanel(af, af.getViewport());
@@ -83,14 +84,13 @@ public class PopupMenuTest
   public void testConfigureReferenceAnnotationsMenu_noReferenceAnnotations()
   {
     JMenuItem menu = new JMenuItem();
-    List<SequenceI> seqs = new ArrayList<SequenceI>();
 
     /*
      * Initial state is that sequences have annotations, and have dataset
      * sequences, but the dataset sequences have no annotations. Hence nothing
      * to add.
      */
-    seqs = parentPanel.getAlignment().getSequences();
+    List<SequenceI> seqs = parentPanel.getAlignment().getSequences();
 
     testee.configureReferenceAnnotationsMenu(menu, seqs);
     assertFalse(menu.isEnabled());
@@ -105,12 +105,12 @@ public class PopupMenuTest
   public void testConfigureReferenceAnnotationsMenu_alreadyAdded()
   {
     JMenuItem menu = new JMenuItem();
-    List<SequenceI> seqs = new ArrayList<SequenceI>();
+    List<SequenceI> seqs = parentPanel.getAlignment().getSequences();
+
+    // make up new annotations and add to dataset sequences, sequences and
+    // alignment
+    attachReferenceAnnotations(seqs, true, true);
 
-    seqs = parentPanel.getAlignment().getSequences();
-    // copy annotation from sequence to dataset
-    seqs.get(1).getDatasetSequence()
-            .addAlignmentAnnotation(seqs.get(1).getAnnotation()[0]);
     testee.configureReferenceAnnotationsMenu(menu, seqs);
     assertFalse(menu.isEnabled());
   }
@@ -126,28 +126,104 @@ public class PopupMenuTest
   {
     JMenuItem menu = new JMenuItem();
     List<SequenceI> seqs = parentPanel.getAlignment().getSequences();
+
     // make up new annotations and add to dataset sequences
+    attachReferenceAnnotations(seqs, false, false);
+
+    testee.configureReferenceAnnotationsMenu(menu, seqs);
+    assertTrue(menu.isEnabled());
+    String expected = "<html><table width=350 border=0><tr><td>Add annotations for<br/>JMOL/secondary structure<br/>PBD/Temp</td></tr></table></html>";
+    assertEquals(expected, menu.getToolTipText());
+  }
+
+  /**
+   * Test building the 'add reference annotations' menu for the case where
+   * several reference annotations are on the dataset and the sequences but not
+   * on the alignment. The menu item should be enabled, and acquire a tooltip
+   * which lists the annotation sources (calcIds) and type (labels).
+   */
+  @Test
+  public void testConfigureReferenceAnnotationsMenu_notOnAlignment()
+  {
+    JMenuItem menu = new JMenuItem();
+    List<SequenceI> seqs = parentPanel.getAlignment().getSequences();
+
+    // make up new annotations and add to dataset sequences and sequences
+    attachReferenceAnnotations(seqs, true, false);
+
+    testee.configureReferenceAnnotationsMenu(menu, seqs);
+    assertTrue(menu.isEnabled());
+    String expected = "<html><table width=350 border=0><tr><td>Add annotations for<br/>JMOL/secondary structure<br/>PBD/Temp</td></tr></table></html>";
+    assertEquals(expected, menu.getToolTipText());
+  }
 
+  /**
+   * Generate annotations and add to dataset sequences and (optionally)
+   * sequences and/or alignment
+   * 
+   * @param seqs
+   * @param addToSequence
+   * @param addToAlignment
+   */
+  private void attachReferenceAnnotations(List<SequenceI> seqs,
+          boolean addToSequence, boolean addToAlignment)
+  {
     // PDB.secondary structure on Sequence0
     AlignmentAnnotation annotation = new AlignmentAnnotation(
             "secondary structure", "", 0);
     annotation.setCalcId("PBD");
     seqs.get(0).getDatasetSequence().addAlignmentAnnotation(annotation);
+    if (addToSequence)
+    {
+      seqs.get(0).addAlignmentAnnotation(annotation);
+    }
+    if (addToAlignment)
+    {
+      this.alignment.addAnnotation(annotation);
+    }
 
     // PDB.Temp on Sequence1
     annotation = new AlignmentAnnotation("Temp", "", 0);
     annotation.setCalcId("PBD");
     seqs.get(1).getDatasetSequence().addAlignmentAnnotation(annotation);
+    if (addToSequence)
+    {
+      seqs.get(1).addAlignmentAnnotation(annotation);
+    }
+    if (addToAlignment)
+    {
+      this.alignment.addAnnotation(annotation);
+    }
 
     // JMOL.secondary structure on Sequence0
     annotation = new AlignmentAnnotation("secondary structure", "", 0);
     annotation.setCalcId("JMOL");
     seqs.get(0).getDatasetSequence().addAlignmentAnnotation(annotation);
+    if (addToSequence)
+    {
+      seqs.get(0).addAlignmentAnnotation(annotation);
+    }
+    if (addToAlignment)
+    {
+      this.alignment.addAnnotation(annotation);
+    }
+  }
 
-    testee.configureReferenceAnnotationsMenu(menu, seqs);
-    assertTrue(menu.isEnabled());
-    String expected = "<html><table width=350 border=0><tr><td>Add annotations for<br/>JMOL/secondary structure<br/>PBD/Temp</td></tr></table></html>";
-    assertEquals(expected, menu.getToolTipText());
+  /**
+   * Test building the 'add reference annotations' menu for the case where there
+   * are two alignment views:
+   * <ul>
+   * <li>in one view, reference annotations have been added (are on the
+   * datasets, sequences and alignment)</li>
+   * <li>in the current view, reference annotations are on the dataset and
+   * sequence, but not the alignment</li>
+   * </ul>
+   * The menu item should be enabled, and acquire a tooltip which lists the
+   * annotation sources (calcIds) and type (labels).
+   */
+  @Test
+  public void testConfigureReferenceAnnotationsMenu_twoViews()
+  {
   }
 
   /**
diff --git a/test/jalview/io/BioJsHTMLOutputTest.java b/test/jalview/io/BioJsHTMLOutputTest.java
new file mode 100644 (file)
index 0000000..cbda794
--- /dev/null
@@ -0,0 +1,47 @@
+package jalview.io;
+
+import jalview.datamodel.Alignment;
+import jalview.datamodel.Sequence;
+
+import java.io.IOException;
+
+import org.junit.Test;
+
+import com.json.JSONException;
+
+public class BioJsHTMLOutputTest
+{
+
+
+  @Test
+  public void getJalviewAlignmentAsJsonString()
+  {
+    BioJsHTMLOutput bioJsHtmlOuput = new BioJsHTMLOutput(null, null);
+    bioJsHtmlOuput.setGlobalColorScheme("Zappo");
+
+    Sequence[] seqs = new Sequence[1];
+    Sequence seq = new Sequence("name", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1, 26);
+    // SequenceFeature seqFeature = new SequenceFeature("type", "desc",
+    // "status", 1, 5, "jalview");
+    // seq.addSequenceFeature(seqFeature);
+    seq.setDatasetSequence(seq);
+    seqs[0] = seq;
+
+    Alignment al = new Alignment(seqs);
+    try
+    {
+      String generatedJson = bioJsHtmlOuput
+              .getJalviewAlignmentAsJsonString(al);
+      assert (generatedJson
+              .equalsIgnoreCase("{\"globalColorScheme\":\"zappo\",\"seqs\":[{\"id\":\"1\",\"start\":1,\"name\":\"name/1-26\",\"features\":[],\"seq\":\"ABCDEFGHIJKLMNOPQRSTUVWXYZ\",\"end\":26}]}"));
+      System.out.println("Output : " + generatedJson);
+    } catch (IOException e)
+    {
+      e.printStackTrace();
+    } catch (JSONException e)
+    {
+      e.printStackTrace();
+    }
+  }
+
+}
diff --git a/test/jalview/io/HtmlFileTest.java b/test/jalview/io/HtmlFileTest.java
new file mode 100644 (file)
index 0000000..be228b8
--- /dev/null
@@ -0,0 +1,16 @@
+package jalview.io;
+
+import static org.junit.Assert.*;
+
+import org.junit.Test;
+
+public class HtmlFileTest
+{
+
+  @Test
+  public void test()
+  {
+    fail("Not yet implemented");
+  }
+
+}
index 6dfa729..75626e9 100644 (file)
@@ -20,7 +20,9 @@
  */
 package jalview.io;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import jalview.api.AlignmentViewPanel;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
@@ -45,7 +47,7 @@ public class Jalview2xmlTests
   public static void setUpBeforeClass() throws Exception
   {
     jalview.bin.Jalview.main(new String[]
-    { "-props", "test/src/jalview/io/testProps.jvprops" });
+    { "-props", "test/jalview/io/testProps.jvprops" });
   }
 
   /**
@@ -237,7 +239,8 @@ public class Jalview2xmlTests
   @Test
   public void gatherViewsHere() throws Exception
   {
-    int origCount = Desktop.getAlignframes().length;
+    int origCount = Desktop.getAlignframes() == null ? 0 : Desktop
+            .getAlignframes().length;
     AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
             "examples/exampleFile_2_7.jar", FormatAdapter.FILE);
     assertTrue("Didn't read in the example file correctly.", af != null);
@@ -245,4 +248,62 @@ public class Jalview2xmlTests
             Desktop.getAlignframes().length == 1 + origCount);
 
   }
+
+  @Test
+  public void viewRefPdbAnnotation() throws Exception
+  {
+    AlignFrame af = new jalview.io.FileLoader().LoadFileWaitTillLoaded(
+            "examples/exampleFile_2_7.jar", FormatAdapter.FILE);
+    assertTrue("Didn't read in the example file correctly.", af != null);
+    AlignmentViewPanel sps = null;
+    for (AlignmentViewPanel ap : af.alignPanel.alignFrame.getAlignPanels())
+    {
+      if ("Spinach Feredoxin Structure".equals(ap.getViewName()))
+      {
+        sps = ap;
+        break;
+      }
+    }
+    assertTrue("Couldn't find the structure view", sps != null);
+    SequenceI sq = sps.getAlignment().findName("1A70|");
+    AlignmentAnnotation refan = null;
+    for (AlignmentAnnotation ra:sps.getAlignment().getAlignmentAnnotation())
+    {
+      if (ra.graph != 0)
+      {
+        refan = ra;
+        break;
+      }
+    }
+    assertTrue("Annotation secondary structure not found.",refan!=null);
+    assertTrue("Couldn't find 1a70 null chain", sq != null);
+    // compare the manually added temperature factor annotation
+    // to the track automatically transferred from the pdb structure on load
+    for (AlignmentAnnotation ala : sq.getDatasetSequence().getAnnotation())
+    {
+      AlignmentAnnotation alaa;
+      sq.addAlignmentAnnotation(alaa = new AlignmentAnnotation(ala));
+      alaa.adjustForAlignment();
+      if (ala.graph == refan.graph)
+      {
+        for (int p = 0; p < ala.annotations.length; p++)
+        {
+          sq.findPosition(p);
+          try {
+            assertTrue(
+                    "Mismatch at alignment position " + p,
+                  (alaa.annotations[p] == null && refan.annotations[p] == null)
+                            || alaa.annotations[p].value == refan.annotations[p].value);
+          }
+          catch (NullPointerException q)
+          {
+            fail("Mismatch of alignment annotations at position " + p
+                    + " Ref seq ann: " + refan.annotations[p]
+                    + " alignment " + alaa.annotations[p]);
+          }
+          }
+      }
+    }
+    
+  }
 }
index 5839761..f5b0258 100644 (file)
@@ -20,8 +20,6 @@
  */
 package jalview.io;
 
-import static org.junit.Assert.*;
-
 import java.io.File;
 
 import org.junit.AfterClass;
@@ -45,7 +43,7 @@ public class RNAMLfileTest
   public void testRnamlToStockholmIO()
   {
     StockholmFileTest.testFileIOwithFormat(new File(
-            "examples/rna-alignment.xml"), "STH");
+            "examples/rna-alignment.xml"), "STH", -1, -1);
 
   }
 
index 8fece9d..cf61e6e 100644 (file)
@@ -20,6 +20,7 @@
  */
 package jalview.io;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import jalview.datamodel.Alignment;
@@ -45,7 +46,7 @@ public class StockholmFileTest
   @Test
   public void pfamFileIO() throws Exception
   {
-    testFileIOwithFormat(new File(PfamFile), "STH");
+    testFileIOwithFormat(new File(PfamFile), "STH", -1, 0);
   }
 
   @Test
@@ -70,7 +71,7 @@ public class StockholmFileTest
   @Test
   public void rfamFileIO() throws Exception
   {
-    testFileIOwithFormat(new File(RfamFile), "STH");
+    testFileIOwithFormat(new File(RfamFile), "STH", 2, 1);
   }
 
   /**
@@ -83,7 +84,8 @@ public class StockholmFileTest
    *          - label for IO class used to write and read back in the data from
    *          f
    */
-  public static void testFileIOwithFormat(File f, String ioformat)
+  public static void testFileIOwithFormat(File f, String ioformat,
+          int naliannot, int nminseqann)
   {
     System.out.println("Reading file: " + f);
     String ff = f.getPath();
@@ -118,6 +120,28 @@ public class StockholmFileTest
                       + ioformat + "' writer",
               ioformat.equals(identifyoutput));
       testAlignmentEquivalence(al, al_input);
+      int numaliannot = 0, numsqswithali = 0;
+      for (AlignmentAnnotation ala : al_input.getAlignmentAnnotation())
+      {
+        if (ala.sequenceRef == null)
+        {
+          numaliannot++;
+        }
+        else
+        {
+          numsqswithali++;
+        }
+      }
+      if (naliannot > -1)
+      {
+        assertEquals("Number of alignment annotations", naliannot,
+              numaliannot);
+      }
+
+      assertTrue(
+              "Number of sequence associated annotations wasn't at least "
+                      + nminseqann, numsqswithali >= nminseqann);
+
     } catch (Exception e)
     {
       e.printStackTrace();
diff --git a/test/jalview/io/testProps.jvprops b/test/jalview/io/testProps.jvprops
new file mode 100644 (file)
index 0000000..d5a6c4c
--- /dev/null
@@ -0,0 +1,84 @@
+#---JalviewX Properties File---
+#Fri Apr 25 09:54:25 BST 2014
+SCREEN_Y=768
+SCREEN_X=936
+SHOW_WSDISCOVERY_ERRORS=true
+LATEST_VERSION=2.8.0b1
+SHOW_CONSERVATION=true
+JALVIEW_RSS_WINDOW_SCREEN_WIDTH=550
+JAVA_CONSOLE_SCREEN_WIDTH=450
+LAST_DIRECTORY=/Volumes/Data/Users/jimp/Documents/testing/Jalview/examples
+ID_ITALICS=true
+SORT_ALIGNMENT=No sort
+SHOW_IDENTITY=true
+WSMENU_BYHOST=false
+SEQUENCE_LINKS=EMBL-EBI Search|http\://www.ebi.ac.uk/ebisearch/search.ebi?db\=allebi&query\=$SEQUENCE_ID$
+SHOW_FULLSCREEN=false
+RECENT_URL=http\://www.jalview.org/examples/exampleFile_2_7.jar
+FONT_NAME=SansSerif
+BLC_JVSUFFIX=true
+VERSION_CHECK=false
+YEAR=2011
+SHOW_DBREFS_TOOLTIP=true
+MSF_JVSUFFIX=true
+SCREENGEOMETRY_HEIGHT=1600
+JAVA_CONSOLE_SCREEN_Y=475
+JAVA_CONSOLE_SCREEN_X=830
+PFAM_JVSUFFIX=true
+PIR_JVSUFFIX=true
+STARTUP_FILE=http\://www.jalview.org/examples/exampleFile_2_3.jar
+JAVA_CONSOLE_SCREEN_HEIGHT=162
+PIR_MODELLER=false
+GAP_SYMBOL=-
+SHOW_QUALITY=true
+SHOW_GROUP_CONSERVATION=false
+SHOW_JWS2_SERVICES=true
+SHOW_NPFEATS_TOOLTIP=true
+FONT_STYLE=plain
+ANTI_ALIAS=false
+SORT_BY_TREE=false
+RSBS_SERVICES=|Multi-Harmony|Analysis|Sequence Harmony and Multi-Relief (Brandt et al. 2010)|hseparable,gapCharacter\='-',returns\='ANNOTATION'|?tool\=jalview|http\://zeus.few.vu.nl/programs/shmrwww/index.php?tool\=jalview&groups\=$PARTITION\:min\='2',minsize\='2',sep\=' '$&ali_file\=$ALIGNMENT\:format\='FASTA',writeasfile$
+AUTHORFNAMES=Jim Procter, Andrew Waterhouse, Jan Engelhardt, Lauren Lui, Michele Clamp, James Cuff, Steve Searle, David Martin & Geoff Barton
+JALVIEW_RSS_WINDOW_SCREEN_HEIGHT=328
+SHOW_GROUP_CONSENSUS=false
+SHOW_CONSENSUS_HISTOGRAM=true
+SHOW_OVERVIEW=false
+AUTHORS=J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
+FIGURE_AUTOIDWIDTH=false
+SCREEN_WIDTH=900
+ANNOTATIONCOLOUR_MIN=ffc800
+SHOW_STARTUP_FILE=false
+RECENT_FILE=examples/uniref50.fa\t/Volumes/Data/Users/jimp/Documents/testing/Jalview/examples/RF00031_folded.stk\t/Volumes/Data/Users/jimp/bs_ig_mult.out
+DEFAULT_FILE_FORMAT=FASTA
+SHOW_JAVA_CONSOLE=false
+VERSION=2.8b1
+FIGURE_USERIDWIDTH=
+WSMENU_BYTYPE=false
+DEFAULT_COLOUR=None
+NOQUESTIONNAIRES=true
+JALVIEW_NEWS_RSS_LASTMODIFIED=Apr 23, 2014 2\:53\:26 PM
+BUILD_DATE=01 November 2013
+PILEUP_JVSUFFIX=true
+SHOW_CONSENSUS_LOGO=false
+SCREENGEOMETRY_WIDTH=2560
+SHOW_ANNOTATIONS=true
+JALVIEW_RSS_WINDOW_SCREEN_Y=0
+USAGESTATS=false
+JALVIEW_RSS_WINDOW_SCREEN_X=0
+SHOW_UNCONSERVED=false
+SHOW_JVSUFFIX=true
+DAS_LOCAL_SOURCE=
+SCREEN_HEIGHT=650
+ANNOTATIONCOLOUR_MAX=ff0000
+AUTO_CALC_CONSENSUS=true
+FASTA_JVSUFFIX=true
+DAS_ACTIVE_SOURCE=uniprot\t
+JWS2HOSTURLS=http\://www.compbio.dundee.ac.uk/jabaws
+PAD_GAPS=false
+CLUSTAL_JVSUFFIX=true
+SHOW_ENFIN_SERVICES=true
+FONT_SIZE=10
+RIGHT_ALIGN_IDS=false
+USE_PROXY=false
+WRAP_ALIGNMENT=false
+DAS_REGISTRY_URL=http\://www.dasregistry.org/das/
index 295c3bf..c206323 100644 (file)
@@ -20,7 +20,8 @@
  */
 package jalview.ws.jabaws;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 import jalview.ws.jws2.Jws2Discoverer;
 
 import java.util.Vector;
@@ -73,7 +74,7 @@ public class JalviewJabawsTestUtils
         services.add(url);
       }
       ;
-      Jws2Discoverer.setServiceUrls(services);
+      Jws2Discoverer.getDiscoverer().setServiceUrls(services);
     }
     try
     {
index 41ca030..d77a93b 100755 (executable)
@@ -1,18 +1,18 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- This script was automatically generated using InstallAnywhere 2013 Professional, Build 4538
+<!-- This script was automatically generated using InstallAnywhere 2014 Professional, Build 4783
      STATUS: Fully Functional LICENSED Edition
-     DATE:   Fri Nov 01 13:57:32 GMT 2013 -->
-<InstallAnywhere_Deployment_Project increments="5103">
+     DATE:   Tue Dec 02 16:16:02 GMT 2014 -->
+<InstallAnywhere_Deployment_Project increments="5299">
        <!-- ** DO NOT EDIT ** Essential authorization and configuration data ** DO NOT EDIT ** -->
        <essentialScriptInfo>
-               <versionID major="15" minor="0" revision="0"/>
-               <editionID>49,53,46,48,32,80,114,111,102,101,115,115,105,111,110,97,108,32,66,117,105,108,100,32,52,53,51,56</editionID>
+               <versionID major="16" minor="0" revision="0"/>
+               <editionID>49,54,46,48,32,80,114,111,102,101,115,115,105,111,110,97,108,32,66,117,105,108,100,32,52,55,56,51</editionID>
                <scriptID>12,42,11,85,78,76,73,67,69,78,83,69,68</scriptID>
-               <buildID>3,13,71,76,105,110,117,120,44,32,50,46,54,46,51,50,45,50,55,57,46,50,50,46,49,46,101,108,54,46,120,56,54,95,54,52,44,32,97,109,100,54,52,59,32,74,97,118,97,32,49,46,55,46,48,95,50,53,44,32,79,114,97,99,108,101,32,67,111,114,112,111,114,97,116,105,111,110,44,32,104,116,116,112,58,47,47,106,97,118,97,46,111,114,97,99,108,101,46,99,111,109,47,59,32,101,110,44,32,85,110,107,110,111,119,110,59,32,73,83,79,45,56,56,53,57,45,49</buildID>
+               <buildID>3,13,71,76,105,110,117,120,44,32,50,46,54,46,51,50,45,51,53,56,46,54,46,50,46,101,108,54,46,120,56,54,95,54,52,44,32,97,109,100,54,52,59,32,74,97,118,97,32,49,46,55,46,48,95,54,48,44,32,79,114,97,99,108,101,32,67,111,114,112,111,114,97,116,105,111,110,44,32,104,116,116,112,58,47,47,106,97,118,97,46,111,114,97,99,108,101,46,99,111,109,47,59,32,101,110,44,32,85,110,107,110,111,119,110,59,32,73,83,79,45,56,56,53,57,45,49</buildID>
                <!-- The authorizationID may change between project saves and builds.  This does not effect the integrity of the project, nor do changes in this value represent changes in the actual InstallAnywhere project. -->
-               <authorizationID>1,0,0,64,29,-4,96,96,80,127,118,101,93,105,116,96,121,48,48,49,56,52,67,98,113,112,112,37,82,101,96,63,55,-11,2,0,1,84,19,2,1,0,0</authorizationID>
+               <authorizationID>1,0,0,64,13,-64,-128,0,80,127,118,101,93,105,116,96,121,48,48,49,56,52,67,98,113,112,112,37,82,101,96,63,55,-11,2,9,1,105,27,10,1,0,0</authorizationID>
        </essentialScriptInfo>
-       <installationObjects uniqueObjects="217">
+       <installationObjects uniqueObjects="225">
                <object class="com.zerog.ia.installer.Installer" objectID="fe7d63eda660">
                        <property name="belongsToUninstallPhase">
                                <boolean>false</boolean>
@@ -1094,110 +1094,110 @@ and any path to a file to save to the file]]></string>
                                                        </property>
                                                </object>
                                        </method>
-          <method name="addElement">
-            <object class="com.zerog.ia.installer.actions.InstallZipfile" objectID="244ffffaa672">
-              <property name="belongsToUninstallPhase">
-                <boolean>false</boolean>
-              </property>
-              <property name="rollbackEnabledCancel">
-                <boolean>true</boolean>
-              </property>
-              <property name="rollbackEnabledError">
-                <boolean>true</boolean>
-              </property>
-              <property name="ruleExpression">
-                <string><![CDATA[]]></string>
-              </property>
-              <property name="unixPermissions">
-                <string><![CDATA[664]]></string>
-              </property>
-              <property name="sourceName">
-                <string><![CDATA[log4j-to-slf4j-2.0-rc2.jar]]></string>
-              </property>
-              <property name="overrideUnixPermissions">
-                <boolean>false</boolean>
-              </property>
-              <property name="sourcePath">
-                <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
-              </property>
-              <property name="shouldUninstall">
-                <boolean>true</boolean>
-              </property>
-              <property name="rollbackEnabledCancel">
-                <boolean>true</boolean>
-              </property>
-              <property name="rollbackEnabledError">
-                <boolean>true</boolean>
-              </property>
-              <property name="destinationName">
-                <string><![CDATA[log4j-to-slf4j-2.0-rc2.jar]]></string>
-              </property>
-              <property name="fileSize">
-                <long>348699</long>
-              </property>
-              <property name="macBinary">
-                <boolean>false</boolean>
-              </property>
-              <property name="targetCheckKind">
-                <int>0</int>
-              </property>
-              <property name="ruleExpression">
-                <string><![CDATA[]]></string>
-              </property>
-            </object>
-          </method>
-          <method name="addElement">
-            <object class="com.zerog.ia.installer.actions.InstallZipfile" objectID="244f00faa672">
-              <property name="belongsToUninstallPhase">
-                <boolean>false</boolean>
-              </property>
-              <property name="rollbackEnabledCancel">
-                <boolean>true</boolean>
-              </property>
-              <property name="rollbackEnabledError">
-                <boolean>true</boolean>
-              </property>
-              <property name="ruleExpression">
-                <string><![CDATA[]]></string>
-              </property>
-              <property name="unixPermissions">
-                <string><![CDATA[664]]></string>
-              </property>
-              <property name="sourceName">
-                <string><![CDATA[slf4j-log4j12-1.7.7.jar]]></string>
-              </property>
-              <property name="overrideUnixPermissions">
-                <boolean>false</boolean>
-              </property>
-              <property name="sourcePath">
-                <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
-              </property>
-              <property name="shouldUninstall">
-                <boolean>true</boolean>
-              </property>
-              <property name="rollbackEnabledCancel">
-                <boolean>true</boolean>
-              </property>
-              <property name="rollbackEnabledError">
-                <boolean>true</boolean>
-              </property>
-              <property name="destinationName">
-                <string><![CDATA[slf4j-log4j12-1.7.7.jar]]></string>
-              </property>
-              <property name="fileSize">
-                <long>348699</long>
-              </property>
-              <property name="macBinary">
-                <boolean>false</boolean>
-              </property>
-              <property name="targetCheckKind">
-                <int>0</int>
-              </property>
-              <property name="ruleExpression">
-                <string><![CDATA[]]></string>
-              </property>
-            </object>
-          </method>
+                                       <method name="addElement">
+                                               <object class="com.zerog.ia.installer.actions.InstallZipfile" objectID="244ffffaa672">
+                                                       <property name="belongsToUninstallPhase">
+                                                               <boolean>false</boolean>
+                                                       </property>
+                                                       <property name="rollbackEnabledCancel">
+                                                               <boolean>true</boolean>
+                                                       </property>
+                                                       <property name="rollbackEnabledError">
+                                                               <boolean>true</boolean>
+                                                       </property>
+                                                       <property name="ruleExpression">
+                                                               <string><![CDATA[]]></string>
+                                                       </property>
+                                                       <property name="unixPermissions">
+                                                               <string><![CDATA[664]]></string>
+                                                       </property>
+                                                       <property name="sourceName">
+                                                               <string><![CDATA[log4j-to-slf4j-2.0-rc2.jar]]></string>
+                                                       </property>
+                                                       <property name="overrideUnixPermissions">
+                                                               <boolean>false</boolean>
+                                                       </property>
+                                                       <property name="sourcePath">
+                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                       </property>
+                                                       <property name="shouldUninstall">
+                                                               <boolean>true</boolean>
+                                                       </property>
+                                                       <property name="rollbackEnabledCancel">
+                                                               <boolean>true</boolean>
+                                                       </property>
+                                                       <property name="rollbackEnabledError">
+                                                               <boolean>true</boolean>
+                                                       </property>
+                                                       <property name="destinationName">
+                                                               <string><![CDATA[log4j-to-slf4j-2.0-rc2.jar]]></string>
+                                                       </property>
+                                                       <property name="fileSize">
+                                                               <long>348699</long>
+                                                       </property>
+                                                       <property name="macBinary">
+                                                               <boolean>false</boolean>
+                                                       </property>
+                                                       <property name="targetCheckKind">
+                                                               <int>0</int>
+                                                       </property>
+                                                       <property name="ruleExpression">
+                                                               <string><![CDATA[]]></string>
+                                                       </property>
+                                               </object>
+                                       </method>
+                                       <method name="addElement">
+                                               <object class="com.zerog.ia.installer.actions.InstallZipfile" objectID="244f00faa672">
+                                                       <property name="belongsToUninstallPhase">
+                                                               <boolean>false</boolean>
+                                                       </property>
+                                                       <property name="rollbackEnabledCancel">
+                                                               <boolean>true</boolean>
+                                                       </property>
+                                                       <property name="rollbackEnabledError">
+                                                               <boolean>true</boolean>
+                                                       </property>
+                                                       <property name="ruleExpression">
+                                                               <string><![CDATA[]]></string>
+                                                       </property>
+                                                       <property name="unixPermissions">
+                                                               <string><![CDATA[664]]></string>
+                                                       </property>
+                                                       <property name="sourceName">
+                                                               <string><![CDATA[slf4j-log4j12-1.7.7.jar]]></string>
+                                                       </property>
+                                                       <property name="overrideUnixPermissions">
+                                                               <boolean>false</boolean>
+                                                       </property>
+                                                       <property name="sourcePath">
+                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                       </property>
+                                                       <property name="shouldUninstall">
+                                                               <boolean>true</boolean>
+                                                       </property>
+                                                       <property name="rollbackEnabledCancel">
+                                                               <boolean>true</boolean>
+                                                       </property>
+                                                       <property name="rollbackEnabledError">
+                                                               <boolean>true</boolean>
+                                                       </property>
+                                                       <property name="destinationName">
+                                                               <string><![CDATA[slf4j-log4j12-1.7.7.jar]]></string>
+                                                       </property>
+                                                       <property name="fileSize">
+                                                               <long>348699</long>
+                                                       </property>
+                                                       <property name="macBinary">
+                                                               <boolean>false</boolean>
+                                                       </property>
+                                                       <property name="targetCheckKind">
+                                                               <int>0</int>
+                                                       </property>
+                                                       <property name="ruleExpression">
+                                                               <string><![CDATA[]]></string>
+                                                       </property>
+                                               </object>
+                                       </method>
                                        <method name="addElement">
                                                <object class="com.zerog.ia.installer.actions.InstallZipfile" objectID="88d4aff3b0c6">
                                                        <property name="belongsToUninstallPhase">
@@ -2121,7 +2121,59 @@ and any path to a file to save to the file]]></string>
                                                                <string><![CDATA[jfreesvg-2.1.jar]]></string>
                                                        </property>
                                                        <property name="fileSize">
-                                                               <long>382442</long>
+                                                               <long>49768</long>
+                                                       </property>
+                                                       <property name="macBinary">
+                                                               <boolean>false</boolean>
+                                                       </property>
+                                                       <property name="targetCheckKind">
+                                                               <int>0</int>
+                                                       </property>
+                                                       <property name="ruleExpression">
+                                                               <string><![CDATA[]]></string>
+                                                       </property>
+                                               </object>
+                                       </method>
+                                       <method name="addElement">
+                                               <object class="com.zerog.ia.installer.actions.InstallZipfile" objectID="1f46efeefab93">
+                                                       <property name="belongsToUninstallPhase">
+                                                               <boolean>false</boolean>
+                                                       </property>
+                                                       <property name="rollbackEnabledCancel">
+                                                               <boolean>true</boolean>
+                                                       </property>
+                                                       <property name="rollbackEnabledError">
+                                                               <boolean>true</boolean>
+                                                       </property>
+                                                       <property name="ruleExpression">
+                                                               <string><![CDATA[]]></string>
+                                                       </property>
+                                                       <property name="unixPermissions">
+                                                               <string><![CDATA[664]]></string>
+                                                       </property>
+                                                       <property name="sourceName">
+                                                               <string><![CDATA[json_simple-1.1.jar]]></string>
+                                                       </property>
+                                                       <property name="overrideUnixPermissions">
+                                                               <boolean>false</boolean>
+                                                       </property>
+                                                       <property name="sourcePath">
+                                                               <string><![CDATA[/home/cruisecontrol/jalview/lib/]]></string>
+                                                       </property>
+                                                       <property name="shouldUninstall">
+                                                               <boolean>true</boolean>
+                                                       </property>
+                                                       <property name="rollbackEnabledCancel">
+                                                               <boolean>true</boolean>
+                                                       </property>
+                                                       <property name="rollbackEnabledError">
+                                                               <boolean>true</boolean>
+                                                       </property>
+                                                       <property name="destinationName">
+                                                               <string><![CDATA[json_simple-1.1.jar]]></string>
+                                                       </property>
+                                                       <property name="fileSize">
+                                                               <long>16046</long>
                                                        </property>
                                                        <property name="macBinary">
                                                                <boolean>false</boolean>
@@ -2946,10 +2998,13 @@ Press "Done" to quit the installer.]]></string>
                                                                                                <boolean>true</boolean>
                                                                                        </property>
                                                                                        <property name="buildWithVM">
-                                                                                               <boolean>false</boolean>
+                                                                                               <boolean>true</boolean>
+                                                                                       </property>
+                                                                                       <property name="bundledVM">
+                                                                                               <string><![CDATA[OracleJRE8u5_Macosx.vm]]></string>
                                                                                        </property>
                                                                                        <property name="withoutVmSearchOption">
-                                                                                               <short>13</short>
+                                                                                               <short>10</short>
                                                                                        </property>
                                                                                        <property name="withVMSearchOption">
                                                                                                <short>21</short>
@@ -2983,7 +3038,7 @@ Press "Done" to quit the installer.]]></string>
                                                                                                <boolean>true</boolean>
                                                                                        </property>
                                                                                        <property name="bundledVM">
-                                                                                               <string><![CDATA[SunJRE160_01iWin32.vm]]></string>
+                                                                                               <string><![CDATA[SunJRE170_03Win32.vm]]></string>
                                                                                        </property>
                                                                                        <property name="withoutVmSearchOption">
                                                                                                <short>10</short>
@@ -3017,7 +3072,7 @@ Press "Done" to quit the installer.]]></string>
                                                                                                <boolean>true</boolean>
                                                                                        </property>
                                                                                        <property name="buildWithVM">
-                                                                                               <boolean>true</boolean>
+                                                                                               <boolean>false</boolean>
                                                                                        </property>
                                                                                        <property name="bundledVM">
                                                                                                <string><![CDATA[IBMJRE142AIX_ca1420-20040626.vm]]></string>
@@ -3094,13 +3149,13 @@ Press "Done" to quit the installer.]]></string>
                                                                                                <boolean>true</boolean>
                                                                                        </property>
                                                                                        <property name="bundledVM">
-                                                                                               <string><![CDATA[SunJRE160_26LinuxINTEL.vm]]></string>
+                                                                                               <string><![CDATA[ORACLEJRE7u60_linux32.vm]]></string>
                                                                                        </property>
                                                                                        <property name="withoutVmSearchOption">
                                                                                                <short>10</short>
                                                                                        </property>
                                                                                        <property name="withVMSearchOption">
-                                                                                               <short>21</short>
+                                                                                               <short>20</short>
                                                                                        </property>
                                                                                        <property name="win32InstallerLauncherType">
                                                                                                <short>90</short>
@@ -3131,7 +3186,7 @@ Press "Done" to quit the installer.]]></string>
                                                                                                <boolean>true</boolean>
                                                                                        </property>
                                                                                        <property name="bundledVM">
-                                                                                               <string><![CDATA[SunJRE160_26SolarisSPARC.vm]]></string>
+                                                                                               <string><![CDATA[OracleJRE8u5_SolarisSparc.vm]]></string>
                                                                                        </property>
                                                                                        <property name="withoutVmSearchOption">
                                                                                                <short>10</short>
@@ -3196,13 +3251,13 @@ Press "Done" to quit the installer.]]></string>
                                                                                                <string><![CDATA[UNIX_with_VM]]></string>
                                                                                        </property>
                                                                                        <property name="buildNoVM">
-                                                                                               <boolean>false</boolean>
+                                                                                               <boolean>true</boolean>
                                                                                        </property>
                                                                                        <property name="buildWithVM">
                                                                                                <boolean>true</boolean>
                                                                                        </property>
                                                                                        <property name="bundledVM">
-                                                                                               <string><![CDATA[SunJRE160_02LinuxINTEL.vm]]></string>
+                                                                                               <string><![CDATA[ORACLEJRE7u60_linux32.vm]]></string>
                                                                                        </property>
                                                                                        <property name="withoutVmSearchOption">
                                                                                                <short>10</short>
@@ -3267,16 +3322,19 @@ Press "Done" to quit the installer.]]></string>
                                                                                                <string><![CDATA[Windows_Pure_64_Bit]]></string>
                                                                                        </property>
                                                                                        <property name="buildNoVM">
-                                                                                               <boolean>false</boolean>
+                                                                                               <boolean>true</boolean>
                                                                                        </property>
                                                                                        <property name="buildWithVM">
-                                                                                               <boolean>false</boolean>
+                                                                                               <boolean>true</boolean>
+                                                                                       </property>
+                                                                                       <property name="bundledVM">
+                                                                                               <string><![CDATA[OracleJRE8u5_windows(x64).vm]]></string>
                                                                                        </property>
                                                                                        <property name="withoutVmSearchOption">
                                                                                                <short>10</short>
                                                                                        </property>
                                                                                        <property name="withVMSearchOption">
-                                                                                               <short>21</short>
+                                                                                               <short>20</short>
                                                                                        </property>
                                                                                        <property name="win32InstallerLauncherType">
                                                                                                <short>90</short>
@@ -4245,7 +4303,7 @@ Press "Done" to quit the installer.]]></string>
                                                                <boolean>true</boolean>
                                                        </property>
                                                        <property name="credentialInformation">
-                                                               <object class="com.flexera.ia.vapp.datastructures.VMWareCredentialInformationImpl" objectID="27759feba050">
+                                                               <object class="com.flexera.ia.vapp.datastructures.VMWareCredentialInformationImpl" objectID="1f4abcab8706">
                                                                        <property name="hostName">
                                                                                <string><![CDATA[]]></string>
                                                                        </property>
@@ -4367,7 +4425,7 @@ Press "Done" to quit the installer.]]></string>
                                        </method>
                                        <method name="put">
                                                <string><![CDATA[com.zerog.ia.installer.options.valid.vm.list]]></string>
-                                               <string><![CDATA[1.6,1.7,1.8+]]></string>
+                                               <string><![CDATA[1.7+]]></string>
                                        </method>
                                        <method name="put">
                                                <string><![CDATA[com.zerog.ia.project.build.last.date]]></string>
@@ -4439,7 +4497,7 @@ Press "Done" to quit the installer.]]></string>
                                        </method>
                                        <method name="put">
                                                <string><![CDATA[com.zerog.ia.project.save.last.date]]></string>
-                                               <string><![CDATA[01 November 2013 13:57:31 o'clock GMT]]></string>
+                                               <string><![CDATA[02 December 2014 16:16:01 o'clock GMT]]></string>
                                        </method>
                                        <method name="put">
                                                <string><![CDATA[com.zerog.ia.build.options.optimization.platform.cdrom]]></string>
@@ -4463,7 +4521,7 @@ Press "Done" to quit the installer.]]></string>
                                        </method>
                                        <method name="put">
                                                <string><![CDATA[com.zerog.ia.installer.options.platform.macosx.vm.version]]></string>
-                                               <string><![CDATA[1.6+]]></string>
+                                               <string><![CDATA[1.7+]]></string>
                                        </method>
                                        <method name="put">
                                                <string><![CDATA[com.zerog.ia.build.platform.java.novm]]></string>
@@ -4720,13 +4778,20 @@ Press "Done" to quit the installer.]]></string>
                                                                <int>8</int>
                                                        </property>
                                                        <property name="revision">
-                                                               <int>0</int>
+                                                               <int>2</int>
                                                        </property>
                                                        <property name="subRevision">
                                                                <int>0</int>
                                                        </property>
                                                </object>
                                        </property>
+                                       <property name="upgradeCode">
+                                               <object class="com.zerog.registry.UUID">
+                                                       <method name="update">
+                                                               <string><![CDATA[fe7d6410-1ed5-11b2-a662-f4777f28dbfc]]></string>
+                                                       </method>
+                                               </object>
+                                       </property>
                                        <property name="supportURL">
                                                <string><![CDATA[http://www.jalview.org/faq]]></string>
                                        </property>
@@ -4747,7 +4812,7 @@ Press "Done" to quit the installer.]]></string>
                                                <string><![CDATA[jalview-discuss@jalview.org]]></string>
                                        </property>
                                        <property name="copyright">
-                                               <string><![CDATA[2013]]></string>
+                                               <string><![CDATA[2014]]></string>
                                        </property>
                                        <property name="license">
                                                <string><![CDATA[Commercial]]></string>
@@ -5740,6 +5805,80 @@ This will remove features installed by InstallAnywhere.  It will not remove file
                        <property name="oldStyleInstallersEnabled">
                                <boolean>false</boolean>
                        </property>
+                       <property name="upgradeSettings">
+                               <object class="com.zerog.ia.installer.UpgradeSettings" objectID="1b941ce786e7">
+                                       <property name="enableUpgrade">
+                                               <boolean>false</boolean>
+                                       </property>
+                                       <property name="upgradeConfigurationsList">
+                                               <object class="java.util.ArrayList" list="true">
+                                                       <method name="add">
+                                                               <object class="com.zerog.ia.installer.UpgradeConfiguration" objectID="1b941ce886e7">
+                                                                       <property name="detectionBasedOn">
+                                                                               <string><![CDATA[PRODUCT_CODE]]></string>
+                                                                       </property>
+                                                                       <property name="requireValidationForPreviousProductCode">
+                                                                               <boolean>false</boolean>
+                                                                       </property>
+                                                                       <property name="maxVersion">
+                                                                               <object class="com.zerog.ia.installer.util.Version" objectID="1b941cea86e7">
+                                                                                       <property name="major">
+                                                                                               <int>1</int>
+                                                                                       </property>
+                                                                                       <property name="minor">
+                                                                                               <int>0</int>
+                                                                                       </property>
+                                                                                       <property name="revision">
+                                                                                               <int>0</int>
+                                                                                       </property>
+                                                                                       <property name="subRevision">
+                                                                                               <int>0</int>
+                                                                                       </property>
+                                                                               </object>
+                                                                       </property>
+                                                                       <property name="minVersion">
+                                                                               <object class="com.zerog.ia.installer.util.Version" objectID="1b941ce886e8">
+                                                                                       <property name="major">
+                                                                                               <int>1</int>
+                                                                                       </property>
+                                                                                       <property name="minor">
+                                                                                               <int>0</int>
+                                                                                       </property>
+                                                                                       <property name="revision">
+                                                                                               <int>0</int>
+                                                                                       </property>
+                                                                                       <property name="subRevision">
+                                                                                               <int>0</int>
+                                                                                       </property>
+                                                                               </object>
+                                                                       </property>
+                                                                       <property name="configurationName">
+                                                                               <string><![CDATA[Default Upgrade Configuration]]></string>
+                                                                       </property>
+                                                               </object>
+                                                       </method>
+                                               </object>
+                                       </property>
+                                       <property name="abortInstallationIfUninstallFails">
+                                               <boolean>true</boolean>
+                                       </property>
+                                       <property name="automaticallyRemoveAllExistingInstallations">
+                                               <boolean>true</boolean>
+                                       </property>
+                                       <property name="promptUserOnExistanceOfMultiplePreviousInstallations">
+                                               <boolean>false</boolean>
+                                       </property>
+                                       <property name="allowCustomizationOfUserInstallDirectory">
+                                               <boolean>false</boolean>
+                                       </property>
+                                       <property name="retainFeaturePreferences">
+                                               <boolean>false</boolean>
+                                       </property>
+                               </object>
+                       </property>
+                       <property name="tomcatServerNamesList">
+                               <object class="java.util.ArrayList" list="true"/>
+                       </property>
                        <visualChildren>
                                <object class="com.zerog.ia.installer.InstallSet" objectID="fe7d6493a66a">
                                        <property name="belongsToUninstallPhase">
@@ -6237,9 +6376,11 @@ and any path to a file to read from that file]]></string>
                                                                                <object refID="24485f8aa671"/>
                                                                                <object refID="24485f89a672"/>
                                                                                <object refID="24485f8aa672"/>
+
                                                                                <object refID="244fff00ffff"/>
-                    <object refID="244ffffaa672"/>
-                    <object refID="244f00faa672"/>
+                                                           <object refID="244ffffaa672"/>
+                                                           <object refID="244f00faa672"/>
+
                                                                                <object refID="24485f8ba672"/>
                                                                                <object refID="24485f8aa673"/>
                                                                                <object refID="24485f8ba673"/>
@@ -6423,7 +6564,9 @@ and any path to a file to read from that file]]></string>
                                                                                <object refID="f44ca391ab9f"/>
                                                                                <object refID="f44ca392ab9f"/>
                                                                                <object refID="f44ca393ab9f"/>
-                                                                               <object refID=""1f46cffffab93"/>
+                                                                               <object refID="f46c2f42ab93"/>
+                                                                               <object refID="1f46cffffab93"/>
+                                                                               <object refID="1f46efeefab93"/>
                                                                                <object class="com.zerog.ia.installer.actions.InstallFile" objectID="f44fc5b2aba1">
                                                                                        <property name="belongsToUninstallPhase">
                                                                                                <boolean>false</boolean>
@@ -6925,7 +7068,6 @@ and any path to a file to read from that file]]></string>
                                                                                                <int>0</int>
                                                                                        </property>
                                                                                </object>
-                                                                               <object refID="f46c2f42ab93"/>
                                                                                <object class="com.zerog.ia.installer.actions.InstallDirectory" objectID="24485f85a670">
                                                                                        <property name="belongsToUninstallPhase">
                                                                                                <boolean>false</boolean>
@@ -6976,8 +7118,8 @@ and any path to a file to read from that file]]></string>
                                                                                                <object refID="24485f89a672"/>
                                                                                                <object refID="24485f8aa672"/>
                                                                                                <object refID="244fff00ffff"/>
-                        <object refID="244ffffaa672"/>
-                        <object refID="244f00faa672"/>
+                                                                       <object refID="244ffffaa672"/>
+                                                                       <object refID="244f00faa672"/>
                                                                                                <object refID="24485f8ba672"/>
                                                                                                <object refID="24485f8aa673"/>
                                                                                                <object refID="24485f8ba673"/>
@@ -7001,6 +7143,7 @@ and any path to a file to read from that file]]></string>
                                                                                                <object refID="f44ca393ab9f"/>
                                                                                                <object refID="f46c2f42ab93"/>
                                                                                                <object refID="1f46cffffab93"/>
+                                                                                               <object refID="1f46efeefab93"/>
                                                                                        </visualChildren>
                                                                                </object>
                                                                                <object class="com.zerog.ia.installer.actions.InstallDirectory" objectID="f44fc5d5aba1">