From 8a6fa9ea9900d0f106529c3f6283e7f9d76dd2cb Mon Sep 17 00:00:00 2001 From: jprocter Date: Thu, 23 Sep 2010 07:06:55 +0000 Subject: [PATCH] apply jalview code style --- src/MCview/AppletPDBCanvas.java | 9 +- src/MCview/PDBCanvas.java | 7 +- src/MCview/PDBChain.java | 35 +- src/MCview/PDBViewer.java | 16 +- src/ext/vamsas/JpredSoapBindingStub.java | 19 +- src/ext/vamsas/MuscleWSSoapBindingStub.java | 31 +- src/ext/vamsas/RegistryServiceSoapBindingStub.java | 6 +- .../vamsas/SeqSearchServiceSoapBindingStub.java | 30 +- src/jalview/analysis/AAFrequency.java | 14 +- src/jalview/analysis/AlignSeq.java | 16 +- src/jalview/analysis/AlignmentSorter.java | 5 +- src/jalview/analysis/CrossRef.java | 10 +- src/jalview/analysis/Dna.java | 9 +- src/jalview/analysis/NJTree.java | 5 +- src/jalview/analysis/PCA.java | 16 +- src/jalview/analysis/SeqsetUtils.java | 9 +- src/jalview/api/FeatureRenderer.java | 3 +- src/jalview/api/SequenceStructureBinding.java | 10 +- src/jalview/appletgui/APopupMenu.java | 53 +- src/jalview/appletgui/AlignFrame.java | 90 +-- src/jalview/appletgui/AlignViewport.java | 25 +- src/jalview/appletgui/AlignmentPanel.java | 3 +- src/jalview/appletgui/AnnotationColourChooser.java | 13 +- src/jalview/appletgui/AnnotationLabels.java | 32 +- src/jalview/appletgui/AnnotationPanel.java | 20 +- src/jalview/appletgui/AppletJmol.java | 80 +- src/jalview/appletgui/AppletJmolBinding.java | 47 +- src/jalview/appletgui/CutAndPasteTransfer.java | 4 +- src/jalview/appletgui/ExtJmol.java | 44 +- src/jalview/appletgui/FeatureColourChooser.java | 10 +- src/jalview/appletgui/FeatureRenderer.java | 24 +- src/jalview/appletgui/FeatureSettings.java | 8 +- src/jalview/appletgui/Finder.java | 4 +- src/jalview/appletgui/IdPanel.java | 3 +- src/jalview/appletgui/OverviewPanel.java | 3 +- src/jalview/appletgui/RotatableCanvas.java | 13 +- src/jalview/appletgui/ScalePanel.java | 22 +- src/jalview/appletgui/SeqCanvas.java | 8 +- src/jalview/appletgui/SeqPanel.java | 38 +- src/jalview/appletgui/Tooltip.java | 15 +- src/jalview/appletgui/TreeCanvas.java | 24 +- src/jalview/appletgui/TreePanel.java | 4 +- src/jalview/appletgui/UserDefinedColours.java | 7 +- src/jalview/bin/Cache.java | 21 +- src/jalview/bin/Jalview.java | 7 +- src/jalview/bin/JalviewLite.java | 82 +- src/jalview/commands/EditCommand.java | 18 +- src/jalview/datamodel/Alignment.java | 4 +- src/jalview/datamodel/AlignmentI.java | 5 +- src/jalview/datamodel/ColumnSelection.java | 9 +- src/jalview/datamodel/SeqCigar.java | 31 +- src/jalview/datamodel/SequenceGroup.java | 8 +- src/jalview/datamodel/xdb/embl/EmblEntry.java | 15 +- src/jalview/gui/AlignFrame.java | 2 +- src/jalview/gui/AlignViewport.java | 15 +- src/jalview/gui/AlignmentPanel.java | 84 +- src/jalview/gui/AnnotationColourChooser.java | 13 +- src/jalview/gui/AnnotationExporter.java | 2 +- src/jalview/gui/AnnotationLabels.java | 31 +- src/jalview/gui/AnnotationPanel.java | 24 +- src/jalview/gui/AppJmol.java | 63 +- src/jalview/gui/AppJmolBinding.java | 37 +- src/jalview/gui/Console.java | 237 +++--- src/jalview/gui/CutAndPasteTransfer.java | 4 +- src/jalview/gui/DasSourceBrowser.java | 33 +- src/jalview/gui/Desktop.java | 245 +++--- src/jalview/gui/EditNameDialog.java | 4 +- src/jalview/gui/FeatureRenderer.java | 24 +- src/jalview/gui/FeatureSettings.java | 70 +- src/jalview/gui/FontChooser.java | 4 +- src/jalview/gui/IdCanvas.java | 4 +- src/jalview/gui/Jalview2XML.java | 24 +- src/jalview/gui/Jalview2XML_V1.java | 27 +- src/jalview/gui/JvSwingUtils.java | 19 +- src/jalview/gui/OOMWarning.java | 2 +- src/jalview/gui/OverviewPanel.java | 3 +- src/jalview/gui/PCAPanel.java | 73 +- src/jalview/gui/PopupMenu.java | 82 +- src/jalview/gui/Preferences.java | 141 ++-- src/jalview/gui/RotatableCanvas.java | 18 +- src/jalview/gui/ScalePanel.java | 29 +- src/jalview/gui/SeqCanvas.java | 8 +- src/jalview/gui/SeqPanel.java | 53 +- src/jalview/gui/SequenceRenderer.java | 6 +- src/jalview/gui/SliderPanel.java | 4 +- src/jalview/gui/SplashScreen.java | 50 +- src/jalview/gui/TextColourChooser.java | 11 +- src/jalview/gui/TreePanel.java | 30 +- src/jalview/gui/UserDefinedColours.java | 39 +- src/jalview/gui/UserQuestionnaireCheck.java | 8 +- src/jalview/gui/VamsasApplication.java | 21 +- src/jalview/gui/WsJobParameters.java | 139 ++-- src/jalview/gui/WsPreferences.java | 292 ++++--- src/jalview/io/AnnotationFile.java | 30 +- src/jalview/io/AppletFormatAdapter.java | 11 +- src/jalview/io/ClustalFile.java | 4 +- src/jalview/io/FeaturesFile.java | 26 +- src/jalview/io/FormatAdapter.java | 10 +- src/jalview/io/HTMLOutput.java | 14 +- src/jalview/io/JPredFile.java | 7 +- src/jalview/io/JalviewFileChooser.java | 4 +- src/jalview/io/JnetAnnotationMaker.java | 15 +- src/jalview/io/NewickFile.java | 12 +- src/jalview/io/PIRFile.java | 6 +- src/jalview/io/StockholmFile.java | 4 +- src/jalview/io/VamsasAppDatastore.java | 55 +- src/jalview/io/WSWUBlastClient.java | 17 +- src/jalview/io/vamsas/Datasetsequence.java | 10 +- src/jalview/io/vamsas/DatastoreItem.java | 4 +- src/jalview/io/vamsas/Dbref.java | 5 +- src/jalview/io/vamsas/Sequencefeature.java | 9 +- src/jalview/io/vamsas/Sequencemapping.java | 6 +- src/jalview/io/vamsas/Tree.java | 11 +- src/jalview/jbgui/GAlignFrame.java | 5 +- src/jalview/jbgui/GPCAPanel.java | 7 +- src/jalview/jbgui/GPreferences.java | 5 +- src/jalview/jbgui/GStructureViewer.java | 2 +- src/jalview/jbgui/GUserDefinedColours.java | 5 +- src/jalview/jbgui/GWsPreferences.java | 64 +- .../version2/WebServiceParameterSet.java | 819 ++++++++++---------- .../descriptors/AlcodonFrameDescriptor.java | 3 +- .../version2/descriptors/AnnotationDescriptor.java | 6 +- .../version2/descriptors/FeatureDescriptor.java | 3 +- .../version2/descriptors/JGroupDescriptor.java | 8 +- .../version2/descriptors/JSeqDescriptor.java | 3 +- .../descriptors/JalviewModelDescriptor.java | 9 +- .../JalviewModelSequenceDescriptor.java | 9 +- .../descriptors/MapListTypeDescriptor.java | 6 +- .../descriptors/MappingChoiceDescriptor.java | 3 +- .../version2/descriptors/MappingDescriptor.java | 6 +- .../version2/descriptors/PdbentryDescriptor.java | 6 +- .../descriptors/PdbentryItemDescriptor.java | 3 +- .../version2/descriptors/PdbidsDescriptor.java | 3 +- .../descriptors/SequenceSetDescriptor.java | 12 +- .../version2/descriptors/TreeDescriptor.java | 4 +- .../descriptors/UserColoursDescriptor.java | 3 +- .../version2/descriptors/VAMSASDescriptor.java | 3 +- .../version2/descriptors/ViewportDescriptor.java | 10 +- .../WebServiceParameterSetDescriptor.java | 676 ++++++++-------- src/jalview/schemes/ClustalxColourScheme.java | 6 +- src/jalview/schemes/ResidueProperties.java | 2 +- src/jalview/util/AWTConsole.java | 2 +- src/jalview/util/DBRefUtils.java | 4 +- src/jalview/util/Format.java | 105 ++- src/jalview/util/ImageMaker.java | 16 +- src/jalview/util/TableSorter.java | 4 +- src/jalview/ws/AWSThread.java | 19 +- src/jalview/ws/AWsJob.java | 26 +- src/jalview/ws/DBRefFetcher.java | 32 +- src/jalview/ws/DasSequenceFeatureFetcher.java | 16 +- src/jalview/ws/EnfinEnvision2OneWay.java | 77 +- src/jalview/ws/JobStateSummary.java | 7 +- src/jalview/ws/WSClient.java | 1 - src/jalview/ws/dbsources/EmblXmlSource.java | 4 +- src/jalview/ws/dbsources/GeneDbSource.java | 2 +- .../dbsources/das/DasSequenceSourceListener.java | 3 +- src/jalview/ws/ebi/EBIFetchClient.java | 4 +- src/jalview/ws/jws1/Discoverer.java | 4 +- src/jalview/ws/jws1/JPredClient.java | 30 +- src/jalview/ws/jws1/JPredThread.java | 39 +- src/jalview/ws/jws1/JWS1Thread.java | 6 +- src/jalview/ws/jws1/MsaWSClient.java | 15 +- src/jalview/ws/jws1/MsaWSThread.java | 60 +- src/jalview/ws/jws1/SeqSearchWSClient.java | 7 +- src/jalview/ws/jws1/SeqSearchWSThread.java | 52 +- src/jalview/ws/jws1/WS1Client.java | 18 +- src/jalview/ws/jws1/WSJob.java | 40 +- src/jalview/ws/jws2/JWs2Job.java | 94 ++- src/jalview/ws/jws2/JabaPreset.java | 41 +- src/jalview/ws/jws2/Jws2Client.java | 29 +- src/jalview/ws/jws2/Jws2Discoverer.java | 45 +- src/jalview/ws/jws2/MsaWSClient.java | 12 +- src/jalview/ws/jws2/ParameterUtils.java | 20 +- src/jalview/ws/jws2/dm/JabaOption.java | 12 +- src/jalview/ws/jws2/dm/JabaParameter.java | 13 +- src/jalview/ws/jws2/dm/JabaValueConstrain.java | 3 +- src/jalview/ws/params/ArgumentI.java | 5 +- src/jalview/ws/params/OptionI.java | 2 - src/jalview/ws/params/ParamDatastoreI.java | 10 +- src/jalview/ws/params/ParamManager.java | 37 +- src/jalview/ws/params/ParameterI.java | 1 - src/jalview/ws/params/ValueConstrainI.java | 2 +- src/jalview/ws/params/WsParamSetI.java | 22 +- src/uk/ac/ebi/picr/model/UPEntry.java | 8 +- .../AccessionMapperBindingStub.java | 9 +- 185 files changed, 3107 insertions(+), 2821 deletions(-) diff --git a/src/MCview/AppletPDBCanvas.java b/src/MCview/AppletPDBCanvas.java index 543d680..9939131 100755 --- a/src/MCview/AppletPDBCanvas.java +++ b/src/MCview/AppletPDBCanvas.java @@ -177,8 +177,10 @@ public class AppletPDBCanvas extends Panel implements MouseListener, // the start and end points. // Align the sequence to the pdb // TODO: DNa/Pep switch - AlignSeq as = new AlignSeq(sequence, ((PDBChain) pdb.chains - .elementAt(i)).sequence, ((PDBChain) pdb.chains.elementAt(i)).isNa ? AlignSeq.DNA : AlignSeq.PEP); + AlignSeq as = new AlignSeq(sequence, + ((PDBChain) pdb.chains.elementAt(i)).sequence, + ((PDBChain) pdb.chains.elementAt(i)).isNa ? AlignSeq.DNA + : AlignSeq.PEP); as.calcScoreMatrix(); as.traceAlignment(); PrintStream ps = new PrintStream(System.out) @@ -1102,7 +1104,8 @@ public class AppletPDBCanvas extends Panel implements MouseListener, // /StructureListener public String[] getPdbFile() { - return new String[] { pdbentry.getFile() }; + return new String[] + { pdbentry.getFile() }; } String lastMessage; diff --git a/src/MCview/PDBCanvas.java b/src/MCview/PDBCanvas.java index 3b00418..23de254 100755 --- a/src/MCview/PDBCanvas.java +++ b/src/MCview/PDBCanvas.java @@ -173,8 +173,8 @@ public class PDBCanvas extends JPanel implements MouseListener, // Now lets compare the sequences to get // the start and end points. // Align the sequence to the pdb - AlignSeq as = new AlignSeq(sequence, ((PDBChain) pdb.chains - .elementAt(i)).sequence, "pep"); + AlignSeq as = new AlignSeq(sequence, + ((PDBChain) pdb.chains.elementAt(i)).sequence, "pep"); as.calcScoreMatrix(); as.traceAlignment(); PrintStream ps = new PrintStream(System.out) @@ -1069,7 +1069,8 @@ public class PDBCanvas extends JPanel implements MouseListener, // /StructureListener public String[] getPdbFile() { - return new String[] { pdbentry.getFile() }; + return new String[] + { pdbentry.getFile() }; } String lastMessage; diff --git a/src/MCview/PDBChain.java b/src/MCview/PDBChain.java index e25dfd0..47f6817 100755 --- a/src/MCview/PDBChain.java +++ b/src/MCview/PDBChain.java @@ -46,7 +46,9 @@ public class PDBChain public int offset; public Sequence sequence; - public boolean isNa=false; + + public boolean isNa = false; + public boolean isVisible = true; public int pdbstart = 0; @@ -150,10 +152,9 @@ public class PDBChain - offset)).atoms.elementAt(0)).alignmentMapping); tx.setEnd(1 + ((Atom) ((Residue) residues.elementAt(tx.getEnd() - offset)).atoms.elementAt(0)).alignmentMapping); - tx - .setStatus(status - + ((tx.getStatus() == null || tx.getStatus() - .length() == 0) ? "" : ":" + tx.getStatus())); + tx.setStatus(status + + ((tx.getStatus() == null || tx.getStatus().length() == 0) ? "" + : ":" + tx.getStatus())); if (tx.begin != 0 && tx.end != 0) sq.addSequenceFeature(tx); } @@ -163,18 +164,18 @@ public class PDBChain public void makeCaBondList() { - boolean na=false; - int numNa=0; + boolean na = false; + int numNa = 0; for (int i = 0; i < (residues.size() - 1); i++) { Residue tmpres = (Residue) residues.elementAt(i); Residue tmpres2 = (Residue) residues.elementAt(i + 1); Atom at1 = tmpres.findAtom("CA"); Atom at2 = tmpres2.findAtom("CA"); - na=false; + na = false; if ((at1 == null) && (at2 == null)) { - na=true; + na = true; at1 = tmpres.findAtom("P"); at2 = tmpres2.findAtom("P"); } @@ -194,9 +195,9 @@ public class PDBChain System.out.println("not found " + i); } } - if (numNa>0 && ((numNa/residues.size())>0.99)) + if (numNa > 0 && ((numNa / residues.size()) > 0.99)) { - isNa=true; + isNa = true; } } @@ -273,7 +274,7 @@ public class PDBChain // Keep totting up the sequence if ((symbol = ResidueProperties.getAA3Hash().get(tmpat.resName)) == null) { - String nucname=tmpat.resName.trim(); + String nucname = tmpat.resName.trim(); if (ResidueProperties.nucleotideIndex[nucname.charAt(0)] == -1) { seq.append("X"); @@ -303,7 +304,7 @@ public class PDBChain { id = " "; } - isNa=nucleotide; + isNa = nucleotide; sequence = new Sequence(id, seq.toString(), offset, resNumber - 1); // Note: // resNumber-offset // ~= @@ -475,11 +476,9 @@ public class PDBChain } } } - sq - .addAlignmentAnnotation(new AlignmentAnnotation("PDB.RESNUM", - "PDB Residue Numbering for " + this.pdbid + ":" - + this.id, an, (float) min, (float) max, - AlignmentAnnotation.LINE_GRAPH)); + sq.addAlignmentAnnotation(new AlignmentAnnotation("PDB.RESNUM", + "PDB Residue Numbering for " + this.pdbid + ":" + this.id, + an, (float) min, (float) max, AlignmentAnnotation.LINE_GRAPH)); } } } diff --git a/src/MCview/PDBViewer.java b/src/MCview/PDBViewer.java index 3800d07..6c3de37 100755 --- a/src/MCview/PDBViewer.java +++ b/src/MCview/PDBViewer.java @@ -360,8 +360,7 @@ public class PDBViewer extends JInternalFrame implements Runnable if (evt.isControlDown() || SwingUtilities.isRightMouseButton(evt)) { - radioItem - .removeActionListener(radioItem.getActionListeners()[0]); + radioItem.removeActionListener(radioItem.getActionListeners()[0]); int option = JOptionPane.showInternalConfirmDialog( jalview.gui.Desktop.desktop, @@ -492,8 +491,8 @@ public class PDBViewer extends JInternalFrame implements Runnable else { im = new jalview.util.ImageMaker(this, jalview.util.ImageMaker.EPS, - "Make EPS file from view", width, height, null, this - .getTitle()); + "Make EPS file from view", width, height, null, + this.getTitle()); } if (im.getGraphics() != null) @@ -564,12 +563,13 @@ public class PDBViewer extends JInternalFrame implements Runnable public void mapping_actionPerformed(ActionEvent e) { jalview.gui.CutAndPasteTransfer cap = new jalview.gui.CutAndPasteTransfer(); - try { + try + { cap.setText(pdbcanvas.mappingDetails.toString()); Desktop.addInternalFrame(cap, "PDB - Sequence Mapping", 550, 600); } catch (OutOfMemoryError oom) { - new OOMWarning("Opening sequence to structure mapping report",oom); + new OOMWarning("Opening sequence to structure mapping report", oom); cap.dispose(); } } @@ -659,8 +659,8 @@ public class PDBViewer extends JInternalFrame implements Runnable public void savePDB_actionPerformed(ActionEvent e) { - JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache - .getProperty("LAST_DIRECTORY")); + JalviewFileChooser chooser = new JalviewFileChooser( + jalview.bin.Cache.getProperty("LAST_DIRECTORY")); chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle("Save PDB File"); diff --git a/src/ext/vamsas/JpredSoapBindingStub.java b/src/ext/vamsas/JpredSoapBindingStub.java index ecbd9c5..7c80f57 100755 --- a/src/ext/vamsas/JpredSoapBindingStub.java +++ b/src/ext/vamsas/JpredSoapBindingStub.java @@ -95,9 +95,7 @@ public class JpredSoapBindingStub extends org.apache.axis.client.Stub oper.setReturnType(new javax.xml.namespace.QName( "http://simple.objects.vamsas", "JpredResult")); oper.setReturnClass(vamsas.objects.simple.JpredResult.class); - oper - .setReturnQName(new javax.xml.namespace.QName("", - "getresultReturn")); + oper.setReturnQName(new javax.xml.namespace.QName("", "getresultReturn")); oper.setStyle(org.apache.axis.constants.Style.RPC); oper.setUse(org.apache.axis.constants.Use.ENCODED); _operations[3] = oper; @@ -236,8 +234,7 @@ public class JpredSoapBindingStub extends org.apache.axis.client.Stub if (firstCall()) { // must set encoding style before registering serializers - _call - .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC); for (int i = 0; i < cachedSerFactories.size(); ++i) { @@ -271,8 +268,7 @@ public class JpredSoapBindingStub extends org.apache.axis.client.Stub _call.setOperation(_operations[0]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); - _call - .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setOperationName(new javax.xml.namespace.QName("vamsas", "predict")); @@ -311,8 +307,7 @@ public class JpredSoapBindingStub extends org.apache.axis.client.Stub _call.setOperation(_operations[1]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); - _call - .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setOperationName(new javax.xml.namespace.QName("vamsas", "predictOnMsa")); @@ -350,8 +345,7 @@ public class JpredSoapBindingStub extends org.apache.axis.client.Stub _call.setOperation(_operations[2]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); - _call - .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setOperationName(new javax.xml.namespace.QName("vamsas", "getpredict")); @@ -389,8 +383,7 @@ public class JpredSoapBindingStub extends org.apache.axis.client.Stub _call.setOperation(_operations[3]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); - _call - .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setOperationName(new javax.xml.namespace.QName("vamsas", "getresult")); diff --git a/src/ext/vamsas/MuscleWSSoapBindingStub.java b/src/ext/vamsas/MuscleWSSoapBindingStub.java index c8aa279..f732060 100755 --- a/src/ext/vamsas/MuscleWSSoapBindingStub.java +++ b/src/ext/vamsas/MuscleWSSoapBindingStub.java @@ -194,9 +194,7 @@ public class MuscleWSSoapBindingStub extends org.apache.axis.client.Stub oper.setReturnType(new javax.xml.namespace.QName( "simple.objects.vamsas", "Alignment")); oper.setReturnClass(vamsas.objects.simple.Alignment.class); - oper - .setReturnQName(new javax.xml.namespace.QName("", - "getalignReturn")); + oper.setReturnQName(new javax.xml.namespace.QName("", "getalignReturn")); oper.setStyle(org.apache.axis.constants.Style.RPC); oper.setUse(org.apache.axis.constants.Use.ENCODED); _operations[1] = oper; @@ -211,9 +209,7 @@ public class MuscleWSSoapBindingStub extends org.apache.axis.client.Stub oper.setReturnType(new javax.xml.namespace.QName( "simple.objects.vamsas", "MsaResult")); oper.setReturnClass(vamsas.objects.simple.MsaResult.class); - oper - .setReturnQName(new javax.xml.namespace.QName("", - "getResultReturn")); + oper.setReturnQName(new javax.xml.namespace.QName("", "getResultReturn")); oper.setStyle(org.apache.axis.constants.Style.RPC); oper.setUse(org.apache.axis.constants.Use.ENCODED); _operations[2] = oper; @@ -290,8 +286,7 @@ public class MuscleWSSoapBindingStub extends org.apache.axis.client.Stub if (firstCall()) { // must set encoding style before registering serializers - _call - .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC); for (int i = 0; i < cachedSerFactories.size(); ++i) @@ -329,11 +324,8 @@ public class MuscleWSSoapBindingStub extends org.apache.axis.client.Stub _call.setOperation(_operations[0]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); - _call - .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call - .setOperationName(new javax.xml.namespace.QName("vamsas", - "align")); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("vamsas", "align")); setRequestHeaders(_call); setAttachments(_call); @@ -372,8 +364,7 @@ public class MuscleWSSoapBindingStub extends org.apache.axis.client.Stub _call.setOperation(_operations[1]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); - _call - .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setOperationName(new javax.xml.namespace.QName("vamsas", "getalign")); @@ -414,8 +405,7 @@ public class MuscleWSSoapBindingStub extends org.apache.axis.client.Stub _call.setOperation(_operations[2]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); - _call - .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setOperationName(new javax.xml.namespace.QName("vamsas", "getResult")); @@ -456,11 +446,8 @@ public class MuscleWSSoapBindingStub extends org.apache.axis.client.Stub _call.setOperation(_operations[3]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); - _call - .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call - .setOperationName(new javax.xml.namespace.QName("vamsas", - "cancel")); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("vamsas", "cancel")); setRequestHeaders(_call); setAttachments(_call); diff --git a/src/ext/vamsas/RegistryServiceSoapBindingStub.java b/src/ext/vamsas/RegistryServiceSoapBindingStub.java index 5d977ad..7722d99 100755 --- a/src/ext/vamsas/RegistryServiceSoapBindingStub.java +++ b/src/ext/vamsas/RegistryServiceSoapBindingStub.java @@ -166,8 +166,7 @@ public class RegistryServiceSoapBindingStub extends if (firstCall()) { // must set encoding style before registering serializers - _call - .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC); for (int i = 0; i < cachedSerFactories.size(); ++i) { @@ -201,8 +200,7 @@ public class RegistryServiceSoapBindingStub extends _call.setOperation(_operations[0]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); - _call - .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setOperationName(new javax.xml.namespace.QName("vamsas", "getServices")); diff --git a/src/ext/vamsas/SeqSearchServiceSoapBindingStub.java b/src/ext/vamsas/SeqSearchServiceSoapBindingStub.java index 305caf9..9b918fd 100644 --- a/src/ext/vamsas/SeqSearchServiceSoapBindingStub.java +++ b/src/ext/vamsas/SeqSearchServiceSoapBindingStub.java @@ -60,9 +60,7 @@ public class SeqSearchServiceSoapBindingStub extends oper.setReturnType(new javax.xml.namespace.QName( "simple.objects.vamsas", "SeqSearchResult")); oper.setReturnClass(vamsas.objects.simple.SeqSearchResult.class); - oper - .setReturnQName(new javax.xml.namespace.QName("", - "getResultReturn")); + oper.setReturnQName(new javax.xml.namespace.QName("", "getResultReturn")); oper.setStyle(org.apache.axis.constants.Style.RPC); oper.setUse(org.apache.axis.constants.Use.ENCODED); _operations[1] = oper; @@ -275,8 +273,7 @@ public class SeqSearchServiceSoapBindingStub extends if (firstCall()) { // must set encoding style before registering serializers - _call - .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setEncodingStyle(org.apache.axis.Constants.URI_SOAP11_ENC); for (int i = 0; i < cachedSerFactories.size(); ++i) { @@ -309,8 +306,7 @@ public class SeqSearchServiceSoapBindingStub extends _call.setOperation(_operations[0]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); - _call - .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setOperationName(new javax.xml.namespace.QName("vamsas", "getDatabase")); @@ -348,8 +344,7 @@ public class SeqSearchServiceSoapBindingStub extends _call.setOperation(_operations[1]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); - _call - .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setOperationName(new javax.xml.namespace.QName("vamsas", "getResult")); @@ -388,8 +383,7 @@ public class SeqSearchServiceSoapBindingStub extends _call.setOperation(_operations[2]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); - _call - .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); _call.setOperationName(new javax.xml.namespace.QName("vamsas", "psearch")); @@ -428,11 +422,8 @@ public class SeqSearchServiceSoapBindingStub extends _call.setOperation(_operations[3]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); - _call - .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call - .setOperationName(new javax.xml.namespace.QName("vamsas", - "search")); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("vamsas", "search")); setRequestHeaders(_call); setAttachments(_call); @@ -468,11 +459,8 @@ public class SeqSearchServiceSoapBindingStub extends _call.setOperation(_operations[4]); _call.setUseSOAPAction(true); _call.setSOAPActionURI(""); - _call - .setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); - _call - .setOperationName(new javax.xml.namespace.QName("vamsas", - "cancel")); + _call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS); + _call.setOperationName(new javax.xml.namespace.QName("vamsas", "cancel")); setRequestHeaders(_call); setAttachments(_call); diff --git a/src/jalview/analysis/AAFrequency.java b/src/jalview/analysis/AAFrequency.java index 11e7a3d..4bff6ef 100755 --- a/src/jalview/analysis/AAFrequency.java +++ b/src/jalview/analysis/AAFrequency.java @@ -204,16 +204,20 @@ public class AAFrequency boolean includeAllConsSymbols, char[] alphabet) { float tval, value; - if (consensus==null || consensus.annotations==null || consensus.annotations.length=hconsensus.length) { - // happens if sequences calculated over were shorter than alignment width - consensus.annotations[i]=null; + if (i >= hconsensus.length) + { + // happens if sequences calculated over were shorter than alignment + // width + consensus.annotations[i] = null; continue; } value = 0; diff --git a/src/jalview/analysis/AlignSeq.java b/src/jalview/analysis/AlignSeq.java index fcb117c..28c6283 100755 --- a/src/jalview/analysis/AlignSeq.java +++ b/src/jalview/analysis/AlignSeq.java @@ -501,22 +501,23 @@ public class AlignSeq // TODO: Use original sequence characters rather than re-translated // characters in output // Find the biggest id length for formatting purposes - String s1id=s1.getName(),s2id=s2.getName(); + String s1id = s1.getName(), s2id = s2.getName(); int maxid = s1.getName().length(); if (s2.getName().length() > maxid) { maxid = s2.getName().length(); } - if (maxid>30) { + if (maxid > 30) + { maxid = 30; // JAL-527 - truncate the sequence ids - if (s1.getName().length()>maxid) + if (s1.getName().length() > maxid) { - s1id = s1.getName().substring(0,30); + s1id = s1.getName().substring(0, 30); } - if (s2.getName().length()>maxid) + if (s2.getName().length() > maxid) { - s2id = s2.getName().substring(0,30); + s2id = s2.getName().substring(0, 30); } } int len = 72 - maxid - 1; @@ -537,8 +538,7 @@ public class AlignSeq for (int j = 0; j < nochunks; j++) { // Print the first aligned sequence - output.append(new Format("%" + (maxid) + "s").form(s1id) - + " "); + output.append(new Format("%" + (maxid) + "s").form(s1id) + " "); for (int i = 0; i < len; i++) { diff --git a/src/jalview/analysis/AlignmentSorter.java b/src/jalview/analysis/AlignmentSorter.java index 0ea479d..158fe81 100755 --- a/src/jalview/analysis/AlignmentSorter.java +++ b/src/jalview/analysis/AlignmentSorter.java @@ -798,9 +798,8 @@ public class AlignmentSorter // filter for selection criteria if ( // ignore features outwith alignment start-stop positions. - (sf[f].end < sstart || sf[f].begin > sstop) - || - // or ignore based on selection criteria + (sf[f].end < sstart || sf[f].begin > sstop) || + // or ignore based on selection criteria (featureLabels != null && !AlignmentSorter .containsIgnoreCase(sf[f].type, featureLabels)) || (groupLabels != null diff --git a/src/jalview/analysis/CrossRef.java b/src/jalview/analysis/CrossRef.java index 1c14240..8682e8a 100644 --- a/src/jalview/analysis/CrossRef.java +++ b/src/jalview/analysis/CrossRef.java @@ -66,12 +66,12 @@ public class CrossRef public static Hashtable classifyDbRefs(DBRefEntry[] rfs) { Hashtable classes = new Hashtable(); - classes.put(DBRefSource.PROTEINDBS, jalview.util.DBRefUtils.selectRefs( - rfs, DBRefSource.PROTEINDBS)); + classes.put(DBRefSource.PROTEINDBS, + jalview.util.DBRefUtils.selectRefs(rfs, DBRefSource.PROTEINDBS)); classes.put(DBRefSource.DNACODINGDBS, jalview.util.DBRefUtils .selectRefs(rfs, DBRefSource.DNACODINGDBS)); - classes.put(DBRefSource.DOMAINDBS, jalview.util.DBRefUtils.selectRefs( - rfs, DBRefSource.DOMAINDBS)); + classes.put(DBRefSource.DOMAINDBS, + jalview.util.DBRefUtils.selectRefs(rfs, DBRefSource.DOMAINDBS)); // classes.put(OTHER, ) return classes; } @@ -518,7 +518,7 @@ public class CrossRef } else { - poss = CrossRef.findXDbRefs(dna, poss); // + poss = CrossRef.findXDbRefs(dna, poss); // cands = jalview.util.DBRefUtils.searchRefs(poss, xrf); } if (cands != null) diff --git a/src/jalview/analysis/Dna.java b/src/jalview/analysis/Dna.java index 2b753fe..482c54a 100644 --- a/src/jalview/analysis/Dna.java +++ b/src/jalview/analysis/Dna.java @@ -559,8 +559,8 @@ public class Dna } if (resSize > 0) { - SequenceI newseq = new Sequence(selection.getName(), protein - .toString()); + SequenceI newseq = new Sequence(selection.getName(), + protein.toString()); if (rf != 0) { jalview.bin.Cache.log @@ -655,7 +655,7 @@ public class Dna } } // register the mapping somehow - // + // return null; } @@ -700,8 +700,7 @@ public class Dna fgstate = (featureGroups == null) ? null : ((Boolean) featureGroups .get(sf[f].featureGroup)); if ((featureTypes == null || featureTypes.containsKey(sf[f] - .getType())) - && (fgstate == null || fgstate.booleanValue())) + .getType())) && (fgstate == null || fgstate.booleanValue())) { if (FeatureProperties.isCodingFeature(null, sf[f].getType())) { diff --git a/src/jalview/analysis/NJTree.java b/src/jalview/analysis/NJTree.java index c053cb3..ee782e7 100755 --- a/src/jalview/analysis/NJTree.java +++ b/src/jalview/analysis/NJTree.java @@ -740,8 +740,9 @@ public class NJTree { try { - score += pwmatrix.getPairwiseScore(sequenceString[i] - .charAt(k), sequenceString[j].charAt(k)); + score += pwmatrix.getPairwiseScore( + sequenceString[i].charAt(k), + sequenceString[j].charAt(k)); } catch (Exception ex) { System.err.println("err creating BLOSUM62 tree"); diff --git a/src/jalview/analysis/PCA.java b/src/jalview/analysis/PCA.java index 4b20b07..9be0e3c 100755 --- a/src/jalview/analysis/PCA.java +++ b/src/jalview/analysis/PCA.java @@ -245,15 +245,11 @@ public class PCA implements Runnable details.append(" --- Eigenvalues ---\n"); eigenvector.printD(ps); ps.println(); - /*for (int seq=0;seq0) { - seqs = new SequenceI[sqi.size()]; - for (int sid=0,sSize=sqi.size();sid0) { seqs = new SequenceI[sqi.size()]; for (int + * sid=0,sSize=sqi.size();sid -1) @@ -350,7 +352,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener, } graphStretchY = evt.getY(); adjustPanelHeight(); - needValidating=true; + needValidating = true; ap.paintAlignment(true); } else @@ -453,7 +455,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener, height += aa[i].height; } } - if (height==0) + if (height == 0) { height = 20; } @@ -697,9 +699,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener, if (v == column) { - g - .fillRect(x * av.charWidth, y, av.charWidth, - av.charHeight); + g.fillRect(x * av.charWidth, y, av.charWidth, av.charHeight); } } } @@ -877,9 +877,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener, if (sCol == 0 || row.annotations[sCol - 1] == null || row.annotations[sCol - 1].secondaryStructure != 'H') { - g - .fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, - 90, 180); + g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90, 180); x1 += av.charWidth / 2; } diff --git a/src/jalview/appletgui/AppletJmol.java b/src/jalview/appletgui/AppletJmol.java index 55df194..42e6f56 100644 --- a/src/jalview/appletgui/AppletJmol.java +++ b/src/jalview/appletgui/AppletJmol.java @@ -98,25 +98,41 @@ public class AppletJmol extends EmbmenuFrame implements * datasource protocol for access to PDBEntry */ String protocol = null; + /** - * Load a bunch of pdb entries associated with sequences in the alignment and display them - aligning them if necessary. - * @param pdbentries each pdb file (at least one needed) - * @param boundseqs each set of sequences for each pdb file (must match number of pdb files) - * @param boundchains the target pdb chain corresponding with each sequence associated with each pdb file (may be null at any level) - * @param align true/false - * @param ap associated alignment - * @param protocol how to get pdb data + * Load a bunch of pdb entries associated with sequences in the alignment and + * display them - aligning them if necessary. + * + * @param pdbentries + * each pdb file (at least one needed) + * @param boundseqs + * each set of sequences for each pdb file (must match number of pdb + * files) + * @param boundchains + * the target pdb chain corresponding with each sequence associated + * with each pdb file (may be null at any level) + * @param align + * true/false + * @param ap + * associated alignment + * @param protocol + * how to get pdb data */ - public AppletJmol(PDBEntry[] pdbentries, SequenceI[][] boundseqs, String[][] boundchains, boolean align, AlignmentPanel ap, String protocol) + public AppletJmol(PDBEntry[] pdbentries, SequenceI[][] boundseqs, + String[][] boundchains, boolean align, AlignmentPanel ap, + String protocol) { throw new Error("Not yet implemented."); } + public AppletJmol(PDBEntry pdbentry, SequenceI[] seq, String[] chains, AlignmentPanel ap, String protocol) { this.ap = ap; jmb = new AppletJmolBinding(this, new PDBEntry[] - { pdbentry }, new SequenceI[][]{seq}, new String[][]{ chains }, protocol); + { pdbentry }, new SequenceI[][] + { seq }, new String[][] + { chains }, protocol); jmb.setColourBySequence(true); if (pdbentry.getId() == null || pdbentry.getId().length() < 1) { @@ -194,12 +210,12 @@ public class AppletJmol extends EmbmenuFrame implements scriptWindow = new Panel(); scriptWindow.setVisible(false); // this.add(scriptWindow, BorderLayout.SOUTH); - + try { - jmb.allocateViewer(renderPanel, true, ap.av.applet.getName()+"_jmol_", - ap.av.applet.getDocumentBase(), ap.av.applet.getCodeBase(), - "-applet", scriptWindow, null); + jmb.allocateViewer(renderPanel, true, ap.av.applet.getName() + + "_jmol_", ap.av.applet.getDocumentBase(), + ap.av.applet.getCodeBase(), "-applet", scriptWindow, null); } catch (Exception e) { System.err @@ -220,7 +236,7 @@ public class AppletJmol extends EmbmenuFrame implements closeViewer(); } }); - if (pdbentry.getProperty()==null) + if (pdbentry.getProperty() == null) { pdbentry.setProperty(new Hashtable()); pdbentry.getProperty().put("protocol", protocol); @@ -359,19 +375,21 @@ public class AppletJmol extends EmbmenuFrame implements frame.add(cap); StringBuffer sb = new StringBuffer(); - try { - for (int s = 0; s < jmb.pdbentry.length; s++) + try { - sb.append(StructureSelectionManager.getStructureSelectionManager() - .printMapping(jmb.pdbentry[s].getFile())); - sb.append("\n"); - } - cap.setText(sb.toString()); - } - catch (OutOfMemoryError ex) + for (int s = 0; s < jmb.pdbentry.length; s++) + { + sb.append(StructureSelectionManager + .getStructureSelectionManager().printMapping( + jmb.pdbentry[s].getFile())); + sb.append("\n"); + } + cap.setText(sb.toString()); + } catch (OutOfMemoryError ex) { frame.dispose(); - System.err.println("Out of memory when trying to create dialog box with sequence-structure mapping."); + System.err + .println("Out of memory when trying to create dialog box with sequence-structure mapping."); return; } jalview.bin.JalviewLite.addFrame(frame, "PDB - Sequence Mapping", @@ -525,26 +543,30 @@ public class AppletJmol extends EmbmenuFrame implements { } } - Panel splitPane=null; + + Panel splitPane = null; + public void showConsole(boolean showConsole) { if (showConsole) { remove(renderPanel); splitPane = new Panel(); - - splitPane.setLayout(new java.awt.GridLayout(2,1)); + + splitPane.setLayout(new java.awt.GridLayout(2, 1)); splitPane.add(renderPanel); splitPane.add(scriptWindow); scriptWindow.setVisible(true); this.add(splitPane, BorderLayout.CENTER); splitPane.setVisible(true); splitPane.validate(); - } else { + } + else + { scriptWindow.setVisible(false); remove(splitPane); add(renderPanel, BorderLayout.CENTER); - splitPane=null; + splitPane = null; } validate(); } diff --git a/src/jalview/appletgui/AppletJmolBinding.java b/src/jalview/appletgui/AppletJmolBinding.java index 7490edc..009cefd 100644 --- a/src/jalview/appletgui/AppletJmolBinding.java +++ b/src/jalview/appletgui/AppletJmolBinding.java @@ -36,8 +36,8 @@ class AppletJmolBinding extends jalview.ext.jmol.JalviewJmolBinding */ private AppletJmol appletJmolBinding; - public AppletJmolBinding(AppletJmol appletJmol, PDBEntry[] pdbentry, SequenceI[][] seq, - String[][] chains, String protocol) + public AppletJmolBinding(AppletJmol appletJmol, PDBEntry[] pdbentry, + SequenceI[][] seq, String[][] chains, String protocol) { super(pdbentry, seq, chains, protocol); appletJmolBinding = appletJmol; @@ -49,10 +49,13 @@ class AppletJmolBinding extends jalview.ext.jmol.JalviewJmolBinding { if (appletJmolBinding.fr == null) { - appletJmolBinding.fr = new jalview.appletgui.FeatureRenderer(appletJmolBinding.ap.av); + appletJmolBinding.fr = new jalview.appletgui.FeatureRenderer( + appletJmolBinding.ap.av); } - appletJmolBinding.fr.transferSettings(appletJmolBinding.ap.seqPanel.seqCanvas.getFeatureRenderer()); + appletJmolBinding.fr + .transferSettings(appletJmolBinding.ap.seqPanel.seqCanvas + .getFeatureRenderer()); } return appletJmolBinding.fr; @@ -90,7 +93,7 @@ class AppletJmolBinding extends jalview.ext.jmol.JalviewJmolBinding { appletJmolBinding.updateTitleAndMenus(); } - + public void updateColours(Object source) { AlignmentPanel ap = (AlignmentPanel) source; @@ -101,17 +104,19 @@ class AppletJmolBinding extends jalview.ext.jmol.JalviewJmolBinding { try { - appletJmolBinding.ap.av.applet.getAppletContext().showDocument(new java.net.URL(url), - "jmol"); + appletJmolBinding.ap.av.applet.getAppletContext().showDocument( + new java.net.URL(url), "jmol"); } catch (java.net.MalformedURLException ex) { } } - public void newJmolPopup(boolean translateLocale, String menuName, boolean asPopup) + public void newJmolPopup(boolean translateLocale, String menuName, + boolean asPopup) { - - jmolpopup = JmolPopup.newJmolPopup(viewer,translateLocale, menuName,asPopup); + + jmolpopup = JmolPopup.newJmolPopup(viewer, translateLocale, menuName, + asPopup); } public void notifyScriptTermination(String strStatus, int msWalltime) @@ -122,13 +127,13 @@ class AppletJmolBinding extends jalview.ext.jmol.JalviewJmolBinding public void selectionChanged(BitSet arg0) { // TODO Auto-generated method stub - + } public void refreshPdbEntries() { // TODO Auto-generated method stub - + } @Override @@ -143,17 +148,25 @@ class AppletJmolBinding extends jalview.ext.jmol.JalviewJmolBinding { return new AppletConsole(viewer2, consolePanel); } + @Override protected void releaseUIResources() { appletJmolBinding = null; - if (console!=null) { - try { + if (console != null) + { + try + { console.setVisible(false); - } catch (Error e) {} catch (Exception x) {}; - console=null; + } catch (Error e) + { + } catch (Exception x) + { + } + ; + console = null; } - + } } diff --git a/src/jalview/appletgui/CutAndPasteTransfer.java b/src/jalview/appletgui/CutAndPasteTransfer.java index f9e4ac1..c09784e 100755 --- a/src/jalview/appletgui/CutAndPasteTransfer.java +++ b/src/jalview/appletgui/CutAndPasteTransfer.java @@ -139,8 +139,8 @@ public class CutAndPasteTransfer extends Panel implements ActionListener, { try { - jalview.io.NewickFile fin = new jalview.io.NewickFile(textarea - .getText(), "Paste"); + jalview.io.NewickFile fin = new jalview.io.NewickFile( + textarea.getText(), "Paste"); fin.parse(); if (fin.getTree() != null) diff --git a/src/jalview/appletgui/ExtJmol.java b/src/jalview/appletgui/ExtJmol.java index a854c6c..d3dad58 100644 --- a/src/jalview/appletgui/ExtJmol.java +++ b/src/jalview/appletgui/ExtJmol.java @@ -33,15 +33,17 @@ import jalview.ext.jmol.JalviewJmolBinding; /** * bind an alignment view to an external Jmol instance. + * * @author JimP - * + * */ public class ExtJmol extends JalviewJmolBinding { private AlignmentPanel ap; - protected ExtJmol(jalview.appletgui.AlignFrame alframe, PDBEntry[] pdbentry, SequenceI[][] seq, String[][] chains, + protected ExtJmol(jalview.appletgui.AlignFrame alframe, + PDBEntry[] pdbentry, SequenceI[][] seq, String[][] chains, String protocol) { super(pdbentry, seq, chains, protocol); @@ -58,7 +60,7 @@ public class ExtJmol extends JalviewJmolBinding public void updateColours(Object source) { - + // TODO Auto-generated method stub } @@ -120,22 +122,23 @@ public class ExtJmol extends JalviewJmolBinding Vector pdbe = new Vector(); Hashtable fileids = new Hashtable(); SequenceI[] sq = ap.av.getAlignment().getSequencesArray(); - for (int s=0;s 0) { SearchResults highlight = new SearchResults(); - highlight.addResult(sequence, features[0].getBegin(), features[0] - .getEnd()); + highlight.addResult(sequence, features[0].getBegin(), + features[0].getEnd()); seqCanvas.highlightSearchResults(highlight); } if (features != null && features.length > 0) @@ -580,8 +580,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, y -= hgap; - seq = Math.min((y % cHeight) / av.getCharHeight(), av.alignment - .getHeight() - 1); + seq = Math.min((y % cHeight) / av.getCharHeight(), + av.alignment.getHeight() - 1); if (seq < 0) { seq = -1; @@ -734,8 +734,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, } // use aa to see if the mouse pointer is on a - SequenceFeature[] allFeatures = findFeaturesAtRes(sequence, sequence - .findPosition(res)); + SequenceFeature[] allFeatures = findFeaturesAtRes(sequence, + sequence.findPosition(res)); int index = 0; while (index < allFeatures.length) @@ -836,9 +836,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, fontSize = 1; } - av - .setFont(new Font(av.font.getName(), av.font.getStyle(), - fontSize)); + av.setFont(new Font(av.font.getName(), av.font.getStyle(), fontSize)); av.charWidth = oldWidth; } else @@ -1348,8 +1346,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, // DETECT RIGHT MOUSE BUTTON IN AWT if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK) { - SequenceFeature[] allFeatures = findFeaturesAtRes(sequence, sequence - .findPosition(res)); + SequenceFeature[] allFeatures = findFeaturesAtRes(sequence, + sequence.findPosition(res)); Vector links = null; if (allFeatures != null) @@ -1420,9 +1418,9 @@ public class SeqPanel extends Panel implements MouseMotionListener, { if (stretchGroup.cs instanceof ClustalxColourScheme) { - ((ClustalxColourScheme) stretchGroup.cs).resetClustalX(stretchGroup - .getSequences(av.hiddenRepSequences), stretchGroup - .getWidth()); + ((ClustalxColourScheme) stretchGroup.cs).resetClustalX( + stretchGroup.getSequences(av.hiddenRepSequences), + stretchGroup.getWidth()); } if (stretchGroup.cs instanceof Blosum62ColourScheme @@ -1435,14 +1433,14 @@ public class SeqPanel extends Panel implements MouseMotionListener, if (stretchGroup.cs.conservationApplied()) { - SliderPanel.setConservationSlider(ap, stretchGroup.cs, stretchGroup - .getName()); + SliderPanel.setConservationSlider(ap, stretchGroup.cs, + stretchGroup.getName()); stretchGroup.recalcConservation(); } else { - SliderPanel.setPIDSliderSource(ap, stretchGroup.cs, stretchGroup - .getName()); + SliderPanel.setPIDSliderSource(ap, stretchGroup.cs, + stretchGroup.getName()); } } changeEndRes = false; diff --git a/src/jalview/appletgui/Tooltip.java b/src/jalview/appletgui/Tooltip.java index 61c9976..4806ba1 100755 --- a/src/jalview/appletgui/Tooltip.java +++ b/src/jalview/appletgui/Tooltip.java @@ -86,8 +86,8 @@ public class Tooltip extends Canvas implements MouseListener, g.drawImage(linkImage, x, i * fontHeight + 1, this); if (lindex + 6 < tip[i].length()) { - g.drawString(tip[i].substring(lindex + 6), x - + linkImage.getWidth(this), (i + 1) * fontHeight - 3); + g.drawString(tip[i].substring(lindex + 6), + x + linkImage.getWidth(this), (i + 1) * fontHeight - 3); } } else @@ -142,11 +142,12 @@ public class Tooltip extends Canvas implements MouseListener, { return; } - setLocation((owner.getLocationOnScreen().x - mainContainer - .getLocationOnScreen().x) - + evt.getX(), (owner.getLocationOnScreen().y - - mainContainer.getLocationOnScreen().y + VERTICAL_OFFSET) - + evt.getY()); + setLocation( + (owner.getLocationOnScreen().x - mainContainer.getLocationOnScreen().x) + + evt.getX(), + (owner.getLocationOnScreen().y + - mainContainer.getLocationOnScreen().y + VERTICAL_OFFSET) + + evt.getY()); // correction, whole tool tip must be visible if (mainContainer.getSize().width < (getLocation().x + getSize().width)) diff --git a/src/jalview/appletgui/TreeCanvas.java b/src/jalview/appletgui/TreeCanvas.java index d1c6c61..d40ab73 100755 --- a/src/jalview/appletgui/TreeCanvas.java +++ b/src/jalview/appletgui/TreeCanvas.java @@ -184,8 +184,7 @@ public class TreeCanvas extends Panel implements MouseListener, } String name = (markPlaceholders && node.isPlaceholder()) ? (PLACEHOLDER + node - .getName()) - : node.getName(); + .getName()) : node.getName(); FontMetrics fm = g.getFontMetrics(font); int charWidth = fm.stringWidth(name) + 3; int charHeight = fm.getHeight(); @@ -585,12 +584,12 @@ public class TreeCanvas extends Panel implements MouseListener, for (int i = 0; i < tree.getGroups().size(); i++) { - Color col = new Color((int) (Math.random() * 255), (int) (Math - .random() * 255), (int) (Math.random() * 255)); + Color col = new Color((int) (Math.random() * 255), + (int) (Math.random() * 255), (int) (Math.random() * 255)); setColor((SequenceNode) tree.getGroups().elementAt(i), col.brighter()); - Vector l = tree.findLeaves((SequenceNode) tree.getGroups().elementAt( - i), new Vector()); + Vector l = tree.findLeaves( + (SequenceNode) tree.getGroups().elementAt(i), new Vector()); Vector sequences = new Vector(); for (int j = 0; j < l.size(); j++) @@ -609,8 +608,9 @@ public class TreeCanvas extends Panel implements MouseListener, { if (av.getGlobalColourScheme() instanceof UserColourScheme) { - cs = new UserColourScheme(((UserColourScheme) av - .getGlobalColourScheme()).getColours()); + cs = new UserColourScheme( + ((UserColourScheme) av.getGlobalColourScheme()) + .getColours()); } else @@ -620,8 +620,8 @@ public class TreeCanvas extends Panel implements MouseListener, .getGlobalColourScheme())); } - cs.setThreshold(av.getGlobalColourScheme().getThreshold(), av - .getIgnoreGapsConsensus()); + cs.setThreshold(av.getGlobalColourScheme().getThreshold(), + av.getIgnoreGapsConsensus()); } SequenceGroup sg = new SequenceGroup(sequences, "", cs, true, true, @@ -633,8 +633,8 @@ public class TreeCanvas extends Panel implements MouseListener, && av.getGlobalColourScheme().conservationApplied()) { Conservation c = new Conservation("Group", - ResidueProperties.propHash, 3, sg.getSequences(null), sg - .getStartRes(), sg.getEndRes()); + ResidueProperties.propHash, 3, sg.getSequences(null), + sg.getStartRes(), sg.getEndRes()); c.calculate(); c.verdict(false, av.ConsPercGaps); diff --git a/src/jalview/appletgui/TreePanel.java b/src/jalview/appletgui/TreePanel.java index 92dcde4..268fece 100755 --- a/src/jalview/appletgui/TreePanel.java +++ b/src/jalview/appletgui/TreePanel.java @@ -280,8 +280,8 @@ public class TreePanel extends EmbmenuFrame implements ActionListener, public void newickOutput_actionPerformed() { - jalview.io.NewickFile fout = new jalview.io.NewickFile(tree - .getTopNode()); + jalview.io.NewickFile fout = new jalview.io.NewickFile( + tree.getTopNode()); String output = fout.print(false, true); CutAndPasteTransfer cap = new CutAndPasteTransfer(false, null); cap.setText(output); diff --git a/src/jalview/appletgui/UserDefinedColours.java b/src/jalview/appletgui/UserDefinedColours.java index 7819ff3..188099a 100755 --- a/src/jalview/appletgui/UserDefinedColours.java +++ b/src/jalview/appletgui/UserDefinedColours.java @@ -194,9 +194,10 @@ public class UserDefinedColours extends Panel implements ActionListener, int width = 400; dialog.setBounds(alignframe.getBounds().x - + (alignframe.getSize().width - width) / 2, alignframe - .getBounds().y - + (alignframe.getSize().height - height) / 2, width, height); + + (alignframe.getSize().width - width) / 2, + alignframe.getBounds().y + + (alignframe.getSize().height - height) / 2, width, + height); } diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 24ef016..d666b01 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -125,7 +125,8 @@ import org.biojava.dasobert.dasregistry.Das1Source; *
  • SHOW_CONSENSUS_LOGO (false) Show consensus annotation row's sequence * logo.
  • *
  • FOLLOW_SELECTIONS (true) Controls whether a new alignment view should - * respond to selections made in other alignments containing the same sequences.
  • + * respond to selections made in other alignments containing the same sequences. + * * *
  • * @@ -172,7 +173,7 @@ public class Cache public static void initLogger() { - if (log!=null) + if (log != null) { return; } @@ -241,9 +242,7 @@ public class Cache System.out.println("Using proxyServer: " + getDefault("PROXY_SERVER", null) + " proxyPort: " + getDefault("PROXY_PORT", null)); - System - .setProperty("http.proxyHost", getDefault("PROXY_SERVER", - null)); + System.setProperty("http.proxyHost", getDefault("PROXY_SERVER", null)); System.setProperty("http.proxyPort", getDefault("PROXY_PORT", null)); } @@ -253,8 +252,8 @@ public class Cache try { String buildDetails = "jar:".concat(Cache.class.getProtectionDomain() - .getCodeSource().getLocation().toString().concat( - "!/.build_properties")); + .getCodeSource().getLocation().toString() + .concat("!/.build_properties")); java.net.URL localJarFileURL = new java.net.URL(buildDetails); @@ -609,8 +608,7 @@ public class Cache "com.boxysystems.jgoogleanalytics.FocusPoint"); } catch (Exception e) { - log - .debug("com.boxysystems.jgoogleanalytics package is not present - tracking not enabled."); + log.debug("com.boxysystems.jgoogleanalytics package is not present - tracking not enabled."); tracker = null; jgoogleanalyticstracker = null; trackerfocus = null; @@ -654,10 +652,7 @@ public class Cache if (log != null) { if (re != null) - log - .debug( - "Caught runtime exception in googletracker init:", - re); + log.debug("Caught runtime exception in googletracker init:", re); if (ex != null) log.warn( "Failed to initialise GoogleTracker for Jalview Desktop with version " diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index e7fc917..39daac6 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -81,8 +81,9 @@ public class Jalview + System.getProperty("os.version")); if (new Platform().isAMac()) { - System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Jalview"); - System.setProperty("apple.laf.useScreenMenuBar", "true"); + System.setProperty("com.apple.mrj.application.apple.menu.about.name", + "Jalview"); + System.setProperty("apple.laf.useScreenMenuBar", "true"); } ArgsParser aparser = new ArgsParser(args); @@ -553,7 +554,7 @@ public class Jalview } } // and finally, turn off batch mode indicator - if the desktop still exists - if (desktop!=null) + if (desktop != null) { desktop.setInBatchMode(false); } diff --git a/src/jalview/bin/JalviewLite.java b/src/jalview/bin/JalviewLite.java index 157c22b..6a29ecd 100755 --- a/src/jalview/bin/JalviewLite.java +++ b/src/jalview/bin/JalviewLite.java @@ -334,7 +334,7 @@ public class JalviewLite extends Applet public boolean jmolAvailable = false; - private boolean alignPdbStructures=false; + private boolean alignPdbStructures = false; public static boolean debug = false; @@ -901,10 +901,11 @@ public class JalviewLite extends Applet } } /* - * - * Undocumented for 2.6 - related to JAL-434 + * Undocumented for 2.6 + * - related to JAL-434 */ - applet.setAlignPdbStructures(getDefaultParameter("alignpdbfiles",false)); + applet.setAlignPdbStructures(getDefaultParameter("alignpdbfiles", + false)); /* * @@ -913,10 +914,11 @@ public class JalviewLite extends Applet * * */ - + int pdbFileCount = 0; - // Accumulate pdbs here if they are heading for the same view (if alignPdbStructures is true) - Vector pdbs=new Vector(); + // Accumulate pdbs here if they are heading for the same view (if + // alignPdbStructures is true) + Vector pdbs = new Vector(); do { if (pdbFileCount > 0) @@ -1008,25 +1010,29 @@ public class JalviewLite extends Applet } } } - - if (!alignPdbStructures) { + + if (!alignPdbStructures) + { newAlignFrame.newStructureView(applet, pdb, seqs, chains, - protocol); - } else { - pdbs.addElement(new Object[] { pdb, seqs, chains, new String(protocol)}); + protocol); + } + else + { + pdbs.addElement(new Object[] + { pdb, seqs, chains, new String(protocol) }); } } } pdbFileCount++; } while (pdbFileCount < 10); - if (pdbs.size()>0) + if (pdbs.size() > 0) { SequenceI[][] seqs = new SequenceI[pdbs.size()][]; PDBEntry[] pdb = new PDBEntry[pdbs.size()]; String[][] chains = new String[pdbs.size()][]; String[] protocols = new String[pdbs.size()]; - for (int pdbsi=0,pdbsiSize=pdbs.size(); pdbsi0) + if (list != null && list.length > 0) { for (int i = 0, iSize = list.length - 1; i < iSize; i++) { @@ -1365,7 +1372,8 @@ public class JalviewLite extends Applet } /** - * get all components associated with the applet of the given type + * get all components associated with the applet of the given type + * * @param class1 * @return */ @@ -1373,19 +1381,19 @@ public class JalviewLite extends Applet { Vector wnds = new Vector(); Component[] cmp = getComponents(); - if (cmp!=null) - { - for (int i=0;i 0) - { - return alFrame.addStructureViewInstance(viewer, - separatorListToArray(sequenceIds)); - } - else - { - return alFrame.addStructureViewInstance(viewer, null); - } - // return null; - } + * binding fails public SequenceStructureBinding + * addStructureViewInstance( AlignFrame alFrame, Object viewer, String + * sequenceIds) { + * + * if (sequenceIds != null && sequenceIds.length() > 0) { return + * alFrame.addStructureViewInstance(viewer, + * separatorListToArray(sequenceIds)); } else { return + * alFrame.addStructureViewInstance(viewer, null); } // return null; } */ } diff --git a/src/jalview/commands/EditCommand.java b/src/jalview/commands/EditCommand.java index d556442..5310838 100644 --- a/src/jalview/commands/EditCommand.java +++ b/src/jalview/commands/EditCommand.java @@ -143,8 +143,8 @@ public class EditCommand implements CommandI final public void appendEdit(int command, SequenceI[] seqs, int position, int number, AlignmentI al, boolean performEdit, AlignmentI[] views) { - Edit edit = new Edit(command, seqs, position, number, al - .getGapCharacter()); + Edit edit = new Edit(command, seqs, position, number, + al.getGapCharacter()); if (al.getHeight() == seqs.length) { edit.al = al; @@ -286,9 +286,12 @@ public class EditCommand implements CommandI command.oldds = new SequenceI[command.seqs.length]; } command.oldds[i] = oldds; - adjustFeatures(command, i, command.seqs[i] - .findPosition(command.position), command.seqs[i] - .findPosition(command.position + command.number), false); + adjustFeatures( + command, + i, + command.seqs[i].findPosition(command.position), + command.seqs[i].findPosition(command.position + + command.number), false); } } } @@ -781,9 +784,8 @@ public class EditCommand implements CommandI if (command.editedFeatures != null && command.editedFeatures.containsKey(seq)) { - sequence - .setSequenceFeatures((SequenceFeature[]) command.editedFeatures - .get(seq)); + sequence.setSequenceFeatures((SequenceFeature[]) command.editedFeatures + .get(seq)); } return; diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 2352ac5..1a0d82c 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -593,8 +593,8 @@ public class Alignment implements AlignmentI for (int i = 0; i < sequences.size(); i++) { Sequence seq = (Sequence) sequences.elementAt(i); - seq.setSequence(seq.getSequenceAsString().replace('.', gc).replace( - '-', gc).replace(' ', gc)); + seq.setSequence(seq.getSequenceAsString().replace('.', gc) + .replace('-', gc).replace(' ', gc)); } } diff --git a/src/jalview/datamodel/AlignmentI.java b/src/jalview/datamodel/AlignmentI.java index 9339b5c..8b947eb 100755 --- a/src/jalview/datamodel/AlignmentI.java +++ b/src/jalview/datamodel/AlignmentI.java @@ -215,8 +215,9 @@ public interface AlignmentI public boolean deleteAnnotation(AlignmentAnnotation aa); /** - * Get the annotation associated with this alignment - * (this can be null if no annotation has ever been created on the alignment) + * Get the annotation associated with this alignment (this can be null if no + * annotation has ever been created on the alignment) + * * @return array of AlignmentAnnotation objects */ public AlignmentAnnotation[] getAlignmentAnnotation(); diff --git a/src/jalview/datamodel/ColumnSelection.java b/src/jalview/datamodel/ColumnSelection.java index 546ba1a..a36faf7 100644 --- a/src/jalview/datamodel/ColumnSelection.java +++ b/src/jalview/datamodel/ColumnSelection.java @@ -508,8 +508,9 @@ public class ColumnSelection } /** - * Use this method to find out where a column will appear in the visible alignment when - * hidden columns exist. If the column is not visible, then the left-most visible column will always be returned. + * Use this method to find out where a column will appear in the visible + * alignment when hidden columns exist. If the column is not visible, then the + * left-most visible column will always be returned. * * @param hiddenColumn * int @@ -530,9 +531,9 @@ public class ColumnSelection result -= region[1] + 1 - region[0]; } } while ((hiddenColumn > region[1]) && (index < hiddenColumns.size())); - if (hiddenColumn>region[0] && hiddenColumn region[0] && hiddenColumn < region[1]) { - return region[0]+hiddenColumn-result; + return region[0] + hiddenColumn - result; } } return result; // return the shifted position after removing hidden columns. diff --git a/src/jalview/datamodel/SeqCigar.java b/src/jalview/datamodel/SeqCigar.java index f2777f4..b2a1f66 100644 --- a/src/jalview/datamodel/SeqCigar.java +++ b/src/jalview/datamodel/SeqCigar.java @@ -68,8 +68,8 @@ public class SeqCigar extends CigarSimple */ public String getSequenceString(char GapChar) { - return (length == 0) ? "" : (String) getSequenceAndDeletions(refseq - .getSequenceAsString(start, end), GapChar)[0]; + return (length == 0) ? "" : (String) getSequenceAndDeletions( + refseq.getSequenceAsString(start, end), GapChar)[0]; } /** @@ -85,18 +85,17 @@ public class SeqCigar extends CigarSimple { return null; } - Object[] edit_result = getSequenceAndDeletions(refseq - .getSequenceAsString(start, end), GapChar); + Object[] edit_result = getSequenceAndDeletions( + refseq.getSequenceAsString(start, end), GapChar); if (edit_result == null) { throw new Error( "Implementation Error - unexpected null from getSequenceAndDeletions"); } int bounds[] = (int[]) edit_result[1]; - seq = new Sequence(refseq.getName(), (String) edit_result[0], refseq - .getStart() - + start + bounds[0], refseq.getStart() + start - + ((bounds[2] == 0) ? -1 : bounds[2])); + seq = new Sequence(refseq.getName(), (String) edit_result[0], + refseq.getStart() + start + bounds[0], refseq.getStart() + + start + ((bounds[2] == 0) ? -1 : bounds[2])); seq.setDescription(refseq.getDescription()); int sstart = seq.getStart(), send = seq.getEnd(); // seq.checkValidRange(); probably not needed @@ -170,9 +169,8 @@ public class SeqCigar extends CigarSimple } else { - ds = new Sequence(seq.getName(), ungapped, seq.getStart(), seq - .getStart() - + ungapped.length() - 1); + ds = new Sequence(seq.getName(), ungapped, seq.getStart(), + seq.getStart() + ungapped.length() - 1); // JBPNote: this would be consistent but may not be useful // seq.setDatasetSequence(ds); } @@ -501,8 +499,8 @@ public class SeqCigar extends CigarSimple } else { - g_seqs[s].insert(inspos, alseqs_string[i].substring( - region[0], region[1] + 1)); + g_seqs[s].insert(inspos, + alseqs_string[i].substring(region[0], region[1] + 1)); } } shifts.addShift(region[2], insert.length); // update shift in @@ -520,10 +518,9 @@ public class SeqCigar extends CigarSimple { int[] bounds = ((int[]) ((Object[]) gs_regions[i])[1]); SequenceI ref = alseqs[i].getRefSeq(); - seqs[i] = new Sequence(ref.getName(), g_seqs[i].toString(), ref - .getStart() - + alseqs[i].start + bounds[0], ref.getStart() - + alseqs[i].start + (bounds[2] == 0 ? -1 : bounds[2])); + seqs[i] = new Sequence(ref.getName(), g_seqs[i].toString(), + ref.getStart() + alseqs[i].start + bounds[0], ref.getStart() + + alseqs[i].start + (bounds[2] == 0 ? -1 : bounds[2])); seqs[i].setDatasetSequence(ref); seqs[i].setDescription(ref.getDescription()); } diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index 1c70ae9..be40bce 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -226,8 +226,8 @@ public class SequenceGroup if (!found) continue; } - AlignmentAnnotation newannot = new AlignmentAnnotation(seq - .getAnnotation()[a]); + AlignmentAnnotation newannot = new AlignmentAnnotation( + seq.getAnnotation()[a]); newannot.restrict(startRes, endRes); newannot.setSequenceRef(seqs[ipos]); newannot.adjustForAlignment(); @@ -1056,8 +1056,8 @@ public class SequenceGroup } } - SequenceI sq = new Sequence("Group" + getName() + " Consensus", seqs - .toString()); + SequenceI sq = new Sequence("Group" + getName() + " Consensus", + seqs.toString()); sq.setDescription("Percentage Identity Consensus " + ((ignoreGapsInConsensus) ? " without gaps" : "")); return sq; diff --git a/src/jalview/datamodel/xdb/embl/EmblEntry.java b/src/jalview/datamodel/xdb/embl/EmblEntry.java index a1b8509..1439a8b 100644 --- a/src/jalview/datamodel/xdb/embl/EmblEntry.java +++ b/src/jalview/datamodel/xdb/embl/EmblEntry.java @@ -585,10 +585,9 @@ public class EmblEntry { // extract proteins. product = new Sequence(prid, prseq, 1, prseq.length()); - product - .setDescription(((prname.length() == 0) ? "Protein Product from " - + sourceDb - : prname)); + product.setDescription(((prname.length() == 0) ? "Protein Product from " + + sourceDb + : prname)); if (!noPeptide) { // Protein is also added to vector of sequences returned @@ -713,16 +712,16 @@ public class EmblEntry } if (product != null) { - DBRefEntry pref = new DBRefEntry(ref.getSource(), ref - .getVersion(), ref.getAccessionId()); + DBRefEntry pref = new DBRefEntry(ref.getSource(), + ref.getVersion(), ref.getAccessionId()); pref.setMap(null); // reference is direct product.addDBRef(pref); // Add converse mapping reference if (map != null) { Mapping pmap = new Mapping(dna, map.getMap().getInverse()); - pref = new DBRefEntry(sourceDb, getVersion(), this - .getAccession()); + pref = new DBRefEntry(sourceDb, getVersion(), + this.getAccession()); pref.setMap(pmap); if (map.getTo() != null) { diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 42e6185..b20314b 100755 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -4572,7 +4572,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, }); rfetch.add(fetchr); - final AlignFrame me=this; + final AlignFrame me = this; new Thread(new Runnable() { public void run() diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 9208e5e..6f713fc 100755 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -552,8 +552,8 @@ public class AlignViewport implements SelectionSource consensus.annotations = new Annotation[aWidth]; hconsensus = new Hashtable[aWidth]; - AAFrequency.calculate(alignment.getSequencesArray(), 0, alignment - .getWidth(), hconsensus, true); + AAFrequency.calculate(alignment.getSequencesArray(), 0, + alignment.getWidth(), hconsensus, true); updateAnnotation(true); if (globalColourScheme != null) @@ -589,7 +589,8 @@ public class AlignViewport implements SelectionSource protected void updateAnnotation(boolean immediate) { - // TODO: make calls thread-safe, so if another thread calls this method, it will either return or wait until one calculation is finished. + // TODO: make calls thread-safe, so if another thread calls this method, + // it will either return or wait until one calculation is finished. if (immediate || (!updatingConsensus && consensus != null && hconsensus != null)) { @@ -1852,8 +1853,8 @@ public class AlignViewport implements SelectionSource { Alignment al = (Alignment) alignment; Conservation c = new Conservation("All", - ResidueProperties.propHash, 3, al.getSequences(), 0, al - .getWidth() - 1); + ResidueProperties.propHash, 3, al.getSequences(), 0, + al.getWidth() - 1); c.calculate(); c.verdict(false, ConsPercGaps); @@ -1867,8 +1868,8 @@ public class AlignViewport implements SelectionSource SequenceGroup sg = (SequenceGroup) alignment.getGroups().elementAt(s); if (sg.cs != null && sg.cs instanceof ClustalxColourScheme) { - ((ClustalxColourScheme) sg.cs).resetClustalX(sg - .getSequences(hiddenRepSequences), sg.getWidth()); + ((ClustalxColourScheme) sg.cs).resetClustalX( + sg.getSequences(hiddenRepSequences), sg.getWidth()); } sg.recalcConservation(); } diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 9278bc1..efefeaf 100755 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -179,8 +179,8 @@ public class AlignmentPanel extends GAlignmentPanel implements AlignmentI al = av.getAlignment(); int afwidth = (alignFrame != null ? alignFrame.getWidth() : 300); - int maxwidth = Math.max(20, Math.min(afwidth - 200, (int) 2 * afwidth - / 3)); + int maxwidth = Math.max(20, + Math.min(afwidth - 200, (int) 2 * afwidth / 3)); int i = 0; int idWidth = 0; String id; @@ -283,7 +283,8 @@ public class AlignmentPanel extends GAlignmentPanel implements } int start = r[0]; int end = r[1]; - // System.err.println("Seq : "+seqIndex+" Scroll to "+start+","+end); // DEBUG + // System.err.println("Seq : "+seqIndex+" Scroll to "+start+","+end); // + // DEBUG if (start < 0) { return false; @@ -577,9 +578,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 + (seqPanel.seqCanvas.getWidth() / av.getCharWidth())) - 1); } if (evt.getSource() == vscroll) @@ -859,8 +858,8 @@ public class AlignmentPanel extends GAlignmentPanel implements } pg.setColor(currentColor); - pg.fillRect(0, (i - startSeq) * av.charHeight, idWidth, av - .getCharHeight()); + pg.fillRect(0, (i - startSeq) * av.charHeight, idWidth, + av.getCharHeight()); pg.setColor(currentTextColor); @@ -873,7 +872,9 @@ public class AlignmentPanel extends GAlignmentPanel implements - 4; } - pg.drawString(seq.getDisplayId(av.getShowJVSuffix()), xPos, + pg.drawString( + seq.getDisplayId(av.getShowJVSuffix()), + xPos, (((i - startSeq) * av.charHeight) + av.getCharHeight()) - (av.getCharHeight() / 5)); } @@ -1327,7 +1328,8 @@ public class AlignmentPanel extends GAlignmentPanel implements public void updateAnnotation(boolean applyGlobalSettings) { - // TODO: this should be merged with other annotation update stuff - that sits on AlignViewport + // TODO: this should be merged with other annotation update stuff - that + // sits on AlignViewport boolean updateCalcs = false; boolean conv = av.isShowGroupConservation(); boolean cons = av.isShowGroupConsensus(); @@ -1346,46 +1348,46 @@ public class AlignmentPanel extends GAlignmentPanel implements Hashtable oldrfs = new Hashtable(); if (aan != null) { - for (int an = 0; an < aan.length; an++) - { - if (aan[an].autoCalculated && aan[an].groupRef != null) + for (int an = 0; an < aan.length; an++) { - oldrfs.put(aan[an].groupRef, aan[an].groupRef); - av.alignment.deleteAnnotation(aan[an]); - aan[an] = null; + if (aan[an].autoCalculated && aan[an].groupRef != null) + { + oldrfs.put(aan[an].groupRef, aan[an].groupRef); + av.alignment.deleteAnnotation(aan[an]); + aan[an] = null; + } } } - } SequenceGroup sg; if (gr != null) { - for (int g = 0; g < gr.size(); g++) - { - updateCalcs = false; - sg = (SequenceGroup) gr.elementAt(g); - if (applyGlobalSettings || !oldrfs.containsKey(sg)) - { - // set defaults for this group's conservation/consensus - sg.setshowSequenceLogo(showprf); - sg.setShowConsensusHistogram(showConsHist); - } - if (conv) - { - updateCalcs = true; - av.alignment.addAnnotation(sg.getConservationRow(), 0); - } - if (cons) - { - updateCalcs = true; - av.alignment.addAnnotation(sg.getConsensus(), 0); - } - // refresh the annotation rows - if (updateCalcs) + for (int g = 0; g < gr.size(); g++) { - sg.recalcConservation(); + updateCalcs = false; + sg = (SequenceGroup) gr.elementAt(g); + if (applyGlobalSettings || !oldrfs.containsKey(sg)) + { + // set defaults for this group's conservation/consensus + sg.setshowSequenceLogo(showprf); + sg.setShowConsensusHistogram(showConsHist); + } + if (conv) + { + updateCalcs = true; + av.alignment.addAnnotation(sg.getConservationRow(), 0); + } + if (cons) + { + updateCalcs = true; + av.alignment.addAnnotation(sg.getConsensus(), 0); + } + // refresh the annotation rows + if (updateCalcs) + { + sg.recalcConservation(); + } } } - } oldrfs.clear(); adjustAnnotationHeight(); } diff --git a/src/jalview/gui/AnnotationColourChooser.java b/src/jalview/gui/AnnotationColourChooser.java index 43bf850..a05ccf1 100755 --- a/src/jalview/gui/AnnotationColourChooser.java +++ b/src/jalview/gui/AnnotationColourChooser.java @@ -377,13 +377,14 @@ public class AnnotationColourChooser extends JPanel AnnotationColourGradient acg = null; if (currentColours.isSelected()) { - acg = new AnnotationColourGradient(currentAnnotation, av - .getGlobalColourScheme(), aboveThreshold); + acg = new AnnotationColourGradient(currentAnnotation, + av.getGlobalColourScheme(), aboveThreshold); } else { - acg = new AnnotationColourGradient(currentAnnotation, minColour - .getBackground(), maxColour.getBackground(), aboveThreshold); + acg = new AnnotationColourGradient(currentAnnotation, + minColour.getBackground(), maxColour.getBackground(), + aboveThreshold); } if (currentAnnotation.graphMin == 0f @@ -416,8 +417,8 @@ public class AnnotationColourChooser extends JPanel } else { - sg.cs = new AnnotationColourGradient(currentAnnotation, minColour - .getBackground(), maxColour.getBackground(), + sg.cs = new AnnotationColourGradient(currentAnnotation, + minColour.getBackground(), maxColour.getBackground(), aboveThreshold); } diff --git a/src/jalview/gui/AnnotationExporter.java b/src/jalview/gui/AnnotationExporter.java index de6aaa0..e50859d 100755 --- a/src/jalview/gui/AnnotationExporter.java +++ b/src/jalview/gui/AnnotationExporter.java @@ -196,7 +196,7 @@ public class AnnotationExporter extends JPanel private Hashtable getDisplayedFeatureCols() { Hashtable fcols = new Hashtable(); - if (ap.av.featuresDisplayed==null) + if (ap.av.featuresDisplayed == null) { return fcols; } diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index 8605f74..b77fab6 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -104,8 +104,8 @@ public class AnnotationLabels extends JPanel implements MouseListener, { } - BufferedImage bi = new BufferedImage(temp.getHeight(this), temp - .getWidth(this), BufferedImage.TYPE_INT_RGB); + BufferedImage bi = new BufferedImage(temp.getHeight(this), + temp.getWidth(this), BufferedImage.TYPE_INT_RGB); Graphics2D g = (Graphics2D) bi.getGraphics(); g.rotate(Math.toRadians(90)); g.drawImage(temp, 0, -bi.getWidth(this), this); @@ -453,7 +453,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, // todo: make the ap scroll to the selection ap.seqPanel.ap.idPanel.highlightSearchResults(null); ap.av.setSelectionGroup(// new SequenceGroup( - aa[selectedRow].groupRef); // ); + aa[selectedRow].groupRef); // ); ap.av.sendSelection(); ap.paintAlignment(false); PaintRefresher.Refresh(ap, ap.av.getSequenceSetId()); @@ -550,8 +550,8 @@ public class AnnotationLabels extends JPanel implements MouseListener, final JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem( "Ignore Gaps In Consensus", (aa[selectedRow].groupRef != null) ? aa[selectedRow].groupRef - .getIgnoreGapsConsensus() - : ap.av.getIgnoreGapsConsensus()); + .getIgnoreGapsConsensus() : ap.av + .getIgnoreGapsConsensus()); final AlignmentAnnotation aaa = aa[selectedRow]; cbmi.addActionListener(new ActionListener() { @@ -574,8 +574,8 @@ public class AnnotationLabels extends JPanel implements MouseListener, if (aaa.groupRef != null) { final JCheckBoxMenuItem chist = new JCheckBoxMenuItem( - "Show Group Histogram", aa[selectedRow].groupRef - .isShowConsensusHistogram()); + "Show Group Histogram", + aa[selectedRow].groupRef.isShowConsensusHistogram()); chist.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -593,8 +593,8 @@ public class AnnotationLabels extends JPanel implements MouseListener, }); pop.add(chist); final JCheckBoxMenuItem cprofl = new JCheckBoxMenuItem( - "Show Group Logo", aa[selectedRow].groupRef - .isShowSequenceLogo()); + "Show Group Logo", + aa[selectedRow].groupRef.isShowSequenceLogo()); cprofl.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -690,8 +690,8 @@ public class AnnotationLabels extends JPanel implements MouseListener, String output = new FormatAdapter().formatSequences("Fasta", seqs, omitHidden); - Toolkit.getDefaultToolkit().getSystemClipboard().setContents( - new StringSelection(output), Desktop.instance); + Toolkit.getDefaultToolkit().getSystemClipboard() + .setContents(new StringSelection(output), Desktop.instance); Vector hiddenColumns = null; if (av.hasHiddenColumns) @@ -824,8 +824,8 @@ public class AnnotationLabels extends JPanel implements MouseListener, g.setColor(aa[gg].annotations[0].colour); } - g.drawLine(x, y - graphExtras - 3, x - + fm.stringWidth(aa[gg].label), y - graphExtras - 3); + g.drawLine(x, y - graphExtras - 3, + x + fm.stringWidth(aa[gg].label), y - graphExtras - 3); g.setColor(Color.black); graphExtras += fontHeight + 8; @@ -846,9 +846,8 @@ public class AnnotationLabels extends JPanel implements MouseListener, else if (dragEvent != null && aa != null) { g.setColor(Color.lightGray); - g.drawString(aa[selectedRow].label, dragEvent.getX(), dragEvent - .getY() - - scrollOffset); + g.drawString(aa[selectedRow].label, dragEvent.getX(), + dragEvent.getY() - scrollOffset); } if ((aa == null) || (aa.length < 1)) diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 638a1c9..a7cca2c 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -175,7 +175,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, height += aa[i].height; } } - if (height==0) + if (height == 0) { // set minimum height = 20; @@ -200,7 +200,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, public void actionPerformed(ActionEvent evt) { AlignmentAnnotation[] aa = av.alignment.getAlignmentAnnotation(); - if (aa==null) + if (aa == null) { return; } @@ -919,9 +919,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, if (v == column) { - g - .fillRect(x * av.charWidth, y, av.charWidth, - av.charHeight); + g.fillRect(x * av.charWidth, y, av.charWidth, av.charHeight); } } } @@ -1096,9 +1094,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, if (sCol == 0 || row.annotations[sCol - 1] == null || row.annotations[sCol - 1].secondaryStructure != 'H') { - g - .fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, - 90, 180); + g.fillArc(lastSSX, y + 4 + iconOffset, av.charWidth, 8, 90, 180); x1 += av.charWidth / 2; } @@ -1416,8 +1412,8 @@ public class AnnotationPanel extends JPanel implements MouseListener, // group(aa.groupRef.cs==null) // ? av.textColour2 : // cs.findColour(dc)); - g.drawChars(dc, 0, 1, x * av.charWidth, (int) (ht + lm - .getHeight())); + g.drawChars(dc, 0, 1, x * av.charWidth, + (int) (ht + lm.getHeight())); // ht+=g.getFontMetrics().getAscent()-g.getFontMetrics().getDescent(); } } @@ -1447,16 +1443,16 @@ public class AnnotationPanel extends JPanel implements MouseListener, && aa.groupRef.isShowSequenceLogo()) { return AAFrequency.extractProfile( - aa.groupRef.consensusData[column], aa.groupRef - .getIgnoreGapsConsensus()); + aa.groupRef.consensusData[column], + aa.groupRef.getIgnoreGapsConsensus()); } // TODO extend annotation row to enable dynamic and static profile data to // be stored if (aa.groupRef == null && aa.sequenceRef == null && av.isShowSequenceLogo()) { - return AAFrequency.extractProfile(av.hconsensus[column], av - .getIgnoreGapsConsensus()); + return AAFrequency.extractProfile(av.hconsensus[column], + av.getIgnoreGapsConsensus()); } } return null; diff --git a/src/jalview/gui/AppJmol.java b/src/jalview/gui/AppJmol.java index 868f306..041d6a2 100644 --- a/src/jalview/gui/AppJmol.java +++ b/src/jalview/gui/AppJmol.java @@ -49,7 +49,7 @@ public class AppJmol extends GStructureViewer implements Runnable, AppJmolBinding jmb; JPanel scriptWindow; - + JSplitPane splitPane; RenderPanel renderPanel; @@ -255,12 +255,13 @@ public class AppJmol extends GStructureViewer implements Runnable, * @param pdbentry * @param seq * @param chains - * @param alignFrame + * @param alignFrame * @param align * if true, new structure(s) will be align using associated alignment */ private void addStructure(final PDBEntry pdbentry, final SequenceI[] seq, - final String[] chains, final boolean b, final IProgressIndicator alignFrame) + final String[] chains, final boolean b, + final IProgressIndicator alignFrame) { if (pdbentry.getFile() == null) { @@ -298,7 +299,7 @@ public class AppJmol extends GStructureViewer implements Runnable, addingStructures = true; _started = false; alignAddedStructures = b; - progressBar = alignFrame; // visual indication happens on caller frame. + progressBar = alignFrame; // visual indication happens on caller frame. (worker = new Thread(this)).start(); return; } @@ -340,8 +341,10 @@ public class AppJmol extends GStructureViewer implements Runnable, bl.setVgap(0); scriptWindow = new JPanel(bl); scriptWindow.setVisible(false); - }; - jmb.allocateViewer(renderPanel, true, "", null, null, "", scriptWindow, null); + } + ; + jmb.allocateViewer(renderPanel, true, "", null, null, "", scriptWindow, + null); jmb.newJmolPopup(true, "Jmol", true); jmb.evalStateCommand(command); jmb.setFinishedInit(true); @@ -414,7 +417,7 @@ public class AppJmol extends GStructureViewer implements Runnable, void closeViewer() { jmb.closeViewer(); - + // TODO: check for memory leaks where instance isn't finalised because jmb // holds a reference to the window jmb = null; @@ -445,11 +448,10 @@ public class AppJmol extends GStructureViewer implements Runnable, // retrieve the pdb and store it locally AlignmentI pdbseq = null; pdbid = jmb.pdbentry[pi].getId(); - long hdl=pdbid.hashCode()-System.currentTimeMillis(); + long hdl = pdbid.hashCode() - System.currentTimeMillis(); if (progressBar != null) { - progressBar.setProgressBar("Fetching PDB " + pdbid, - hdl); + progressBar.setProgressBar("Fetching PDB " + pdbid, hdl); } try { @@ -557,23 +559,24 @@ public class AppJmol extends GStructureViewer implements Runnable, { Cache.log.error("Couldn't add files to Jmol viewer!", ex); } - long lastnotify=jmb.getLoadNotifiesHandled(); - // need to wait around until script has finished - while (lastnotify>=jmb.getLoadNotifiesHandled()); + long lastnotify = jmb.getLoadNotifiesHandled(); + // need to wait around until script has finished + while (lastnotify >= jmb.getLoadNotifiesHandled()) + ; + { + try { - try - { - Thread.sleep(35); - } catch (Exception e) - { - } - } - // refresh the sequence colours for the new structure(s) - jmb.updateColours(ap); - // do superposition if asked to - if (alignAddedStructures) + Thread.sleep(35); + } catch (Exception e) { - javax.swing.SwingUtilities.invokeLater(new Runnable() + } + } + // refresh the sequence colours for the new structure(s) + jmb.updateColours(ap); + // do superposition if asked to + if (alignAddedStructures) + { + javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { @@ -787,7 +790,8 @@ public class AppJmol extends GStructureViewer implements Runnable, { } } -public void showConsole(boolean showConsole) + + public void showConsole(boolean showConsole) { if (showConsole) @@ -808,9 +812,9 @@ public void showConsole(boolean showConsole) else { if (splitPane != null) - { - splitPane.setVisible(false); - } + { + splitPane.setVisible(false); + } splitPane = null; @@ -819,6 +823,7 @@ public void showConsole(boolean showConsole) validate(); } + class RenderPanel extends JPanel { final Dimension currentSize = new Dimension(); diff --git a/src/jalview/gui/AppJmolBinding.java b/src/jalview/gui/AppJmolBinding.java index 38c9e70..ed56ebb 100644 --- a/src/jalview/gui/AppJmolBinding.java +++ b/src/jalview/gui/AppJmolBinding.java @@ -35,7 +35,7 @@ import org.jmol.api.JmolViewer; import org.jmol.popup.JmolPopup; import org.openscience.jmol.app.jmolpanel.AppConsole; -public class AppJmolBinding extends jalview.ext.jmol.JalviewJmolBinding +public class AppJmolBinding extends jalview.ext.jmol.JalviewJmolBinding { /** @@ -110,11 +110,14 @@ public class AppJmolBinding extends jalview.ext.jmol.JalviewJmolBinding public void refreshGUI() { // appJmolWindow.repaint(); - javax.swing.SwingUtilities.invokeLater(new Runnable() { - public void run() { + javax.swing.SwingUtilities.invokeLater(new Runnable() + { + public void run() + { appJmolWindow.updateTitleAndMenus(); appJmolWindow.revalidate(); - }}); + } + }); } public void updateColours(Object source) @@ -129,9 +132,9 @@ public class AppJmolBinding extends jalview.ext.jmol.JalviewJmolBinding public void notifyScriptTermination(String strStatus, int msWalltime) { // todo - script termination doesn't happen ? - //if (console != null) - //console.notifyScriptTermination(strStatus, - // msWalltime); + // if (console != null) + // console.notifyScriptTermination(strStatus, + // msWalltime); } public void showUrl(String url) @@ -159,7 +162,8 @@ public class AppJmolBinding extends jalview.ext.jmol.JalviewJmolBinding } - public void showConsole(boolean b) { + public void showConsole(boolean b) + { appJmolWindow.showConsole(b); } @@ -193,12 +197,19 @@ public class AppJmolBinding extends jalview.ext.jmol.JalviewJmolBinding protected void releaseUIResources() { appJmolWindow = null; - if (console!=null) { - try { + if (console != null) + { + try + { console.setVisible(false); - } catch (Error e) {} catch (Exception x) {}; - console=null; + } catch (Error e) + { + } catch (Exception x) + { + } + ; + console = null; } - + } } diff --git a/src/jalview/gui/Console.java b/src/jalview/gui/Console.java index 20c672a..823b594 100644 --- a/src/jalview/gui/Console.java +++ b/src/jalview/gui/Console.java @@ -39,11 +39,12 @@ public class Console extends WindowAdapter implements WindowListener, private JFrame frame; private JTextArea textArea; -/* unused - tally and limit for lines in console window - int lines = 0; - int lim = 1000; -*/ + /* + * unused - tally and limit for lines in console window int lines = 0; + * + * int lim = 1000; + */ int byteslim = 102400, bytescut = 76800; // 100k and 75k cut point. private Thread reader, reader2, textAppender; @@ -76,11 +77,13 @@ public class Console extends WindowAdapter implements WindowListener, { initConsole(visible, true); } - + /** * - * @param visible - open the window - * @param redirect - redirect std* + * @param visible + * - open the window + * @param redirect + * - redirect std* */ private void initConsole(boolean visible, boolean redirect) { @@ -102,7 +105,9 @@ public class Console extends WindowAdapter implements WindowListener, if (redirect) { redirectStreams(); - } else { + } + else + { unredirectStreams(); } quit = false; // signals the Threads that they should exit @@ -121,45 +126,50 @@ public class Console extends WindowAdapter implements WindowListener, textAppender.setDaemon(true); textAppender.start(); } - PipedOutputStream pout=null,perr=null; - public void redirectStreams() { - if (pout==null) + + PipedOutputStream pout = null, perr = null; + + public void redirectStreams() + { + if (pout == null) { try { pout = new PipedOutputStream(this.pin); System.setOut(new PrintStream(pout, true)); - } catch (java.io.IOException io) - { - textArea.append("Couldn't redirect STDOUT to this console\n" - + io.getMessage()); - io.printStackTrace(stderr); - } catch (SecurityException se) - { - textArea.append("Couldn't redirect STDOUT to this console\n" - + se.getMessage()); - se.printStackTrace(stderr); - } + } catch (java.io.IOException io) + { + textArea.append("Couldn't redirect STDOUT to this console\n" + + io.getMessage()); + io.printStackTrace(stderr); + } catch (SecurityException se) + { + textArea.append("Couldn't redirect STDOUT to this console\n" + + se.getMessage()); + se.printStackTrace(stderr); + } - try - { - perr = new PipedOutputStream(this.pin2); - System.setErr(new PrintStream(perr, true)); - } catch (java.io.IOException io) - { - textArea.append("Couldn't redirect STDERR to this console\n" - + io.getMessage()); - io.printStackTrace(stderr); - } catch (SecurityException se) - { - textArea.append("Couldn't redirect STDERR to this console\n" - + se.getMessage()); - se.printStackTrace(stderr); - } + try + { + perr = new PipedOutputStream(this.pin2); + System.setErr(new PrintStream(perr, true)); + } catch (java.io.IOException io) + { + textArea.append("Couldn't redirect STDERR to this console\n" + + io.getMessage()); + io.printStackTrace(stderr); + } catch (SecurityException se) + { + textArea.append("Couldn't redirect STDERR to this console\n" + + se.getMessage()); + se.printStackTrace(stderr); + } } } - public void unredirectStreams() { - if (pout!=null) + + public void unredirectStreams() + { + if (pout != null) { try { @@ -167,37 +177,37 @@ public class Console extends WindowAdapter implements WindowListener, pout.flush(); pout.close(); pin = new PipedInputStream(); - pout=null; - } catch (java.io.IOException io) - { - textArea.append("Couldn't unredirect STDOUT to this console\n" - + io.getMessage()); - io.printStackTrace(stderr); - } catch (SecurityException se) - { - textArea.append("Couldn't unredirect STDOUT to this console\n" - + se.getMessage()); - se.printStackTrace(stderr); - } + pout = null; + } catch (java.io.IOException io) + { + textArea.append("Couldn't unredirect STDOUT to this console\n" + + io.getMessage()); + io.printStackTrace(stderr); + } catch (SecurityException se) + { + textArea.append("Couldn't unredirect STDOUT to this console\n" + + se.getMessage()); + se.printStackTrace(stderr); + } - try - { - System.setErr(stderr); - perr.flush(); - perr.close(); - pin2 = new PipedInputStream(); - perr = null; - } catch (java.io.IOException io) - { - textArea.append("Couldn't unredirect STDERR to this console\n" - + io.getMessage()); + try + { + System.setErr(stderr); + perr.flush(); + perr.close(); + pin2 = new PipedInputStream(); + perr = null; + } catch (java.io.IOException io) + { + textArea.append("Couldn't unredirect STDERR to this console\n" + + io.getMessage()); io.printStackTrace(stderr); - } catch (SecurityException se) - { - textArea.append("Couldn't unredirect STDERR to this console\n" - + se.getMessage()); - se.printStackTrace(stderr); - } + } catch (SecurityException se) + { + textArea.append("Couldn't unredirect STDERR to this console\n" + + se.getMessage()); + se.printStackTrace(stderr); + } } } @@ -205,7 +215,7 @@ public class Console extends WindowAdapter implements WindowListener, { // testing part // you may omit this part for your application - // + // System.out.println("Hello World 2"); System.out.println("All fonts available to Graphic2D:\n"); @@ -245,11 +255,13 @@ public class Console extends WindowAdapter implements WindowListener, { this(desktop, true); } + /** * attach a console to the desktop - the desktop will open it if requested. * * @param desktop - * @param showjconsole - if true, then redirect stdout immediately + * @param showjconsole + * - if true, then redirect stdout immediately */ public Console(Desktop desktop, boolean showjconsole) { @@ -274,40 +286,37 @@ public class Console extends WindowAdapter implements WindowListener, org.apache.log4j.Logger.getRootLogger().addAppender(jappender); } - public synchronized void stopConsole() { quit = true; this.notifyAll(); - /*reader.notify(); - reader2.notify(); - if (errorThrower!=null) - errorThrower.notify(); // stop all threads - if (textAppender!=null) - textAppender.notify(); - */ - if (pout!=null) - { - try - { - reader.join(10); - pin.close(); - } catch (Exception e) - { - } - try - { - reader2.join(10); - pin2.close(); - } catch (Exception e) + /* + * reader.notify(); reader2.notify(); if (errorThrower!=null) + * errorThrower.notify(); // stop all threads if (textAppender!=null) + * textAppender.notify(); + */ + if (pout != null) { - } - try - { - textAppender.join(10); - } catch (Exception e) - { - } + try + { + reader.join(10); + pin.close(); + } catch (Exception e) + { + } + try + { + reader2.join(10); + pin2.close(); + } catch (Exception e) + { + } + try + { + textAppender.join(10); + } catch (Exception e) + { + } } if (!frame.isVisible()) { @@ -321,7 +330,9 @@ public class Console extends WindowAdapter implements WindowListener, frame.setVisible(false); closeConsoleGui(); } - private void closeConsoleGui() { + + private void closeConsoleGui() + { updateConsole = false; if (parent == null) { @@ -338,7 +349,7 @@ public class Console extends WindowAdapter implements WindowListener, { frame.setVisible(false); // default behaviour of JFrame closeConsoleGui(); - + // frame.dispose(); } @@ -354,7 +365,7 @@ public class Console extends WindowAdapter implements WindowListener, { while (Thread.currentThread() == reader) { - if (pin==null || pin.available() == 0) + if (pin == null || pin.available() == 0) { try { @@ -374,8 +385,8 @@ public class Console extends WindowAdapter implements WindowListener, stdout.print(input); long time = System.nanoTime(); appendToTextArea(input); - //stderr.println("Time taken to stdout append:\t" - // + (System.nanoTime() - time) + " ns"); + // stderr.println("Time taken to stdout append:\t" + // + (System.nanoTime() - time) + " ns"); // lines++; } if (quit) @@ -403,8 +414,8 @@ public class Console extends WindowAdapter implements WindowListener, stderr.print(input); long time = System.nanoTime(); appendToTextArea(input); - //stderr.println("Time taken to stderr append:\t" - // + (System.nanoTime() - time) + " ns"); + // stderr.println("Time taken to stderr append:\t" + // + (System.nanoTime() - time) + " ns"); // lines++; } if (quit) @@ -541,8 +552,8 @@ public class Console extends WindowAdapter implements WindowListener, { long time = System.nanoTime(); textArea.replaceRange(header, 0, tlength - bytescut); - //stderr.println("Time taken to cut:\t" - // + (System.nanoTime() - time) + " ns"); + // stderr.println("Time taken to cut:\t" + // + (System.nanoTime() - time) + " ns"); } else { @@ -612,19 +623,23 @@ public class Console extends WindowAdapter implements WindowListener, } /** - * set the banner that appears at the top of the console output + * set the banner that appears at the top of the console output + * * @param string */ public void setHeader(String string) { header = string; - if (header.charAt(header.length()-1)!='\n') { - header+="\n"; + if (header.charAt(header.length() - 1) != '\n') + { + header += "\n"; } textArea.insert(header, 0); } + /** * get the banner + * * @return */ public String getHeader() diff --git a/src/jalview/gui/CutAndPasteTransfer.java b/src/jalview/gui/CutAndPasteTransfer.java index 4432d89..f608a52 100755 --- a/src/jalview/gui/CutAndPasteTransfer.java +++ b/src/jalview/gui/CutAndPasteTransfer.java @@ -91,8 +91,8 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer public void save_actionPerformed(ActionEvent e) { - JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache - .getProperty("LAST_DIRECTORY")); + JalviewFileChooser chooser = new JalviewFileChooser( + jalview.bin.Cache.getProperty("LAST_DIRECTORY")); chooser.setAcceptAllFileFilterUsed(false); chooser.setFileView(new JalviewFileView()); diff --git a/src/jalview/gui/DasSourceBrowser.java b/src/jalview/gui/DasSourceBrowser.java index adcb924..8ce0995 100755 --- a/src/jalview/gui/DasSourceBrowser.java +++ b/src/jalview/gui/DasSourceBrowser.java @@ -107,7 +107,9 @@ public class DasSourceBrowser extends GDasSourceBrowser implements init(); } } + FeatureSettings fs = null; + public DasSourceBrowser() { this(null); @@ -189,11 +191,10 @@ public class DasSourceBrowser extends GDasSourceBrowser implements text.append("URL: " + dasSources[i].getUrl() + "
    "); - text - .append("Admin Email: " - + dasSources[i].getAdminemail() + "" + "
    "); + text.append("Admin Email: " + + dasSources[i].getAdminemail() + "" + "
    "); text.append("Registered at: " + dasSources[i].getRegisterDate() + "
    "); @@ -291,7 +292,7 @@ public class DasSourceBrowser extends GDasSourceBrowser implements private void setParentGuiEnabled(boolean b) { - if (fs!=null) + if (fs != null) { fs.fetchDAS.setEnabled(b); fs.saveDAS.setEnabled(b); @@ -587,8 +588,8 @@ public class DasSourceBrowser extends GDasSourceBrowser implements { tmp[index] = dasSources[i]; data[index][0] = dasSources[i].getNickname(); - data[index][1] = new Boolean(selectedSources - .contains(dasSources[i].getNickname())); + data[index][1] = new Boolean( + selectedSources.contains(dasSources[i].getNickname())); index++; } } @@ -688,14 +689,13 @@ public class DasSourceBrowser extends GDasSourceBrowser implements // HAVE COORDINATE SYSTEMS, INFO WHICH AT PRESENT // IS ADDED FROM THE REGISTRY names.add(ds.getNickname()); - selected - .add(new Boolean(selectedSources.contains(ds.getNickname()))); + selected.add(new Boolean(selectedSources.contains(ds.getNickname()))); continue; } if (!selectedInList(dummyFeatureList, ds.getCapabilities()) - || !selectedInList(filter3.getSelectedValues(), ds - .getLabels())) + || !selectedInList(filter3.getSelectedValues(), + ds.getLabels())) { continue; } @@ -805,8 +805,8 @@ public class DasSourceBrowser extends GDasSourceBrowser implements } } - properties.setProperty(jalview.bin.Cache.DAS_ACTIVE_SOURCE, sb - .toString()); + properties.setProperty(jalview.bin.Cache.DAS_ACTIVE_SOURCE, + sb.toString()); if (localSources != null) { @@ -822,8 +822,8 @@ public class DasSourceBrowser extends GDasSourceBrowser implements + ((DasSource) localSources.get(token)).getUrl() + "\t"); } - properties.setProperty(jalview.bin.Cache.DAS_LOCAL_SOURCE, sb - .toString()); + properties.setProperty(jalview.bin.Cache.DAS_LOCAL_SOURCE, + sb.toString()); } } @@ -951,6 +951,7 @@ public class DasSourceBrowser extends GDasSourceBrowser implements /** * disable or enable the buttons on the source browser + * * @param b */ public void setGuiEnabled(boolean b) diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 6910f28..3205dab 100755 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -83,8 +83,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements /** * @param listener - * @see java.beans.PropertyChangeSupport#addPropertyChangeListener( - * java.beans.PropertyChangeListener) + * @see java.beans.PropertyChangeSupport#addPropertyChangeListener(java.beans.PropertyChangeListener) */ public void addJalviewPropertyChangeListener( PropertyChangeListener listener) @@ -414,13 +413,17 @@ public class Desktop extends jalview.jbgui.GDesktop implements iw = (int) (iw * sw); iy = (int) (iy * sh); ih = (int) (ih * sh); - while (ix>=screenSize.width) { - jalview.bin.Cache.log.debug("Window geometry location recall error: shifting horizontal to within screenbounds."); - ix-=screenSize.width; + while (ix >= screenSize.width) + { + jalview.bin.Cache.log + .debug("Window geometry location recall error: shifting horizontal to within screenbounds."); + ix -= screenSize.width; } - while (iy>=screenSize.height) { - jalview.bin.Cache.log.debug("Window geometry location recall error: shifting vertical to within screenbounds."); - iy-=screenSize.height; + while (iy >= screenSize.height) + { + jalview.bin.Cache.log + .debug("Window geometry location recall error: shifting vertical to within screenbounds."); + iy -= screenSize.height; } jalview.bin.Cache.log.debug("Got last known dimensions for " + windowName + ": x:" + ix + " y:" + iy + " width:" + iw @@ -584,34 +587,33 @@ public class Desktop extends jalview.jbgui.GDesktop implements } final JMenuItem menuItem = new JMenuItem(title); - frame - .addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() - { - public void internalFrameActivated( - javax.swing.event.InternalFrameEvent evt) - { - JInternalFrame itf = desktop.getSelectedFrame(); - if (itf != null) - { - itf.requestFocus(); - } + frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() + { + public void internalFrameActivated( + javax.swing.event.InternalFrameEvent evt) + { + JInternalFrame itf = desktop.getSelectedFrame(); + if (itf != null) + { + itf.requestFocus(); + } - } + } - public void internalFrameClosed( - javax.swing.event.InternalFrameEvent evt) - { - PaintRefresher.RemoveComponent(frame); - openFrameCount--; - windowMenu.remove(menuItem); - JInternalFrame itf = desktop.getSelectedFrame(); - if (itf != null) - { - itf.requestFocus(); - } - System.gc(); - }; - }); + public void internalFrameClosed( + javax.swing.event.InternalFrameEvent evt) + { + PaintRefresher.RemoveComponent(frame); + openFrameCount--; + windowMenu.remove(menuItem); + JInternalFrame itf = desktop.getSelectedFrame(); + if (itf != null) + { + itf.requestFocus(); + } + System.gc(); + }; + }); menuItem.addActionListener(new ActionListener() { @@ -763,8 +765,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements */ public void inputLocalFileMenuItem_actionPerformed(AlignViewport viewport) { - JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache - .getProperty("LAST_DIRECTORY"), + JalviewFileChooser chooser = new JalviewFileChooser( + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), jalview.io.AppletFormatAdapter.READABLE_EXTENSIONS, jalview.io.AppletFormatAdapter.READABLE_FNAMES, jalview.bin.Cache.getProperty("DEFAULT_FILE_FORMAT")); @@ -944,22 +946,20 @@ public class Desktop extends jalview.jbgui.GDesktop implements if (!jalview.bin.Cache.getProperty("LATEST_VERSION").equals( jalview.bin.Cache.getProperty("VERSION"))) { - message - .append("\n\n!! Jalview version " - + jalview.bin.Cache.getProperty("LATEST_VERSION") - + " is available for download from http://www.jalview.org !!\n"); + message.append("\n\n!! Jalview version " + + jalview.bin.Cache.getProperty("LATEST_VERSION") + + " is available for download from http://www.jalview.org !!\n"); } // TODO: update this text for each release or centrally store it for lite // and application - message - .append("\nAuthors: Andrew Waterhouse, Jim Procter, Michele Clamp, James Cuff, Steve Searle,\n David Martin & Geoff Barton." - + "\nDevelopment managed by The Barton Group, University of Dundee, Scotland, UK.\n" - + "\nFor help, see the FAQ at www.jalview.org and/or join the jalview-discuss@jalview.org mailing list\n" - + "\nIf you use Jalview, please cite:" - + "\nWaterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)" - + "\nJalview Version 2 - a multiple sequence alignment editor and analysis workbench" - + "\nBioinformatics doi: 10.1093/bioinformatics/btp033"); + message.append("\nAuthors: Andrew Waterhouse, Jim Procter, Michele Clamp, James Cuff, Steve Searle,\n David Martin & Geoff Barton." + + "\nDevelopment managed by The Barton Group, University of Dundee, Scotland, UK.\n" + + "\nFor help, see the FAQ at www.jalview.org and/or join the jalview-discuss@jalview.org mailing list\n" + + "\nIf you use Jalview, please cite:" + + "\nWaterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)" + + "\nJalview Version 2 - a multiple sequence alignment editor and analysis workbench" + + "\nBioinformatics doi: 10.1093/bioinformatics/btp033"); JOptionPane.showInternalMessageDialog(Desktop.desktop, message.toString(), "About Jalview", JOptionPane.INFORMATION_MESSAGE); @@ -1172,10 +1172,10 @@ public class Desktop extends jalview.jbgui.GDesktop implements */ public void saveState_actionPerformed(ActionEvent e) { - JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache - .getProperty("LAST_DIRECTORY"), new String[] - { "jar" }, new String[] - { "Jalview Project" }, "Jalview Project"); + JalviewFileChooser chooser = new JalviewFileChooser( + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] + { "jar" }, new String[] + { "Jalview Project" }, "Jalview Project"); chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle("Save State"); @@ -1185,23 +1185,28 @@ public class Desktop extends jalview.jbgui.GDesktop implements if (value == JalviewFileChooser.APPROVE_OPTION) { java.io.File choice = chooser.getSelectedFile(); - setProgressBar("Saving jalview project " - + choice.getName(), choice.hashCode()); + setProgressBar("Saving jalview project " + choice.getName(), + choice.hashCode()); jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice.getParent()); // TODO catch and handle errors for savestate - try { + try + { new Jalview2XML().SaveState(choice); } catch (OutOfMemoryError oom) { - new OOMWarning("Whilst saving current state to "+choice.getName(), oom); - } - catch (Exception ex) + new OOMWarning( + "Whilst saving current state to " + choice.getName(), oom); + } catch (Exception ex) { - Cache.log.error("Problems whilst trying to save to "+choice.getName(),ex); - JOptionPane.showMessageDialog(this, "Error whilst saving current state to "+choice.getName(), "Couldn't save project", JOptionPane.WARNING_MESSAGE); + Cache.log + .error("Problems whilst trying to save to " + + choice.getName(), ex); + JOptionPane.showMessageDialog(this, + "Error whilst saving current state to " + choice.getName(), + "Couldn't save project", JOptionPane.WARNING_MESSAGE); } setProgressBar(null, choice.hashCode()); - + } } @@ -1213,10 +1218,10 @@ public class Desktop extends jalview.jbgui.GDesktop implements */ public void loadState_actionPerformed(ActionEvent e) { - JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache - .getProperty("LAST_DIRECTORY"), new String[] - { "jar" }, new String[] - { "Jalview Project" }, "Jalview Project"); + JalviewFileChooser chooser = new JalviewFileChooser( + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] + { "jar" }, new String[] + { "Jalview Project" }, "Jalview Project"); chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle("Restore state"); @@ -1227,22 +1232,27 @@ public class Desktop extends jalview.jbgui.GDesktop implements final String choice = chooser.getSelectedFile().getAbsolutePath(); jalview.bin.Cache.setProperty("LAST_DIRECTORY", chooser .getSelectedFile().getParent()); - new Thread(new Runnable() { - public void run() { - setProgressBar("loading jalview project " - + choice, choice.hashCode()); - try { - new Jalview2XML().LoadJalviewAlign(choice); } - catch (OutOfMemoryError oom) + new Thread(new Runnable() { - new OOMWarning("Whilst loading project from "+choice, oom); - } - catch (Exception ex) - { - Cache.log.error("Problems whilst loading project from "+choice,ex); - JOptionPane.showMessageDialog(Desktop.desktop, "Error whilst loading project from "+choice, "Couldn't load project", JOptionPane.WARNING_MESSAGE); - } - setProgressBar(null, choice.hashCode()); + public void run() + { + setProgressBar("loading jalview project " + choice, + choice.hashCode()); + try + { + new Jalview2XML().LoadJalviewAlign(choice); + } catch (OutOfMemoryError oom) + { + new OOMWarning("Whilst loading project from " + choice, oom); + } catch (Exception ex) + { + Cache.log.error("Problems whilst loading project from " + + choice, ex); + JOptionPane.showMessageDialog(Desktop.desktop, + "Error whilst loading project from " + choice, + "Couldn't load project", JOptionPane.WARNING_MESSAGE); + } + setProgressBar(null, choice.hashCode()); } }).start(); } @@ -1487,13 +1497,12 @@ public class Desktop extends jalview.jbgui.GDesktop implements if (v_client == null) { // Load and try to start a session. - JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache - .getProperty("LAST_DIRECTORY")); + JalviewFileChooser chooser = new JalviewFileChooser( + jalview.bin.Cache.getProperty("LAST_DIRECTORY")); chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle("Open a saved VAMSAS session"); - chooser - .setToolTipText("select a vamsas session to be opened as a new vamsas session."); + chooser.setToolTipText("select a vamsas session to be opened as a new vamsas session."); int value = chooser.showOpenDialog(this); @@ -1548,8 +1557,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements } bis.close(); fos.close(); - v_client = new jalview.gui.VamsasApplication(this, file, url - .toExternalForm()); + v_client = new jalview.gui.VamsasApplication(this, file, + url.toExternalForm()); } catch (Exception ex) { jalview.bin.Cache.log.error( @@ -1578,8 +1587,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements return false; } - setProgressBar("Importing VAMSAS session from " + file.getName(), file - .hashCode()); + setProgressBar("Importing VAMSAS session from " + file.getName(), + file.hashCode()); try { v_client = new jalview.gui.VamsasApplication(this, file, null); @@ -1593,8 +1602,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements } setupVamsasConnectedGui(); v_client.initial_update(); // TODO: thread ? - setProgressBar("Importing VAMSAS session from " + file.getName(), file - .hashCode()); + setProgressBar("Importing VAMSAS session from " + file.getName(), + file.hashCode()); return v_client.inSession(); } @@ -1744,9 +1753,9 @@ public class Desktop extends jalview.jbgui.GDesktop implements { if (v_client != null) { - JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache - .getProperty("LAST_DIRECTORY"), new String[] - { "vdj" }, // TODO: VAMSAS DOCUMENT EXTENSION is VDJ + JalviewFileChooser chooser = new JalviewFileChooser( + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] + { "vdj" }, // TODO: VAMSAS DOCUMENT EXTENSION is VDJ new String[] { "Vamsas Document" }, "Vamsas Document"); @@ -1917,10 +1926,11 @@ public class Desktop extends jalview.jbgui.GDesktop implements FontMetrics fm = g.getFontMetrics(); if (fm != null) { - g.drawString("Total Free Memory: " + df.format(totalFreeMemory) - + "MB; Max Memory: " + df.format(maxMemory) + "MB; " - + df.format(percentUsage) + "%", 10, getHeight() - - fm.getHeight()); + g.drawString( + "Total Free Memory: " + df.format(totalFreeMemory) + + "MB; Max Memory: " + df.format(maxMemory) + + "MB; " + df.format(percentUsage) + "%", 10, + getHeight() - fm.getHeight()); } } } @@ -2084,8 +2094,10 @@ public class Desktop extends jalview.jbgui.GDesktop implements public void actionPerformed(ActionEvent e) { handler.cancelActivity(id); - us.setProgressBar("Cancelled " - + ((JLabel) progressPanel.getComponent(0)).getText(), id); + us.setProgressBar( + "Cancelled " + + ((JLabel) progressPanel.getComponent(0)) + .getText(), id); } }); progressPanel.add(cancel, BorderLayout.EAST); @@ -2120,13 +2132,15 @@ public class Desktop extends jalview.jbgui.GDesktop implements return v_client; } + /** * flag set if jalview GUI is being operated programmatically */ - private boolean inBatchMode=false; + private boolean inBatchMode = false; /** * check if jalview GUI is being operated programmatically + * * @return inBatchMode */ public boolean isInBatchMode() @@ -2136,14 +2150,14 @@ public class Desktop extends jalview.jbgui.GDesktop implements /** * set flag if jalview GUI is being operated programmatically - * @param inBatchMode + * + * @param inBatchMode */ public void setInBatchMode(boolean inBatchMode) { this.inBatchMode = inBatchMode; } - public void startServiceDiscovery() { startServiceDiscovery(false); @@ -2179,8 +2193,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements } catch (Exception e) { Cache.log - .info( - "Exception when trying to launch Envision2 workflow discovery.", + .info("Exception when trying to launch Envision2 workflow discovery.", e); Cache.log.info(e.getStackTrace()); } @@ -2209,34 +2222,42 @@ public class Desktop extends jalview.jbgui.GDesktop implements } /** - * start a thread to open a URL in the configured browser. Pops up a warning dialog to the user if there is an exception when calling out to the browser to open the URL. + * start a thread to open a URL in the configured browser. Pops up a warning + * dialog to the user if there is an exception when calling out to the browser + * to open the URL. + * * @param url */ public static void showUrl(final String url) { - new Thread(new Runnable() { - public void run() { - try { + new Thread(new Runnable() + { + public void run() + { + try + { jalview.util.BrowserLauncher.openURL(url); } catch (Exception ex) - { + { JOptionPane .showInternalMessageDialog( Desktop.desktop, "Unixers: Couldn't find default web browser." + "\nAdd the full path to your browser in Preferences.", - "Web browser not found", JOptionPane.WARNING_MESSAGE); + "Web browser not found", + JOptionPane.WARNING_MESSAGE); ex.printStackTrace(); } } - }).start(); + }).start(); } public static WsParamSetManager wsparamManager = null; + public static ParamManager getUserParameterStore() { - if (wsparamManager==null) + if (wsparamManager == null) { wsparamManager = new WsParamSetManager(); } diff --git a/src/jalview/gui/EditNameDialog.java b/src/jalview/gui/EditNameDialog.java index 3d1a519..4d3e167 100644 --- a/src/jalview/gui/EditNameDialog.java +++ b/src/jalview/gui/EditNameDialog.java @@ -68,8 +68,8 @@ public class EditNameDialog panel2.add(description, BorderLayout.CENTER); panel.add(panel2, BorderLayout.SOUTH); } - int reply = JOptionPane.showInternalConfirmDialog(parent, - panel, title, JOptionPane.OK_CANCEL_OPTION); + int reply = JOptionPane.showInternalConfirmDialog(parent, panel, title, + JOptionPane.OK_CANCEL_OPTION); if (!parent.requestFocusInWindow()) { System.err.println("Bad focus for dialog!"); diff --git a/src/jalview/gui/FeatureRenderer.java b/src/jalview/gui/FeatureRenderer.java index 46767f0..38d6f0c 100755 --- a/src/jalview/gui/FeatureRenderer.java +++ b/src/jalview/gui/FeatureRenderer.java @@ -396,16 +396,16 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer else if (sequenceFeatures[sfindex].type.equals("disulfide bond")) { - renderFeature(g, seq, seq - .findIndex(sequenceFeatures[sfindex].begin) - 1, seq - .findIndex(sequenceFeatures[sfindex].begin) - 1, + renderFeature(g, seq, + seq.findIndex(sequenceFeatures[sfindex].begin) - 1, + seq.findIndex(sequenceFeatures[sfindex].begin) - 1, getColour(sequenceFeatures[sfindex]) // new Color(((Integer) av.featuresDisplayed // .get(sequenceFeatures[sfindex].type)).intValue()) , start, end, y1); - renderFeature(g, seq, seq - .findIndex(sequenceFeatures[sfindex].end) - 1, seq - .findIndex(sequenceFeatures[sfindex].end) - 1, + renderFeature(g, seq, + seq.findIndex(sequenceFeatures[sfindex].end) - 1, + seq.findIndex(sequenceFeatures[sfindex].end) - 1, getColour(sequenceFeatures[sfindex]) // new Color(((Integer) av.featuresDisplayed // .get(sequenceFeatures[sfindex].type)).intValue()) @@ -417,17 +417,17 @@ public class FeatureRenderer implements jalview.api.FeatureRenderer if (av.showSeqFeaturesHeight && sequenceFeatures[sfindex].score != Float.NaN) { - renderScoreFeature(g, seq, seq - .findIndex(sequenceFeatures[sfindex].begin) - 1, seq - .findIndex(sequenceFeatures[sfindex].end) - 1, + renderScoreFeature(g, seq, + seq.findIndex(sequenceFeatures[sfindex].begin) - 1, + seq.findIndex(sequenceFeatures[sfindex].end) - 1, getColour(sequenceFeatures[sfindex]), start, end, y1, normaliseScore(sequenceFeatures[sfindex])); } else { - renderFeature(g, seq, seq - .findIndex(sequenceFeatures[sfindex].begin) - 1, seq - .findIndex(sequenceFeatures[sfindex].end) - 1, + renderFeature(g, seq, + seq.findIndex(sequenceFeatures[sfindex].begin) - 1, + seq.findIndex(sequenceFeatures[sfindex].end) - 1, getColour(sequenceFeatures[sfindex]), start, end, y1); } } diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 2139da5..1997dc9 100755 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -165,21 +165,22 @@ public class FeatureSettings extends JPanel frame.setContentPane(this); if (new jalview.util.Platform().isAMac()) { - Desktop.addInternalFrame(frame, "Sequence Feature Settings", 475, 480); - } else { - Desktop.addInternalFrame(frame, "Sequence Feature Settings", 400, 450); + Desktop.addInternalFrame(frame, "Sequence Feature Settings", 475, 480); } - - frame - .addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() - { - public void internalFrameClosed( - javax.swing.event.InternalFrameEvent evt) - { - fr.removePropertyChangeListener(change); - dassourceBrowser.fs = null; - }; - }); + else + { + Desktop.addInternalFrame(frame, "Sequence Feature Settings", 400, 450); + } + + frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() + { + public void internalFrameClosed( + javax.swing.event.InternalFrameEvent evt) + { + fr.removePropertyChangeListener(change); + dassourceBrowser.fs = null; + }; + }); frame.setLayer(JLayeredPane.PALETTE_LAYER); } @@ -279,8 +280,9 @@ public class FeatureSettings extends JPanel // probably the color chooser! table.setValueAt(colorChooser.getColor(), selectedRow, 1); table.validate(); - me.updateFeatureRenderer(((FeatureTableModel) table - .getModel()).getData(), false); + me.updateFeatureRenderer( + ((FeatureTableModel) table.getModel()).getData(), + false); } } } @@ -404,8 +406,8 @@ public class FeatureSettings extends JPanel { public void itemStateChanged(ItemEvent evt) { - fr.featureGroups.put(check.getText(), new Boolean(check - .isSelected())); + fr.featureGroups.put(check.getText(), + new Boolean(check.isSelected())); af.alignPanel.seqPanel.seqCanvas.repaint(); if (af.alignPanel.overviewPanel != null) { @@ -519,8 +521,8 @@ public class FeatureSettings extends JPanel data[dataIndex][0] = type; data[dataIndex][1] = fr.getFeatureStyle(type); - data[dataIndex][2] = new Boolean(af.getViewport().featuresDisplayed - .containsKey(type)); + data[dataIndex][2] = new Boolean( + af.getViewport().featuresDisplayed.containsKey(type)); dataIndex++; visibleChecks.removeElement(type); } @@ -594,10 +596,10 @@ public class FeatureSettings extends JPanel void load() { - JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache - .getProperty("LAST_DIRECTORY"), new String[] - { "fc" }, new String[] - { "Sequence Feature Colours" }, "Sequence Feature Colours"); + JalviewFileChooser chooser = new JalviewFileChooser( + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] + { "fc" }, new String[] + { "Sequence Feature Colours" }, "Sequence Feature Colours"); chooser.setFileView(new jalview.io.JalviewFileView()); chooser.setDialogTitle("Load Feature Colours"); chooser.setToolTipText("Load"); @@ -634,8 +636,8 @@ public class FeatureSettings extends JPanel Cache.log.warn("Couldn't parse out graduated feature color.", e); } - GraduatedColor gcol = new GraduatedColor(mincol, maxcol, newcol - .getMin(), newcol.getMax()); + GraduatedColor gcol = new GraduatedColor(mincol, maxcol, + newcol.getMin(), newcol.getMax()); if (newcol.hasAutoScale()) { gcol.setAutoScaled(newcol.getAutoScale()); @@ -658,13 +660,11 @@ public class FeatureSettings extends JPanel } if (ttyp.equalsIgnoreCase("ABOVE")) { - gcol - .setThreshType(AnnotationColourGradient.ABOVE_THRESHOLD); + gcol.setThreshType(AnnotationColourGradient.ABOVE_THRESHOLD); } if (ttyp.equalsIgnoreCase("BELOW")) { - gcol - .setThreshType(AnnotationColourGradient.BELOW_THRESHOLD); + gcol.setThreshType(AnnotationColourGradient.BELOW_THRESHOLD); } } fr.setColour(name = newcol.getName(), gcol); @@ -694,10 +694,10 @@ public class FeatureSettings extends JPanel void save() { - JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache - .getProperty("LAST_DIRECTORY"), new String[] - { "fc" }, new String[] - { "Sequence Feature Colours" }, "Sequence Feature Colours"); + JalviewFileChooser chooser = new JalviewFileChooser( + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] + { "fc" }, new String[] + { "Sequence Feature Colours" }, "Sequence Feature Colours"); chooser.setFileView(new jalview.io.JalviewFileView()); chooser.setDialogTitle("Save Feature Colour Scheme"); chooser.setToolTipText("Save"); @@ -1294,7 +1294,7 @@ public class FeatureSettings extends JPanel fetchDAS.setEnabled(true); cancelDAS.setEnabled(false); dassourceBrowser.setGuiEnabled(true); - + } public void cancelDAS_actionPerformed(ActionEvent e) diff --git a/src/jalview/gui/FontChooser.java b/src/jalview/gui/FontChooser.java index 0323b58..12493eb 100755 --- a/src/jalview/gui/FontChooser.java +++ b/src/jalview/gui/FontChooser.java @@ -264,7 +264,7 @@ public class FontChooser extends GFontChooser Cache.setProperty("FONT_NAME", fontName.getSelectedItem().toString()); Cache.setProperty("FONT_STYLE", fontStyle.getSelectedIndex() + ""); Cache.setProperty("FONT_SIZE", fontSize.getSelectedItem().toString()); - Cache.setProperty("ANTI_ALIAS", Boolean.toString(smoothFont - .isSelected())); + Cache.setProperty("ANTI_ALIAS", + Boolean.toString(smoothFont.isSelected())); } } diff --git a/src/jalview/gui/IdCanvas.java b/src/jalview/gui/IdCanvas.java index 7d8ff70..b713913 100755 --- a/src/jalview/gui/IdCanvas.java +++ b/src/jalview/gui/IdCanvas.java @@ -357,8 +357,8 @@ public class IdCanvas extends JPanel currentTextColor = Color.white; } else if ((av.getSelectionGroup() != null) - && av.getSelectionGroup().getSequences(null).contains( - sequence)) + && av.getSelectionGroup().getSequences(null) + .contains(sequence)) { currentColor = Color.lightGray; currentTextColor = Color.black; diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index b28ed0e..a93e84c 100755 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -2696,16 +2696,18 @@ public class Jalview2XML { public void run() { - AppJmol sview=null; - try { - sview=new AppJmol(pdbf, id, sq, alf.alignPanel, fileloc, - - rect, vid); - } - catch (OutOfMemoryError ex) + AppJmol sview = null; + try + { + sview = new AppJmol(pdbf, id, sq, alf.alignPanel, + fileloc, + + rect, vid); + } catch (OutOfMemoryError ex) { - new OOMWarning("restoring structure view for PDB id "+id,(OutOfMemoryError) ex.getCause()); - if (sview!=null && sview.isVisible()) + new OOMWarning("restoring structure view for PDB id " + + id, (OutOfMemoryError) ex.getCause()); + if (sview != null && sview.isVisible()) { sview.closeViewer(); sview.setVisible(false); @@ -2716,8 +2718,8 @@ public class Jalview2XML }); } catch (InvocationTargetException ex) { - warn("Unexpected error when opening Jmol view.",ex); - + warn("Unexpected error when opening Jmol view.", ex); + } catch (InterruptedException e) { // e.printStackTrace(); diff --git a/src/jalview/gui/Jalview2XML_V1.java b/src/jalview/gui/Jalview2XML_V1.java index 3cde3bb..5d1a89b 100755 --- a/src/jalview/gui/Jalview2XML_V1.java +++ b/src/jalview/gui/Jalview2XML_V1.java @@ -238,8 +238,8 @@ public class Jalview2XML_V1 { anot[ae[aa].getPosition()] = new jalview.datamodel.Annotation( ae[aa].getDisplayCharacter(), ae[aa].getDescription(), - ae[aa].getSecondaryStructure().charAt(0), ae[aa] - .getValue()); + ae[aa].getSecondaryStructure().charAt(0), + ae[aa].getValue()); } jalview.datamodel.AlignmentAnnotation jaa = null; @@ -318,15 +318,13 @@ public class Jalview2XML_V1 groups[i].getDisplayText(), groups[i].getColourText(), groups[i].getStart(), groups[i].getEnd()); - sg - .setOutlineColour(new java.awt.Color(groups[i] - .getOutlineColour())); + sg.setOutlineColour(new java.awt.Color(groups[i].getOutlineColour())); if (groups[i].getConsThreshold() != 0) { jalview.analysis.Conservation c = new jalview.analysis.Conservation( - "All", ResidueProperties.propHash, 3, sg - .getSequences(null), 0, sg.getWidth() - 1); + "All", ResidueProperties.propHash, 3, + sg.getSequences(null), 0, sg.getWidth() - 1); c.calculate(); c.verdict(false, 25); sg.cs.setConservation(c); @@ -336,8 +334,8 @@ public class Jalview2XML_V1 } } - af.setBounds(view.getXpos(), view.getYpos(), view.getWidth(), view - .getHeight()); + af.setBounds(view.getXpos(), view.getYpos(), view.getWidth(), + view.getHeight()); af.viewport.setStartRes(view.getStartRes()); af.viewport.setStartSeq(view.getStartSeq()); af.viewport.setShowAnnotation(view.getShowAnnotation()); @@ -413,8 +411,8 @@ public class Jalview2XML_V1 af.setMenusFromViewport(af.viewport); - Desktop.addInternalFrame(af, view.getTitle(), view.getWidth(), view - .getHeight()); + Desktop.addInternalFrame(af, view.getTitle(), view.getWidth(), + view.getHeight()); // LOAD TREES // ///////////////////////////////////// @@ -427,9 +425,10 @@ public class Jalview2XML_V1 Tree tree = jms.getTree(t); - TreePanel tp = af.ShowNewickTree(new jalview.io.NewickFile(tree - .getNewick()), tree.getTitle(), tree.getWidth(), tree - .getHeight(), tree.getXpos(), tree.getYpos()); + TreePanel tp = af.ShowNewickTree( + new jalview.io.NewickFile(tree.getNewick()), + tree.getTitle(), tree.getWidth(), tree.getHeight(), + tree.getXpos(), tree.getYpos()); tp.fitToWindow.setState(tree.getFitToWindow()); tp.fitToWindow_actionPerformed(null); diff --git a/src/jalview/gui/JvSwingUtils.java b/src/jalview/gui/JvSwingUtils.java index a98dc4c..f41e85a 100644 --- a/src/jalview/gui/JvSwingUtils.java +++ b/src/jalview/gui/JvSwingUtils.java @@ -26,25 +26,34 @@ import javax.swing.SwingConstants; /** * useful functions for building Swing GUIs + * * @author JimP - * + * */ public final class JvSwingUtils { /** - * wrap a bare html safe string to around 60 characters per line using a field + * wrap a bare html safe string to around 60 characters per line using a + *
    + * + * field + * * @param ttext * @return */ public static String wrapTooltip(String ttext) { - if (ttext.length()<60) + if (ttext.length() < 60) { return ttext; - } else { - return "
    "+ttext+"
    "; + } + else + { + return "
    " + ttext + + "
    "; } } + public static JButton makeButton(String label, String tooltip, ActionListener action) { diff --git a/src/jalview/gui/OOMWarning.java b/src/jalview/gui/OOMWarning.java index 324b307..8bcb29c 100644 --- a/src/jalview/gui/OOMWarning.java +++ b/src/jalview/gui/OOMWarning.java @@ -82,7 +82,7 @@ public class OOMWarning implements Runnable "Out of memory", javax.swing.JOptionPane.WARNING_MESSAGE); // hope that there's enough memory left that no more appear. - oomInprogress=false; + oomInprogress = false; } } diff --git a/src/jalview/gui/OverviewPanel.java b/src/jalview/gui/OverviewPanel.java index 4d281632..2426d4d 100755 --- a/src/jalview/gui/OverviewPanel.java +++ b/src/jalview/gui/OverviewPanel.java @@ -388,8 +388,7 @@ public class OverviewPanel extends JPanel implements Runnable { int fullsizeWidth = av.alignment.getWidth() * av.getCharWidth(); int fullsizeHeight = (av.alignment.getHeight() + av.alignment - .getHiddenSequences().getSize()) - * av.getCharHeight(); + .getHiddenSequences().getSize()) * av.getCharHeight(); int startRes = av.getStartRes(); int endRes = av.getEndRes(); diff --git a/src/jalview/gui/PCAPanel.java b/src/jalview/gui/PCAPanel.java index 084311f..2171e08 100755 --- a/src/jalview/gui/PCAPanel.java +++ b/src/jalview/gui/PCAPanel.java @@ -100,9 +100,7 @@ public class PCAPanel extends GPCAPanel implements Runnable return; } - Desktop - .addInternalFrame(this, "Principal component analysis", 400, - 400); + Desktop.addInternalFrame(this, "Principal component analysis", 400, 400); PaintRefresher.Register(this, av.getSequenceSetId()); @@ -244,12 +242,13 @@ public class PCAPanel extends GPCAPanel implements Runnable public void outputValues_actionPerformed(ActionEvent e) { CutAndPasteTransfer cap = new CutAndPasteTransfer(); - try { + try + { cap.setText(pca.getDetails()); Desktop.addInternalFrame(cap, "PCA details", 500, 500); } catch (OutOfMemoryError oom) { - new OOMWarning("opening PCA details",oom); + new OOMWarning("opening PCA details", oom); cap.dispose(); } } @@ -414,8 +413,8 @@ public class PCAPanel extends GPCAPanel implements Runnable else { im = new jalview.util.ImageMaker(this, jalview.util.ImageMaker.EPS, - "Make EPS file from PCA", width, height, null, this - .getTitle()); + "Make EPS file from PCA", width, height, null, + this.getTitle()); } if (im.getGraphics() != null) @@ -492,18 +491,24 @@ public class PCAPanel extends GPCAPanel implements Runnable associateViewsMenu.add(itemf); } - /* (non-Javadoc) - * @see jalview.jbgui.GPCAPanel#outputPoints_actionPerformed(java.awt.event.ActionEvent) + + /* + * (non-Javadoc) + * + * @see + * jalview.jbgui.GPCAPanel#outputPoints_actionPerformed(java.awt.event.ActionEvent + * ) */ protected void outputPoints_actionPerformed(ActionEvent e) { CutAndPasteTransfer cap = new CutAndPasteTransfer(); - try { + try + { cap.setText(getPointsasCsv(false)); - Desktop.addInternalFrame(cap, "Points for "+getTitle(), 500, 500); + Desktop.addInternalFrame(cap, "Points for " + getTitle(), 500, 500); } catch (OutOfMemoryError oom) { - new OOMWarning("exporting PCA points",oom); + new OOMWarning("exporting PCA points", oom); cap.dispose(); } } @@ -512,36 +517,42 @@ public class PCAPanel extends GPCAPanel implements Runnable { StringBuffer csv = new StringBuffer(); csv.append("\"Sequence\""); - if (transformed) { + if (transformed) + { csv.append(","); csv.append(xCombobox.getSelectedIndex()); csv.append(","); csv.append(yCombobox.getSelectedIndex()); csv.append(","); csv.append(zCombobox.getSelectedIndex()); - } else { - for (int d=1,dmax=pca.component(1).length;d<=dmax;d++) + } + else + { + for (int d = 1, dmax = pca.component(1).length; d <= dmax; d++) { - csv.append(","+d); + csv.append("," + d); } } csv.append("\n"); - for (int s=0;s=0;d--) + for (int d = fl.length - 1; d >= 0; d--) { csv.append(","); csv.append(fl[d]); } - } else { - // output current x,y,z coords for points + } + else + { + // output current x,y,z coords for points fl = rc.getPointPosition(s); - for (int d=0; d= av.alignment.getWidth()) { res = av.alignment.getWidth() - 1; - } else { + } + else + { res = x; } @@ -353,8 +355,7 @@ public class ScalePanel extends JPanel implements MouseMotionListener, { reveal = region; ToolTipManager.sharedInstance().registerComponent(this); - this - .setToolTipText("Reveal Hidden Columns with Right Mouse Button"); + this.setToolTipText("Reveal Hidden Columns with Right Mouse Button"); break; } else @@ -455,22 +456,20 @@ public class ScalePanel extends JPanel implements MouseMotionListener, maxX = (i - startx + 1) * av.charWidth + fm.stringWidth(string); } - gg - .drawLine( - (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)), - y + 2, - (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)), - y + (fm.getDescent() * 2)); + gg.drawLine( + (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)), + y + 2, + (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)), + y + (fm.getDescent() * 2)); } else { - gg - .drawLine( - (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)), - y + fm.getDescent(), - (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)), - y + (fm.getDescent() * 2)); + gg.drawLine( + (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)), + y + fm.getDescent(), + (int) (((i - startx - 1) * av.charWidth) + (av.charWidth / 2)), + y + (fm.getDescent() * 2)); } } diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index 0297fce..f625838 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -654,11 +654,9 @@ public class SeqCanvas extends JComponent { g1.setColor(Color.blue); - g1 - .drawLine((blockEnd - blockStart + 1) * av.charWidth - 1, - 0 + offset, (blockEnd - blockStart + 1) - * av.charWidth - 1, (endSeq - startSeq) - * av.charHeight + offset); + g1.drawLine((blockEnd - blockStart + 1) * av.charWidth - 1, + 0 + offset, (blockEnd - blockStart + 1) * av.charWidth + - 1, (endSeq - startSeq) * av.charHeight + offset); } g1.translate(-screenY * av.charWidth, 0); diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 8acdcc6..7502812 100755 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -198,8 +198,8 @@ public class SeqPanel extends JPanel implements MouseListener, y -= hgap; - seq = Math.min((y % cHeight) / av.getCharHeight(), av.alignment - .getHeight() - 1); + seq = Math.min((y % cHeight) / av.getCharHeight(), + av.alignment.getHeight() - 1); } else { @@ -688,8 +688,9 @@ public class SeqPanel extends JPanel implements MouseListener, if (av.showSequenceFeatures) { int rpos; - SequenceFeature[] features = findFeaturesAtRes(sequence - .getDatasetSequence(), rpos = sequence.findPosition(res)); + SequenceFeature[] features = findFeaturesAtRes( + sequence.getDatasetSequence(), + rpos = sequence.findPosition(res)); appendFeatures(tooltipText, linkImageURL.toString(), rpos, features, this.ap.seqPanel.seqCanvas.fr.minmax); } @@ -937,8 +938,7 @@ public class SeqPanel extends JPanel implements MouseListener, // Which is bigger, left-right or up-down? if (Math.abs(evt.getY() - lastMousePress.getY()) > Math.abs(evt - .getX() - - lastMousePress.getX())) + .getX() - lastMousePress.getX())) { int fontSize = av.font.getSize(); @@ -956,9 +956,7 @@ public class SeqPanel extends JPanel implements MouseListener, fontSize = 1; } - av - .setFont(new Font(av.font.getName(), av.font.getStyle(), - fontSize)); + av.setFont(new Font(av.font.getName(), av.font.getStyle(), fontSize)); av.charWidth = oldWidth; ap.fontChanged(); } @@ -1443,14 +1441,15 @@ public class SeqPanel extends JPanel implements MouseListener, av.setSelectionGroup(null); } - SequenceFeature[] features = findFeaturesAtRes(sequence - .getDatasetSequence(), sequence.findPosition(findRes(evt))); + SequenceFeature[] features = findFeaturesAtRes( + sequence.getDatasetSequence(), + sequence.findPosition(findRes(evt))); if (features != null && features.length > 0) { SearchResults highlight = new SearchResults(); - highlight.addResult(sequence, features[0].getBegin(), features[0] - .getEnd()); + highlight.addResult(sequence, features[0].getBegin(), + features[0].getEnd()); seqCanvas.highlightSearchResults(highlight); } if (features != null && features.length > 0) @@ -1554,8 +1553,8 @@ public class SeqPanel extends JPanel implements MouseListener, if (javax.swing.SwingUtilities.isRightMouseButton(evt)) { - SequenceFeature[] allFeatures = findFeaturesAtRes(sequence - .getDatasetSequence(), sequence.findPosition(res)); + SequenceFeature[] allFeatures = findFeaturesAtRes( + sequence.getDatasetSequence(), sequence.findPosition(res)); Vector links = new Vector(); for (int i = 0; i < allFeatures.length; i++) { @@ -1641,20 +1640,20 @@ public class SeqPanel extends JPanel implements MouseListener, { if (stretchGroup.cs instanceof ClustalxColourScheme) { - ((ClustalxColourScheme) stretchGroup.cs).resetClustalX(stretchGroup - .getSequences(av.hiddenRepSequences), stretchGroup - .getWidth()); + ((ClustalxColourScheme) stretchGroup.cs).resetClustalX( + stretchGroup.getSequences(av.hiddenRepSequences), + stretchGroup.getWidth()); } if (stretchGroup.cs.conservationApplied()) { - SliderPanel.setConservationSlider(ap, stretchGroup.cs, stretchGroup - .getName()); + SliderPanel.setConservationSlider(ap, stretchGroup.cs, + stretchGroup.getName()); } else { - SliderPanel.setPIDSliderSource(ap, stretchGroup.cs, stretchGroup - .getName()); + SliderPanel.setPIDSliderSource(ap, stretchGroup.cs, + stretchGroup.getName()); } } PaintRefresher.Refresh(this, av.getSequenceSetId()); @@ -1883,8 +1882,9 @@ public class SeqPanel extends JPanel implements MouseListener, } // do we want to thread this ? (contention with seqsel and colsel locks, I // suspect) - // rules are: colsel is copied if there is a real intersection between sequence selection - boolean repaint = false,copycolsel=true; + // rules are: colsel is copied if there is a real intersection between + // sequence selection + boolean repaint = false, copycolsel = true; if (av.selectionGroup == null || !av.isSelectionGroupChanged()) { SequenceGroup sgroup = null; @@ -1899,10 +1899,11 @@ public class SeqPanel extends JPanel implements MouseListener, } sgroup = seqsel.intersect(av.alignment, (av.hasHiddenRows) ? av.hiddenRepSequences : null); - if ((sgroup==null || sgroup.getSize()==0) && (colsel==null || colsel.size()==0)) + if ((sgroup == null || sgroup.getSize() == 0) + && (colsel == null || colsel.size() == 0)) { // don't copy columns if the region didn't intersect. - copycolsel=false; + copycolsel = false; } } if (sgroup != null && sgroup.getSize() > 0) diff --git a/src/jalview/gui/SequenceRenderer.java b/src/jalview/gui/SequenceRenderer.java index 44e4ddd..b15851c 100755 --- a/src/jalview/gui/SequenceRenderer.java +++ b/src/jalview/gui/SequenceRenderer.java @@ -466,10 +466,8 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer } charOffset = (av.charWidth - fm.charWidth(s)) / 2; - graphics - .drawString(String.valueOf(s), charOffset + x1 - + (av.charWidth * (i - start)), - (y1 + av.charHeight) - pady); + graphics.drawString(String.valueOf(s), charOffset + x1 + + (av.charWidth * (i - start)), (y1 + av.charHeight) - pady); } } } diff --git a/src/jalview/gui/SliderPanel.java b/src/jalview/gui/SliderPanel.java index 77fa400..ed3fc52 100755 --- a/src/jalview/gui/SliderPanel.java +++ b/src/jalview/gui/SliderPanel.java @@ -160,8 +160,8 @@ public class SliderPanel extends GSliderPanel if (!conservationSlider.isVisible()) { - Desktop.addInternalFrame(conservationSlider, conservationSlider - .getTitle(), 420, 90, false); + Desktop.addInternalFrame(conservationSlider, + conservationSlider.getTitle(), 420, 90, false); conservationSlider .addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() { diff --git a/src/jalview/gui/SplashScreen.java b/src/jalview/gui/SplashScreen.java index 06c5807..4801051 100755 --- a/src/jalview/gui/SplashScreen.java +++ b/src/jalview/gui/SplashScreen.java @@ -167,8 +167,9 @@ public class SplashScreen extends JPanel implements Runnable int vwidth = fm.stringWidth("Jalview " + jalview.bin.Cache.getProperty("VERSION")); g.setFont(new Font("Verdana", Font.BOLD, fontSize + 2)); - g.drawString("Last updated: " - + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"), + g.drawString( + "Last updated: " + + jalview.bin.Cache.getDefault("BUILD_DATE", "unknown"), 50 + vwidth + 5, y); if (jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking").equals( "Checking")) @@ -181,44 +182,39 @@ public class SplashScreen extends JPanel implements Runnable else if (!jalview.bin.Cache.getDefault("LATEST_VERSION", "Checking") .equals(jalview.bin.Cache.getProperty("VERSION"))) { - if (jalview.bin.Cache.getProperty("VERSION").toLowerCase().indexOf( - "automated build") == -1) + if (jalview.bin.Cache.getProperty("VERSION").toLowerCase() + .indexOf("automated build") == -1) { // Displayed when code version and jnlp version do not match and code // version is not a development build g.setColor(Color.red); } - g - .drawString( - "!! Jalview version " - + jalview.bin.Cache.getDefault( - "LATEST_VERSION", "..Checking..") - + " is available for download from http://www.jalview.org !!", - 50, y += fontSize + 10); + g.drawString( + "!! Jalview version " + + jalview.bin.Cache.getDefault("LATEST_VERSION", + "..Checking..") + + " is available for download from http://www.jalview.org !!", + 50, y += fontSize + 10); y += 5; g.setColor(Color.black); } g.setFont(new Font("Verdana", Font.BOLD, fontSize)); - g - .drawString( - "Authors: Andrew Waterhouse, Jim Procter, Michele Clamp, James Cuff, Steve Searle,", - 50, y += fontSize + 4); + g.drawString( + "Authors: Andrew Waterhouse, Jim Procter, Michele Clamp, James Cuff, Steve Searle,", + 50, y += fontSize + 4); g.drawString("David Martin & Geoff Barton.", 60, y += fontSize + 4); - g - .drawString( - "Development managed by The Barton Group, University of Dundee.", - 50, y += fontSize + 4); + g.drawString( + "Development managed by The Barton Group, University of Dundee.", + 50, y += fontSize + 4); g.drawString("If you use Jalview, please cite: ", 50, y += fontSize + 4); - g - .drawString( - "Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)", - 50, y += fontSize + 4); - g - .drawString( - "Jalview Version 2 - a multiple sequence alignment editor and analysis workbench", - 50, y += fontSize + 4); + g.drawString( + "Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)", + 50, y += fontSize + 4); + g.drawString( + "Jalview Version 2 - a multiple sequence alignment editor and analysis workbench", + 50, y += fontSize + 4); g.drawString("Bioinformatics doi: 10.1093/bioinformatics/btp033", 50, y += fontSize + 4); } diff --git a/src/jalview/gui/TextColourChooser.java b/src/jalview/gui/TextColourChooser.java index 837c42d..bec6823 100644 --- a/src/jalview/gui/TextColourChooser.java +++ b/src/jalview/gui/TextColourChooser.java @@ -65,12 +65,11 @@ public class TextColourChooser final JPanel bigpanel = new JPanel(new BorderLayout()); JPanel panel = new JPanel(); bigpanel.add(panel, BorderLayout.CENTER); - bigpanel - .add( - new JLabel( - "Select a dark and light text colour, then set the threshold to" - + "
    switch between colours, based on background colour
    "), - BorderLayout.NORTH); + bigpanel.add( + new JLabel( + "Select a dark and light text colour, then set the threshold to" + + "
    switch between colours, based on background colour
    "), + BorderLayout.NORTH); panel.add(col1); panel.add(slider); panel.add(col2); diff --git a/src/jalview/gui/TreePanel.java b/src/jalview/gui/TreePanel.java index e77134e..ea0b791 100755 --- a/src/jalview/gui/TreePanel.java +++ b/src/jalview/gui/TreePanel.java @@ -364,16 +364,16 @@ public class TreePanel extends GTreePanel buffer.append("PID"); } - - jalview.io.NewickFile fout = new jalview.io.NewickFile(tree - .getTopNode()); - try { + jalview.io.NewickFile fout = new jalview.io.NewickFile( + tree.getTopNode()); + try + { cap.setText(fout.print(tree.isHasBootstrap(), tree.isHasDistances(), - tree.isHasRootDistance())); + tree.isHasRootDistance())); Desktop.addInternalFrame(cap, buffer.toString(), 500, 100); } catch (OutOfMemoryError oom) { - new OOMWarning("generating newick tree file",oom); + new OOMWarning("generating newick tree file", oom); cap.dispose(); } @@ -387,8 +387,8 @@ public class TreePanel extends GTreePanel */ public void saveAsNewick_actionPerformed(ActionEvent e) { - JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache - .getProperty("LAST_DIRECTORY")); + JalviewFileChooser chooser = new JalviewFileChooser( + jalview.bin.Cache.getProperty("LAST_DIRECTORY")); chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle("Save tree as newick file"); chooser.setToolTipText("Save"); @@ -403,10 +403,10 @@ public class TreePanel extends GTreePanel try { - jalview.io.NewickFile fout = new jalview.io.NewickFile(tree - .getTopNode()); - String output = fout.print(tree.isHasBootstrap(), tree - .isHasDistances(), tree.isHasRootDistance()); + jalview.io.NewickFile fout = new jalview.io.NewickFile( + tree.getTopNode()); + String output = fout.print(tree.isHasBootstrap(), + tree.isHasDistances(), tree.isHasRootDistance()); java.io.PrintWriter out = new java.io.PrintWriter( new java.io.FileWriter(choice)); out.println(output); @@ -725,9 +725,9 @@ public class TreePanel extends GTreePanel if (sq != null) { // search dbrefs, features and annotation - DBRefEntry[] refs = jalview.util.DBRefUtils.selectRefs(sq - .getDBRef(), new String[] - { labelClass.toUpperCase() }); + DBRefEntry[] refs = jalview.util.DBRefUtils.selectRefs( + sq.getDBRef(), new String[] + { labelClass.toUpperCase() }); if (refs != null) { for (int i = 0; i < refs.length; i++) diff --git a/src/jalview/gui/UserDefinedColours.java b/src/jalview/gui/UserDefinedColours.java index 88bf6e2..f4afe56 100755 --- a/src/jalview/gui/UserDefinedColours.java +++ b/src/jalview/gui/UserDefinedColours.java @@ -297,9 +297,7 @@ public class UserDefinedColours extends GUserDefinedColours implements JButton button = (JButton) buttonPanel.getComponent(b); if (!selectedButtons.contains(button)) { - button - .setForeground(button.getBackground().brighter() - .brighter()); + button.setForeground(button.getBackground().brighter().brighter()); selectedButtons.add(button); } } @@ -325,9 +323,7 @@ public class UserDefinedColours extends GUserDefinedColours implements } else { - pressed - .setForeground(pressed.getBackground().brighter() - .brighter()); + pressed.setForeground(pressed.getBackground().brighter().brighter()); selectedButtons.addElement(pressed); } } @@ -487,10 +483,10 @@ public class UserDefinedColours extends GUserDefinedColours implements upperCaseButtons = new Vector(); lowerCaseButtons = new Vector(); - JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache - .getProperty("LAST_DIRECTORY"), new String[] - { "jc" }, new String[] - { "Jalview User Colours" }, "Jalview User Colours"); + JalviewFileChooser chooser = new JalviewFileChooser( + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] + { "jc" }, new String[] + { "Jalview User Colours" }, "Jalview User Colours"); chooser.setFileView(new jalview.io.JalviewFileView()); chooser.setDialogTitle("Load colour scheme"); chooser.setToolTipText("Load"); @@ -708,7 +704,8 @@ public class UserDefinedColours extends GUserDefinedColours implements if (userColourSchemes != null && userColourSchemes.containsKey(schemeName.getText())) { - int reply = JOptionPane.showInternalConfirmDialog(Desktop.desktop, + int reply = JOptionPane.showInternalConfirmDialog( + Desktop.desktop, "Colour scheme " + schemeName.getText() + " exists." + "\nContinue saving colour scheme as " + schemeName.getText() + "?", @@ -720,10 +717,10 @@ public class UserDefinedColours extends GUserDefinedColours implements userColourSchemes.remove(schemeName.getText()); } - JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache - .getProperty("LAST_DIRECTORY"), new String[] - { "jc" }, new String[] - { "Jalview User Colours" }, "Jalview User Colours"); + JalviewFileChooser chooser = new JalviewFileChooser( + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] + { "jc" }, new String[] + { "Jalview User Colours" }, "Jalview User Colours"); chooser.setFileView(new jalview.io.JalviewFileView()); chooser.setDialogTitle("Save colour scheme"); @@ -856,8 +853,8 @@ public class UserDefinedColours extends GUserDefinedColours implements { if (coloursFound.toString().length() > 1) { - jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS", coloursFound - .toString()); + jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS", + coloursFound.toString()); } else { @@ -876,8 +873,8 @@ public class UserDefinedColours extends GUserDefinedColours implements userColourSchemes = new Hashtable(); StringBuffer coloursFound = new StringBuffer(); - StringTokenizer st = new StringTokenizer(jalview.bin.Cache - .getProperty("USER_DEFINED_COLOURS"), "|"); + StringTokenizer st = new StringTokenizer( + jalview.bin.Cache.getProperty("USER_DEFINED_COLOURS"), "|"); while (st.hasMoreElements()) { @@ -902,8 +899,8 @@ public class UserDefinedColours extends GUserDefinedColours implements if (coloursFound.toString().length() > 1) { - jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS", coloursFound - .toString()); + jalview.bin.Cache.setProperty("USER_DEFINED_COLOURS", + coloursFound.toString()); } else { diff --git a/src/jalview/gui/UserQuestionnaireCheck.java b/src/jalview/gui/UserQuestionnaireCheck.java index 6f566a5..1c08b9b 100644 --- a/src/jalview/gui/UserQuestionnaireCheck.java +++ b/src/jalview/gui/UserQuestionnaireCheck.java @@ -56,8 +56,8 @@ public class UserQuestionnaireCheck implements Runnable boolean prompt = false; // see if we have already responsed to this questionnaire or get a new // qid/rid pair - BufferedReader br = new BufferedReader(new InputStreamReader(qurl - .openStream())); + BufferedReader br = new BufferedReader(new InputStreamReader( + qurl.openStream())); String qresp; while ((qresp = br.readLine()) != null) { @@ -108,8 +108,8 @@ public class UserQuestionnaireCheck implements Runnable String qurl = url + (url.indexOf('?') > -1 ? "&" : "?") + "checkresponse=1"; // query the server with the old qid/id pair - String qqid = lastq.indexOf(':') > -1 ? lastq.substring(0, lastq - .indexOf(':')) : null; + String qqid = lastq.indexOf(':') > -1 ? lastq.substring(0, + lastq.indexOf(':')) : null; if (qqid != null && qqid != "null" && qqid.length() > 0) { qurl += "&qid=" + qqid; diff --git a/src/jalview/gui/VamsasApplication.java b/src/jalview/gui/VamsasApplication.java index c48c86f..efd94de 100644 --- a/src/jalview/gui/VamsasApplication.java +++ b/src/jalview/gui/VamsasApplication.java @@ -222,14 +222,12 @@ public class VamsasApplication implements SelectionSource } catch (Error e) { Cache.log - .warn( - "Probable SERIOUS VAMSAS client incompatibility - carrying on regardless", + .warn("Probable SERIOUS VAMSAS client incompatibility - carrying on regardless", e); } catch (Exception e) { Cache.log - .warn( - "Probable VAMSAS client incompatibility - carrying on regardless", + .warn("Probable VAMSAS client incompatibility - carrying on regardless", e); } } @@ -241,8 +239,8 @@ public class VamsasApplication implements SelectionSource */ private ClientHandle getJalviewHandle() { - return new ClientHandle("jalview.bin.Jalview", jalview.bin.Cache - .getProperty("VERSION")); + return new ClientHandle("jalview.bin.Jalview", + jalview.bin.Cache.getProperty("VERSION")); } /** @@ -305,8 +303,7 @@ public class VamsasApplication implements SelectionSource } catch (Exception e) { Cache.log - .warn( - "Exception whilst refreshing jalview windows after a vamsas document update.", + .warn("Exception whilst refreshing jalview windows after a vamsas document update.", e); } } @@ -791,8 +788,8 @@ public class VamsasApplication implements SelectionSource // Cache.log.debug("Handling Mouse over "+mm.getVorbaID()+" // bound to "+jvobj+" at "+mm.getPosition()); // position is character position in aligned sequence - ssm.mouseOverVamsasSequence((SequenceI) jvobj, mm - .getPosition()); + ssm.mouseOverVamsasSequence((SequenceI) jvobj, + mm.getPosition()); } } if (message instanceof uk.ac.vamsas.client.picking.SelectionMessage) @@ -1064,8 +1061,8 @@ public class VamsasApplication implements SelectionSource } else { - int[] intervals = colsel.getVisibleContigs(seqsel - .getStartRes(), seqsel.getEndRes() + 1); + int[] intervals = colsel.getVisibleContigs( + seqsel.getStartRes(), seqsel.getEndRes() + 1); for (int iv = 0; iv < intervals.length; iv += 2) { Seg s = new Seg(); diff --git a/src/jalview/gui/WsJobParameters.java b/src/jalview/gui/WsJobParameters.java index 09499ff..9164cc0 100644 --- a/src/jalview/gui/WsJobParameters.java +++ b/src/jalview/gui/WsJobParameters.java @@ -125,6 +125,7 @@ public class WsJobParameters extends JPanel implements ItemListener, ActionListener, DocumentListener { URL linkImageURL = getClass().getResource("/images/link.gif"); + private static final String SVC_DEF = "Defaults"; // this is the null // parameter set as shown to // user @@ -141,8 +142,11 @@ public class WsJobParameters extends JPanel implements ItemListener, JSplitPane settingsPanel = new JSplitPane(); JSplitPane jobPanel = new JSplitPane(); - boolean split=true; - JTabbedPane tabpanels=new JTabbedPane(); + + boolean split = true; + + JTabbedPane tabpanels = new JTabbedPane(); + JPanel jobOptions = new JPanel(); JScrollPane jobOptionsPane = new JScrollPane(); @@ -242,17 +246,23 @@ public class WsJobParameters extends JPanel implements ItemListener, (int) (deskr.getCenterY() - 250), 480, 500)); frame.setContentPane(this); // should recover defaults from user prefs. - //settingsPanel.setDividerLocation(0.4); - //jobPanel.setDividerLocation(0.5); + // settingsPanel.setDividerLocation(0.4); + // jobPanel.setDividerLocation(0.5); frame.validate(); - if (split) { - javax.swing.SwingUtilities.invokeLater(new Runnable() { - public void run() { + if (split) + { + javax.swing.SwingUtilities.invokeLater(new Runnable() + { + public void run() + { settingsPanel.setDividerLocation(0.5); - jobPanel.setDividerLocation(setDescr.getLineCount()>3 ? 0.35 : 0.16 ); + jobPanel.setDividerLocation(setDescr.getLineCount() > 3 ? 0.35 + : 0.16); } }); - } else { + } + else + { tabpanels.setSelectedComponent(jobOptionsPane); } frame.setVisible(true); @@ -264,10 +274,10 @@ public class WsJobParameters extends JPanel implements ItemListener, return false; } - private void jbInit() { - updatepref = JvSwingUtils.makeButton("Update", "Update this existing user parameter set.", + updatepref = JvSwingUtils.makeButton("Update", + "Update this existing user parameter set.", new ActionListener() { @@ -276,7 +286,8 @@ public class WsJobParameters extends JPanel implements ItemListener, update_actionPerformed(e); } }); - deletepref = JvSwingUtils.makeButton("Delete", "Delete the currently selected user parameter set.", + deletepref = JvSwingUtils.makeButton("Delete", + "Delete the currently selected user parameter set.", new ActionListener() { @@ -285,7 +296,8 @@ public class WsJobParameters extends JPanel implements ItemListener, delete_actionPerformed(e); } }); - createpref = JvSwingUtils.makeButton("Create", "Create a new parameter set with the current settings.", + createpref = JvSwingUtils.makeButton("Create", + "Create a new parameter set with the current settings.", new ActionListener() { @@ -295,7 +307,8 @@ public class WsJobParameters extends JPanel implements ItemListener, } }); revertpref = JvSwingUtils.makeButton("Revert", - "Undo all changes to the current parameter set", new ActionListener() + "Undo all changes to the current parameter set", + new ActionListener() { public void actionPerformed(ActionEvent e) @@ -303,20 +316,22 @@ public class WsJobParameters extends JPanel implements ItemListener, revert_actionPerformed(e); } }); - startjob = JvSwingUtils.makeButton("Start Job", "Start Job with current settings.",new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - startjob_actionPerformed(e); - } - }); - canceljob = JvSwingUtils.makeButton("Cancel Job", "Close this dialog and cancel job.", new ActionListener() - { - public void actionPerformed(ActionEvent e) - { - canceljob_actionPerformed(e); - } - }); + startjob = JvSwingUtils.makeButton("Start Job", + "Start Job with current settings.", new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + startjob_actionPerformed(e); + } + }); + canceljob = JvSwingUtils.makeButton("Cancel Job", + "Close this dialog and cancel job.", new ActionListener() + { + public void actionPerformed(ActionEvent e) + { + canceljob_actionPerformed(e); + } + }); setDetails.setBorder(new TitledBorder("Details")); setDetails.setLayout(new BorderLayout()); @@ -360,7 +375,7 @@ public class WsJobParameters extends JPanel implements ItemListener, SetNamePanel.add(setNameInfo); SetNamePanel.add(buttonArea); setDetails.add(setDescrView, BorderLayout.CENTER); - //setDetails.setPreferredSize(new Dimension(360, 100)); + // setDetails.setPreferredSize(new Dimension(360, 100)); jobParameters.setBorder(new TitledBorder("Parameters")); jobParameters.setLayout(new BorderLayout()); paramPane.setPreferredSize(new Dimension(360, 300)); @@ -374,23 +389,26 @@ public class WsJobParameters extends JPanel implements ItemListener, jobOptionsPanel.setBorder(new TitledBorder("Options")); jobOptionsPane.getViewport().setView(jobOptions); jobOptionsPanel.add(jobOptionsPane, BorderLayout.CENTER); - + setLayout(new BorderLayout()); jobPanel.setLeftComponent(setDetails); - if (split) { + if (split) + { settingsPanel.setLeftComponent(jobOptionsPanel); settingsPanel.setRightComponent(jobParameters); settingsPanel.setOrientation(JSplitPane.VERTICAL_SPLIT); jobPanel.setRightComponent(settingsPanel); - } else { - jobPanel.setRightComponent(tabpanels); - jobOptionsPane.setName("Options"); - tabpanels.add(jobOptionsPane); - paramPane.setName("Parameters"); - tabpanels.add(paramPane); + } + else + { + jobPanel.setRightComponent(tabpanels); + jobOptionsPane.setName("Options"); + tabpanels.add(jobOptionsPane); + paramPane.setName("Parameters"); + tabpanels.add(paramPane); } jobPanel.setOrientation(JSplitPane.VERTICAL_SPLIT); - add(SetNamePanel, BorderLayout.NORTH); + add(SetNamePanel, BorderLayout.NORTH); add(jobPanel, BorderLayout.CENTER); JPanel dialogpanel = new JPanel(); dialogpanel.add(startjob); @@ -886,12 +904,20 @@ public class WsJobParameters extends JPanel implements ItemListener, finfo = parm.getFurtherDetails(); if (finfo != null) { - showDesc.setToolTipText(""+JvSwingUtils.wrapTooltip("Click to show brief description
    Right click for further information.")+""); + showDesc.setToolTipText("" + + JvSwingUtils + .wrapTooltip("Click to show brief description
    Right click for further information.") + + ""); showDesc.addMouseListener(this); } else { - showDesc.setToolTipText(""+JvSwingUtils.wrapTooltip("Click to show brief description.")+""); + showDesc.setToolTipText("" + + JvSwingUtils + .wrapTooltip("Click to show brief description.") + + ""); } showDesc.addActionListener(new ActionListener() { @@ -1239,7 +1265,9 @@ public class WsJobParameters extends JPanel implements ItemListener, { hasLink = true; // optlabel.setToolTipText("

    "+opt.getDescription()+"

    "); - enabled.setToolTipText("" + JvSwingUtils.wrapTooltip(opt.getDescription()+"
    ") + enabled.setToolTipText("" + + JvSwingUtils.wrapTooltip(opt.getDescription() + + "
    ") + ""); // optlabel.addMouseListener(this); enabled.addMouseListener(this); @@ -1247,7 +1275,9 @@ public class WsJobParameters extends JPanel implements ItemListener, else { // optlabel.setToolTipText(opt.getDescription()); - enabled.setToolTipText(""+JvSwingUtils.wrapTooltip(opt.getDescription())+""); + enabled.setToolTipText("" + + JvSwingUtils.wrapTooltip(opt.getDescription()) + + ""); } add(enabled, BorderLayout.NORTH); if (opt.getPossibleValues().size() > 1) @@ -1900,17 +1930,22 @@ public class WsJobParameters extends JPanel implements ItemListener, String msg = null; if (isServicePreset(newname)) { - final String oldname = curSetName!=null ? curSetName : lastParmSet; - final Component ourframe=this; - settingDialog=true; + final String oldname = curSetName != null ? curSetName + : lastParmSet; + final Component ourframe = this; + settingDialog = true; setName.getEditor().setItem(oldname); - settingDialog=false; - javax.swing.SwingUtilities.invokeLater(new Runnable() {public void run() { - JOptionPane.showMessageDialog(ourframe, - "Invalid name - preset already exists.", "Invalid name", - JOptionPane.WARNING_MESSAGE); - }}); - + settingDialog = false; + javax.swing.SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + JOptionPane.showMessageDialog(ourframe, + "Invalid name - preset already exists.", + "Invalid name", JOptionPane.WARNING_MESSAGE); + } + }); + return; } curSetName = newname; diff --git a/src/jalview/gui/WsPreferences.java b/src/jalview/gui/WsPreferences.java index 0812b7b..d6446af 100644 --- a/src/jalview/gui/WsPreferences.java +++ b/src/jalview/gui/WsPreferences.java @@ -40,68 +40,91 @@ public class WsPreferences extends GWsPreferences initFromPreferences(); } - Vector wsUrls,oldUrls; + Vector wsUrls, oldUrls; + private boolean needWsMenuUpdate; - private boolean oldJws1,oldJws2,oldIndexByHost,oldIndexByType,oldEnfin; + + private boolean oldJws1, oldJws2, oldIndexByHost, oldIndexByType, + oldEnfin; + private void initFromPreferences() { wsUrls = jalview.ws.jws2.Jws2Discoverer.getServiceUrls(); - if (wsUrls!=null) { + if (wsUrls != null) + { oldUrls = new Vector(wsUrls); - } else { - oldUrls=null; - wsUrls=new Vector(); + } + else + { + oldUrls = null; + wsUrls = new Vector(); } updateList(); - enableEnfinServices.setSelected(oldEnfin=Cache.getDefault( + enableEnfinServices.setSelected(oldEnfin = Cache.getDefault( "SHOW_ENFIN_SERVICES", true)); - enableJws1Services.setSelected(oldJws1=Cache.getDefault("SHOW_JWS1_SERVICES", - true)); - enableJws2Services.setSelected(oldJws2=Cache.getDefault("SHOW_JWS2_SERVICES", - true)); - indexByHost.setSelected(oldIndexByHost=Cache.getDefault("WSMENU_BYHOST", true)); - indexByType.setSelected(oldIndexByType=Cache.getDefault("WSMENU_BYTYPE", true)); + enableJws1Services.setSelected(oldJws1 = Cache.getDefault( + "SHOW_JWS1_SERVICES", true)); + enableJws2Services.setSelected(oldJws2 = Cache.getDefault( + "SHOW_JWS2_SERVICES", true)); + indexByHost.setSelected(oldIndexByHost = Cache.getDefault( + "WSMENU_BYHOST", true)); + indexByType.setSelected(oldIndexByType = Cache.getDefault( + "WSMENU_BYTYPE", true)); } - private void updateList() { + + private void updateList() + { wsList.setListData(wsUrls); } - private void updateServiceList() { + + private void updateServiceList() + { jalview.ws.jws2.Jws2Discoverer.setServiceUrls(wsUrls); } - /* (non-Javadoc) - * @see jalview.jbgui.GWsPreferences#deleteWsUrl_actionPerformed(java.awt.event.ActionEvent) + + /* + * (non-Javadoc) + * + * @see + * jalview.jbgui.GWsPreferences#deleteWsUrl_actionPerformed(java.awt.event + * .ActionEvent) */ @Override protected void deleteWsUrl_actionPerformed(ActionEvent e) { int sel = wsList.getSelectedIndex(); - if (sel>-1) + if (sel > -1) { wsUrls.removeElementAt(sel); updateList(); } } - /* (non-Javadoc) - * @see jalview.jbgui.GWsPreferences#editWsUrl_actionPerformed(java.awt.event.ActionEvent) + /* + * (non-Javadoc) + * + * @see jalview.jbgui.GWsPreferences#editWsUrl_actionPerformed(java.awt.event. + * ActionEvent) */ @Override protected void editWsUrl_actionPerformed(ActionEvent e) { int sel = wsList.getSelectedIndex(); - if (sel>-1) + if (sel > -1) { - String url=editUrl(wsUrls.elementAt(sel),"Edit JWS2 URL"); - if (url!=null) + String url = editUrl(wsUrls.elementAt(sel), "Edit JWS2 URL"); + if (url != null) { int present = wsUrls.indexOf(url); - if (present==-1) + if (present == -1) { - wsUrls.setElementAt(url,sel); + wsUrls.setElementAt(url, sel); updateList(); - } else { - if (present!=sel) + } + else + { + if (present != sel) { wsUrls.removeElementAt(sel); updateList(); @@ -110,60 +133,88 @@ public class WsPreferences extends GWsPreferences } } } - - void updateWsMenuConfig(boolean old) { - if (old) { - wsUrls = (oldUrls==null) ? null : new Vector(oldUrls); - } else { - + + void updateWsMenuConfig(boolean old) + { + if (old) + { + wsUrls = (oldUrls == null) ? null : new Vector(oldUrls); + } + else + { + } - Cache.setProperty("SHOW_ENFIN_SERVICES", Boolean.valueOf(old ? oldEnfin : enableEnfinServices.isSelected()).toString()); - Cache.setProperty("SHOW_JWS1_SERVICES", Boolean.valueOf(old ? oldJws1 : enableJws1Services.isSelected()).toString()); - Cache.setProperty("SHOW_JWS2_SERVICES", Boolean.valueOf(old ? oldJws2 : enableJws2Services.isSelected()).toString()); - Cache.setProperty("WSMENU_BYHOST", Boolean.valueOf(old ? oldIndexByHost : indexByHost.isSelected()).toString()); - Cache.setProperty("WSMENU_BYTYPE", Boolean.valueOf(old ? oldIndexByType : indexByType.isSelected()).toString()); + Cache.setProperty( + "SHOW_ENFIN_SERVICES", + Boolean.valueOf( + old ? oldEnfin : enableEnfinServices.isSelected()) + .toString()); + Cache.setProperty( + "SHOW_JWS1_SERVICES", + Boolean.valueOf(old ? oldJws1 : enableJws1Services.isSelected()) + .toString()); + Cache.setProperty( + "SHOW_JWS2_SERVICES", + Boolean.valueOf(old ? oldJws2 : enableJws2Services.isSelected()) + .toString()); + Cache.setProperty( + "WSMENU_BYHOST", + Boolean.valueOf(old ? oldIndexByHost : indexByHost.isSelected()) + .toString()); + Cache.setProperty( + "WSMENU_BYTYPE", + Boolean.valueOf(old ? oldIndexByType : indexByType.isSelected()) + .toString()); updateServiceList(); } - - /* (non-Javadoc) - * @see jalview.jbgui.GWsPreferences#moveWsUrlDown_actionPerformed(java.awt.event.ActionEvent) + + /* + * (non-Javadoc) + * + * @see + * jalview.jbgui.GWsPreferences#moveWsUrlDown_actionPerformed(java.awt.event + * .ActionEvent) */ @Override protected void moveWsUrlDown_actionPerformed(ActionEvent e) { - int p=wsList.getSelectedIndex(); - if (p>-1 && p -1 && p < wsUrls.size() - 1) { - String t = wsUrls.get(p+1); - wsUrls.setElementAt(wsUrls.elementAt(p), p+1); + String t = wsUrls.get(p + 1); + wsUrls.setElementAt(wsUrls.elementAt(p), p + 1); wsUrls.setElementAt(t, p); updateList(); - wsList.setSelectedIndex(p+1); + wsList.setSelectedIndex(p + 1); } } - /* (non-Javadoc) - * @see jalview.jbgui.GWsPreferences#moveWsUrlUp_actionPerformed(java.awt.event.ActionEvent) + /* + * (non-Javadoc) + * + * @see + * jalview.jbgui.GWsPreferences#moveWsUrlUp_actionPerformed(java.awt.event + * .ActionEvent) */ @Override protected void moveWsUrlUp_actionPerformed(ActionEvent e) { - int p=wsList.getSelectedIndex(); - if (p>0) + int p = wsList.getSelectedIndex(); + if (p > 0) { - String t = wsUrls.get(p-1); - wsUrls.setElementAt(wsUrls.elementAt(p), p-1); + String t = wsUrls.get(p - 1); + wsUrls.setElementAt(wsUrls.elementAt(p), p - 1); wsUrls.setElementAt(t, p); updateList(); - wsList.setSelectedIndex(p-1); + wsList.setSelectedIndex(p - 1); } } private String editUrl(String initUrl, String title) { - String url=initUrl; - URL foo=null; - if (url==null) + String url = initUrl; + URL foo = null; + if (url == null) { url = ""; } @@ -173,54 +224,77 @@ public class WsPreferences extends GWsPreferences pane12.add(new JLabel("URL: "), BorderLayout.CENTER); pane12.add(urltf, BorderLayout.EAST); panel.add(pane12, BorderLayout.NORTH); - boolean valid=false; - int resp=JOptionPane.CANCEL_OPTION; - while (!valid && (resp=JOptionPane.showInternalConfirmDialog(Desktop.desktop, panel, title, JOptionPane.OK_CANCEL_OPTION))==JOptionPane.OK_OPTION) + boolean valid = false; + int resp = JOptionPane.CANCEL_OPTION; + while (!valid + && (resp = JOptionPane.showInternalConfirmDialog( + Desktop.desktop, panel, title, + JOptionPane.OK_CANCEL_OPTION)) == JOptionPane.OK_OPTION) { - try { - // TODO: do a better job of checking that the url is a valid discovery URL for web services. + try + { + // TODO: do a better job of checking that the url is a valid discovery + // URL for web services. foo = new URL(urltf.getText().trim()); valid = true; } catch (Exception e) { valid = false; - JOptionPane.showInternalMessageDialog(Desktop.desktop, "Invalid URL !"); + JOptionPane.showInternalMessageDialog(Desktop.desktop, + "Invalid URL !"); } } - if (valid && resp==JOptionPane.OK_OPTION) + if (valid && resp == JOptionPane.OK_OPTION) { - int validate = JOptionPane.showInternalConfirmDialog(Desktop.desktop, "Validate JabaWS Server ?\n(Look in console output for results)", "Test Server?", JOptionPane.YES_NO_OPTION); + int validate = JOptionPane + .showInternalConfirmDialog( + Desktop.desktop, + "Validate JabaWS Server ?\n(Look in console output for results)", + "Test Server?", JOptionPane.YES_NO_OPTION); if (validate == JOptionPane.OK_OPTION) { - if (jalview.ws.jws2.Jws2Discoverer.testServiceUrl(foo)) + if (jalview.ws.jws2.Jws2Discoverer.testServiceUrl(foo)) { return foo.toString(); - } else { - JOptionPane.showInternalMessageDialog(Desktop.desktop, "Service did not pass validation.\nCheck the Jalview Console for more details."); } - } else { + else + { + JOptionPane + .showInternalMessageDialog( + Desktop.desktop, + "Service did not pass validation.\nCheck the Jalview Console for more details."); + } + } + else + { // just return the URL anyway return foo.toString(); } } - return initUrl; + return initUrl; } - /* (non-Javadoc) - * @see jalview.jbgui.GWsPreferences#newWsUrl_actionPerformed(java.awt.event.ActionEvent) + + /* + * (non-Javadoc) + * + * @see jalview.jbgui.GWsPreferences#newWsUrl_actionPerformed(java.awt.event. + * ActionEvent) */ @Override protected void newWsUrl_actionPerformed(ActionEvent e) { - String url=editUrl(null,"Add new JWS2 URL"); - if (url!=null) + String url = editUrl(null, "Add new JWS2 URL"); + if (url != null) { if (!wsUrls.contains(url)) { int selind = wsList.getSelectedIndex(); - if (selind>-1) + if (selind > -1) { wsUrls.insertElementAt(url, selind); - } else { + } + else + { wsUrls.addElement(url); } updateList(); @@ -228,83 +302,105 @@ public class WsPreferences extends GWsPreferences } } - /* (non-Javadoc) - * @see jalview.jbgui.GWsPreferences#refreshWs_actionPerformed(java.awt.event.ActionEvent) + /* + * (non-Javadoc) + * + * @see jalview.jbgui.GWsPreferences#refreshWs_actionPerformed(java.awt.event. + * ActionEvent) */ @Override protected void refreshWs_actionPerformed(ActionEvent e) { - new Thread(new Runnable() { + new Thread(new Runnable() + { public void run() { updateWsMenuConfig(false); refreshWsMenu(true); - } + } }).start(); - + } + /** * - * @param showProgress show progress in dialog or on desktop + * @param showProgress + * show progress in dialog or on desktop */ protected void refreshWsMenu(boolean showProgress) { if (showProgress) { - new Thread(new Runnable() { + new Thread(new Runnable() + { public void run() { progressBar.setVisible(true); validate(); progressBar.setIndeterminate(true); - Desktop.instance.startServiceDiscovery(true); // wait around for all threads to complete + Desktop.instance.startServiceDiscovery(true); // wait around for all + // threads to complete progressBar.setIndeterminate(false); progressBar.setVisible(false); validate(); - } + } }).start(); - - } else { - new Thread(new Runnable() { + + } + else + { + new Thread(new Runnable() + { public void run() { long ct = System.currentTimeMillis(); - Desktop.instance.setProgressBar("Refreshing Web Service Menus", ct); + Desktop.instance.setProgressBar("Refreshing Web Service Menus", + ct); Desktop.instance.startServiceDiscovery(true); - Desktop.instance.setProgressBar("Refreshing Web Service Menus", ct); + Desktop.instance.setProgressBar("Refreshing Web Service Menus", + ct); } - + }).start(); } } - /* (non-Javadoc) - * @see jalview.jbgui.GWsPreferences#resetWs_actionPerformed(java.awt.event.ActionEvent) + /* + * (non-Javadoc) + * + * @see + * jalview.jbgui.GWsPreferences#resetWs_actionPerformed(java.awt.event.ActionEvent + * ) */ @Override protected void resetWs_actionPerformed(ActionEvent e) { jalview.ws.jws2.Jws2Discoverer.setServiceUrls(null); - wsUrls = jalview.ws.jws2.Jws2Discoverer.getServiceUrls(); + wsUrls = jalview.ws.jws2.Jws2Discoverer.getServiceUrls(); updateList(); } - protected void ok_ActionPerformed(ActionEvent e) { + + protected void ok_ActionPerformed(ActionEvent e) + { // update everything regardless. updateAndRefreshWsMenuConfig(false); } - public void updateAndRefreshWsMenuConfig(final boolean showProgressInDialog) + + public void updateAndRefreshWsMenuConfig( + final boolean showProgressInDialog) { - new Thread(new Runnable() { + new Thread(new Runnable() + { public void run() { updateWsMenuConfig(false); refreshWsMenu(showProgressInDialog); - } + } }).start(); - + } } diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index 581d9cc..ef2673a 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -508,14 +508,16 @@ public class AnnotationFile if (aa[aai].autoCalculated) { // make a note of the name and description - autoAnnots.put(aa[aai].graph - + "\t" - + aa[aai].label - + "\t" - + aa[aai].description - + "\t" - + (aa[aai].sequenceRef != null ? aa[aai].sequenceRef - .getDisplayId(true) : ""), new Integer(1)); + autoAnnots + .put(aa[aai].graph + + "\t" + + aa[aai].label + + "\t" + + aa[aai].description + + "\t" + + (aa[aai].sequenceRef != null ? aa[aai].sequenceRef + .getDisplayId(true) : ""), + new Integer(1)); } } } @@ -1121,9 +1123,7 @@ public class AnnotationFile } else { - sg - .addSequence(al.getSequenceAt(Integer.parseInt(tmp) - 1), - false); + sg.addSequence(al.getSequenceAt(Integer.parseInt(tmp) - 1), false); } } } @@ -1234,8 +1234,8 @@ public class AnnotationFile { sg.cs.setConservationInc(Integer.parseInt(value)); Conservation c = new Conservation("Group", - ResidueProperties.propHash, 3, sg.getSequences(null), sg - .getStartRes(), sg.getEndRes() + 1); + ResidueProperties.propHash, 3, sg.getSequences(null), + sg.getStartRes(), sg.getEndRes() + 1); c.calculate(); c.verdict(false, 25); @@ -1314,7 +1314,7 @@ public class AnnotationFile token = st.nextToken(); if (ala == null) { - System.err.print(" "+token); + System.err.print(" " + token); } else { @@ -1328,7 +1328,7 @@ public class AnnotationFile } } } - if (ala==null) + if (ala == null) { System.err.print("\n"); } diff --git a/src/jalview/io/AppletFormatAdapter.java b/src/jalview/io/AppletFormatAdapter.java index ee24238..b1952a9 100755 --- a/src/jalview/io/AppletFormatAdapter.java +++ b/src/jalview/io/AppletFormatAdapter.java @@ -597,11 +597,14 @@ public class AppletFormatAdapter if (!fp.isValid()) { fp = null; - } else { - if (debug) + } + else { - System.out.println("Successful."); - }} + if (debug) + { + System.out.println("Successful."); + } + } } catch (Exception e) { if (debug) diff --git a/src/jalview/io/ClustalFile.java b/src/jalview/io/ClustalFile.java index 4973908..4c700ed 100755 --- a/src/jalview/io/ClustalFile.java +++ b/src/jalview/io/ClustalFile.java @@ -189,9 +189,7 @@ public class ClustalFile extends AlignFile while ((j < s.length) && (s[j] != null)) { - out - .append(new Format("%-" + maxid + "s").form(printId(s[j]) - + " ")); + out.append(new Format("%-" + maxid + "s").form(printId(s[j]) + " ")); int start = i * len; int end = start + len; diff --git a/src/jalview/io/FeaturesFile.java b/src/jalview/io/FeaturesFile.java index cfc08fb..7c70b54 100755 --- a/src/jalview/io/FeaturesFile.java +++ b/src/jalview/io/FeaturesFile.java @@ -165,24 +165,27 @@ public class FeaturesFile extends AlignFile // fifth is either 'above','below', or 'none'. // sixth is a float value and only required when fifth is either // 'above' or 'below'. - StringTokenizer gcol = new StringTokenizer(colscheme, "|", true); + StringTokenizer gcol = new StringTokenizer(colscheme, "|", + true); // set defaults int threshtype = AnnotationColourGradient.NO_THRESHOLD; float min = Float.MIN_VALUE, max = Float.MAX_VALUE, threshval = Float.NaN; boolean labelCol = false; // Parse spec line String mincol = gcol.nextToken(); - if (mincol=="|") + if (mincol == "|") { System.err - .println("Expected either 'label' or a colour specification in the line: "+line ); + .println("Expected either 'label' or a colour specification in the line: " + + line); continue; } String maxcol = null; if (mincol.toLowerCase().indexOf("label") == 0) { labelCol = true; - mincol = (gcol.hasMoreTokens() ? gcol.nextToken() : null); // skip '|' + mincol = (gcol.hasMoreTokens() ? gcol.nextToken() : null); // skip + // '|' mincol = (gcol.hasMoreTokens() ? gcol.nextToken() : null); } String abso = null, minval, maxval; @@ -191,16 +194,20 @@ public class FeaturesFile extends AlignFile // at least four more tokens if (mincol.equals("|")) { - mincol=""; - } else { + mincol = ""; + } + else + { gcol.nextToken(); // skip next '|' } // continue parsing rest of line maxcol = gcol.nextToken(); if (maxcol.equals("|")) { - maxcol=""; - } else { + maxcol = ""; + } + else + { gcol.nextToken(); // skip next '|' } abso = gcol.nextToken(); @@ -216,7 +223,8 @@ public class FeaturesFile extends AlignFile gcol.nextToken(); // skip next '|' } maxval = gcol.nextToken(); - if (gcol.hasMoreTokens()) { + if (gcol.hasMoreTokens()) + { gcol.nextToken(); // skip next '|' } try diff --git a/src/jalview/io/FormatAdapter.java b/src/jalview/io/FormatAdapter.java index dec784b..79a9190 100755 --- a/src/jalview/io/FormatAdapter.java +++ b/src/jalview/io/FormatAdapter.java @@ -194,9 +194,9 @@ public class FormatAdapter extends AppletFormatAdapter { if (omitHidden != null) { - // - Alignment alv = new Alignment(replaceStrings(alignment - .getSequencesArray(), omitHidden)); + // + Alignment alv = new Alignment(replaceStrings( + alignment.getSequencesArray(), omitHidden)); AlignmentAnnotation[] ala = alignment.getAlignmentAnnotation(); if (ala != null) { @@ -205,8 +205,8 @@ public class FormatAdapter extends AppletFormatAdapter AlignmentAnnotation na = new AlignmentAnnotation(ala[i]); if (selgp != null) { - colSel.makeVisibleAnnotation(selgp.getStartRes(), selgp - .getEndRes(), na); + colSel.makeVisibleAnnotation(selgp.getStartRes(), + selgp.getEndRes(), na); } else { diff --git a/src/jalview/io/HTMLOutput.java b/src/jalview/io/HTMLOutput.java index ef917d1..f131ce6 100755 --- a/src/jalview/io/HTMLOutput.java +++ b/src/jalview/io/HTMLOutput.java @@ -43,10 +43,10 @@ public class HTMLOutput fr = new FeatureRenderer(ap); fr.transferSettings(fr1); - JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache - .getProperty("LAST_DIRECTORY"), new String[] - { "html" }, new String[] - { "HTML files" }, "HTML files"); + JalviewFileChooser chooser = new JalviewFileChooser( + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] + { "html" }, new String[] + { "HTML files" }, "HTML files"); chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle("Save as HTML"); @@ -109,8 +109,7 @@ public class HTMLOutput void drawUnwrappedAlignment(PrintWriter out) { out.println("
    \n"); - out - .println("\n"); + out.println("
    \n"); // //////////// SequenceI seq; @@ -182,8 +181,7 @@ public class HTMLOutput String b; out.println("
    \n"); - out - .println("\n"); + out.println("
    \n"); for (int startRes = 0; startRes < al.getWidth(); startRes += av .getWrappedWidth()) diff --git a/src/jalview/io/JPredFile.java b/src/jalview/io/JPredFile.java index 458fbba..f41c2c3 100755 --- a/src/jalview/io/JPredFile.java +++ b/src/jalview/io/JPredFile.java @@ -207,8 +207,8 @@ public class JPredFile extends AlignFile for (int j = 0; j < i; j++) { - scores.setElementAt((Object) ((Float) scores.elementAt(j)) - .toString(), j); + scores.setElementAt( + (Object) ((Float) scores.elementAt(j)).toString(), j); } scores.addElement((Object) ascore); @@ -296,8 +296,7 @@ public class JPredFile extends AlignFile } if ((newSeq.getName().startsWith("QUERY") || newSeq.getName() - .startsWith("align;")) - && (QuerySeqPosition == -1)) + .startsWith("align;")) && (QuerySeqPosition == -1)) { QuerySeqPosition = seqs.size(); } diff --git a/src/jalview/io/JalviewFileChooser.java b/src/jalview/io/JalviewFileChooser.java index 42a5fa9..acd24b3 100755 --- a/src/jalview/io/JalviewFileChooser.java +++ b/src/jalview/io/JalviewFileChooser.java @@ -265,9 +265,7 @@ public class JalviewFileChooser extends JFileChooser } }); - this - .setBorder(new javax.swing.border.TitledBorder( - "Recently Opened")); + this.setBorder(new javax.swing.border.TitledBorder("Recently Opened")); final JScrollPane scroller = new JScrollPane(list); scroller.setPreferredSize(new Dimension(130, 200)); diff --git a/src/jalview/io/JnetAnnotationMaker.java b/src/jalview/io/JnetAnnotationMaker.java index d7e901e..11f05b7 100755 --- a/src/jalview/io/JnetAnnotationMaker.java +++ b/src/jalview/io/JnetAnnotationMaker.java @@ -95,8 +95,8 @@ public class JnetAnnotationMaker { for (int j = 0; j < width; j++) { - annotations[gapmap[j]] = new Annotation("", "", preds[i] - .getCharAt(j), 0); + annotations[gapmap[j]] = new Annotation("", "", + preds[i].getCharAt(j), 0); } } else @@ -126,9 +126,9 @@ public class JnetAnnotationMaker { float value = new Float(preds[i].getCharAt(j) + "") .floatValue(); - annotations[gapmap[delMap[j]]] = new Annotation(preds[i] - .getCharAt(j) - + "", "", preds[i].getCharAt(j), value); + annotations[gapmap[delMap[j]]] = new Annotation( + preds[i].getCharAt(j) + "", "", + preds[i].getCharAt(j), value); } } } @@ -146,9 +146,8 @@ public class JnetAnnotationMaker { for (int j = 0; j < width; j++) { - annotations[gapmap[delMap[j]]] = new Annotation(preds[i] - .getCharAt(j) - + "", "", ' ', 0); + annotations[gapmap[delMap[j]]] = new Annotation( + preds[i].getCharAt(j) + "", "", ' ', 0); } } } diff --git a/src/jalview/io/NewickFile.java b/src/jalview/io/NewickFile.java index 5a5c9ac..b7df38f 100755 --- a/src/jalview/io/NewickFile.java +++ b/src/jalview/io/NewickFile.java @@ -215,8 +215,8 @@ public class NewickFile extends FileParse + " at position " + p + " ( " - + s.substring(((p - r) < 0) ? 0 : (p - r), ((p + r) > s - .length()) ? s.length() : (p + r)) + " )\n"; + + s.substring(((p - r) < 0) ? 0 : (p - r), + ((p + r) > s.length()) ? s.length() : (p + r)) + " )\n"; } // @tree annotations @@ -470,8 +470,8 @@ public class NewickFile extends FileParse } catch (Exception e) { Error = ErrorStringrange(Error, - "Can't parse bootstrap value", 4, ncp - + nbootstrap.matchedFrom(), nf); + "Can't parse bootstrap value", 4, + ncp + nbootstrap.matchedFrom(), nf); } } } @@ -488,8 +488,8 @@ public class NewickFile extends FileParse } catch (Exception e) { Error = ErrorStringrange(Error, - "Can't parse node distance value", 7, ncp - + ndist.matchedFrom(), nf); + "Can't parse node distance value", 7, + ncp + ndist.matchedFrom(), nf); } } diff --git a/src/jalview/io/PIRFile.java b/src/jalview/io/PIRFile.java index 6a5b473..ef06b0c 100755 --- a/src/jalview/io/PIRFile.java +++ b/src/jalview/io/PIRFile.java @@ -157,10 +157,8 @@ public class PIRFile extends AlignFile } else { - out - .append(s[i].getName() + " " - + (s[i].getEnd() - s[i].getStart() + 1) - + " residues\n"); + out.append(s[i].getName() + " " + + (s[i].getEnd() - s[i].getStart() + 1) + " residues\n"); } } } diff --git a/src/jalview/io/StockholmFile.java b/src/jalview/io/StockholmFile.java index 04b1f87..34ce3bf 100644 --- a/src/jalview/io/StockholmFile.java +++ b/src/jalview/io/StockholmFile.java @@ -363,8 +363,8 @@ public class StockholmFile extends AlignFile if (x.search(annContent)) { // parse out and create alignment annotation directly. - parseAnnotationRow(annotations, x.stringMatched(1), x - .stringMatched(2)); + parseAnnotationRow(annotations, x.stringMatched(1), + x.stringMatched(2)); } } else if (annType.equals("GR")) diff --git a/src/jalview/io/VamsasAppDatastore.java b/src/jalview/io/VamsasAppDatastore.java index 108bcb7..06154c8 100644 --- a/src/jalview/io/VamsasAppDatastore.java +++ b/src/jalview/io/VamsasAppDatastore.java @@ -424,8 +424,8 @@ public class VamsasAppDatastore { boolean modified = false; // check existing sequences in local and in document. - Vector docseqs = new Vector(alignment - .getAlignmentSequenceAsReference()); + Vector docseqs = new Vector( + alignment.getAlignmentSequenceAsReference()); for (int i = 0; i < jal.getHeight(); i++) { modified |= syncToAlignmentSequence(jal.getSequenceAt(i), @@ -633,11 +633,9 @@ public class VamsasAppDatastore if (aa[i].annotations[a].secondaryStructure != ' ') { Glyph ss = new Glyph(); - ss - .setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE); - ss - .setContent(String - .valueOf(aa[i].annotations[a].secondaryStructure)); + ss.setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE); + ss.setContent(String + .valueOf(aa[i].annotations[a].secondaryStructure)); ae.addGlyph(ss); } an.addAnnotationElement(ae); @@ -657,10 +655,8 @@ public class VamsasAppDatastore an.setGroup(Integer.toString(aa[i].graphGroup)); if (aa[i].threshold != null && aa[i].threshold.displayed) { - an - .addProperty(Properties.newProperty(THRESHOLD, - Properties.FLOATTYPE, "" - + aa[i].threshold.value)); + an.addProperty(Properties.newProperty(THRESHOLD, + Properties.FLOATTYPE, "" + aa[i].threshold.value)); if (aa[i].threshold.label != null) { an.addProperty(Properties.newProperty(THRESHOLD @@ -708,8 +704,8 @@ public class VamsasAppDatastore { TreePanel tp = (TreePanel) frames[t]; - if (tp.getViewPort().getSequenceSetId().equals( - av.getSequenceSetId())) + if (tp.getViewPort().getSequenceSetId() + .equals(av.getSequenceSetId())) { DatastoreItem vtree = new jalview.io.vamsas.Tree(this, tp, jal, alignment); @@ -936,8 +932,8 @@ public class VamsasAppDatastore else { alseq = new jalview.datamodel.Sequence(valseq.getName(), valseq - .getSequence().replace(valGapchar, gapChar), (int) valseq - .getStart(), (int) valseq.getEnd()); + .getSequence().replace(valGapchar, gapChar), + (int) valseq.getStart(), (int) valseq.getEnd()); Vobject datsetseq = (Vobject) valseq.getRefid(); if (datsetseq != null) @@ -1037,8 +1033,7 @@ public class VamsasAppDatastore { // we only write an annotation where it really exists. Glyph ss = new Glyph(); - ss - .setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE); + ss.setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE); ss.setContent(String .valueOf(alan.annotations[a].secondaryStructure)); ae.addGlyph(ss); @@ -1512,8 +1507,7 @@ public class VamsasAppDatastore { // TODO raise GUI warning if user requests it. jalview.bin.Cache.log - .error( - "Couldn't update jalview client application data. Giving up - local settings probably lost.", + .error("Couldn't update jalview client application data. Giving up - local settings probably lost.", e); } } @@ -1720,8 +1714,7 @@ public class VamsasAppDatastore AlignmentSequence valseq = alignment.getAlignmentSequence(i); jalview.datamodel.Sequence alseq = (jalview.datamodel.Sequence) getvObj2jv(valseq); if (syncFromAlignmentSequence(valseq, valGapchar, gapChar, - dsseqs) - && alseq != null) + dsseqs) && alseq != null) { // updated to sequence from the document @@ -1867,8 +1860,10 @@ public class VamsasAppDatastore .toString()); av = alignFrame.getViewport(); newAlignmentViews.addElement(av); - String title = alignment.getProvenance().getEntry( - alignment.getProvenance().getEntryCount() - 1) + String title = alignment + .getProvenance() + .getEntry( + alignment.getProvenance().getEntryCount() - 1) .getAction(); if (alignment.getPropertyCount() > 0) { @@ -2059,16 +2054,14 @@ public class VamsasAppDatastore { if (glyphs[g] .getDict() - .equals( - uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE)) + .equals(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE)) { ss = glyphs[g].getContent(); AeContent[HASSECSTR] = true; } else if (glyphs[g] .getDict() - .equals( - uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_HD_HYDRO)) + .equals(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_HD_HYDRO)) { Cache.log.debug("ignoring hydrophobicity glyph marker."); AeContent[HASHPHOB] = true; @@ -2107,14 +2100,14 @@ public class VamsasAppDatastore if (colour == null) { anot[row][pos] = new jalview.datamodel.Annotation( - (dc != null) ? dc : "", desc, (ss != null) ? ss - .charAt(0) : ' ', val); + (dc != null) ? dc : "", desc, + (ss != null) ? ss.charAt(0) : ' ', val); } else { anot[row][pos] = new jalview.datamodel.Annotation( - (dc != null) ? dc : "", desc, (ss != null) ? ss - .charAt(0) : ' ', val, colour); + (dc != null) ? dc : "", desc, + (ss != null) ? ss.charAt(0) : ' ', val, colour); } } else diff --git a/src/jalview/io/WSWUBlastClient.java b/src/jalview/io/WSWUBlastClient.java index 81b4e55..8fbf002 100755 --- a/src/jalview/io/WSWUBlastClient.java +++ b/src/jalview/io/WSWUBlastClient.java @@ -56,13 +56,12 @@ public class WSWUBlastClient { this.ap = ap; this.al = al; - output - .setText("To display sequence features an exact Uniprot id with 100% sequence identity match must be entered." - + "\nIn order to display these features, try changing the names of your sequences to the ids suggested below." - + "\n\nRunning WSWUBlast at EBI." - + "\nPlease quote Pillai S., Silventoinen V., Kallio K., Senger M., Sobhany S., Tate J., Velankar S., Golovin A., Henrick K., Rice P., Stoehr P., Lopez R." - + "\nSOAP-based services provided by the European Bioinformatics Institute." - + "\nNucleic Acids Res. 33(1):W25-W28 (2005));"); + output.setText("To display sequence features an exact Uniprot id with 100% sequence identity match must be entered." + + "\nIn order to display these features, try changing the names of your sequences to the ids suggested below." + + "\n\nRunning WSWUBlast at EBI." + + "\nPlease quote Pillai S., Silventoinen V., Kallio K., Senger M., Sobhany S., Tate J., Velankar S., Golovin A., Henrick K., Rice P., Stoehr P., Lopez R." + + "\nSOAP-based services provided by the European Bioinformatics Institute." + + "\nNucleic Acids Res. 33(1):W25-W28 (2005));"); Desktop.addInternalFrame(output, "BLASTing for unidentified sequences ", 800, 300); @@ -286,8 +285,8 @@ public class WSWUBlastClient Data inputs[] = new Data[1]; Data input = new Data(); input.setType("sequence"); - input.setContent(AlignSeq.extractGaps("-. ", sequence - .getSequenceAsString())); + input.setContent(AlignSeq.extractGaps("-. ", + sequence.getSequenceAsString())); inputs[0] = input; WSWUBlastService service = new WSWUBlastServiceLocator(); diff --git a/src/jalview/io/vamsas/Datasetsequence.java b/src/jalview/io/vamsas/Datasetsequence.java index 88caf46..7af8a7b 100644 --- a/src/jalview/io/vamsas/Datasetsequence.java +++ b/src/jalview/io/vamsas/Datasetsequence.java @@ -61,8 +61,8 @@ public class Datasetsequence extends DatastoreItem public void addFromDocument() { Sequence vseq = (Sequence) vobj; - SequenceI dsseq = new jalview.datamodel.Sequence(vseq.getName(), vseq - .getSequence(), (int) vseq.getStart(), (int) vseq.getEnd()); + SequenceI dsseq = new jalview.datamodel.Sequence(vseq.getName(), + vseq.getSequence(), (int) vseq.getStart(), (int) vseq.getEnd()); dsseq.setDescription(vseq.getDescription()); bindjvvobj(dsseq, vseq); dsseq.setVamsasId(vseq.getVorbaId().getId()); @@ -76,8 +76,7 @@ public class Datasetsequence extends DatastoreItem SequenceI sequence = (SequenceI) jvobj; if (!sequence.getSequenceAsString().equals(sq.getSequence())) { - log - .warn("Potential Client Error ! - mismatch of dataset sequence: and jalview internal dataset sequence."); + log.warn("Potential Client Error ! - mismatch of dataset sequence: and jalview internal dataset sequence."); } else { @@ -217,8 +216,7 @@ public class Datasetsequence extends DatastoreItem public void conflict() { - log - .warn("Conflict in dataset sequence update to document. Overwriting document"); + log.warn("Conflict in dataset sequence update to document. Overwriting document"); // TODO: could try to import from document data to jalview first. and then updateToDoc(); } diff --git a/src/jalview/io/vamsas/DatastoreItem.java b/src/jalview/io/vamsas/DatastoreItem.java index d37e845..f2d49e7 100644 --- a/src/jalview/io/vamsas/DatastoreItem.java +++ b/src/jalview/io/vamsas/DatastoreItem.java @@ -381,8 +381,8 @@ public abstract class DatastoreItem { datastore = ds; dsReg = ds.getDatastoreRegisty(); - initDatastoreItem(ds.getProvEntry(), ds.getClientDocument(), ds - .getVamsasObjectBinding(), ds.getJvObjectBinding()); + initDatastoreItem(ds.getProvEntry(), ds.getClientDocument(), + ds.getVamsasObjectBinding(), ds.getJvObjectBinding()); } private void initDatastoreItem(Entry provEntry, IClientDocument cdoc, diff --git a/src/jalview/io/vamsas/Dbref.java b/src/jalview/io/vamsas/Dbref.java index e247d9c..28ae762 100644 --- a/src/jalview/io/vamsas/Dbref.java +++ b/src/jalview/io/vamsas/Dbref.java @@ -103,8 +103,7 @@ public class Dbref extends Rangetype */ private void updateMapTo(jalview.datamodel.Mapping mp) { - log - .info("Performing updateMapTo remove this message when we know what we're doing."); + log.info("Performing updateMapTo remove this message when we know what we're doing."); // TODO determine how sequences associated with database mappings are stored // in the document if (mp != null && mp.getTo() != null) @@ -127,7 +126,7 @@ public class Dbref extends Rangetype : uk.ac.vamsas.objects.utils.SymbolDictionary.STANDARD_AA), ds); } - // + // // TODO: NOW add a mapping between new dataset sequence and sequence // associated with the database reference diff --git a/src/jalview/io/vamsas/Sequencefeature.java b/src/jalview/io/vamsas/Sequencefeature.java index f044abc..0525cf9 100644 --- a/src/jalview/io/vamsas/Sequencefeature.java +++ b/src/jalview/io/vamsas/Sequencefeature.java @@ -250,8 +250,7 @@ public class Sequencefeature extends Rangetype else if (vlu instanceof Integer) { valid = true; - nprop - .setType(uk.ac.vamsas.objects.utils.Properties.INTEGERTYPE); + nprop.setType(uk.ac.vamsas.objects.utils.Properties.INTEGERTYPE); } else if (vlu instanceof Float) { @@ -279,9 +278,9 @@ public class Sequencefeature extends Rangetype private SequenceFeature getJalviewSeqFeature(RangeAnnotation dseta) { int[] se = getBounds(dseta); - SequenceFeature sf = new jalview.datamodel.SequenceFeature(dseta - .getType(), dseta.getDescription(), dseta.getStatus(), se[0], - se[1], dseta.getGroup()); + SequenceFeature sf = new jalview.datamodel.SequenceFeature( + dseta.getType(), dseta.getDescription(), dseta.getStatus(), + se[0], se[1], dseta.getGroup()); if (dseta.getLinkCount() > 0) { Link[] links = dseta.getLink(); diff --git a/src/jalview/io/vamsas/Sequencemapping.java b/src/jalview/io/vamsas/Sequencemapping.java index 8223123..9263690 100644 --- a/src/jalview/io/vamsas/Sequencemapping.java +++ b/src/jalview/io/vamsas/Sequencemapping.java @@ -346,9 +346,9 @@ public class Sequencemapping extends Rangetype if (!sense) { mapping = this.parsemapType(sequenceMapping, 1, 3); // invert sense - mapping = new jalview.util.MapList(mapping.getToRanges(), mapping - .getFromRanges(), mapping.getToRatio(), mapping - .getFromRatio()); + mapping = new jalview.util.MapList(mapping.getToRanges(), + mapping.getFromRanges(), mapping.getToRatio(), + mapping.getFromRatio()); afc.addMap(to, from, mapping); } else diff --git a/src/jalview/io/vamsas/Tree.java b/src/jalview/io/vamsas/Tree.java index 2a62df4..9b76f91 100644 --- a/src/jalview/io/vamsas/Tree.java +++ b/src/jalview/io/vamsas/Tree.java @@ -155,8 +155,7 @@ public class Tree extends DatastoreItem else { // handle conflict - log - .info("TODO: Add the locally modified tree in Jalview as a new tree in document, leaving locked tree unchanged."); + log.info("TODO: Add the locally modified tree in Jalview as a new tree in document, leaving locked tree unchanged."); } } @@ -220,8 +219,8 @@ public class Tree extends DatastoreItem // or just correctly resolve the tree's seqData to the correct alignment // in // the document. - Vector alsqrefs = getjv2vObjs(findAlignmentSequences(jal, tp - .getTree().seqData.getSequences())); + Vector alsqrefs = getjv2vObjs(findAlignmentSequences(jal, + tp.getTree().seqData.getSequences())); Object[] alsqs = new Object[alsqrefs.size()]; alsqrefs.copyInto(alsqs); vInput.setObjRef(alsqs); @@ -347,9 +346,7 @@ public class Tree extends DatastoreItem else { leaf.setPlaceholder(true); - leaf - .setElement(new Sequence(leaf.getName(), - "THISISAPLACEHLDER")); + leaf.setElement(new Sequence(leaf.getName(), "THISISAPLACEHLDER")); } } } diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index af7766a..9260b23 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -363,8 +363,7 @@ public class GAlignFrame extends JInternalFrame if (evt.isControlDown() || SwingUtilities.isRightMouseButton(evt)) { - radioItem - .removeActionListener(radioItem.getActionListeners()[0]); + radioItem.removeActionListener(radioItem.getActionListeners()[0]); int option = JOptionPane.showInternalConfirmDialog( jalview.gui.Desktop.desktop, @@ -492,7 +491,7 @@ public class GAlignFrame extends JInternalFrame default: noColourmenuItem.setSelected(true); break; - + } } diff --git a/src/jalview/jbgui/GPCAPanel.java b/src/jalview/jbgui/GPCAPanel.java index d45edd6..e4b20a0 100755 --- a/src/jalview/jbgui/GPCAPanel.java +++ b/src/jalview/jbgui/GPCAPanel.java @@ -56,8 +56,9 @@ public class GPCAPanel extends JInternalFrame JMenuItem print = new JMenuItem(); JMenuItem outputValues = new JMenuItem(); - + JMenuItem outputPoints = new JMenuItem(); + JMenuItem outputProjPoints = new JMenuItem(); protected JMenu viewMenu = new JMenu(); @@ -242,13 +243,13 @@ public class GPCAPanel extends JInternalFrame protected void outputPoints_actionPerformed(ActionEvent e) { // TODO Auto-generated method stub - + } protected void outputProjPoints_actionPerformed(ActionEvent e) { // TODO Auto-generated method stub - + } protected void xCombobox_actionPerformed(ActionEvent e) diff --git a/src/jalview/jbgui/GPreferences.java b/src/jalview/jbgui/GPreferences.java index 7205773..aaa73a1 100755 --- a/src/jalview/jbgui/GPreferences.java +++ b/src/jalview/jbgui/GPreferences.java @@ -186,7 +186,7 @@ public class GPreferences extends JPanel protected JCheckBox modellerOutput = new JCheckBox(); protected JPanel dasPanel = new JPanel(); - + BorderLayout borderLayout4 = new BorderLayout(); protected JPanel wsPanel = new JPanel(); @@ -228,9 +228,6 @@ public class GPreferences extends JPanel protected JCheckBox shareSelections = new JCheckBox(); protected JCheckBox followHighlight = new JCheckBox(); - - - /** * Creates a new GPreferences object. diff --git a/src/jalview/jbgui/GStructureViewer.java b/src/jalview/jbgui/GStructureViewer.java index 0fb2c4c..26bdad2 100644 --- a/src/jalview/jbgui/GStructureViewer.java +++ b/src/jalview/jbgui/GStructureViewer.java @@ -227,7 +227,7 @@ public class GStructureViewer extends JInternalFrame colourButtons.add(turnColour); colourButtons.add(buriedColour); colourButtons.add(userColour); - + helpMenu.add(jmolHelp); jmolActionMenu.add(alignStructs); } diff --git a/src/jalview/jbgui/GUserDefinedColours.java b/src/jalview/jbgui/GUserDefinedColours.java index e213f01..6085b64 100755 --- a/src/jalview/jbgui/GUserDefinedColours.java +++ b/src/jalview/jbgui/GUserDefinedColours.java @@ -177,9 +177,8 @@ public class GUserDefinedColours extends JPanel label.setFont(new java.awt.Font("Verdana", Font.ITALIC, 10)); label.setOpaque(false); label.setPreferredSize(new Dimension(260, 34)); - label - .setText("Save your colour scheme with a unique name and it will be added " - + "to the Colour menu."); + label.setText("Save your colour scheme with a unique name and it will be added " + + "to the Colour menu."); caseSensitive.setText("Case Sensitive"); caseSensitive.addActionListener(new ActionListener() { diff --git a/src/jalview/jbgui/GWsPreferences.java b/src/jalview/jbgui/GWsPreferences.java index 9505457..2b30f47 100644 --- a/src/jalview/jbgui/GWsPreferences.java +++ b/src/jalview/jbgui/GWsPreferences.java @@ -72,18 +72,19 @@ public class GWsPreferences extends JPanel protected JCheckBox enableEnfinServices = new JCheckBox(); protected JButton refreshWs = new JButton(); + protected JButton resetWs = new JButton(); - + protected JProgressBar progressBar = new JProgressBar(); JScrollPane wsListPane = new JScrollPane(); - + JPanel wsListUrlPanel = new JPanel(); - + JPanel wsListPanel = new JPanel(); JPanel wsListButtons = new JPanel(); - + JPanel wsListNavButs = new JPanel(); BorderLayout myBorderlayout = new BorderLayout(); @@ -97,7 +98,9 @@ public class GWsPreferences extends JPanel GridBagLayout wsMenuLayout = new GridBagLayout(); JPanel wsMenuButtons = new JPanel(); + JPanel wsMenuRefreshButs = new JPanel(); + public GWsPreferences() { jbInit(); @@ -117,7 +120,7 @@ public class GWsPreferences extends JPanel }); resetWs.setFont(new java.awt.Font("Verdana", Font.PLAIN, 10)); resetWs.setText("Reset Services"); - + resetWs.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -225,30 +228,31 @@ public class GWsPreferences extends JPanel }); setLayout(myBorderlayout); - setPreferredSize(new Dimension(500,400)); + setPreferredSize(new Dimension(500, 400)); progressBar.setPreferredSize(new Dimension(450, 20)); progressBar.setString(""); wsListUrlPanel.setBorder(BorderFactory.createEtchedBorder()); wsListUrlPanel.setLayout(new BorderLayout()); -// wsListUrlPanel.setPreferredSize(new Dimension(482,202)); + // wsListUrlPanel.setPreferredSize(new Dimension(482,202)); wsListPane.setBorder(BorderFactory.createEtchedBorder()); wsListPane.getViewport().add(wsList); wsListPane.setPreferredSize(new Dimension(380, 200)); wsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); - wsList.addMouseListener(new MouseListener() { + wsList.addMouseListener(new MouseListener() + { public void mouseClicked(MouseEvent e) { - if (e.getClickCount()>1) + if (e.getClickCount() > 1) { editWsUrl_actionPerformed(null); } - + } public void mouseEntered(MouseEvent e) { - + } public void mouseExited(MouseEvent e) @@ -257,54 +261,54 @@ public class GWsPreferences extends JPanel public void mousePressed(MouseEvent e) { - + } public void mouseReleased(MouseEvent e) { - + } - + }); -// wsListButtons.setPreferredSize(new Dimension(480, 60)); + // wsListButtons.setPreferredSize(new Dimension(480, 60)); wsListButtons.setLayout(new FlowLayout()); - //wsListButtons.add(moveWsUrlUp); - //wsListButtons.add(moveWsUrlDown); + // wsListButtons.add(moveWsUrlUp); + // wsListButtons.add(moveWsUrlDown); wsListButtons.add(newWsUrl); wsListButtons.add(editWsUrl); wsListButtons.add(deleteWsUrl); - wsListNavButs.setSize(new Dimension(80,80)); - wsListNavButs.setPreferredSize(new Dimension(80,80)); + wsListNavButs.setSize(new Dimension(80, 80)); + wsListNavButs.setPreferredSize(new Dimension(80, 80)); wsListNavButs.setLayout(new FlowLayout()); wsListNavButs.add(moveWsUrlUp); wsListNavButs.add(moveWsUrlDown); - wsListUrlPanel.add(wsListPane,BorderLayout.EAST); - wsListUrlPanel.add(wsListNavButs,BorderLayout.WEST); + wsListUrlPanel.add(wsListPane, BorderLayout.EAST); + wsListUrlPanel.add(wsListNavButs, BorderLayout.WEST); wsListPanel.setBorder(wsListTitleBorder); wsListPanel.setLayout(new BorderLayout()); wsListPanel.add(wsListUrlPanel, BorderLayout.NORTH); wsListPanel.add(wsListButtons, BorderLayout.SOUTH); - wsMenuButtons.setLayout(new GridLayout(2,3)); + wsMenuButtons.setLayout(new GridLayout(2, 3)); wsMenuButtons.add(indexByHost); wsMenuButtons.add(indexByType); wsMenuButtons.add(enableJws1Services); wsMenuButtons.add(enableJws2Services); wsMenuButtons.add(enableEnfinServices); wsMenuRefreshButs.setLayout(new FlowLayout()); - wsMenuRefreshButs.setPreferredSize(new Dimension(480,30)); - wsMenuRefreshButs.setSize(new Dimension(480,30)); - wsMenuRefreshButs.add(refreshWs,null); - wsMenuRefreshButs.add(resetWs,null); - wsMenuRefreshButs.add(progressBar,null); + wsMenuRefreshButs.setPreferredSize(new Dimension(480, 30)); + wsMenuRefreshButs.setSize(new Dimension(480, 30)); + wsMenuRefreshButs.add(refreshWs, null); + wsMenuRefreshButs.add(resetWs, null); + wsMenuRefreshButs.add(progressBar, null); myBorderlayout.setHgap(3); - add(wsListPanel,BorderLayout.NORTH); - add(wsMenuButtons,BorderLayout.CENTER); + add(wsListPanel, BorderLayout.NORTH); + add(wsMenuButtons, BorderLayout.CENTER); add(wsMenuRefreshButs, BorderLayout.SOUTH); } protected void resetWs_actionPerformed(ActionEvent e) { - + } protected void indexByType_actionPerformed(ActionEvent e) diff --git a/src/jalview/schemabinding/version2/WebServiceParameterSet.java b/src/jalview/schemabinding/version2/WebServiceParameterSet.java index 7120203..6c7c211 100644 --- a/src/jalview/schemabinding/version2/WebServiceParameterSet.java +++ b/src/jalview/schemabinding/version2/WebServiceParameterSet.java @@ -17,8 +17,8 @@ */ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -29,421 +29,418 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class WebServiceParameterSet implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * The short name for the parameter set. This will be shown - * amongst the - * other presets for the web service. - * - */ - private java.lang.String _name; - - /** - * A Jalview Web Service Parameter Set container - * version number. - * Version 1 created for storing Jaba user presets. - * - */ - private java.lang.String _version; - - /** - * Short description - as utf8 encoded text. This is - * usually displayed - * in the body of an HTML capable tooltip, so HTML tags may be - * embedded - * using standard UTF8 encoding. - * - */ - private java.lang.String _description; - - /** - * URL for which the parameter set is valid. Jalview will use - * it to - * match up parameter sets to service instances that can parse - * the - * parameter set payload. - * - */ - private java.util.Vector _serviceURLList; - - /** - * UTF8 encoded string to be processed into a specific web - * services' - * parameter set. Note - newlines may be important to the - * structure - * of this file. - * - */ - private java.lang.String _parameters; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public WebServiceParameterSet() { - super(); - this._serviceURLList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vServiceURL - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addServiceURL( - final java.lang.String vServiceURL) - throws java.lang.IndexOutOfBoundsException { - this._serviceURLList.addElement(vServiceURL); +public class WebServiceParameterSet implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * The short name for the parameter set. This will be shown amongst the other + * presets for the web service. + * + */ + private java.lang.String _name; + + /** + * A Jalview Web Service Parameter Set container version number. Version 1 + * created for storing Jaba user presets. + * + */ + private java.lang.String _version; + + /** + * Short description - as utf8 encoded text. This is usually displayed in the + * body of an HTML capable tooltip, so HTML tags may be embedded using + * standard UTF8 encoding. + * + */ + private java.lang.String _description; + + /** + * URL for which the parameter set is valid. Jalview will use it to match up + * parameter sets to service instances that can parse the parameter set + * payload. + * + */ + private java.util.Vector _serviceURLList; + + /** + * UTF8 encoded string to be processed into a specific web services' parameter + * set. Note - newlines may be important to the structure of this file. + * + */ + private java.lang.String _parameters; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public WebServiceParameterSet() + { + super(); + this._serviceURLList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vServiceURL + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addServiceURL(final java.lang.String vServiceURL) + throws java.lang.IndexOutOfBoundsException + { + this._serviceURLList.addElement(vServiceURL); + } + + /** + * + * + * @param index + * @param vServiceURL + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addServiceURL(final int index, + final java.lang.String vServiceURL) + throws java.lang.IndexOutOfBoundsException + { + this._serviceURLList.add(index, vServiceURL); + } + + /** + * Method enumerateServiceURL. + * + * @return an Enumeration over all java.lang.String elements + */ + public java.util.Enumeration enumerateServiceURL() + { + return this._serviceURLList.elements(); + } + + /** + * Returns the value of field 'description'. The field 'description' has the + * following description: Short description - as utf8 encoded text. This is + * usually displayed in the body of an HTML capable tooltip, so HTML tags may + * be embedded using standard UTF8 encoding. + * + * + * @return the value of field 'Description'. + */ + public java.lang.String getDescription() + { + return this._description; + } + + /** + * Returns the value of field 'name'. The field 'name' has the following + * description: The short name for the parameter set. This will be shown + * amongst the other presets for the web service. + * + * + * @return the value of field 'Name'. + */ + public java.lang.String getName() + { + return this._name; + } + + /** + * Returns the value of field 'parameters'. The field 'parameters' has the + * following description: UTF8 encoded string to be processed into a specific + * web services' parameter set. Note - newlines may be important to the + * structure of this file. + * + * + * @return the value of field 'Parameters'. + */ + public java.lang.String getParameters() + { + return this._parameters; + } + + /** + * Method getServiceURL. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the java.lang.String at the given index + */ + public java.lang.String getServiceURL(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._serviceURLList.size()) + { + throw new IndexOutOfBoundsException("getServiceURL: Index value '" + + index + "' not in range [0.." + + (this._serviceURLList.size() - 1) + "]"); } - /** - * - * - * @param index - * @param vServiceURL - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addServiceURL( - final int index, - final java.lang.String vServiceURL) - throws java.lang.IndexOutOfBoundsException { - this._serviceURLList.add(index, vServiceURL); + return (java.lang.String) _serviceURLList.get(index); + } + + /** + * Method getServiceURL.Returns the contents of the collection in an Array. + *

    + * Note: Just in case the collection contents are changing in another thread, + * we pass a 0-length Array of the correct type into the API call. This way we + * know that the Array returned is of exactly the correct length. + * + * @return this collection as an Array + */ + public java.lang.String[] getServiceURL() + { + java.lang.String[] array = new java.lang.String[0]; + return (java.lang.String[]) this._serviceURLList.toArray(array); + } + + /** + * Method getServiceURLCount. + * + * @return the size of this collection + */ + public int getServiceURLCount() + { + return this._serviceURLList.size(); + } + + /** + * Returns the value of field 'version'. The field 'version' has the following + * description: A Jalview Web Service Parameter Set container version number. + * Version 1 created for storing Jaba user presets. + * + * + * @return the value of field 'Version'. + */ + public java.lang.String getVersion() + { + return this._version; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } - - /** - * Method enumerateServiceURL. - * - * @return an Enumeration over all java.lang.String elements - */ - public java.util.Enumeration enumerateServiceURL( - ) { - return this._serviceURLList.elements(); - } - - /** - * Returns the value of field 'description'. The field - * 'description' has the following description: Short - * description - as utf8 encoded text. This is - * usually displayed - * in the body of an HTML capable tooltip, so HTML tags may be - * embedded - * using standard UTF8 encoding. - * - * - * @return the value of field 'Description'. - */ - public java.lang.String getDescription( - ) { - return this._description; - } - - /** - * Returns the value of field 'name'. The field 'name' has the - * following description: The short name for the parameter set. - * This will be shown amongst the - * other presets for the web service. - * - * - * @return the value of field 'Name'. - */ - public java.lang.String getName( - ) { - return this._name; - } - - /** - * Returns the value of field 'parameters'. The field - * 'parameters' has the following description: UTF8 encoded - * string to be processed into a specific web services' - * parameter set. Note - newlines may be important to the - * structure - * of this file. - * - * - * @return the value of field 'Parameters'. - */ - public java.lang.String getParameters( - ) { - return this._parameters; - } - - /** - * Method getServiceURL. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the java.lang.String at the given index - */ - public java.lang.String getServiceURL( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._serviceURLList.size()) { - throw new IndexOutOfBoundsException("getServiceURL: Index value '" + index + "' not in range [0.." + (this._serviceURLList.size() - 1) + "]"); - } - - return (java.lang.String) _serviceURLList.get(index); - } - - /** - * Method getServiceURL.Returns the contents of the collection - * in an Array.

    Note: Just in case the collection contents - * are changing in another thread, we pass a 0-length Array of - * the correct type into the API call. This way we know - * that the Array returned is of exactly the correct length. - * - * @return this collection as an Array - */ - public java.lang.String[] getServiceURL( - ) { - java.lang.String[] array = new java.lang.String[0]; - return (java.lang.String[]) this._serviceURLList.toArray(array); - } - - /** - * Method getServiceURLCount. - * - * @return the size of this collection - */ - public int getServiceURLCount( - ) { - return this._serviceURLList.size(); - } - - /** - * Returns the value of field 'version'. The field 'version' - * has the following description: A Jalview Web Service - * Parameter Set container - * version number. - * Version 1 created for storing Jaba user presets. - * - * - * @return the value of field 'Version'. + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** */ - public java.lang.String getVersion( - ) { - return this._version; + public void removeAllServiceURL() + { + this._serviceURLList.clear(); + } + + /** + * Method removeServiceURL. + * + * @param vServiceURL + * @return true if the object was removed from the collection. + */ + public boolean removeServiceURL(final java.lang.String vServiceURL) + { + boolean removed = _serviceURLList.remove(vServiceURL); + return removed; + } + + /** + * Method removeServiceURLAt. + * + * @param index + * @return the element removed from the collection + */ + public java.lang.String removeServiceURLAt(final int index) + { + java.lang.Object obj = this._serviceURLList.remove(index); + return (java.lang.String) obj; + } + + /** + * Sets the value of field 'description'. The field 'description' has the + * following description: Short description - as utf8 encoded text. This is + * usually displayed in the body of an HTML capable tooltip, so HTML tags may + * be embedded using standard UTF8 encoding. + * + * + * @param description + * the value of field 'description'. + */ + public void setDescription(final java.lang.String description) + { + this._description = description; + } + + /** + * Sets the value of field 'name'. The field 'name' has the following + * description: The short name for the parameter set. This will be shown + * amongst the other presets for the web service. + * + * + * @param name + * the value of field 'name'. + */ + public void setName(final java.lang.String name) + { + this._name = name; + } + + /** + * Sets the value of field 'parameters'. The field 'parameters' has the + * following description: UTF8 encoded string to be processed into a specific + * web services' parameter set. Note - newlines may be important to the + * structure of this file. + * + * + * @param parameters + * the value of field 'parameters'. + */ + public void setParameters(final java.lang.String parameters) + { + this._parameters = parameters; + } + + /** + * + * + * @param index + * @param vServiceURL + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setServiceURL(final int index, + final java.lang.String vServiceURL) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._serviceURLList.size()) + { + throw new IndexOutOfBoundsException("setServiceURL: Index value '" + + index + "' not in range [0.." + + (this._serviceURLList.size() - 1) + "]"); } - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - */ - public void removeAllServiceURL( - ) { - this._serviceURLList.clear(); - } - - /** - * Method removeServiceURL. - * - * @param vServiceURL - * @return true if the object was removed from the collection. - */ - public boolean removeServiceURL( - final java.lang.String vServiceURL) { - boolean removed = _serviceURLList.remove(vServiceURL); - return removed; - } - - /** - * Method removeServiceURLAt. - * - * @param index - * @return the element removed from the collection - */ - public java.lang.String removeServiceURLAt( - final int index) { - java.lang.Object obj = this._serviceURLList.remove(index); - return (java.lang.String) obj; - } - - /** - * Sets the value of field 'description'. The field - * 'description' has the following description: Short - * description - as utf8 encoded text. This is - * usually displayed - * in the body of an HTML capable tooltip, so HTML tags may be - * embedded - * using standard UTF8 encoding. - * - * - * @param description the value of field 'description'. - */ - public void setDescription( - final java.lang.String description) { - this._description = description; - } - - /** - * Sets the value of field 'name'. The field 'name' has the - * following description: The short name for the parameter set. - * This will be shown amongst the - * other presets for the web service. - * - * - * @param name the value of field 'name'. - */ - public void setName( - final java.lang.String name) { - this._name = name; - } - - /** - * Sets the value of field 'parameters'. The field 'parameters' - * has the following description: UTF8 encoded string to be - * processed into a specific web services' - * parameter set. Note - newlines may be important to the - * structure - * of this file. - * - * - * @param parameters the value of field 'parameters'. - */ - public void setParameters( - final java.lang.String parameters) { - this._parameters = parameters; - } - - /** - * - * - * @param index - * @param vServiceURL - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setServiceURL( - final int index, - final java.lang.String vServiceURL) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._serviceURLList.size()) { - throw new IndexOutOfBoundsException("setServiceURL: Index value '" + index + "' not in range [0.." + (this._serviceURLList.size() - 1) + "]"); - } - - this._serviceURLList.set(index, vServiceURL); - } - - /** - * - * - * @param vServiceURLArray - */ - public void setServiceURL( - final java.lang.String[] vServiceURLArray) { - //-- copy array - _serviceURLList.clear(); - - for (int i = 0; i < vServiceURLArray.length; i++) { - this._serviceURLList.add(vServiceURLArray[i]); - } - } - - /** - * Sets the value of field 'version'. The field 'version' has - * the following description: A Jalview Web Service Parameter - * Set container - * version number. - * Version 1 created for storing Jaba user presets. - * - * - * @param version the value of field 'version'. - */ - public void setVersion( - final java.lang.String version) { - this._version = version; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled - * jalview.schemabinding.version2.WebServiceParameterSet - */ - public static jalview.schemabinding.version2.WebServiceParameterSet unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.WebServiceParameterSet) Unmarshaller.unmarshal(jalview.schemabinding.version2.WebServiceParameterSet.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); + this._serviceURLList.set(index, vServiceURL); + } + + /** + * + * + * @param vServiceURLArray + */ + public void setServiceURL(final java.lang.String[] vServiceURLArray) + { + // -- copy array + _serviceURLList.clear(); + + for (int i = 0; i < vServiceURLArray.length; i++) + { + this._serviceURLList.add(vServiceURLArray[i]); } + } + + /** + * Sets the value of field 'version'. The field 'version' has the following + * description: A Jalview Web Service Parameter Set container version number. + * Version 1 created for storing Jaba user presets. + * + * + * @param version + * the value of field 'version'. + */ + public void setVersion(final java.lang.String version) + { + this._version = version; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled + * jalview.schemabinding.version2.WebServiceParameterSet + */ + public static jalview.schemabinding.version2.WebServiceParameterSet unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.WebServiceParameterSet) Unmarshaller + .unmarshal( + jalview.schemabinding.version2.WebServiceParameterSet.class, + reader); + } + + /** + * + * + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void validate() throws org.exolab.castor.xml.ValidationException + { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); + } } diff --git a/src/jalview/schemabinding/version2/descriptors/AlcodonFrameDescriptor.java b/src/jalview/schemabinding/version2/descriptors/AlcodonFrameDescriptor.java index 8f64616..5c646ca 100644 --- a/src/jalview/schemabinding/version2/descriptors/AlcodonFrameDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/AlcodonFrameDescriptor.java @@ -150,8 +150,7 @@ public class AlcodonFrameDescriptor extends try { AlcodonFrame target = (AlcodonFrame) object; - target - .addAlcodMap((jalview.schemabinding.version2.AlcodMap) value); + target.addAlcodMap((jalview.schemabinding.version2.AlcodMap) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); diff --git a/src/jalview/schemabinding/version2/descriptors/AnnotationDescriptor.java b/src/jalview/schemabinding/version2/descriptors/AnnotationDescriptor.java index 184216e..c30ef18 100644 --- a/src/jalview/schemabinding/version2/descriptors/AnnotationDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/AnnotationDescriptor.java @@ -835,8 +835,7 @@ public class AnnotationDescriptor extends try { Annotation target = (Annotation) object; - target - .addAnnotationElement((jalview.schemabinding.version2.AnnotationElement) value); + target.addAnnotationElement((jalview.schemabinding.version2.AnnotationElement) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); @@ -986,8 +985,7 @@ public class AnnotationDescriptor extends try { Annotation target = (Annotation) object; - target - .setThresholdLine((jalview.schemabinding.version2.ThresholdLine) value); + target.setThresholdLine((jalview.schemabinding.version2.ThresholdLine) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); diff --git a/src/jalview/schemabinding/version2/descriptors/FeatureDescriptor.java b/src/jalview/schemabinding/version2/descriptors/FeatureDescriptor.java index 40de2ea..e50fc8c 100644 --- a/src/jalview/schemabinding/version2/descriptors/FeatureDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/FeatureDescriptor.java @@ -447,8 +447,7 @@ public class FeatureDescriptor extends try { Feature target = (Feature) object; - target - .addOtherData((jalview.schemabinding.version2.OtherData) value); + target.addOtherData((jalview.schemabinding.version2.OtherData) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); diff --git a/src/jalview/schemabinding/version2/descriptors/JGroupDescriptor.java b/src/jalview/schemabinding/version2/descriptors/JGroupDescriptor.java index 5fc6aef..08b9aea 100644 --- a/src/jalview/schemabinding/version2/descriptors/JGroupDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/JGroupDescriptor.java @@ -469,9 +469,7 @@ public class JGroupDescriptor extends target.deleteDisplayBoxes(); return; } - target - .setDisplayBoxes(((java.lang.Boolean) value) - .booleanValue()); + target.setDisplayBoxes(((java.lang.Boolean) value).booleanValue()); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); @@ -742,9 +740,7 @@ public class JGroupDescriptor extends target.deleteTextColThreshold(); return; } - target - .setTextColThreshold(((java.lang.Integer) value) - .intValue()); + target.setTextColThreshold(((java.lang.Integer) value).intValue()); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); diff --git a/src/jalview/schemabinding/version2/descriptors/JSeqDescriptor.java b/src/jalview/schemabinding/version2/descriptors/JSeqDescriptor.java index 5283afe..b33eda7 100644 --- a/src/jalview/schemabinding/version2/descriptors/JSeqDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/JSeqDescriptor.java @@ -365,8 +365,7 @@ public class JSeqDescriptor extends try { JSeq target = (JSeq) object; - target - .addFeatures((jalview.schemabinding.version2.Features) value); + target.addFeatures((jalview.schemabinding.version2.Features) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); diff --git a/src/jalview/schemabinding/version2/descriptors/JalviewModelDescriptor.java b/src/jalview/schemabinding/version2/descriptors/JalviewModelDescriptor.java index 0c2bf40..4480ea9 100644 --- a/src/jalview/schemabinding/version2/descriptors/JalviewModelDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/JalviewModelDescriptor.java @@ -192,8 +192,7 @@ public class JalviewModelDescriptor extends try { JalviewModel target = (JalviewModel) object; - target - .setVamsasModel((jalview.schemabinding.version2.VamsasModel) value); + target.setVamsasModel((jalview.schemabinding.version2.VamsasModel) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); @@ -237,8 +236,7 @@ public class JalviewModelDescriptor extends try { JalviewModel target = (JalviewModel) object; - target - .setJalviewModelSequence((jalview.schemabinding.version2.JalviewModelSequence) value); + target.setJalviewModelSequence((jalview.schemabinding.version2.JalviewModelSequence) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); @@ -252,8 +250,7 @@ public class JalviewModelDescriptor extends }; desc.setHandler(handler); desc.setContainer(true); - desc - .setClassDescriptor(new jalview.schemabinding.version2.descriptors.JalviewModelSequenceDescriptor()); + desc.setClassDescriptor(new jalview.schemabinding.version2.descriptors.JalviewModelSequenceDescriptor()); desc.setNameSpaceURI("www.jalview.org"); desc.setRequired(true); desc.setMultivalued(false); diff --git a/src/jalview/schemabinding/version2/descriptors/JalviewModelSequenceDescriptor.java b/src/jalview/schemabinding/version2/descriptors/JalviewModelSequenceDescriptor.java index ee2e00e..4ea81bc 100644 --- a/src/jalview/schemabinding/version2/descriptors/JalviewModelSequenceDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/JalviewModelSequenceDescriptor.java @@ -205,8 +205,7 @@ public class JalviewModelSequenceDescriptor extends try { JalviewModelSequence target = (JalviewModelSequence) object; - target - .addViewport((jalview.schemabinding.version2.Viewport) value); + target.addViewport((jalview.schemabinding.version2.Viewport) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); @@ -263,8 +262,7 @@ public class JalviewModelSequenceDescriptor extends try { JalviewModelSequence target = (JalviewModelSequence) object; - target - .addUserColours((jalview.schemabinding.version2.UserColours) value); + target.addUserColours((jalview.schemabinding.version2.UserColours) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); @@ -375,8 +373,7 @@ public class JalviewModelSequenceDescriptor extends try { JalviewModelSequence target = (JalviewModelSequence) object; - target - .setFeatureSettings((jalview.schemabinding.version2.FeatureSettings) value); + target.setFeatureSettings((jalview.schemabinding.version2.FeatureSettings) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); diff --git a/src/jalview/schemabinding/version2/descriptors/MapListTypeDescriptor.java b/src/jalview/schemabinding/version2/descriptors/MapListTypeDescriptor.java index b860d9f..858753f 100644 --- a/src/jalview/schemabinding/version2/descriptors/MapListTypeDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/MapListTypeDescriptor.java @@ -208,8 +208,7 @@ public class MapListTypeDescriptor extends try { MapListType target = (MapListType) object; - target - .addMapListFrom((jalview.schemabinding.version2.MapListFrom) value); + target.addMapListFrom((jalview.schemabinding.version2.MapListFrom) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); @@ -265,8 +264,7 @@ public class MapListTypeDescriptor extends try { MapListType target = (MapListType) object; - target - .addMapListTo((jalview.schemabinding.version2.MapListTo) value); + target.addMapListTo((jalview.schemabinding.version2.MapListTo) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); diff --git a/src/jalview/schemabinding/version2/descriptors/MappingChoiceDescriptor.java b/src/jalview/schemabinding/version2/descriptors/MappingChoiceDescriptor.java index 89488a1..92aac5e 100644 --- a/src/jalview/schemabinding/version2/descriptors/MappingChoiceDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/MappingChoiceDescriptor.java @@ -94,8 +94,7 @@ public class MappingChoiceDescriptor extends try { MappingChoice target = (MappingChoice) object; - target - .setSequence((jalview.schemabinding.version2.Sequence) value); + target.setSequence((jalview.schemabinding.version2.Sequence) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); diff --git a/src/jalview/schemabinding/version2/descriptors/MappingDescriptor.java b/src/jalview/schemabinding/version2/descriptors/MappingDescriptor.java index 6dd524c..9c748cf 100644 --- a/src/jalview/schemabinding/version2/descriptors/MappingDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/MappingDescriptor.java @@ -97,8 +97,7 @@ public class MappingDescriptor extends try { Mapping target = (Mapping) object; - target - .setMappingChoice((jalview.schemabinding.version2.MappingChoice) value); + target.setMappingChoice((jalview.schemabinding.version2.MappingChoice) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); @@ -112,8 +111,7 @@ public class MappingDescriptor extends }; desc.setHandler(handler); desc.setContainer(true); - desc - .setClassDescriptor(new jalview.schemabinding.version2.descriptors.MappingChoiceDescriptor()); + desc.setClassDescriptor(new jalview.schemabinding.version2.descriptors.MappingChoiceDescriptor()); desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); desc.setMultivalued(false); addFieldDescriptor(desc); diff --git a/src/jalview/schemabinding/version2/descriptors/PdbentryDescriptor.java b/src/jalview/schemabinding/version2/descriptors/PdbentryDescriptor.java index f04892b..f892f79 100644 --- a/src/jalview/schemabinding/version2/descriptors/PdbentryDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/PdbentryDescriptor.java @@ -228,8 +228,7 @@ public class PdbentryDescriptor extends try { Pdbentry target = (Pdbentry) object; - target - .addPdbentryItem((jalview.schemabinding.version2.PdbentryItem) value); + target.addPdbentryItem((jalview.schemabinding.version2.PdbentryItem) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); @@ -256,8 +255,7 @@ public class PdbentryDescriptor extends }; desc.setHandler(handler); desc.setContainer(true); - desc - .setClassDescriptor(new jalview.schemabinding.version2.descriptors.PdbentryItemDescriptor()); + desc.setClassDescriptor(new jalview.schemabinding.version2.descriptors.PdbentryItemDescriptor()); desc.setMultivalued(true); addFieldDescriptor(desc); diff --git a/src/jalview/schemabinding/version2/descriptors/PdbentryItemDescriptor.java b/src/jalview/schemabinding/version2/descriptors/PdbentryItemDescriptor.java index c1eff63..0a043d7 100644 --- a/src/jalview/schemabinding/version2/descriptors/PdbentryItemDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/PdbentryItemDescriptor.java @@ -95,8 +95,7 @@ public class PdbentryItemDescriptor extends try { PdbentryItem target = (PdbentryItem) object; - target - .addProperty((jalview.schemabinding.version2.Property) value); + target.addProperty((jalview.schemabinding.version2.Property) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); diff --git a/src/jalview/schemabinding/version2/descriptors/PdbidsDescriptor.java b/src/jalview/schemabinding/version2/descriptors/PdbidsDescriptor.java index d53e400..cf746cd 100644 --- a/src/jalview/schemabinding/version2/descriptors/PdbidsDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/PdbidsDescriptor.java @@ -97,8 +97,7 @@ public class PdbidsDescriptor extends try { Pdbids target = (Pdbids) object; - target - .addStructureState((jalview.schemabinding.version2.StructureState) value); + target.addStructureState((jalview.schemabinding.version2.StructureState) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); diff --git a/src/jalview/schemabinding/version2/descriptors/SequenceSetDescriptor.java b/src/jalview/schemabinding/version2/descriptors/SequenceSetDescriptor.java index 2dfc594..ab0d2b8 100644 --- a/src/jalview/schemabinding/version2/descriptors/SequenceSetDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/SequenceSetDescriptor.java @@ -187,8 +187,7 @@ public class SequenceSetDescriptor extends try { SequenceSet target = (SequenceSet) object; - target - .addSequence((jalview.schemabinding.version2.Sequence) value); + target.addSequence((jalview.schemabinding.version2.Sequence) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); @@ -244,8 +243,7 @@ public class SequenceSetDescriptor extends try { SequenceSet target = (SequenceSet) object; - target - .addAnnotation((jalview.schemabinding.version2.Annotation) value); + target.addAnnotation((jalview.schemabinding.version2.Annotation) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); @@ -301,8 +299,7 @@ public class SequenceSetDescriptor extends try { SequenceSet target = (SequenceSet) object; - target - .addSequenceSetProperties((jalview.schemabinding.version2.SequenceSetProperties) value); + target.addSequenceSetProperties((jalview.schemabinding.version2.SequenceSetProperties) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); @@ -358,8 +355,7 @@ public class SequenceSetDescriptor extends try { SequenceSet target = (SequenceSet) object; - target - .addAlcodonFrame((jalview.schemabinding.version2.AlcodonFrame) value); + target.addAlcodonFrame((jalview.schemabinding.version2.AlcodonFrame) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); diff --git a/src/jalview/schemabinding/version2/descriptors/TreeDescriptor.java b/src/jalview/schemabinding/version2/descriptors/TreeDescriptor.java index 1d0d139..9d70d62 100644 --- a/src/jalview/schemabinding/version2/descriptors/TreeDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/TreeDescriptor.java @@ -644,9 +644,7 @@ public class TreeDescriptor extends target.deleteMarkUnlinked(); return; } - target - .setMarkUnlinked(((java.lang.Boolean) value) - .booleanValue()); + target.setMarkUnlinked(((java.lang.Boolean) value).booleanValue()); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); diff --git a/src/jalview/schemabinding/version2/descriptors/UserColoursDescriptor.java b/src/jalview/schemabinding/version2/descriptors/UserColoursDescriptor.java index 11d4455..e98dffb 100644 --- a/src/jalview/schemabinding/version2/descriptors/UserColoursDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/UserColoursDescriptor.java @@ -141,8 +141,7 @@ public class UserColoursDescriptor extends try { UserColours target = (UserColours) object; - target - .setUserColourScheme((jalview.schemabinding.version2.UserColourScheme) value); + target.setUserColourScheme((jalview.schemabinding.version2.UserColourScheme) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); diff --git a/src/jalview/schemabinding/version2/descriptors/VAMSASDescriptor.java b/src/jalview/schemabinding/version2/descriptors/VAMSASDescriptor.java index 3308a28..b46ab62 100644 --- a/src/jalview/schemabinding/version2/descriptors/VAMSASDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/VAMSASDescriptor.java @@ -156,8 +156,7 @@ public class VAMSASDescriptor extends try { VAMSAS target = (VAMSAS) object; - target - .addSequenceSet((jalview.schemabinding.version2.SequenceSet) value); + target.addSequenceSet((jalview.schemabinding.version2.SequenceSet) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); diff --git a/src/jalview/schemabinding/version2/descriptors/ViewportDescriptor.java b/src/jalview/schemabinding/version2/descriptors/ViewportDescriptor.java index 41831f4..254b785 100644 --- a/src/jalview/schemabinding/version2/descriptors/ViewportDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/ViewportDescriptor.java @@ -2254,9 +2254,7 @@ public class ViewportDescriptor extends target.deleteTextColThreshold(); return; } - target - .setTextColThreshold(((java.lang.Integer) value) - .intValue()); + target.setTextColThreshold(((java.lang.Integer) value).intValue()); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); @@ -2348,8 +2346,7 @@ public class ViewportDescriptor extends try { Viewport target = (Viewport) object; - target - .setAnnotationColours((jalview.schemabinding.version2.AnnotationColours) value); + target.setAnnotationColours((jalview.schemabinding.version2.AnnotationColours) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); @@ -2391,8 +2388,7 @@ public class ViewportDescriptor extends try { Viewport target = (Viewport) object; - target - .addHiddenColumns((jalview.schemabinding.version2.HiddenColumns) value); + target.addHiddenColumns((jalview.schemabinding.version2.HiddenColumns) value); } catch (java.lang.Exception ex) { throw new IllegalStateException(ex.toString()); diff --git a/src/jalview/schemabinding/version2/descriptors/WebServiceParameterSetDescriptor.java b/src/jalview/schemabinding/version2/descriptors/WebServiceParameterSetDescriptor.java index ca64e21..bf029a2 100644 --- a/src/jalview/schemabinding/version2/descriptors/WebServiceParameterSetDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/WebServiceParameterSetDescriptor.java @@ -17,8 +17,8 @@ */ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.WebServiceParameterSet; @@ -28,337 +28,379 @@ import jalview.schemabinding.version2.WebServiceParameterSet; * * @version $Revision$ $Date$ */ -public class WebServiceParameterSetDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _elementDefinition. - */ - private boolean _elementDefinition; - - /** - * Field _nsPrefix. - */ - private java.lang.String _nsPrefix; - - /** - * Field _nsURI. - */ - private java.lang.String _nsURI; - - /** - * Field _xmlName. - */ - private java.lang.String _xmlName; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public WebServiceParameterSetDescriptor() { - super(); - _nsURI = "www.jalview.org/xml/wsparamset"; - _xmlName = "WebServiceParameterSet"; - _elementDefinition = false; - - //-- set grouping compositor - setCompositorAsSequence(); - org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; - org.exolab.castor.mapping.FieldHandler handler = null; - org.exolab.castor.xml.FieldValidator fieldValidator = null; - //-- initialize attribute descriptors - - //-- _name - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute); - desc.setImmutable(true); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - WebServiceParameterSet target = (WebServiceParameterSet) object; - return target.getName(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - WebServiceParameterSet target = (WebServiceParameterSet) object; - target.setName( (java.lang.String) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _name - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); - } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - //-- _version - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_version", "Version", org.exolab.castor.xml.NodeType.Element); - desc.setImmutable(true); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - WebServiceParameterSet target = (WebServiceParameterSet) object; - return target.getVersion(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - WebServiceParameterSet target = (WebServiceParameterSet) object; - target.setVersion( (java.lang.String) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _version - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); - } - desc.setValidator(fieldValidator); - //-- _description - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_description", "description", org.exolab.castor.xml.NodeType.Element); - desc.setImmutable(true); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - WebServiceParameterSet target = (WebServiceParameterSet) object; - return target.getDescription(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - WebServiceParameterSet target = (WebServiceParameterSet) object; - target.setDescription( (java.lang.String) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _description - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); - } - desc.setValidator(fieldValidator); - //-- _serviceURLList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_serviceURLList", "serviceURL", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - WebServiceParameterSet target = (WebServiceParameterSet) object; - return target.getServiceURL(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - WebServiceParameterSet target = (WebServiceParameterSet) object; - target.addServiceURL( (java.lang.String) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - WebServiceParameterSet target = (WebServiceParameterSet) object; - target.removeAllServiceURL(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new java.lang.String(); - } - }; - desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _serviceURLList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - } - desc.setValidator(fieldValidator); - //-- _parameters - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_parameters", "parameters", org.exolab.castor.xml.NodeType.Element); - desc.setImmutable(true); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - WebServiceParameterSet target = (WebServiceParameterSet) object; - return target.getParameters(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - WebServiceParameterSet target = (WebServiceParameterSet) object; - target.setParameters( (java.lang.String) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _parameters - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); +public class WebServiceParameterSetDescriptor extends + org.exolab.castor.xml.util.XMLClassDescriptorImpl +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public WebServiceParameterSetDescriptor() + { + super(); + _nsURI = "www.jalview.org/xml/wsparamset"; + _xmlName = "WebServiceParameterSet"; + _elementDefinition = false; + + // -- set grouping compositor + setCompositorAsSequence(); + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + // -- initialize attribute descriptors + + // -- _name + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_name", "name", + org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + WebServiceParameterSet target = (WebServiceParameterSet) object; + return target.getName(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + WebServiceParameterSet target = (WebServiceParameterSet) object; + target.setName((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _name + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors + // -- _version + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_version", "Version", + org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + WebServiceParameterSet target = (WebServiceParameterSet) object; + return target.getVersion(); + } - //-----------/ - //- Methods -/ - //-----------/ + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + WebServiceParameterSet target = (WebServiceParameterSet) object; + target.setVersion((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getAccessMode. - * - * @return the access mode specified for this class. - */ - public org.exolab.castor.mapping.AccessMode getAccessMode( - ) { + public java.lang.Object newInstance(java.lang.Object parent) + { return null; - } + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - /** - * Method getIdentity. - * - * @return the identity field, null if this class has no - * identity. - */ - public org.exolab.castor.mapping.FieldDescriptor getIdentity( - ) { - return super.getIdentity(); + // -- validation code for: _version + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); } + desc.setValidator(fieldValidator); + // -- _description + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_description", "description", + org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + WebServiceParameterSet target = (WebServiceParameterSet) object; + return target.getDescription(); + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.WebServiceParameterSet.class; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + WebServiceParameterSet target = (WebServiceParameterSet) object; + target.setDescription((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix( - ) { - return _nsPrefix; - } + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; + // -- validation code for: _description + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); } + desc.setValidator(fieldValidator); + // -- _serviceURLList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_serviceURLList", "serviceURL", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + WebServiceParameterSet target = (WebServiceParameterSet) object; + return target.getServiceURL(); + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + WebServiceParameterSet target = (WebServiceParameterSet) object; + target.addServiceURL((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + WebServiceParameterSet target = (WebServiceParameterSet) object; + target.removeAllServiceURL(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new java.lang.String(); + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _serviceURLList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope } + desc.setValidator(fieldValidator); + // -- _parameters + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_parameters", "parameters", + org.exolab.castor.xml.NodeType.Element); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + WebServiceParameterSet target = (WebServiceParameterSet) object; + return target.getParameters(); + } - /** - * Method isElementDefinition. - * - * @return true if XML schema definition of this Class is that - * of a global - * element or element with anonymous type definition. - */ - public boolean isElementDefinition( - ) { - return _elementDefinition; + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + WebServiceParameterSet target = (WebServiceParameterSet) object; + target.setParameters((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _parameters + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); } + desc.setValidator(fieldValidator); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return super.getIdentity(); + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.WebServiceParameterSet.class; + } + + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix() + { + return _nsPrefix; + } + + /** + * Method getNameSpaceURI. + * + * @return the namespace URI used when marshaling and unmarshaling as XML. + */ + public java.lang.String getNameSpaceURI() + { + return _nsURI; + } + + /** + * Method getValidator. + * + * @return a specific validator for the class described by this + * ClassDescriptor. + */ + public org.exolab.castor.xml.TypeValidator getValidator() + { + return this; + } + + /** + * Method getXMLName. + * + * @return the XML Name for the Class being described. + */ + public java.lang.String getXMLName() + { + return _xmlName; + } + + /** + * Method isElementDefinition. + * + * @return true if XML schema definition of this Class is that of a global + * element or element with anonymous type definition. + */ + public boolean isElementDefinition() + { + return _elementDefinition; + } } diff --git a/src/jalview/schemes/ClustalxColourScheme.java b/src/jalview/schemes/ClustalxColourScheme.java index 3459690..8822567 100755 --- a/src/jalview/schemes/ClustalxColourScheme.java +++ b/src/jalview/schemes/ClustalxColourScheme.java @@ -51,9 +51,7 @@ public class ClustalxColourScheme extends ResidueColourScheme // implements colhash.put("ORANGE", new Color((float) 0.9, (float) 0.6, (float) 0.3)); colhash.put("CYAN", new Color((float) 0.1, (float) 0.7, (float) 0.7)); colhash.put("PINK", new Color((float) 0.9, (float) 0.5, (float) 0.5)); - colhash - .put("MAGENTA", - new Color((float) 0.8, (float) 0.3, (float) 0.8)); + colhash.put("MAGENTA", new Color((float) 0.8, (float) 0.3, (float) 0.8)); colhash.put("YELLOW", new Color((float) 0.8, (float) 0.8, (float) 0.0)); } @@ -216,7 +214,7 @@ public class ClustalxColourScheme extends ResidueColourScheme // implements tmp6[0] = conses[3]; // - tmp6[1] = conses[29]; // D tmp6[2] = conses[10]; // E - tmp6[3] = conses[6]; // QE + tmp6[3] = conses[6]; // QE tmp6[4] = conses[19]; // Q tmp6[5] = conses[2]; // DE colours[5] = new ConsensusColour((Color) colhash.get("MAGENTA"), tmp6); diff --git a/src/jalview/schemes/ResidueProperties.java b/src/jalview/schemes/ResidueProperties.java index 67211cd..9115681 100755 --- a/src/jalview/schemes/ResidueProperties.java +++ b/src/jalview/schemes/ResidueProperties.java @@ -540,7 +540,7 @@ public class ResidueProperties public static final Color[] pidColours = { midBlue, new Color(153, 153, 255), - // Color.lightGray, + // Color.lightGray, new Color(204, 204, 255), }; public static final float[] pidThresholds = diff --git a/src/jalview/util/AWTConsole.java b/src/jalview/util/AWTConsole.java index 63aea1e..14f23a9 100644 --- a/src/jalview/util/AWTConsole.java +++ b/src/jalview/util/AWTConsole.java @@ -118,7 +118,7 @@ public class AWTConsole extends WindowAdapter implements WindowListener, // testing part // you may omit this part for your application - // + // System.out.println("Hello World 2"); System.out.println("All fonts available to Graphic2D:\n"); GraphicsEnvironment ge = GraphicsEnvironment diff --git a/src/jalview/util/DBRefUtils.java b/src/jalview/util/DBRefUtils.java index d7d5835..b772305 100755 --- a/src/jalview/util/DBRefUtils.java +++ b/src/jalview/util/DBRefUtils.java @@ -303,8 +303,8 @@ public class DBRefUtils if ((refb.getMap().getMap() == null && refa.getMap().getMap() == null) || (refb.getMap().getMap() != null && refa.getMap().getMap() != null && refb - .getMap().getMap().getInverse().equals( - refa.getMap().getMap()))) + .getMap().getMap().getInverse() + .equals(refa.getMap().getMap()))) { return true; } diff --git a/src/jalview/util/Format.java b/src/jalview/util/Format.java index c6348b2..97a97ac 100755 --- a/src/jalview/util/Format.java +++ b/src/jalview/util/Format.java @@ -205,66 +205,63 @@ public class Format } } -/** + /** * Formats the number following printf conventions. Main limitation: Can only * handle one format parameter at a time Use multiple Format objects to format * more than one number * * @param s - * the format string following printf conventions The string - * has a prefix, a format code and a suffix. The prefix and - * suffix become part of the formatted output. The format code - * directs the formatting of the (single) parameter to be - * formatted. The code has the following structure - *

      - *
    • a % (required) - *
    • a modifier (optional) - *
      - *
      + - *
      forces display of + for positive numbers - *
      0 - *
      show leading zeroes - *
      - - *
      align left in the field - *
      space - *
      prepend a space in front of positive numbers - *
      # - *
      use "alternate" format. Add 0 or 0x for octal or - * hexadecimal numbers. Don't suppress trailing zeroes in - * general floating point format. - *
      - *
    • an integer denoting field width (optional) - *
    • a period followed by an integer denoting precision - * (optional) - *
    • a format descriptor (required) - *
      - *
      f - *
      floating point number in fixed format - *
      e, E - *
      floating point number in exponential notation - * (scientific format). The E format results in an uppercase E - * for the exponent (1.14130E+003), the e format in a lowercase - * e. - *
      g, G - *
      floating point number in general format (fixed format - * for small numbers, exponential format for large numbers). - * Trailing zeroes are suppressed. The G format results in an - * uppercase E for the exponent (if any), the g format in a - * lowercase e. - *
      d, i - *
      integer in decimal - *
      x - *
      integer in hexadecimal - *
      o - *
      integer in octal - *
      s - *
      string - *
      c - *
      character - *
      - *
    + * the format string following printf conventions The string has a + * prefix, a format code and a suffix. The prefix and suffix become + * part of the formatted output. The format code directs the + * formatting of the (single) parameter to be formatted. The code has + * the following structure + *
      + *
    • a % (required) + *
    • a modifier (optional) + *
      + *
      + + *
      forces display of + for positive numbers + *
      0 + *
      show leading zeroes + *
      - + *
      align left in the field + *
      space + *
      prepend a space in front of positive numbers + *
      # + *
      use "alternate" format. Add 0 or 0x for octal or hexadecimal + * numbers. Don't suppress trailing zeroes in general floating point + * format. + *
      + *
    • an integer denoting field width (optional) + *
    • a period followed by an integer denoting precision (optional) + *
    • a format descriptor (required) + *
      + *
      f + *
      floating point number in fixed format + *
      e, E + *
      floating point number in exponential notation (scientific + * format). The E format results in an uppercase E for the exponent + * (1.14130E+003), the e format in a lowercase e. + *
      g, G + *
      floating point number in general format (fixed format for + * small numbers, exponential format for large numbers). Trailing + * zeroes are suppressed. The G format results in an uppercase E for + * the exponent (if any), the g format in a lowercase e. + *
      d, i + *
      integer in decimal + *
      x + *
      integer in hexadecimal + *
      o + *
      integer in octal + *
      s + *
      string + *
      c + *
      character + *
      + *
    * @exception IllegalArgumentException - * if bad format + * if bad format * */ public static String getHexString(java.awt.Color color) diff --git a/src/jalview/util/ImageMaker.java b/src/jalview/util/ImageMaker.java index 53384ba..01632c9 100755 --- a/src/jalview/util/ImageMaker.java +++ b/src/jalview/util/ImageMaker.java @@ -169,17 +169,17 @@ public class ImageMaker JalviewFileChooser getPNGChooser() { - return new jalview.io.JalviewFileChooser(jalview.bin.Cache - .getProperty("LAST_DIRECTORY"), new String[] - { "png" }, new String[] - { "Portable network graphics" }, "Portable network graphics"); + return new jalview.io.JalviewFileChooser( + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] + { "png" }, new String[] + { "Portable network graphics" }, "Portable network graphics"); } JalviewFileChooser getEPSChooser() { - return new jalview.io.JalviewFileChooser(jalview.bin.Cache - .getProperty("LAST_DIRECTORY"), new String[] - { "eps" }, new String[] - { "Encapsulated Postscript" }, "Encapsulated Postscript"); + return new jalview.io.JalviewFileChooser( + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] + { "eps" }, new String[] + { "Encapsulated Postscript" }, "Encapsulated Postscript"); } } diff --git a/src/jalview/util/TableSorter.java b/src/jalview/util/TableSorter.java index bf6a7e7..495fb21 100755 --- a/src/jalview/util/TableSorter.java +++ b/src/jalview/util/TableSorter.java @@ -576,9 +576,7 @@ public class TableSorter extends AbstractTableModel JLabel l = (JLabel) c; l.setHorizontalTextPosition(JLabel.LEFT); int modelColumn = table.convertColumnIndexToModel(column); - l - .setIcon(getHeaderRendererIcon(modelColumn, l.getFont() - .getSize())); + l.setIcon(getHeaderRendererIcon(modelColumn, l.getFont().getSize())); } return c; } diff --git a/src/jalview/ws/AWSThread.java b/src/jalview/ws/AWSThread.java index 11556b2..a40d27a 100644 --- a/src/jalview/ws/AWSThread.java +++ b/src/jalview/ws/AWSThread.java @@ -34,47 +34,57 @@ public abstract class AWSThread extends Thread * view that this job was associated with */ protected AlignmentI currentView = null; + /** * feature settings from view that job was associated with */ protected FeatureRendererSettings featureSettings = null; + /** * metadata about this web service */ protected WebserviceInfo wsInfo = null; + /** * original input data for this job */ protected AlignmentView input = null; + /** * dataset sequence relationships to be propagated onto new results */ protected AlignedCodonFrame[] codonframe = null; + /** * are there jobs still running in this thread. */ protected boolean jobComplete = false; + /** * one or more jobs being managed by this thread. */ protected AWsJob jobs[] = null; + /** * full name of service */ protected String WebServiceName = null; + protected char defGapChar = '-'; + /** * header prepended to all output from job */ protected String OutputHeader; /** - * only used when reporting a web service out of memory error - the job ID will be concatenated to the URL + * only used when reporting a web service out of memory error - the job ID + * will be concatenated to the URL */ protected String WsUrl = null; /** - * generic web service job/subjob poll loop + * generic web service job/subjob poll loop */ public void run() { @@ -202,7 +212,6 @@ public abstract class AWSThread extends Thread } } - public AWSThread() { super(); @@ -264,8 +273,8 @@ public abstract class AWSThread extends Thread /** * helper function to conserve dataset references to sequence objects returned * from web services 1. Propagates AlCodonFrame data from - * codonframe to al - * TODO: refactor to datamodel + * codonframe to al TODO: refactor to datamodel + * * @param al */ public void propagateDatasetMappings(Alignment al) diff --git a/src/jalview/ws/AWsJob.java b/src/jalview/ws/AWsJob.java index 17d361b..e653539 100644 --- a/src/jalview/ws/AWsJob.java +++ b/src/jalview/ws/AWsJob.java @@ -29,7 +29,8 @@ public abstract class AWsJob protected String jobId; /** - * @param jobId the jobId to set + * @param jobId + * the jobId to set */ public void setJobId(String jobId) { @@ -47,7 +48,8 @@ public abstract class AWsJob int allowedServerExceptions = 3; /** - * @param allowedServerExceptions the allowedServerExceptions to set + * @param allowedServerExceptions + * the allowedServerExceptions to set */ public void setAllowedServerExceptions(int allowedServerExceptions) { @@ -61,7 +63,8 @@ public abstract class AWsJob protected boolean submitted = false; /** - * @param jobnum the jobnum to set + * @param jobnum + * the jobnum to set */ public void setJobnum(int jobnum) { @@ -69,7 +72,8 @@ public abstract class AWsJob } /** - * @param submitted the submitted to set + * @param submitted + * the submitted to set */ public void setSubmitted(boolean submitted) { @@ -77,7 +81,8 @@ public abstract class AWsJob } /** - * @param subjobComplete the subjobComplete to set + * @param subjobComplete + * the subjobComplete to set */ public void setSubjobComplete(boolean subjobComplete) { @@ -203,14 +208,19 @@ public abstract class AWsJob abstract public String getStatus(); abstract public boolean hasResponse(); + abstract public void clearResponse(); + abstract public String getState(); + /** * generates response using the abstract service flags. - * @return a standard state response + * + * @return a standard state response */ - protected String _defaultState() { - + protected String _defaultState() + { + String state = ""; return state; } diff --git a/src/jalview/ws/DBRefFetcher.java b/src/jalview/ws/DBRefFetcher.java index ad8c0f0..c1fe276 100644 --- a/src/jalview/ws/DBRefFetcher.java +++ b/src/jalview/ws/DBRefFetcher.java @@ -126,8 +126,8 @@ public class DBRefFetcher implements Runnable String[] defdb = null, otherdb = sfetcher .getDbInstances(jalview.ws.dbsources.DasSequenceSource.class); Vector selsources = new Vector(), dasselsrc = (af.featureSettings != null) ? af.featureSettings - .getSelectedSources() - : new jalview.gui.DasSourceBrowser().getSelectedSources(); + .getSelectedSources() : new jalview.gui.DasSourceBrowser() + .getSelectedSources(); Enumeration en = dasselsrc.elements(); while (en.hasMoreElements()) { @@ -193,9 +193,7 @@ public class DBRefFetcher implements Runnable { String[] newsrc = new String[dbSources.length + otherdb.length]; System.arraycopy(dbSources, 0, newsrc, 0, dbSources.length); - System - .arraycopy(otherdb, 0, newsrc, dbSources.length, - otherdb.length); + System.arraycopy(otherdb, 0, newsrc, dbSources.length, otherdb.length); dbSources = newsrc; } } @@ -387,9 +385,7 @@ public class DBRefFetcher implements Runnable for (int j = 0; j < uprefs.length; j++) { addSeqId(sequence, uprefs[j].getAccessionId()); - queries - .addElement(uprefs[j].getAccessionId() - .toUpperCase()); + queries.addElement(uprefs[j].getAccessionId().toUpperCase()); } } else @@ -407,8 +403,9 @@ public class DBRefFetcher implements Runnable try { presp = picrClient - .getUPIForAccession(token, null, picrClient - .getMappedDatabaseNames(), null, true); + .getUPIForAccession(token, null, + picrClient.getMappedDatabaseNames(), + null, true); } catch (Exception e) { System.err.println("Exception with Picr for '" + token @@ -447,11 +444,10 @@ public class DBRefFetcher implements Runnable } // all databases have been queries. if (sbuffer.length() > 0) { - output - .setText("Your sequences have been verified against known sequence databases. Some of the ids have been\n" - + "altered, most likely the start/end residue will have been updated.\n" - + "Save your alignment to maintain the updated id.\n\n" - + sbuffer.toString()); + output.setText("Your sequences have been verified against known sequence databases. Some of the ids have been\n" + + "altered, most likely the start/end residue will have been updated.\n" + + "Save your alignment to maintain the updated id.\n\n" + + sbuffer.toString()); Desktop.addInternalFrame(output, "Sequence names updated ", 600, 300); // The above is the dataset, we must now find out the index // of the viewed sequence @@ -496,9 +492,9 @@ public class DBRefFetcher implements Runnable // taking into account all accessionIds and names in the file Vector sequenceMatches = new Vector(); // look for corresponding accession ids - DBRefEntry[] entryRefs = jalview.util.DBRefUtils.selectRefs(entry - .getDBRef(), new String[] - { dbSource }); + DBRefEntry[] entryRefs = jalview.util.DBRefUtils.selectRefs( + entry.getDBRef(), new String[] + { dbSource }); if (entryRefs == null) { System.err diff --git a/src/jalview/ws/DasSequenceFeatureFetcher.java b/src/jalview/ws/DasSequenceFeatureFetcher.java index ab02baf..4262f7e 100644 --- a/src/jalview/ws/DasSequenceFeatureFetcher.java +++ b/src/jalview/ws/DasSequenceFeatureFetcher.java @@ -240,8 +240,7 @@ public class DasSequenceFeatureFetcher } } catch (Exception ex) { - debug( - "Exception whilst setting default feature sources from registry and local preferences.", + debug("Exception whilst setting default feature sources from registry and local preferences.", ex); } } @@ -511,8 +510,8 @@ public class DasSequenceFeatureFetcher for (int i = 0; i < features.length; i++) { // standard DAS feature-> jalview sequence feature transformation - SequenceFeature f = newSequenceFeature(features[i], source - .getNickname()); + SequenceFeature f = newSequenceFeature(features[i], + source.getNickname()); if (!parseSeqFeature(seq, f, features[i], source)) { if (dbref.getMap() != null && f.getBegin() > 0 @@ -615,8 +614,8 @@ public class DasSequenceFeatureFetcher for (int i = 0; i < features.length; i++) { // standard DAS feature-> jalview sequence feature transformation - SequenceFeature f = newSequenceFeature(features[i], source - .getNickname()); + SequenceFeature f = newSequenceFeature(features[i], + source.getNickname()); if (!parseSeqFeature(seq, f, features[i], source)) { // just add as a simple sequence feature @@ -805,8 +804,9 @@ public class DasSequenceFeatureFetcher { } - SequenceFeature f = new SequenceFeature((String) dasfeature - .get("TYPE"), desc, start, end, score, nickname); + SequenceFeature f = new SequenceFeature( + (String) dasfeature.get("TYPE"), desc, start, end, score, + nickname); if (dasfeature.containsKey("LINK")) { diff --git a/src/jalview/ws/EnfinEnvision2OneWay.java b/src/jalview/ws/EnfinEnvision2OneWay.java index f40831c..6a9371b 100644 --- a/src/jalview/ws/EnfinEnvision2OneWay.java +++ b/src/jalview/ws/EnfinEnvision2OneWay.java @@ -284,7 +284,8 @@ public class EnfinEnvision2OneWay extends DefaultHandler implements * Object array returned from the makeUrlStubs function. */ private void addshowLink(JMenu linkMenu, String label, String descr, - String dbname, final GroupUrlLink urlgenerator, final Object[] urlstub) + String dbname, final GroupUrlLink urlgenerator, + final Object[] urlstub) { Component[] jmi = linkMenu.getMenuComponents(); for (int i = 0; i < jmi.length; i++) @@ -299,17 +300,17 @@ public class EnfinEnvision2OneWay extends DefaultHandler implements boolean seqsorids = (urlgenerator.getGroupURLType() & urlgenerator.SEQUENCEIDS) == 0; int i = urlgenerator.getNumberInvolved(urlstub); JMenuItem item = new JMenuItem(label); - // - if (dbname==null || dbname.trim().length()==0) + // + if (dbname == null || dbname.trim().length() == 0) { dbname = ""; } item.setToolTipText("" - + JvSwingUtils.wrapTooltip("Submit " + i + " " + - dbname +" " - + (seqsorids ? "sequence" : "sequence id") + (i > 1 ? "s" : "") - - + " to
    " + descr) + ""); + + JvSwingUtils.wrapTooltip("Submit " + i + " " + dbname + " " + + (seqsorids ? "sequence" : "sequence id") + + (i > 1 ? "s" : "") + + + " to
    " + descr) + ""); item.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) @@ -319,7 +320,8 @@ public class EnfinEnvision2OneWay extends DefaultHandler implements public void run() { - try { + try + { showLink(urlgenerator.constructFrom(urlstub)); } catch (UrlStringTooLongException ex) { @@ -404,7 +406,7 @@ public class EnfinEnvision2OneWay extends DefaultHandler implements */ private JMenu buildGroupURLMenu(SequenceI[] seqs, SequenceGroup sg) { - if (groupURLdescr==null || groupURLLinks==null) + if (groupURLdescr == null || groupURLLinks == null) return null; // TODO: usability: thread off the generation of group url content so root // menu appears asap @@ -476,7 +478,8 @@ public class EnfinEnvision2OneWay extends DefaultHandler implements /** * last number of sequences where URL generation failed */ - int[] nsqtype = new int[] { 0,0,0,0,0,0,0,0,0,0}; + int[] nsqtype = new int[] + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; for (int i = 0; i < groupURLLinks.size(); i++) { String link = (String) groupURLLinks.elementAt(i); @@ -527,7 +530,8 @@ public class EnfinEnvision2OneWay extends DefaultHandler implements String[] allids = ((String[]) idset[1]); seqstr = new String[numinput]; ids = new String[numinput]; - if (nsqtype[urlLink.getGroupURLType()]>0 && numinput>=nsqtype[urlLink.getGroupURLType()]) + if (nsqtype[urlLink.getGroupURLType()] > 0 + && numinput >= nsqtype[urlLink.getGroupURLType()]) { continue; } @@ -539,8 +543,10 @@ public class EnfinEnvision2OneWay extends DefaultHandler implements seqstr[idcount++] = idandseqs[1][sq]; } } - try {createAndAddLinks(wflinkMenus, false, urlLink, ltarget, null, - descr, ids, seqstr); + try + { + createAndAddLinks(wflinkMenus, false, urlLink, ltarget, null, + descr, ids, seqstr); } catch (UrlStringTooLongException ex) { nsqtype[urlLink.getGroupURLType()] = numinput; @@ -550,14 +556,17 @@ public class EnfinEnvision2OneWay extends DefaultHandler implements // also do names only. seqstr = idandseqs[1]; ids = idandseqs[0]; - if (nsqtype[urlLink.getGroupURLType()]>0 && idandseqs[0].length>=nsqtype[urlLink.getGroupURLType()]) + if (nsqtype[urlLink.getGroupURLType()] > 0 + && idandseqs[0].length >= nsqtype[urlLink.getGroupURLType()]) { continue; } - - try {createAndAddLinks(wflinkMenus, true, urlLink, "Any", null, descr, - ids, seqstr); - }catch (UrlStringTooLongException ex) + + try + { + createAndAddLinks(wflinkMenus, true, urlLink, "Any", null, descr, + ids, seqstr); + } catch (UrlStringTooLongException ex) { nsqtype[urlLink.getGroupURLType()] = idandseqs[0].length; } @@ -590,7 +599,7 @@ public class EnfinEnvision2OneWay extends DefaultHandler implements GroupUrlLink urlLink, String label, String ltarget, String descr, String[] ids, String[] seqstr) throws UrlStringTooLongException { - Object[] urlset= urlLink.makeUrlStubs(ids, seqstr, "FromJalview" + Object[] urlset = urlLink.makeUrlStubs(ids, seqstr, "FromJalview" + System.currentTimeMillis(), false); if (urlset != null) @@ -615,6 +624,7 @@ public class EnfinEnvision2OneWay extends DefaultHandler implements } return false; } + // / end of stuff copied from popupmenu public void attachWSMenuEntry(final JMenu wsmenu, final AlignFrame alignFrame) @@ -643,19 +653,22 @@ public class EnfinEnvision2OneWay extends DefaultHandler implements { if (refresh && !isRunning()) { - new Thread(new Runnable() { - public void run() { - try - { - buildGroupLinkMenu(enfinServiceMenu, alignFrame); - } catch (OutOfMemoryError ex) + new Thread(new Runnable() { - Cache.log.error( - "Out of memory when calculating the Envision2 links.", - ex); - enfinServiceMenu.setEnabled(false); - } - }}).start(); + public void run() + { + try + { + buildGroupLinkMenu(enfinServiceMenu, alignFrame); + } catch (OutOfMemoryError ex) + { + Cache.log + .error("Out of memory when calculating the Envision2 links.", + ex); + enfinServiceMenu.setEnabled(false); + } + } + }).start(); refresh = false; } } diff --git a/src/jalview/ws/JobStateSummary.java b/src/jalview/ws/JobStateSummary.java index 9d9d61a..62f172d 100644 --- a/src/jalview/ws/JobStateSummary.java +++ b/src/jalview/ws/JobStateSummary.java @@ -109,9 +109,7 @@ public class JobStateSummary { serror++; j.subjobComplete = true; - wsInfo - .setStatus(j.jobnum, - WebserviceInfo.STATE_STOPPED_SERVERERROR); + wsInfo.setStatus(j.jobnum, WebserviceInfo.STATE_STOPPED_SERVERERROR); } else if (j.isBroken()) { @@ -125,7 +123,8 @@ public class JobStateSummary wsInfo.appendProgressText(j.jobnum, progheader); if (j.hasStatus()) { - // Could try to squash OOMs here, but it usually doesn't help - there probably won't be + // Could try to squash OOMs here, but it usually doesn't help - there + // probably won't be // enough memory to handle the results later on anyway. // try { wsInfo.appendProgressText(j.jobnum, j.getStatus()); diff --git a/src/jalview/ws/WSClient.java b/src/jalview/ws/WSClient.java index ae2e90e..d89ab73 100755 --- a/src/jalview/ws/WSClient.java +++ b/src/jalview/ws/WSClient.java @@ -17,7 +17,6 @@ */ package jalview.ws; - import jalview.gui.*; public abstract class WSClient // implements WSMenuEntryProviderI diff --git a/src/jalview/ws/dbsources/EmblXmlSource.java b/src/jalview/ws/dbsources/EmblXmlSource.java index eaf3846..baffc6d 100644 --- a/src/jalview/ws/dbsources/EmblXmlSource.java +++ b/src/jalview/ws/dbsources/EmblXmlSource.java @@ -58,8 +58,8 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy File reply; try { - reply = dbFetch.fetchDataAsFile(emprefx.toLowerCase() + ":" - + query.trim(), "emblxml", null); + reply = dbFetch.fetchDataAsFile( + emprefx.toLowerCase() + ":" + query.trim(), "emblxml", null); } catch (Exception e) { stopQuery(); diff --git a/src/jalview/ws/dbsources/GeneDbSource.java b/src/jalview/ws/dbsources/GeneDbSource.java index ae11a68..06e1164 100644 --- a/src/jalview/ws/dbsources/GeneDbSource.java +++ b/src/jalview/ws/dbsources/GeneDbSource.java @@ -100,7 +100,7 @@ public class GeneDbSource extends EmblXmlSource implements DbSourceProxy { // query of form // http://www.genedb.org/genedb/ArtemisFormHandler?id=&dest=EMBL - // + // return getEmblSequenceRecords(DBRefSource.GENEDB, queries); } diff --git a/src/jalview/ws/dbsources/das/DasSequenceSourceListener.java b/src/jalview/ws/dbsources/das/DasSequenceSourceListener.java index 5bc0b9b..e5c7c38 100644 --- a/src/jalview/ws/dbsources/das/DasSequenceSourceListener.java +++ b/src/jalview/ws/dbsources/das/DasSequenceSourceListener.java @@ -90,8 +90,7 @@ public class DasSequenceSourceListener implements SequenceListener } Sequence sq = new Sequence(e.getAccessionCode(), e.getSequence()); sq.addDBRef(new DBRefEntry(oursource.getDbSource(), oursource - .getDbVersion() - + ":" + e.getVersion(), e.getAccessionCode())); + .getDbVersion() + ":" + e.getVersion(), e.getAccessionCode())); seqs.addElement(sq); called = true; } diff --git a/src/jalview/ws/ebi/EBIFetchClient.java b/src/jalview/ws/ebi/EBIFetchClient.java index 40a21c6..efb2739 100644 --- a/src/jalview/ws/ebi/EBIFetchClient.java +++ b/src/jalview/ws/ebi/EBIFetchClient.java @@ -84,9 +84,7 @@ public class EBIFetchClient { try { - call - .setOperationName(new QName("urn:Dbfetch", - "getSupportedFormats")); + call.setOperationName(new QName("urn:Dbfetch", "getSupportedFormats")); call.setReturnType(XMLType.SOAP_ARRAY); return (String[]) call.invoke(new Object[] diff --git a/src/jalview/ws/jws1/Discoverer.java b/src/jalview/ws/jws1/Discoverer.java index 523899e..c8b1cda 100644 --- a/src/jalview/ws/jws1/Discoverer.java +++ b/src/jalview/ws/jws1/Discoverer.java @@ -50,6 +50,7 @@ public class Discoverer implements Runnable private java.beans.PropertyChangeSupport changeSupport = new java.beans.PropertyChangeSupport( this); + /** * change listeners are notified of "services" property changes * @@ -172,8 +173,7 @@ public class Discoverer implements Runnable } catch (Exception ex) { jalview.bin.Cache.log - .warn( - "Error parsing comma separated list of urls in DISCOVERY_URLS.", + .warn("Error parsing comma separated list of urls in DISCOVERY_URLS.", ex); } if (urls.size() > 0) diff --git a/src/jalview/ws/jws1/JPredClient.java b/src/jalview/ws/jws1/JPredClient.java index 846cd29..8fff195 100644 --- a/src/jalview/ws/jws1/JPredClient.java +++ b/src/jalview/ws/jws1/JPredClient.java @@ -252,15 +252,9 @@ public class JPredClient extends WS1Client String altitle = "JNet prediction on " + seq.getName() + " using alignment from " + title; - wsInfo - .setProgressText("Job details for MSA based prediction (" - + title - + ") on sequence :\n>" - + seq.getName() - + "\n" - + AlignSeq - .extractGaps("-. ", seq.getSequenceAsString()) - + "\n"); + wsInfo.setProgressText("Job details for MSA based prediction (" + title + + ") on sequence :\n>" + seq.getName() + "\n" + + AlignSeq.extractGaps("-. ", seq.getSequenceAsString()) + "\n"); SequenceI aln[] = new SequenceI[msf.length]; for (int i = 0, j = msf.length; i < j; i++) { @@ -289,13 +283,9 @@ public class JPredClient extends WS1Client { wsInfo = setWebService(); } - wsInfo - .setProgressText("Job details for prediction on sequence :\n>" - + seq.getName() - + "\n" - + AlignSeq - .extractGaps("-. ", seq.getSequenceAsString()) - + "\n"); + wsInfo.setProgressText("Job details for prediction on sequence :\n>" + + seq.getName() + "\n" + + AlignSeq.extractGaps("-. ", seq.getSequenceAsString()) + "\n"); String altitle = "JNet prediction for sequence " + seq.getName() + " from " + title; @@ -371,16 +361,16 @@ public class JPredClient extends WS1Client if (msa.getSequences().length == 1) { // Single Sequence prediction - new jalview.ws.jws1.JPredClient(sh, af.getTitle(), false, msa, af, - true); + new jalview.ws.jws1.JPredClient(sh, af.getTitle(), false, msa, + af, true); } else { if (msa.getSequences().length > 1) { // Sequence profile based prediction - new jalview.ws.jws1.JPredClient(sh, af.getTitle(), true, msa, af, - true); + new jalview.ws.jws1.JPredClient(sh, af.getTitle(), true, msa, + af, true); } } } diff --git a/src/jalview/ws/jws1/JPredThread.java b/src/jalview/ws/jws1/JPredThread.java index 63872f5..98f2645 100644 --- a/src/jalview/ws/jws1/JPredThread.java +++ b/src/jalview/ws/jws1/JPredThread.java @@ -100,8 +100,8 @@ class JPredThread extends JWS1Thread implements WSClientI jalview.bin.Cache.log.debug("Parsing output from JNet job."); // JPredFile prediction = new JPredFile("C:/JalviewX/files/jpred.txt", // "File"); - jalview.io.JPredFile prediction = new jalview.io.JPredFile(result - .getPredfile(), "Paste"); + jalview.io.JPredFile prediction = new jalview.io.JPredFile( + result.getPredfile(), "Paste"); SequenceI[] preds = prediction.getSeqsAsArray(); jalview.bin.Cache.log.debug("Got prediction profile."); @@ -110,8 +110,8 @@ class JPredThread extends JWS1Thread implements WSClientI jalview.bin.Cache.log.debug("Getting associated alignment."); // we ignore the returned alignment if we only predicted on a single // sequence - String format = new jalview.io.IdentifyFile().Identify(result - .getAligfile(), "Paste"); + String format = new jalview.io.IdentifyFile().Identify( + result.getAligfile(), "Paste"); if (jalview.io.FormatAdapter.isValidFormat(format)) { @@ -180,8 +180,8 @@ class JPredThread extends JWS1Thread implements WSClientI profileseq.setSequence(sqs[msaIndex].getSequenceAsString()); } - if (!jalview.analysis.SeqsetUtils.SeqCharacterUnhash(al - .getSequenceAt(FirstSeq), SequenceInfo)) + if (!jalview.analysis.SeqsetUtils.SeqCharacterUnhash( + al.getSequenceAt(FirstSeq), SequenceInfo)) { throw (new Exception( "Couldn't recover sequence properties for JNet Query sequence!")); @@ -352,8 +352,8 @@ class JPredThread extends JWS1Thread implements WSClientI { super(); this.predMap = delMap; - String sq = AlignSeq.extractGaps(Comparison.GapChars, seq - .getSequenceAsString()); + String sq = AlignSeq.extractGaps(Comparison.GapChars, + seq.getSequenceAsString()); if (sq.length() >= 20) { this.SequenceInfo = SequenceInfo; @@ -470,14 +470,12 @@ class JPredThread extends JWS1Thread implements WSClientI wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR); if (e.getMessage().indexOf("Exception") > -1) { - wsInfo - .setStatus(j.getJobnum(), - WebserviceInfo.STATE_STOPPED_SERVERERROR); - wsInfo - .setProgressText( - j.getJobnum(), - "Failed to submit the prediction. (Just close the window)\n" - + "It is most likely that there is a problem with the server.\n"); + wsInfo.setStatus(j.getJobnum(), + WebserviceInfo.STATE_STOPPED_SERVERERROR); + wsInfo.setProgressText( + j.getJobnum(), + "Failed to submit the prediction. (Just close the window)\n" + + "It is most likely that there is a problem with the server.\n"); System.err .println("JPredWS Client: Failed to submit the prediction. Quite possibly because of a server error - see below)\n" + e.getMessage() + "\n"); @@ -492,8 +490,8 @@ class JPredThread extends JWS1Thread implements WSClientI "Failed to submit the prediction:\n" + e.getMessage() + wsInfo.getProgressText()); - jalview.bin.Cache.log.debug("Failed Submission of job " + j.getJobnum(), - e); + jalview.bin.Cache.log.debug( + "Failed Submission of job " + j.getJobnum(), e); } j.setAllowedServerExceptions(-1); @@ -585,7 +583,8 @@ class JPredThread extends JWS1Thread implements WSClientI { jalview.bin.Cache.log.error( "JNet Client: JPred Annotation Parse Error", e); - wsInfo.setStatus(j.getJobnum(), WebserviceInfo.STATE_STOPPED_ERROR); + wsInfo.setStatus(j.getJobnum(), + WebserviceInfo.STATE_STOPPED_ERROR); wsInfo.appendProgressText(j.getJobnum(), OutputHeader + "\n" + j.result.getStatus() + "\nInvalid JNet job result data!\n" + e.getMessage()); @@ -646,7 +645,7 @@ class JPredThread extends JWS1Thread implements WSClientI public void pollJob(AWsJob job) throws Exception { - ((JPredJob)job).result = server.getresult(job.getJobId()); + ((JPredJob) job).result = server.getresult(job.getJobId()); } public boolean isCancellable() diff --git a/src/jalview/ws/jws1/JWS1Thread.java b/src/jalview/ws/jws1/JWS1Thread.java index 84d70b8..0d578c6 100644 --- a/src/jalview/ws/jws1/JWS1Thread.java +++ b/src/jalview/ws/jws1/JWS1Thread.java @@ -25,10 +25,10 @@ import jalview.gui.*; import jalview.ws.AWSThread; /** - * specific methods for Jalview WS1 web service jobs - * (will probably disappear) + * specific methods for Jalview WS1 web service jobs (will probably disappear) + * * @author JimP - * + * */ public abstract class JWS1Thread extends AWSThread { diff --git a/src/jalview/ws/jws1/MsaWSClient.java b/src/jalview/ws/jws1/MsaWSClient.java index f2f1419..a5f1216 100644 --- a/src/jalview/ws/jws1/MsaWSClient.java +++ b/src/jalview/ws/jws1/MsaWSClient.java @@ -79,7 +79,8 @@ public class MsaWSClient extends WS1Client if ((wsInfo = setWebService(sh)) == null) { - JOptionPane.showMessageDialog(Desktop.desktop, + JOptionPane.showMessageDialog( + Desktop.desktop, "The Multiple Sequence Alignment Service named " + sh.getName() + " is unknown", "Internal Jalview Error", JOptionPane.WARNING_MESSAGE); @@ -200,9 +201,9 @@ public class MsaWSClient extends WS1Client public void actionPerformed(ActionEvent e) { AlignmentView msa = alignFrame.gatherSequencesForAlignment(); - new jalview.ws.jws1.MsaWSClient(serviceHandle, alignFrame.getTitle(), - msa, false, true, alignFrame.getViewport().getAlignment() - .getDataset(), alignFrame); + new jalview.ws.jws1.MsaWSClient(serviceHandle, alignFrame + .getTitle(), msa, false, true, alignFrame.getViewport() + .getAlignment().getDataset(), alignFrame); } @@ -219,9 +220,9 @@ public class MsaWSClient extends WS1Client public void actionPerformed(ActionEvent e) { AlignmentView msa = alignFrame.gatherSequencesForAlignment(); - new jalview.ws.jws1.MsaWSClient(serviceHandle, alignFrame.getTitle(), - msa, true, true, alignFrame.getViewport().getAlignment() - .getDataset(), alignFrame); + new jalview.ws.jws1.MsaWSClient(serviceHandle, alignFrame + .getTitle(), msa, true, true, alignFrame.getViewport() + .getAlignment().getDataset(), alignFrame); } diff --git a/src/jalview/ws/jws1/MsaWSThread.java b/src/jalview/ws/jws1/MsaWSThread.java index 5c21d0a..3eca137 100644 --- a/src/jalview/ws/jws1/MsaWSThread.java +++ b/src/jalview/ws/jws1/MsaWSThread.java @@ -123,8 +123,8 @@ class MsaWSThread extends JWS1Thread implements WSClientI // for // any // subjob - SeqNames.put(newname, jalview.analysis.SeqsetUtils - .SeqCharacterHash(seqs[i])); + SeqNames.put(newname, + jalview.analysis.SeqsetUtils.SeqCharacterHash(seqs[i])); if (valid && seqs[i].getEnd() - seqs[i].getStart() > minlen - 1) { seqarray[n] = new vamsas.objects.simple.Sequence(); @@ -139,8 +139,8 @@ class MsaWSThread extends JWS1Thread implements WSClientI if (seqs[i].getEnd() >= seqs[i].getStart()) { empty = (submitGaps) ? seqs[i].getSequenceAsString() : AlignSeq - .extractGaps(jalview.util.Comparison.GapChars, seqs[i] - .getSequenceAsString()); + .extractGaps(jalview.util.Comparison.GapChars, + seqs[i].getSequenceAsString()); } emptySeqs.add(new String[] { newname, empty }); @@ -360,9 +360,8 @@ class MsaWSThread extends JWS1Thread implements WSClientI } if (njobs > 0) { - wsinfo - .setProgressName("region " + jobs[j].getJobnum(), - jobs[j].getJobnum()); + wsinfo.setProgressName("region " + jobs[j].getJobnum(), + jobs[j].getJobnum()); } wsinfo.setProgressText(jobs[j].getJobnum(), OutputHeader); } @@ -416,7 +415,8 @@ class MsaWSThread extends JWS1Thread implements WSClientI cancelledMessage += ("\nProblems cancelling the job : Exception received...\n" + exc + "\n"); Cache.log.warn( - "Exception whilst cancelling " + jobs[job].getJobId(), exc); + "Exception whilst cancelling " + jobs[job].getJobId(), + exc); } wsInfo.setProgressText(jobs[job].getJobnum(), OutputHeader + cancelledMessage + "\n"); @@ -433,9 +433,8 @@ class MsaWSThread extends JWS1Thread implements WSClientI { if (!jobComplete) { - wsInfo - .setProgressText(OutputHeader - + "Server cannot cancel this job because it has not been submitted properly. just close the window.\n"); + wsInfo.setProgressText(OutputHeader + + "Server cannot cancel this job because it has not been submitted properly. just close the window.\n"); } } } @@ -505,13 +504,13 @@ class MsaWSThread extends JWS1Thread implements WSClientI + e.toString() + "\n"); j.setAllowedServerExceptions(0); wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR); - wsInfo.setStatus(j.getJobnum(), WebserviceInfo.STATE_STOPPED_SERVERERROR); - wsInfo - .appendProgressText( - j.getJobnum(), - "Failed to submit sequences for alignment.\n" - + "It is most likely that there is a problem with the server.\n" - + "Just close the window\n"); + wsInfo.setStatus(j.getJobnum(), + WebserviceInfo.STATE_STOPPED_SERVERERROR); + wsInfo.appendProgressText( + j.getJobnum(), + "Failed to submit sequences for alignment.\n" + + "It is most likely that there is a problem with the server.\n" + + "Just close the window\n"); // e.printStackTrace(); // TODO: JBPNote DEBUG } @@ -526,8 +525,8 @@ class MsaWSThread extends JWS1Thread implements WSClientI for (int i = 0, j = seqs.length; i < j; i++) { - msa[i] = new jalview.datamodel.Sequence(seqs[i].getId(), seqs[i] - .getSeq()); + msa[i] = new jalview.datamodel.Sequence(seqs[i].getId(), + seqs[i].getSeq()); } return msa; @@ -546,13 +545,13 @@ class MsaWSThread extends JWS1Thread implements WSClientI && jobs[j].hasResults()) { results++; - //if (Cache.log.isDebugEnabled()) - // { - // System.out.println("Job lob for job "+jobs[j].getJobId()+":"+jobs[j].getJobnum()); - // System.out.println(jobs[j].getStatus()); - // } + // if (Cache.log.isDebugEnabled()) + // { + // System.out.println("Job lob for job "+jobs[j].getJobId()+":"+jobs[j].getJobnum()); + // System.out.println(jobs[j].getStatus()); + // } - vamsas.objects.simple.Alignment valign = ((MsaResult)((MsaWSJob) jobs[j]).result) + vamsas.objects.simple.Alignment valign = ((MsaResult) ((MsaWSJob) jobs[j]).result) .getMsa(); if (valign != null) { @@ -561,12 +560,13 @@ class MsaWSThread extends JWS1Thread implements WSClientI String[] lines = valign.getMethod(); for (int line = 0; line < lines.length; line++) { - wsInfo.appendProgressText(jobs[j].getJobnum(), lines[line] + "\n"); + wsInfo.appendProgressText(jobs[j].getJobnum(), lines[line] + + "\n"); } // JBPNote The returned files from a webservice could be // hidden behind icons in the monitor window that, // when clicked, pop up their corresponding data - + } } } @@ -695,8 +695,8 @@ class MsaWSThread extends JWS1Thread implements WSClientI } for (int i = 0, l = alorders.size(); i < l; i++) { - af.addSortByOrderMenuItem(WebServiceName - + ((String) names.get(i)) + " Ordering", + af.addSortByOrderMenuItem( + WebServiceName + ((String) names.get(i)) + " Ordering", (AlignmentOrder) alorders.get(i)); } } diff --git a/src/jalview/ws/jws1/SeqSearchWSClient.java b/src/jalview/ws/jws1/SeqSearchWSClient.java index 24dc7a4..c344967 100644 --- a/src/jalview/ws/jws1/SeqSearchWSClient.java +++ b/src/jalview/ws/jws1/SeqSearchWSClient.java @@ -249,7 +249,8 @@ public class SeqSearchWSClient extends WS1Client String dbs[] = null; try { - dbs = new jalview.ws.jws1.SeqSearchWSClient(sh).getSupportedDatabases(); + dbs = new jalview.ws.jws1.SeqSearchWSClient(sh) + .getSupportedDatabases(); } catch (Exception e) { jalview.bin.Cache.log.warn( @@ -268,8 +269,8 @@ public class SeqSearchWSClient extends WS1Client // use same input gatherer as for secondary structure prediction // we could actually parameterise the gatherer method here... AlignmentView msa = af.gatherSeqOrMsaForSecStrPrediction(); - new jalview.ws.jws1.SeqSearchWSClient(sh, af.getTitle(), msa, null, af - .getViewport().getAlignment().getDataset(), af); + new jalview.ws.jws1.SeqSearchWSClient(sh, af.getTitle(), msa, null, + af.getViewport().getAlignment().getDataset(), af); } }); // add entry for each database the service supports diff --git a/src/jalview/ws/jws1/SeqSearchWSThread.java b/src/jalview/ws/jws1/SeqSearchWSThread.java index 893482a..99a8d03 100644 --- a/src/jalview/ws/jws1/SeqSearchWSThread.java +++ b/src/jalview/ws/jws1/SeqSearchWSThread.java @@ -124,8 +124,8 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI // for // any // subjob - SeqNames.put(newname, jalview.analysis.SeqsetUtils - .SeqCharacterHash(seqs[i])); + SeqNames.put(newname, + jalview.analysis.SeqsetUtils.SeqCharacterHash(seqs[i])); if (valid && seqs[i].getEnd() - seqs[i].getStart() > minlen - 1) { seqarray[n] = new vamsas.objects.simple.Sequence(); @@ -140,8 +140,8 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI if (seqs[i].getEnd() >= seqs[i].getStart()) { empty = (submitGaps) ? seqs[i].getSequenceAsString() : AlignSeq - .extractGaps(jalview.util.Comparison.GapChars, seqs[i] - .getSequenceAsString()); + .extractGaps(jalview.util.Comparison.GapChars, + seqs[i].getSequenceAsString()); } emptySeqs.add(new String[] { newname, empty }); @@ -374,9 +374,8 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI } if (njobs > 0) { - wsinfo - .setProgressName("region " + jobs[j].getJobnum(), - jobs[j].getJobnum()); + wsinfo.setProgressName("region " + jobs[j].getJobnum(), + jobs[j].getJobnum()); } wsinfo.setProgressText(jobs[j].getJobnum(), OutputHeader); } @@ -430,7 +429,8 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI cancelledMessage += ("\nProblems cancelling the job : Exception received...\n" + exc + "\n"); Cache.log.warn( - "Exception whilst cancelling " + jobs[job].getJobId(), exc); + "Exception whilst cancelling " + jobs[job].getJobId(), + exc); } wsInfo.setProgressText(jobs[job].getJobnum(), OutputHeader + cancelledMessage + "\n"); @@ -447,17 +447,16 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI { if (!jobComplete) { - wsInfo - .setProgressText(OutputHeader - + "Server cannot cancel this job because it has not been submitted properly. just close the window.\n"); + wsInfo.setProgressText(OutputHeader + + "Server cannot cancel this job because it has not been submitted properly. just close the window.\n"); } } } public void pollJob(AWsJob job) throws Exception { - ((SeqSearchWSJob) job).result = server - .getResult(((SeqSearchWSJob) job).getJobId()); + ((SeqSearchWSJob) job).result = server.getResult(((SeqSearchWSJob) job) + .getJobId()); } public void StartJob(AWsJob job) @@ -488,8 +487,8 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI } try { - vamsas.objects.simple.WsJobId jobsubmit = server.search(j.seqs - .getSeqs()[0], dbArg); + vamsas.objects.simple.WsJobId jobsubmit = server.search( + j.seqs.getSeqs()[0], dbArg); if ((jobsubmit != null) && (jobsubmit.getStatus() == 1)) { @@ -521,13 +520,13 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI + e.toString() + "\n"); j.setAllowedServerExceptions(0); wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR); - wsInfo.setStatus(j.getJobnum(), WebserviceInfo.STATE_STOPPED_SERVERERROR); - wsInfo - .appendProgressText( - j.getJobnum(), - "Failed to submit sequences for alignment.\n" - + "It is most likely that there is a problem with the server.\n" - + "Just close the window\n"); + wsInfo.setStatus(j.getJobnum(), + WebserviceInfo.STATE_STOPPED_SERVERERROR); + wsInfo.appendProgressText( + j.getJobnum(), + "Failed to submit sequences for alignment.\n" + + "It is most likely that there is a problem with the server.\n" + + "Just close the window\n"); // e.printStackTrace(); // TODO: JBPNote DEBUG } @@ -541,8 +540,8 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI for (int i = 0, j = seqs.length; i < j; i++) { - msa[i] = new jalview.datamodel.Sequence(seqs[i].getId(), seqs[i] - .getSeq()); + msa[i] = new jalview.datamodel.Sequence(seqs[i].getId(), + seqs[i].getSeq()); } return msa; @@ -561,7 +560,7 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI && jobs[j].hasResults()) { results++; - vamsas.objects.simple.Alignment valign = ((SeqSearchResult) ((SeqSearchWSJob)jobs[j]).result) + vamsas.objects.simple.Alignment valign = ((SeqSearchResult) ((SeqSearchWSJob) jobs[j]).result) .getAlignment(); if (valign != null) { @@ -570,7 +569,8 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI String[] lines = valign.getMethod(); for (int line = 0; line < lines.length; line++) { - wsInfo.appendProgressText(jobs[j].getJobnum(), lines[line] + "\n"); + wsInfo.appendProgressText(jobs[j].getJobnum(), lines[line] + + "\n"); } // JBPNote The returned files from a webservice could be // hidden behind icons in the monitor window that, diff --git a/src/jalview/ws/jws1/WS1Client.java b/src/jalview/ws/jws1/WS1Client.java index d906a96..f05585d 100644 --- a/src/jalview/ws/jws1/WS1Client.java +++ b/src/jalview/ws/jws1/WS1Client.java @@ -27,11 +27,13 @@ import javax.swing.JMenu; import ext.vamsas.ServiceHandle; /** - * JWS1 Specific UI attributes and methods + * JWS1 Specific UI attributes and methods + * * @author JimP - * + * */ -public abstract class WS1Client extends WSClient implements WSMenuEntryProviderI +public abstract class WS1Client extends WSClient implements + WSMenuEntryProviderI { /** @@ -79,7 +81,7 @@ public abstract class WS1Client extends WSClient implements WSMenuEntryProviderI else { WebServiceJobTitle = sh.getAbstractName() + " using " + sh.getName(); - + } WebServiceReference = sh.getDescription(); WsURL = sh.getEndpointURL(); @@ -111,8 +113,8 @@ public abstract class WS1Client extends WSClient implements WSMenuEntryProviderI } /** - * method implemented by each concrete WS1Client implementation that creates menu - * entries that enact their service using data from alignFrame. + * method implemented by each concrete WS1Client implementation that creates + * menu entries that enact their service using data from alignFrame. * * @param wsmenu * where new menu entries (and submenus) are to be attached @@ -121,7 +123,7 @@ public abstract class WS1Client extends WSClient implements WSMenuEntryProviderI * created for * @param alignFrame */ - public abstract void attachWSMenuEntry(JMenu wsmenu, final ServiceHandle serviceHandle, - final AlignFrame alignFrame); + public abstract void attachWSMenuEntry(JMenu wsmenu, + final ServiceHandle serviceHandle, final AlignFrame alignFrame); } diff --git a/src/jalview/ws/jws1/WSJob.java b/src/jalview/ws/jws1/WSJob.java index 3916390..e542c3f 100644 --- a/src/jalview/ws/jws1/WSJob.java +++ b/src/jalview/ws/jws1/WSJob.java @@ -21,7 +21,9 @@ import jalview.ws.AWsJob; abstract class WSJob extends AWsJob { - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see jalview.ws.AWsJob#clearResponse() */ @Override @@ -30,22 +32,26 @@ abstract class WSJob extends AWsJob result = null; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see jalview.ws.AWsJob#hasResponse() */ @Override public boolean hasResponse() { - return result!=null; + return result != null; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see jalview.ws.AWsJob#hasStatus() */ @Override public boolean hasStatus() { - return result!=null && result.getStatus()!=null; + return result != null && result.getStatus() != null; } /** @@ -59,19 +65,21 @@ abstract class WSJob extends AWsJob */ public String getStatus() { - return result==null ? null : result.getStatus(); + return result == null ? null : result.getStatus(); } - public String getState() { - return result==null ? "NULL result" : ""+result.getState(); + public String getState() + { + return result == null ? "NULL result" : "" + result.getState(); } + /** * @return * @see vamsas.objects.simple.Result#isBroken() */ public boolean isBroken() { - return result!=null && result.isBroken(); + return result != null && result.isBroken(); } /** @@ -80,7 +88,7 @@ abstract class WSJob extends AWsJob */ public boolean isFailed() { - return result!=null && result.isFailed(); + return result != null && result.isFailed(); } /** @@ -89,7 +97,7 @@ abstract class WSJob extends AWsJob */ public boolean isFinished() { - return result!=null && result.isFinished(); + return result != null && result.isFinished(); } /** @@ -98,7 +106,7 @@ abstract class WSJob extends AWsJob */ public boolean isInvalid() { - return result!=null && result.isInvalid(); + return result != null && result.isInvalid(); } /** @@ -107,7 +115,7 @@ abstract class WSJob extends AWsJob */ public boolean isJobFailed() { - return result!=null && result.isJobFailed(); + return result != null && result.isJobFailed(); } /** @@ -116,7 +124,7 @@ abstract class WSJob extends AWsJob */ public boolean isQueued() { - return result!=null && result.isQueued(); + return result != null && result.isQueued(); } /** @@ -125,7 +133,7 @@ abstract class WSJob extends AWsJob */ public boolean isRunning() { - return result!=null && result.isRunning(); + return result != null && result.isRunning(); } /** @@ -134,6 +142,6 @@ abstract class WSJob extends AWsJob */ public boolean isServerError() { - return result!=null && result.isServerError(); + return result != null && result.isServerError(); } } diff --git a/src/jalview/ws/jws2/JWs2Job.java b/src/jalview/ws/jws2/JWs2Job.java index 608bf08..bbc0604 100644 --- a/src/jalview/ws/jws2/JWs2Job.java +++ b/src/jalview/ws/jws2/JWs2Job.java @@ -22,20 +22,24 @@ import compbio.metadata.JobStatus; import jalview.ws.AWsJob; /** - * job status processing for JWS2 jobs. + * job status processing for JWS2 jobs. + * * @author JimP - * + * */ public abstract class JWs2Job extends AWsJob { - JobStatus status=null; + JobStatus status = null; + public void setjobStatus(JobStatus jobStatus) { status = jobStatus; // update flags } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see jalview.ws.AWsJob#clearResponse() */ @Override @@ -44,97 +48,111 @@ public abstract class JWs2Job extends AWsJob status = null; } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see jalview.ws.AWsJob#getState() */ @Override public String getState() { - return status==null ? ("Unknown") : status.toString(); + return status == null ? ("Unknown") : status.toString(); } - /* (non-Javadoc) + + /* + * (non-Javadoc) + * * @see jalview.ws.AWsJob#hasResponse() */ @Override public boolean hasResponse() { // TODO Auto-generated method stub - return status!=null; + return status != null; } + /* - StringBuffer statusBuffer = null; - * (non-Javadoc) - * @see jalview.ws.AWsJob#getStatus() - * - @Override - public String getStatus() - { - return statusBuffer.toString(); - } - * (non-Javadoc) + * StringBuffer statusBuffer = null; (non-Javadoc) + * + * @see jalview.ws.AWsJob#getStatus() + * + * @Override public String getStatus() { return statusBuffer.toString(); } + * (non-Javadoc) + * * @see jalview.ws.AWsJob#hasStatus() - * - @Override - public boolean hasStatus() - { - return statusBuffer!=null; - } -*/ + * + * @Override public boolean hasStatus() { return statusBuffer!=null; } + */ - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see jalview.ws.AWsJob#isBroken() */ @Override public boolean isBroken() { - return status==null ? false : status.equals(status.UNDEFINED); + return status == null ? false : status.equals(status.UNDEFINED); } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see jalview.ws.AWsJob#isFailed() */ @Override public boolean isFailed() { - return status==null ? false : status.equals(status.FAILED); + return status == null ? false : status.equals(status.FAILED); } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see jalview.ws.AWsJob#isFinished() */ @Override public boolean isFinished() { - return status==null ? false : status.equals(status.FINISHED); + return status == null ? false : status.equals(status.FINISHED); } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see jalview.ws.AWsJob#isQueued() */ @Override public boolean isQueued() { - return status==null ? false : status.equals(status.SUBMITTED) || status.equals(status.PENDING); + return status == null ? false : status.equals(status.SUBMITTED) + || status.equals(status.PENDING); } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see jalview.ws.AWsJob#isRunning() */ @Override public boolean isRunning() { // TODO Auto-generated method stub - return status!=null && (status.equals(status.RUNNING) || status.equals(status.STARTED)); + return status != null + && (status.equals(status.RUNNING) || status + .equals(status.STARTED)); } - /* (non-Javadoc) + /* + * (non-Javadoc) + * * @see jalview.ws.AWsJob#isServerError() */ @Override public boolean isServerError() { - // server errors are raised as exceptions on the service method calls. - return status==null ? false : false; // status.equals(status.FAILED); + // server errors are raised as exceptions on the service method calls. + return status == null ? false : false; // status.equals(status.FAILED); } } diff --git a/src/jalview/ws/jws2/JabaPreset.java b/src/jalview/ws/jws2/JabaPreset.java index 948455b..c86a790 100644 --- a/src/jalview/ws/jws2/JabaPreset.java +++ b/src/jalview/ws/jws2/JabaPreset.java @@ -25,58 +25,73 @@ import java.util.List; import compbio.metadata.Preset; -public class JabaPreset implements WsParamSetI { - Preset p=null; +public class JabaPreset implements WsParamSetI +{ + Preset p = null; + Jws2Instance service; - public JabaPreset(Jws2Instance svc, Preset preset) { - service=svc; - p=preset; + + public JabaPreset(Jws2Instance svc, Preset preset) + { + service = svc; + p = preset; } + @Override public String getName() { return p.getName(); } + @Override public String getDescription() { return p.getDescription(); } + @Override public String[] getApplicableUrls() { - return new String[] { service.getUri()}; + return new String[] + { service.getUri() }; } + @Override public String getSourceFile() { return null; } + @Override public boolean isModifiable() { return false; } + @Override public void setSourceFile(String newfile) { - throw new Error("Cannot set source file for "+getClass()); + throw new Error("Cannot set source file for " + getClass()); } + @Override public List getArguments() { - try { - return JabaParamStore.getJwsArgsfromJaba(p.getArguments(service.getRunnerConfig())); - } - catch (Exception e) + try + { + return JabaParamStore.getJwsArgsfromJaba(p.getArguments(service + .getRunnerConfig())); + } catch (Exception e) { e.printStackTrace(); - throw new Error("Probable mismatch between service instance and preset!"); + throw new Error( + "Probable mismatch between service instance and preset!"); } } + @Override public void setArguments(List args) { - throw new Error("Cannot set Parameters for a Jaba Web service's preset"); + throw new Error("Cannot set Parameters for a Jaba Web service's preset"); } } diff --git a/src/jalview/ws/jws2/Jws2Client.java b/src/jalview/ws/jws2/Jws2Client.java index 706c138..a9ca8f0 100644 --- a/src/jalview/ws/jws2/Jws2Client.java +++ b/src/jalview/ws/jws2/Jws2Client.java @@ -45,27 +45,26 @@ public abstract class Jws2Client extends jalview.ws.WSClient } return null; } + /* - Jws2Instance serviceHandle; - * (non-Javadoc) - * @see jalview.ws.WSMenuEntryProviderI#attachWSMenuEntry(javax.swing.JMenu, jalview.gui.AlignFrame) - * - @Override - public void attachWSMenuEntry(JMenu wsmenu, AlignFrame alignFrame) - { - if (serviceHandle==null) - { - throw new Error("Implementation error: No service handle for this Jws2 service."); - } - attachWSMenuEntry(wsmenu, serviceHandle, alignFrame); - }*/ + * Jws2Instance serviceHandle; (non-Javadoc) + * + * @see jalview.ws.WSMenuEntryProviderI#attachWSMenuEntry(javax.swing.JMenu, + * jalview.gui.AlignFrame) + * + * @Override public void attachWSMenuEntry(JMenu wsmenu, AlignFrame + * alignFrame) { if (serviceHandle==null) { throw new + * Error("Implementation error: No service handle for this Jws2 service."); } + * attachWSMenuEntry(wsmenu, serviceHandle, alignFrame); } + */ /** * add the menu item for a particular jws2 service instance + * * @param wsmenu * @param service * @param alignFrame */ - abstract void attachWSMenuEntry(JMenu wsmenu, - final Jws2Instance service, final AlignFrame alignFrame); + abstract void attachWSMenuEntry(JMenu wsmenu, final Jws2Instance service, + final AlignFrame alignFrame); } diff --git a/src/jalview/ws/jws2/Jws2Discoverer.java b/src/jalview/ws/jws2/Jws2Discoverer.java index 8e29817..e56a5e5 100644 --- a/src/jalview/ws/jws2/Jws2Discoverer.java +++ b/src/jalview/ws/jws2/Jws2Discoverer.java @@ -179,9 +179,10 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI } System.out.println("Discovered service: " + jwsservers + " " + srv.toString()); - Jws2Instance service = new Jws2Instance(jwsservers, srv.toString(), service2); + Jws2Instance service = new Jws2Instance(jwsservers, srv.toString(), + service2); - services.add(service); + services.add(service); // retrieve the presets and parameter set and cache now service.getParamStore().getPresets(); service.hasParameters(); @@ -299,22 +300,25 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI public String getUri() { // this is only valid for Jaba 1.0 - this formula might have to change! - return hosturl+(hosturl.lastIndexOf("/")==(hosturl.length()-1) ? "/" : "") +serviceType; + return hosturl + + (hosturl.lastIndexOf("/") == (hosturl.length() - 1) ? "/" + : "") + serviceType; } - private boolean hasParams=false,lookedForParams=false; + + private boolean hasParams = false, lookedForParams = false; public boolean hasParameters() { if (!lookedForParams) { - lookedForParams=true; - try - { - hasParams = (getRunnerConfig().getArguments().size() > 0); - } catch (Exception e) - { + lookedForParams = true; + try + { + hasParams = (getRunnerConfig().getArguments().size() > 0); + } catch (Exception e) + { - } + } } return hasParams; } @@ -383,7 +387,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI }); wsmenu.add(jws2al); - + } private void populateWSMenuEntry(JMenu jws2al, final AlignFrame alignFrame) @@ -402,7 +406,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI MsaWSClient msacl = new MsaWSClient(); Vector hostLabels = new Vector(); jws2al.removeAll(); - String lasthost=null; + String lasthost = null; for (final Jws2Instance service : services) { atpoint = jws2al; @@ -424,22 +428,27 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI atpoint.setToolTipText(service.getActionText()); } } - if (!byhost && !hostLabels.contains(host + service.serviceType+service.getActionText())) - //!hostLabels.contains(host + (bytype ? service.serviceType+service.getActionText() : ""))) + if (!byhost + && !hostLabels.contains(host + service.serviceType + + service.getActionText())) + // !hostLabels.contains(host + (bytype ? + // service.serviceType+service.getActionText() : ""))) { // add a marker indicating where this service is hosted // relies on services from the same host being listed in a contiguous // group JMenuItem hitm; atpoint.addSeparator(); - if (lasthost==null || !lasthost.equals(host)) + if (lasthost == null || !lasthost.equals(host)) { atpoint.add(hitm = new JMenuItem(host)); hitm.setForeground(Color.blue); lasthost = host; } - hostLabels.addElement(host + service.serviceType+service.getActionText() ); - // hostLabels.addElement(host + (bytype ? service.serviceType+service.getActionText() : "")); + hostLabels.addElement(host + service.serviceType + + service.getActionText()); + // hostLabels.addElement(host + (bytype ? + // service.serviceType+service.getActionText() : "")); } msacl.attachWSMenuEntry(atpoint, service, alignFrame); /* diff --git a/src/jalview/ws/jws2/MsaWSClient.java b/src/jalview/ws/jws2/MsaWSClient.java index f3c385a..ea91d63 100644 --- a/src/jalview/ws/jws2/MsaWSClient.java +++ b/src/jalview/ws/jws2/MsaWSClient.java @@ -274,18 +274,19 @@ public class MsaWSClient extends Jws2Client boolean hasparams = service.hasParameters(); do { - String action="Align "; + String action = "Align "; if (submitGaps == true) { - action="Realign "; + action = "Realign "; msawsmenu = new JMenu("Realign with " + svcname); - msawsmenu.setToolTipText("Align sequences to an existing alignment"); + msawsmenu + .setToolTipText("Align sequences to an existing alignment"); rmsawsmenu.add(msawsmenu); } final boolean withGaps = submitGaps; JMenuItem method = new JMenuItem(calcName + "Defaults"); - method.setToolTipText(action+"with default settings"); + method.setToolTipText(action + "with default settings"); method.addActionListener(new ActionListener() { @@ -301,7 +302,8 @@ public class MsaWSClient extends Jws2Client msawsmenu.add(method); if (hasparams) { - // only add these menu options if the service has user-modifiable arguments + // only add these menu options if the service has user-modifiable + // arguments method = new JMenuItem(calcName + "Edit and run ..."); method.setToolTipText("View and change the parameters before alignment."); diff --git a/src/jalview/ws/jws2/ParameterUtils.java b/src/jalview/ws/jws2/ParameterUtils.java index f66027d..1f76462 100644 --- a/src/jalview/ws/jws2/ParameterUtils.java +++ b/src/jalview/ws/jws2/ParameterUtils.java @@ -28,15 +28,17 @@ import compbio.metadata.*; public class ParameterUtils { - public static List writeParameterSet(List