From 4d7f98a6dd54d9863ba449ec79dcd95d25ed863d Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 10 Sep 2015 04:57:44 +0100 Subject: [PATCH] JAL-1645 source formatting and organise imports --- src/MCview/AppletPDBCanvas.java | 36 +- src/MCview/AppletPDBViewer.java | 29 +- src/MCview/Bond.java | 6 +- src/MCview/PDBCanvas.java | 31 +- src/MCview/PDBChain.java | 29 +- src/MCview/PDBViewer.java | 12 +- src/MCview/PDBfile.java | 50 +- src/MCview/Zsort.java | 3 +- src/com/github/reinert/jjschema/Attributes.java | 39 +- src/com/stevesoft/pat/Any.java | 2 +- src/com/stevesoft/pat/BackG.java | 2 +- src/com/stevesoft/pat/BackMatch.java | 2 +- src/com/stevesoft/pat/Backup.java | 2 +- src/com/stevesoft/pat/Bits.java | 4 +- src/com/stevesoft/pat/Boundary.java | 2 +- src/com/stevesoft/pat/Bracket.java | 3 +- src/com/stevesoft/pat/Ctrl.java | 97 +- src/com/stevesoft/pat/Custom.java | 6 +- src/com/stevesoft/pat/CustomEndpoint.java | 2 +- src/com/stevesoft/pat/DotMulti.java | 2 +- src/com/stevesoft/pat/End.java | 2 +- src/com/stevesoft/pat/FastBracket.java | 3 +- src/com/stevesoft/pat/FastMulti.java | 2 +- src/com/stevesoft/pat/FileRegex.java | 81 +- src/com/stevesoft/pat/Group.java | 2 +- src/com/stevesoft/pat/Multi.java | 8 +- src/com/stevesoft/pat/Multi_stage2.java | 2 +- src/com/stevesoft/pat/NoPattern.java | 2 +- src/com/stevesoft/pat/NullPattern.java | 2 +- src/com/stevesoft/pat/Or.java | 3 +- src/com/stevesoft/pat/OrMark.java | 2 +- src/com/stevesoft/pat/Pattern.java | 6 +- src/com/stevesoft/pat/Pthings.java | 2 +- src/com/stevesoft/pat/PushRule.java | 5 +- src/com/stevesoft/pat/Range.java | 2 +- src/com/stevesoft/pat/RegOpt.java | 4 +- src/com/stevesoft/pat/RegRes.java | 4 +- src/com/stevesoft/pat/Regex.java | 77 +- src/com/stevesoft/pat/RegexReader.java | 5 +- src/com/stevesoft/pat/RegexTokenizer.java | 3 +- src/com/stevesoft/pat/ReplaceRule.java | 2 +- src/com/stevesoft/pat/Replacer.java | 6 +- src/com/stevesoft/pat/Skip.java | 4 +- src/com/stevesoft/pat/SkipBMH.java | 10 +- src/com/stevesoft/pat/Skipped.java | 6 +- src/com/stevesoft/pat/Start.java | 2 +- src/com/stevesoft/pat/StringLike.java | 8 +- src/com/stevesoft/pat/Transformer.java | 6 +- src/com/stevesoft/pat/lookAhead.java | 2 +- src/com/stevesoft/pat/oneChar.java | 2 +- .../stevesoft/pat/wrap/CharArrayBufferWrap.java | 3 +- src/com/stevesoft/pat/wrap/CharArrayWrap.java | 3 +- .../stevesoft/pat/wrap/RandomAccessFileWrap.java | 17 +- src/com/stevesoft/pat/wrap/StringBufferWrap.java | 3 +- src/com/stevesoft/pat/wrap/StringWrap.java | 3 +- src/com/stevesoft/pat/wrap/WriterWrap.java | 6 +- src/ext/edu/ucsf/rbvi/strucviz2/ChimUtils.java | 1678 +++--- src/ext/edu/ucsf/rbvi/strucviz2/ChimeraChain.java | 554 +- .../edu/ucsf/rbvi/strucviz2/ChimeraManager.java | 23 +- src/ext/edu/ucsf/rbvi/strucviz2/ChimeraModel.java | 987 ++-- .../edu/ucsf/rbvi/strucviz2/ChimeraResidue.java | 752 +-- .../rbvi/strucviz2/ChimeraStructuralObject.java | 120 +- .../edu/ucsf/rbvi/strucviz2/ChimeraTreeModel.java | 306 +- .../edu/ucsf/rbvi/strucviz2/StructureManager.java | 14 +- .../edu/ucsf/rbvi/strucviz2/StructureSettings.java | 35 +- src/ext/vamsas/IRegistryServiceLocator.java | 10 +- src/ext/vamsas/JpredServiceLocator.java | 10 +- src/ext/vamsas/JpredSoapBindingStub.java | 14 +- src/ext/vamsas/MuscleWSServiceLocator.java | 10 +- src/ext/vamsas/MuscleWSSoapBindingStub.java | 15 +- src/ext/vamsas/RegistryServiceSoapBindingStub.java | 3 +- src/ext/vamsas/SeqSearchServiceLocator.java | 10 +- .../vamsas/SeqSearchServiceSoapBindingStub.java | 18 +- src/jalview/analysis/AAFrequency.java | 19 +- src/jalview/analysis/AlignSeq.java | 44 +- src/jalview/analysis/AlignmentAnnotationUtils.java | 8 +- src/jalview/analysis/AlignmentSorter.java | 16 +- src/jalview/analysis/AlignmentUtils.java | 84 +- src/jalview/analysis/AnnotationSorter.java | 9 +- src/jalview/analysis/Conservation.java | 33 +- src/jalview/analysis/CrossRef.java | 13 +- src/jalview/analysis/Dna.java | 20 +- src/jalview/analysis/Finder.java | 2 +- src/jalview/analysis/Grouping.java | 4 +- src/jalview/analysis/NJTree.java | 3 +- src/jalview/analysis/PCA.java | 8 +- src/jalview/analysis/ParseProperties.java | 9 +- src/jalview/analysis/Rna.java | 33 +- src/jalview/analysis/SeqsetUtils.java | 13 +- src/jalview/analysis/SequenceIdMatcher.java | 4 +- src/jalview/analysis/StructureFrequency.java | 19 +- .../scoremodels/PairwiseSeqScoreModel.java | 1 - src/jalview/api/AlignViewControllerGuiI.java | 4 +- src/jalview/api/AlignViewControllerI.java | 14 +- src/jalview/api/AlignViewportI.java | 9 +- src/jalview/api/AlignmentViewPanel.java | 2 +- src/jalview/api/FeatureRenderer.java | 4 +- src/jalview/api/FeatureSettingsControllerI.java | 2 +- src/jalview/api/ViewStyleI.java | 2 +- src/jalview/api/analysis/ViewBasedAnalysisI.java | 2 +- .../api/structures/JalviewStructureDisplayI.java | 2 + src/jalview/appletgui/APopupMenu.java | 116 +- src/jalview/appletgui/AlignFrame.java | 103 +- src/jalview/appletgui/AlignViewport.java | 7 +- src/jalview/appletgui/AlignmentPanel.java | 62 +- src/jalview/appletgui/AnnotationColumnChooser.java | 3 +- src/jalview/appletgui/AnnotationLabels.java | 62 +- src/jalview/appletgui/AnnotationRowFilter.java | 6 - src/jalview/appletgui/AppletJmol.java | 10 +- src/jalview/appletgui/CutAndPasteTransfer.java | 29 +- src/jalview/appletgui/EditNameDialog.java | 7 +- src/jalview/appletgui/EmbmenuFrame.java | 7 +- src/jalview/appletgui/FeatureColourChooser.java | 36 +- src/jalview/appletgui/FeatureRenderer.java | 19 +- src/jalview/appletgui/FeatureSettings.java | 50 +- src/jalview/appletgui/Finder.java | 7 +- src/jalview/appletgui/FontChooser.java | 6 +- src/jalview/appletgui/IdCanvas.java | 18 +- src/jalview/appletgui/JVDialog.java | 10 +- src/jalview/appletgui/OverviewPanel.java | 4 +- src/jalview/appletgui/PCAPanel.java | 26 +- src/jalview/appletgui/PaintRefresher.java | 12 +- src/jalview/appletgui/RedundancyPanel.java | 9 +- src/jalview/appletgui/RotatableCanvas.java | 26 +- src/jalview/appletgui/ScalePanel.java | 24 +- src/jalview/appletgui/SeqCanvas.java | 14 +- src/jalview/appletgui/SeqPanel.java | 53 +- src/jalview/appletgui/SequenceRenderer.java | 16 +- src/jalview/appletgui/SliderPanel.java | 9 +- src/jalview/appletgui/SplitFrame.java | 10 +- src/jalview/appletgui/Tooltip.java | 19 +- src/jalview/appletgui/UserDefinedColours.java | 21 +- src/jalview/bin/BuildDetails.java | 3 - src/jalview/bin/Cache.java | 41 +- src/jalview/bin/Jalview.java | 43 +- src/jalview/bin/JalviewLite.java | 35 +- src/jalview/binding/Alignment.java | 305 +- src/jalview/binding/Annotation.java | 837 +-- src/jalview/binding/AnnotationElement.java | 546 +- src/jalview/binding/Colour.java | 939 ++-- src/jalview/binding/Feature.java | 544 +- src/jalview/binding/FeatureSettings.java | 464 +- src/jalview/binding/Features.java | 178 +- src/jalview/binding/JGroup.java | 1457 +++--- src/jalview/binding/JSeq.java | 1226 ++--- src/jalview/binding/JalviewModel.java | 409 +- src/jalview/binding/JalviewModelSequence.java | 1835 +++---- src/jalview/binding/JalviewUserColours.java | 618 +-- src/jalview/binding/Pdbentry.java | 614 +-- src/jalview/binding/PdbentryItem.java | 344 +- src/jalview/binding/Pdbids.java | 178 +- src/jalview/binding/Property.java | 305 +- src/jalview/binding/Sequence.java | 178 +- src/jalview/binding/SequenceSet.java | 1010 ++-- src/jalview/binding/SequenceType.java | 356 +- src/jalview/binding/Setting.java | 462 +- src/jalview/binding/Tree.java | 1621 +++--- src/jalview/binding/UserColourScheme.java | 179 +- src/jalview/binding/UserColours.java | 306 +- src/jalview/binding/VAMSAS.java | 1141 ++-- src/jalview/binding/VamsasModel.java | 177 +- src/jalview/binding/Viewport.java | 2793 +++++----- src/jalview/commands/EditCommand.java | 25 +- src/jalview/commands/RemoveGapColCommand.java | 6 +- src/jalview/commands/RemoveGapsCommand.java | 10 +- src/jalview/controller/AlignViewController.java | 44 +- .../controller/FeatureSettingsController.java | 6 +- src/jalview/datamodel/AlignedCodonFrame.java | 14 +- src/jalview/datamodel/Alignment.java | 75 +- src/jalview/datamodel/AlignmentAnnotation.java | 28 +- src/jalview/datamodel/AlignmentExportData.java | 1 - src/jalview/datamodel/AlignmentI.java | 5 +- src/jalview/datamodel/AlignmentView.java | 47 +- src/jalview/datamodel/BinarySequence.java | 3 +- src/jalview/datamodel/CigarArray.java | 10 +- src/jalview/datamodel/CigarBase.java | 56 +- src/jalview/datamodel/ColumnSelection.java | 24 +- src/jalview/datamodel/DBRefSource.java | 22 +- src/jalview/datamodel/Mapping.java | 25 +- src/jalview/datamodel/PDBEntry.java | 11 +- src/jalview/datamodel/Provenance.java | 2 +- src/jalview/datamodel/RnaViewerModel.java | 4 +- src/jalview/datamodel/SearchResults.java | 3 +- src/jalview/datamodel/SeqCigar.java | 57 +- src/jalview/datamodel/Sequence.java | 11 +- src/jalview/datamodel/SequenceCollectionI.java | 10 +- src/jalview/datamodel/SequenceDummy.java | 3 +- src/jalview/datamodel/SequenceGroup.java | 29 +- src/jalview/datamodel/SequenceI.java | 5 +- src/jalview/datamodel/SequenceNode.java | 2 +- src/jalview/datamodel/StructureViewerModel.java | 1 + src/jalview/datamodel/xdb/embl/EmblEntry.java | 33 +- src/jalview/datamodel/xdb/embl/EmblFeature.java | 4 +- src/jalview/datamodel/xdb/embl/EmblFile.java | 5 +- src/jalview/ext/jmol/JalviewJmolBinding.java | 30 +- src/jalview/ext/jmol/PDBFileWithJmol.java | 8 +- src/jalview/ext/paradise/Annotate3D.java | 14 +- src/jalview/ext/rbvi/chimera/ChimeraCommands.java | 25 +- src/jalview/ext/rbvi/chimera/ChimeraListener.java | 6 +- src/jalview/gui/AlignExportSettings.java | 4 +- src/jalview/gui/AlignFrame.java | 263 +- src/jalview/gui/AlignViewport.java | 33 +- src/jalview/gui/AlignmentPanel.java | 66 +- src/jalview/gui/AnnotationChooser.java | 23 +- src/jalview/gui/AnnotationColourChooser.java | 18 +- src/jalview/gui/AnnotationColumnChooser.java | 56 +- src/jalview/gui/AnnotationExporter.java | 27 +- src/jalview/gui/AnnotationLabels.java | 94 +- src/jalview/gui/AnnotationPanel.java | 12 +- src/jalview/gui/AnnotationRowFilter.java | 2 - src/jalview/gui/AppJmol.java | 38 +- src/jalview/gui/AppJmolBinding.java | 10 +- src/jalview/gui/AppVarna.java | 10 +- src/jalview/gui/AppVarnaBinding.java | 17 +- src/jalview/gui/AssociatePdbFileWithSeq.java | 4 +- src/jalview/gui/BlogReader.java | 13 +- src/jalview/gui/ChimeraViewFrame.java | 38 +- src/jalview/gui/Console.java | 26 +- src/jalview/gui/CutAndPasteHtmlTransfer.java | 31 +- src/jalview/gui/CutAndPasteTransfer.java | 15 +- src/jalview/gui/DasSourceBrowser.java | 27 +- src/jalview/gui/Desktop.java | 102 +- src/jalview/gui/EPSOptions.java | 19 +- src/jalview/gui/EditNameDialog.java | 11 +- src/jalview/gui/FeatureColourChooser.java | 33 +- src/jalview/gui/FeatureRenderer.java | 26 +- src/jalview/gui/FeatureSettings.java | 74 +- src/jalview/gui/Finder.java | 14 +- src/jalview/gui/FontChooser.java | 15 +- src/jalview/gui/HTMLOptions.java | 3 +- src/jalview/gui/Help.java | 4 +- src/jalview/gui/IdCanvas.java | 19 +- src/jalview/gui/IdPanel.java | 14 +- src/jalview/gui/IdwidthAdjuster.java | 4 +- src/jalview/gui/JDatabaseTree.java | 17 +- src/jalview/gui/Jalview2XML.java | 15 +- src/jalview/gui/Jalview2XML_V1.java | 25 +- src/jalview/gui/JalviewChimeraBindingModel.java | 21 +- src/jalview/gui/JvSwingUtils.java | 6 +- src/jalview/gui/OOMWarning.java | 11 +- src/jalview/gui/OptsAndParamsPage.java | 57 +- src/jalview/gui/OverviewPanel.java | 6 +- src/jalview/gui/PCAPanel.java | 56 +- src/jalview/gui/PDBSearchPanel.java | 2 - src/jalview/gui/PopupMenu.java | 107 +- src/jalview/gui/Preferences.java | 49 +- src/jalview/gui/ProgressBar.java | 15 +- src/jalview/gui/PromptUserConfig.java | 2 +- src/jalview/gui/RedundancyPanel.java | 21 +- src/jalview/gui/RestInputParamEditDialog.java | 14 +- src/jalview/gui/RestServiceEditorPane.java | 6 +- src/jalview/gui/RotatableCanvas.java | 35 +- src/jalview/gui/SVGOptions.java | 3 +- src/jalview/gui/ScalePanel.java | 16 +- src/jalview/gui/SeqCanvas.java | 33 +- src/jalview/gui/SeqPanel.java | 84 +- src/jalview/gui/SequenceFetcher.java | 59 +- src/jalview/gui/SequenceRenderer.java | 5 +- src/jalview/gui/SliderPanel.java | 9 +- src/jalview/gui/SplitFrame.java | 8 +- src/jalview/gui/StructureChooser.java | 102 +- src/jalview/gui/StructureViewer.java | 15 +- src/jalview/gui/StructureViewerBase.java | 54 +- src/jalview/gui/TextColourChooser.java | 25 +- src/jalview/gui/TreeCanvas.java | 15 +- src/jalview/gui/TreePanel.java | 25 +- src/jalview/gui/UserDefinedColours.java | 112 +- src/jalview/gui/UserQuestionnaireCheck.java | 7 +- src/jalview/gui/VamsasApplication.java | 28 +- src/jalview/gui/ViewSelectionMenu.java | 4 +- src/jalview/gui/WebserviceInfo.java | 16 +- src/jalview/gui/WsJobParameters.java | 33 +- src/jalview/gui/WsParamSetManager.java | 11 +- src/jalview/gui/WsPreferences.java | 28 +- src/jalview/httpserver/HttpServer.java | 6 +- src/jalview/io/AMSAFile.java | 3 +- src/jalview/io/AlignFile.java | 41 +- src/jalview/io/AlignmentProperties.java | 6 +- src/jalview/io/AnnotationFile.java | 29 +- src/jalview/io/AppletFormatAdapter.java | 60 +- src/jalview/io/BLCFile.java | 2 +- src/jalview/io/BioJsHTMLOutput.java | 18 +- src/jalview/io/ClustalFile.java | 14 +- src/jalview/io/FastaFile.java | 8 +- src/jalview/io/FeaturesFile.java | 58 +- src/jalview/io/FileLoader.java | 8 +- src/jalview/io/FileParse.java | 40 +- src/jalview/io/FormatAdapter.java | 14 +- src/jalview/io/Gff3File.java | 4 +- src/jalview/io/HTMLOutput.java | 22 +- src/jalview/io/HtmlFile.java | 4 +- src/jalview/io/HtmlSvgOutput.java | 55 +- src/jalview/io/IdentifyFile.java | 9 +- src/jalview/io/JPredFile.java | 25 +- src/jalview/io/JalviewFileChooser.java | 6 +- src/jalview/io/JalviewFileFilter.java | 6 +- src/jalview/io/JalviewFileView.java | 9 +- src/jalview/io/JnetAnnotationMaker.java | 3 +- src/jalview/io/ModellerDescription.java | 19 +- src/jalview/io/NewickFile.java | 18 +- src/jalview/io/PIRFile.java | 7 +- src/jalview/io/PfamFile.java | 15 +- src/jalview/io/PhylipFile.java | 4 +- src/jalview/io/PileUpfile.java | 6 +- src/jalview/io/RnamlFile.java | 18 +- src/jalview/io/SequenceAnnotationReport.java | 32 +- src/jalview/io/SimpleBlastFile.java | 14 +- src/jalview/io/StockholmFile.java | 27 +- src/jalview/io/TCoffeeScoreFile.java | 3 +- src/jalview/io/VamsasAppDatastore.java | 44 +- src/jalview/io/WSWUBlastClient.java | 35 +- src/jalview/io/vamsas/Datasetsequence.java | 1 + src/jalview/io/vamsas/DatastoreItem.java | 43 +- src/jalview/io/vamsas/DatastoreRegistry.java | 3 +- src/jalview/io/vamsas/Dbref.java | 3 +- src/jalview/io/vamsas/Rangetype.java | 19 +- src/jalview/io/vamsas/Sequencefeature.java | 6 +- src/jalview/io/vamsas/Sequencemapping.java | 3 +- src/jalview/io/vamsas/Tree.java | 19 +- src/jalview/javascript/JSFunctionExec.java | 3 +- src/jalview/javascript/JsSelectionSender.java | 12 +- src/jalview/javascript/MouseOverListener.java | 6 +- .../javascript/MouseOverStructureListener.java | 11 +- src/jalview/jbgui/GAlignExportSettings.java | 5 +- src/jalview/jbgui/GAlignFrame.java | 15 +- src/jalview/jbgui/GAlignmentPanel.java | 13 +- src/jalview/jbgui/GCutAndPasteHtmlTransfer.java | 20 +- src/jalview/jbgui/GCutAndPasteTransfer.java | 18 +- src/jalview/jbgui/GDasSourceBrowser.java | 29 +- src/jalview/jbgui/GDesktop.java | 9 +- src/jalview/jbgui/GFinder.java | 1 - src/jalview/jbgui/GFontChooser.java | 9 +- src/jalview/jbgui/GPDBSearchPanel.java | 29 +- src/jalview/jbgui/GPairwiseAlignPanel.java | 10 +- src/jalview/jbgui/GPreferences.java | 37 +- src/jalview/jbgui/GRestInputParamEditDialog.java | 15 +- src/jalview/jbgui/GRestServiceEditorPane.java | 18 +- src/jalview/jbgui/GRnaStructureViewer.java | 2 +- src/jalview/jbgui/GSequenceLink.java | 27 +- src/jalview/jbgui/GSliderPanel.java | 19 +- src/jalview/jbgui/GSplitFrame.java | 6 +- src/jalview/jbgui/GStructureChooser.java | 20 +- src/jalview/jbgui/GStructureViewer.java | 9 +- src/jalview/jbgui/GUserDefinedColours.java | 45 +- src/jalview/jbgui/GWebserviceInfo.java | 18 +- src/jalview/jbgui/PDBDocFieldPreferences.java | 25 +- .../json/binding/biojs/BioJSRepositoryPojo.java | 4 +- .../biojson/v1/AlignmentAnnotationPojo.java | 10 +- .../json/binding/biojson/v1/AlignmentPojo.java | 22 +- .../json/binding/biojson/v1/AnnotationPojo.java | 14 +- .../binding/biojson/v1/SequenceFeaturesPojo.java | 22 +- .../json/binding/biojson/v1/SequenceGrpPojo.java | 35 +- .../json/binding/biojson/v1/SequencePojo.java | 28 +- src/jalview/math/Matrix.java | 13 +- src/jalview/renderer/AnnotationRenderer.java | 58 +- .../renderer/seqfeatures/FeatureRenderer.java | 6 +- src/jalview/rest/RestHandler.java | 4 +- src/jalview/schemabinding/version2/AlcodMap.java | 332 +- src/jalview/schemabinding/version2/Alcodon.java | 484 +- .../schemabinding/version2/AlcodonFrame.java | 828 +-- src/jalview/schemabinding/version2/Annotation.java | 2701 +++++----- .../version2/AnnotationColourScheme.java | 934 ++-- .../schemabinding/version2/AnnotationColours.java | 183 +- .../schemabinding/version2/AnnotationElement.java | 652 +-- .../schemabinding/version2/CalcIdParam.java | 546 +- src/jalview/schemabinding/version2/Colour.java | 940 ++-- src/jalview/schemabinding/version2/DBRef.java | 408 +- src/jalview/schemabinding/version2/Feature.java | 1025 ++-- .../schemabinding/version2/FeatureSettings.java | 824 +-- src/jalview/schemabinding/version2/Features.java | 178 +- src/jalview/schemabinding/version2/Group.java | 369 +- .../schemabinding/version2/HiddenColumns.java | 399 +- src/jalview/schemabinding/version2/JGroup.java | 2460 ++++----- src/jalview/schemabinding/version2/JSeq.java | 1972 +++---- .../schemabinding/version2/JalviewModel.java | 412 +- .../version2/JalviewModelSequence.java | 1869 +++---- .../schemabinding/version2/JalviewUserColours.java | 621 +-- .../schemabinding/version2/MapListFrom.java | 399 +- src/jalview/schemabinding/version2/MapListTo.java | 399 +- .../schemabinding/version2/MapListType.java | 1135 ++-- src/jalview/schemabinding/version2/Mapping.java | 290 +- .../schemabinding/version2/MappingChoice.java | 308 +- src/jalview/schemabinding/version2/OtherData.java | 307 +- src/jalview/schemabinding/version2/Pdbentry.java | 671 +-- .../schemabinding/version2/PdbentryItem.java | 352 +- src/jalview/schemabinding/version2/Pdbids.java | 481 +- src/jalview/schemabinding/version2/Property.java | 307 +- src/jalview/schemabinding/version2/RnaViewer.java | 1271 ++--- .../schemabinding/version2/SecondaryStructure.java | 534 +- src/jalview/schemabinding/version2/Sequence.java | 579 ++- .../schemabinding/version2/SequenceSet.java | 1637 +++--- .../version2/SequenceSetProperties.java | 309 +- .../schemabinding/version2/SequenceType.java | 409 +- src/jalview/schemabinding/version2/Setting.java | 1335 ++--- .../schemabinding/version2/StructureState.java | 1771 +++---- .../schemabinding/version2/ThresholdLine.java | 452 +- src/jalview/schemabinding/version2/Tree.java | 1695 +++--- .../schemabinding/version2/UserColourScheme.java | 182 +- .../schemabinding/version2/UserColours.java | 308 +- src/jalview/schemabinding/version2/VAMSAS.java | 813 +-- .../schemabinding/version2/VamsasModel.java | 178 +- src/jalview/schemabinding/version2/Viewport.java | 5427 ++++++++++---------- .../version2/WebServiceParameterSet.java | 819 ++- .../version2/descriptors/AlcodMapDescriptor.java | 431 +- .../version2/descriptors/AlcodonDescriptor.java | 523 +- .../descriptors/AlcodonFrameDescriptor.java | 443 +- .../AnnotationColourSchemeDescriptor.java | 974 ++-- .../descriptors/AnnotationColoursDescriptor.java | 261 +- .../version2/descriptors/AnnotationDescriptor.java | 2220 ++++---- .../descriptors/AnnotationElementDescriptor.java | 789 +-- .../descriptors/CalcIdParamDescriptor.java | 520 +- .../version2/descriptors/ColourDescriptor.java | 1042 ++-- .../version2/descriptors/DBRefDescriptor.java | 567 +- .../version2/descriptors/FeatureDescriptor.java | 963 ++-- .../descriptors/FeatureSettingsDescriptor.java | 443 +- .../version2/descriptors/FeaturesDescriptor.java | 260 +- .../version2/descriptors/GroupDescriptor.java | 426 +- .../descriptors/HiddenColumnsDescriptor.java | 439 +- .../version2/descriptors/JGroupDescriptor.java | 2177 ++++---- .../version2/descriptors/JSeqDescriptor.java | 1116 ++-- .../descriptors/JalviewModelDescriptor.java | 581 ++- .../JalviewModelSequenceDescriptor.java | 796 +-- .../descriptors/JalviewUserColoursDescriptor.java | 506 +- .../descriptors/MapListFromDescriptor.java | 441 +- .../version2/descriptors/MapListToDescriptor.java | 441 +- .../descriptors/MapListTypeDescriptor.java | 635 +-- .../descriptors/MappingChoiceDescriptor.java | 423 +- .../version2/descriptors/MappingDescriptor.java | 354 +- .../version2/descriptors/OtherDataDescriptor.java | 431 +- .../version2/descriptors/PdbentryDescriptor.java | 588 ++- .../descriptors/PdbentryItemDescriptor.java | 370 +- .../version2/descriptors/PdbidsDescriptor.java | 373 +- .../version2/descriptors/PropertyDescriptor.java | 431 +- .../version2/descriptors/RnaViewerDescriptor.java | 1083 ++-- .../descriptors/SecondaryStructureDescriptor.java | 584 ++- .../version2/descriptors/SequenceDescriptor.java | 432 +- .../descriptors/SequenceSetDescriptor.java | 798 +-- .../SequenceSetPropertiesDescriptor.java | 423 +- .../descriptors/SequenceTypeDescriptor.java | 577 ++- .../version2/descriptors/SettingDescriptor.java | 1279 ++--- .../descriptors/StructureStateDescriptor.java | 1238 +++-- .../descriptors/ThresholdLineDescriptor.java | 519 +- .../version2/descriptors/TreeDescriptor.java | 1702 +++--- .../descriptors/UserColourSchemeDescriptor.java | 261 +- .../descriptors/UserColoursDescriptor.java | 428 +- .../version2/descriptors/VAMSASDescriptor.java | 454 +- .../descriptors/VamsasModelDescriptor.java | 260 +- .../version2/descriptors/ViewportDescriptor.java | 4756 +++++++++-------- .../WebServiceParameterSetDescriptor.java | 676 +-- src/jalview/schemes/AnnotationColourGradient.java | 10 +- src/jalview/schemes/BuriedColourScheme.java | 2 +- src/jalview/schemes/ColourSchemeI.java | 8 +- src/jalview/schemes/CovariationColourScheme.java | 6 +- src/jalview/schemes/HelixColourScheme.java | 2 +- src/jalview/schemes/HydrophobicColourScheme.java | 2 +- .../schemes/PurinePyrimidineColourScheme.java | 2 +- src/jalview/schemes/RNAHelicesColour.java | 1 - src/jalview/schemes/ResidueColourScheme.java | 4 +- src/jalview/schemes/ResidueProperties.java | 118 +- src/jalview/schemes/StrandColourScheme.java | 2 +- src/jalview/schemes/TCoffeeColourScheme.java | 5 +- src/jalview/schemes/TurnColourScheme.java | 2 +- src/jalview/schemes/UserColourScheme.java | 8 +- src/jalview/structure/SequenceListener.java | 1 - src/jalview/structure/StructureListener.java | 4 +- .../structure/StructureSelectionManager.java | 5 +- .../structures/models/AAStructureBindingModel.java | 30 +- src/jalview/util/AWTConsole.java | 23 +- src/jalview/util/BrowserLauncher.java | 155 +- src/jalview/util/Comparison.java | 16 +- src/jalview/util/DBRefUtils.java | 14 +- src/jalview/util/GroupUrlLink.java | 44 +- src/jalview/util/ImageMaker.java | 33 +- src/jalview/util/MapList.java | 66 +- src/jalview/util/MappingUtils.java | 31 +- src/jalview/util/ParseHtmlBodyAndLinks.java | 3 +- src/jalview/util/QuickSort.java | 11 +- src/jalview/util/ReverseListIterator.java | 1 + src/jalview/util/ShiftList.java | 6 +- src/jalview/util/StringUtils.java | 18 +- src/jalview/util/TableSorter.java | 30 +- src/jalview/util/UrlLink.java | 15 +- src/jalview/viewmodel/AlignmentViewport.java | 68 +- src/jalview/viewmodel/PCAModel.java | 6 +- .../AnnotationFilterParameter.java | 1 + .../seqfeatures/FeatureRendererModel.java | 21 +- .../seqfeatures/FeatureRendererSettings.java | 2 +- src/jalview/viewmodel/styles/ViewStyle.java | 9 +- src/jalview/workers/AlignCalcWorker.java | 4 +- src/jalview/workers/ComplementConsensusThread.java | 6 +- src/jalview/workers/ConsensusThread.java | 7 +- src/jalview/ws/AWSThread.java | 7 +- src/jalview/ws/DBRefFetcher.java | 21 +- src/jalview/ws/DasSequenceFeatureFetcher.java | 30 +- src/jalview/ws/HttpClientUtils.java | 3 +- src/jalview/ws/SequenceFetcher.java | 24 +- src/jalview/ws/WSClient.java | 2 +- .../ws/dbsources/EbiFileRetrievedProxy.java | 4 +- src/jalview/ws/dbsources/EmblCdsSouce.java | 4 +- src/jalview/ws/dbsources/EmblSource.java | 4 +- src/jalview/ws/dbsources/EmblXmlSource.java | 15 +- src/jalview/ws/dbsources/GeneDbSource.java | 4 +- src/jalview/ws/dbsources/PDBRestClient.java | 1 - src/jalview/ws/dbsources/Pdb.java | 8 +- src/jalview/ws/dbsources/Pfam.java | 4 +- src/jalview/ws/dbsources/Rfam.java | 4 +- src/jalview/ws/dbsources/Uniprot.java | 3 +- .../ws/dbsources/das/api/jalviewSourceI.java | 4 +- .../dbsources/das/datamodel/DasSequenceSource.java | 28 +- .../ws/dbsources/das/datamodel/JalviewSource.java | 12 +- src/jalview/ws/ebi/EBIFetchClient.java | 4 +- src/jalview/ws/io/mime/MimeTypes.java | 4 +- src/jalview/ws/jws1/Annotate3D.java | 5 +- src/jalview/ws/jws1/Discoverer.java | 23 +- src/jalview/ws/jws1/JPredClient.java | 29 +- src/jalview/ws/jws1/JPredThread.java | 61 +- src/jalview/ws/jws1/JWS1Thread.java | 5 +- src/jalview/ws/jws1/MsaWSClient.java | 38 +- src/jalview/ws/jws1/MsaWSThread.java | 50 +- src/jalview/ws/jws1/SeqSearchWSClient.java | 42 +- src/jalview/ws/jws1/SeqSearchWSThread.java | 51 +- src/jalview/ws/jws1/WS1Client.java | 4 +- src/jalview/ws/jws2/AADisorderClient.java | 72 +- src/jalview/ws/jws2/AbstractJabaCalcWorker.java | 10 +- src/jalview/ws/jws2/JPred301Client.java | 8 +- src/jalview/ws/jws2/JWs2Job.java | 4 +- src/jalview/ws/jws2/JabaParamStore.java | 58 +- src/jalview/ws/jws2/JabaPreset.java | 15 +- src/jalview/ws/jws2/JabaWsServerQuery.java | 27 +- src/jalview/ws/jws2/JabawsCalcWorker.java | 5 +- .../ws/jws2/JabawsMsaInterfaceAlignCalcWorker.java | 34 +- src/jalview/ws/jws2/Jws2Client.java | 19 +- src/jalview/ws/jws2/Jws2Discoverer.java | 34 +- src/jalview/ws/jws2/MsaWSClient.java | 50 +- src/jalview/ws/jws2/MsaWSThread.java | 54 +- src/jalview/ws/jws2/ParameterUtils.java | 17 +- src/jalview/ws/jws2/RNAalifoldClient.java | 3 +- .../ws/jws2/SequenceAnnotationWSClient.java | 40 +- src/jalview/ws/jws2/dm/AAConSettings.java | 19 +- src/jalview/ws/jws2/dm/JabaOption.java | 4 +- src/jalview/ws/jws2/dm/JabaParameter.java | 1 + src/jalview/ws/jws2/dm/JabaValueConstrain.java | 10 +- src/jalview/ws/jws2/dm/JabaWsParamSet.java | 18 +- src/jalview/ws/jws2/jabaws2/Jws2Instance.java | 4 +- .../ws/jws2/jabaws2/Jws2InstanceFactory.java | 2 + src/jalview/ws/params/simple/BooleanOption.java | 7 +- src/jalview/ws/rest/HttpResultSet.java | 6 +- src/jalview/ws/rest/InputType.java | 3 +- src/jalview/ws/rest/RestClient.java | 67 +- src/jalview/ws/rest/RestJob.java | 14 +- src/jalview/ws/rest/RestJobThread.java | 13 +- src/jalview/ws/rest/RestServiceDescription.java | 33 +- src/jalview/ws/rest/params/Alignment.java | 3 +- src/jalview/ws/rest/params/AnnotationFile.java | 13 +- src/jalview/ws/rest/params/JobConstant.java | 3 +- .../ws/rest/params/SeqGroupIndexVector.java | 26 +- src/jalview/ws/rest/params/SeqIdVector.java | 7 +- src/jalview/ws/rest/params/SeqVector.java | 7 +- src/jalview/ws/rest/params/Tree.java | 7 +- src/jalview/ws/seqfetcher/ASequenceFetcher.java | 23 +- src/jalview/ws/uimodel/AlignAnalysisUIText.java | 1 - src/jalview/ws/uimodel/PDBRestRequest.java | 1 - src/jalview/ws/uimodel/PDBRestResponse.java | 7 +- src/org/jibble/epsgraphics/EpsDocument.java | 13 +- src/org/jibble/epsgraphics/EpsGraphics2D.java | 73 +- src/uk/ac/ebi/www/WSWUBlastServiceLocator.java | 5 +- src/uk/ac/ebi/www/WSWUBlastSoapBindingStub.java | 26 +- .../AccessionMapperBindingStub.java | 14 +- .../AccessionMapperServiceLocator.java | 10 +- src/vamsas/IMsaWS.java | 5 +- 570 files changed, 56516 insertions(+), 51586 deletions(-) diff --git a/src/MCview/AppletPDBCanvas.java b/src/MCview/AppletPDBCanvas.java index dc69f43..7f87326 100644 --- a/src/MCview/AppletPDBCanvas.java +++ b/src/MCview/AppletPDBCanvas.java @@ -20,6 +20,18 @@ */ package MCview; +import jalview.analysis.AlignSeq; +import jalview.appletgui.AlignmentPanel; +import jalview.appletgui.FeatureRenderer; +import jalview.appletgui.SequenceRenderer; +import jalview.datamodel.PDBEntry; +import jalview.datamodel.SequenceI; +import jalview.structure.AtomSpec; +import jalview.structure.StructureListener; +import jalview.structure.StructureMapping; +import jalview.structure.StructureSelectionManager; +import jalview.util.MessageManager; + import java.awt.Color; import java.awt.Dimension; import java.awt.Event; @@ -37,18 +49,6 @@ import java.io.PrintStream; import java.util.List; import java.util.Vector; -import jalview.analysis.AlignSeq; -import jalview.appletgui.AlignmentPanel; -import jalview.appletgui.FeatureRenderer; -import jalview.appletgui.SequenceRenderer; -import jalview.datamodel.PDBEntry; -import jalview.datamodel.SequenceI; -import jalview.structure.AtomSpec; -import jalview.structure.StructureListener; -import jalview.structure.StructureMapping; -import jalview.structure.StructureSelectionManager; -import jalview.util.MessageManager; - public class AppletPDBCanvas extends Panel implements MouseListener, MouseMotionListener, StructureListener { @@ -189,11 +189,9 @@ public class AppletPDBCanvas extends Panel implements MouseListener, { mappingDetails.append("\n\nPDB Sequence is :\nSequence = " - + pdb.chains.elementAt(i).sequence - .getSequenceAsString()); + + pdb.chains.elementAt(i).sequence.getSequenceAsString()); mappingDetails.append("\nNo of residues = " - + pdb.chains.elementAt(i).residues.size() - + "\n\n"); + + pdb.chains.elementAt(i).residues.size() + "\n\n"); // Now lets compare the sequences to get // the start and end points. @@ -201,8 +199,7 @@ public class AppletPDBCanvas extends Panel implements MouseListener, // TODO: DNa/Pep switch AlignSeq as = new AlignSeq(sequence, pdb.chains.elementAt(i).sequence, - pdb.chains.elementAt(i).isNa ? AlignSeq.DNA - : AlignSeq.PEP); + pdb.chains.elementAt(i).isNa ? AlignSeq.DNA : AlignSeq.PEP); as.calcScoreMatrix(); as.traceAlignment(); PrintStream ps = new PrintStream(System.out) @@ -1113,8 +1110,7 @@ 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/AppletPDBViewer.java b/src/MCview/AppletPDBViewer.java index ed13578..8233ac3 100644 --- a/src/MCview/AppletPDBViewer.java +++ b/src/MCview/AppletPDBViewer.java @@ -20,14 +20,31 @@ */ package MCview; -import java.awt.*; -import java.awt.event.*; - -import jalview.appletgui.*; -import jalview.datamodel.*; -import jalview.schemes.*; +import jalview.appletgui.AlignmentPanel; +import jalview.appletgui.EmbmenuFrame; +import jalview.datamodel.PDBEntry; +import jalview.datamodel.SequenceI; +import jalview.schemes.BuriedColourScheme; +import jalview.schemes.HelixColourScheme; +import jalview.schemes.HydrophobicColourScheme; +import jalview.schemes.StrandColourScheme; +import jalview.schemes.TaylorColourScheme; +import jalview.schemes.TurnColourScheme; +import jalview.schemes.ZappoColourScheme; import jalview.util.MessageManager; +import java.awt.BorderLayout; +import java.awt.CheckboxGroup; +import java.awt.CheckboxMenuItem; +import java.awt.Frame; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; + public class AppletPDBViewer extends EmbmenuFrame implements ActionListener, ItemListener { diff --git a/src/MCview/Bond.java b/src/MCview/Bond.java index 1f2edd2..371ccd5 100755 --- a/src/MCview/Bond.java +++ b/src/MCview/Bond.java @@ -38,10 +38,8 @@ public class Bond public Bond(Atom at1, Atom at2) { - this.start = new float[] - { at1.x, at1.y, at1.z }; - this.end = new float[] - { at2.x, at2.y, at2.z }; + this.start = new float[] { at1.x, at1.y, at1.z }; + this.end = new float[] { at2.x, at2.y, at2.z }; this.startCol = at1.color; this.endCol = at2.color; this.at1 = at1; diff --git a/src/MCview/PDBCanvas.java b/src/MCview/PDBCanvas.java index 406d9f1..ac1ba06 100644 --- a/src/MCview/PDBCanvas.java +++ b/src/MCview/PDBCanvas.java @@ -20,6 +20,17 @@ */ package MCview; +import jalview.analysis.AlignSeq; +import jalview.datamodel.PDBEntry; +import jalview.datamodel.SequenceI; +import jalview.gui.AlignmentPanel; +import jalview.gui.FeatureRenderer; +import jalview.gui.SequenceRenderer; +import jalview.structure.AtomSpec; +import jalview.structure.StructureListener; +import jalview.structure.StructureMapping; +import jalview.structure.StructureSelectionManager; + import java.awt.Color; import java.awt.Dimension; import java.awt.Event; @@ -41,17 +52,6 @@ import java.util.Vector; import javax.swing.JPanel; import javax.swing.ToolTipManager; -import jalview.analysis.AlignSeq; -import jalview.datamodel.PDBEntry; -import jalview.datamodel.SequenceI; -import jalview.gui.AlignmentPanel; -import jalview.gui.FeatureRenderer; -import jalview.gui.SequenceRenderer; -import jalview.structure.AtomSpec; -import jalview.structure.StructureListener; -import jalview.structure.StructureMapping; -import jalview.structure.StructureSelectionManager; - public class PDBCanvas extends JPanel implements MouseListener, MouseMotionListener, StructureListener { @@ -188,11 +188,9 @@ public class PDBCanvas extends JPanel implements MouseListener, { mappingDetails.append("\n\nPDB Sequence is :\nSequence = " - + pdb.chains.elementAt(i).sequence - .getSequenceAsString()); + + pdb.chains.elementAt(i).sequence.getSequenceAsString()); mappingDetails.append("\nNo of residues = " - + pdb.chains.elementAt(i).residues.size() - + "\n\n"); + + pdb.chains.elementAt(i).residues.size() + "\n\n"); // Now lets compare the sequences to get // the start and end points. @@ -1069,8 +1067,7 @@ 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 0e486ac..6d5f9fe 100755 --- a/src/MCview/PDBChain.java +++ b/src/MCview/PDBChain.java @@ -20,10 +20,6 @@ */ package MCview; -import java.awt.Color; -import java.util.List; -import java.util.Vector; - import jalview.analysis.AlignSeq; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.Annotation; @@ -35,6 +31,10 @@ import jalview.schemes.ColourSchemeI; import jalview.schemes.ResidueProperties; import jalview.structure.StructureMapping; +import java.awt.Color; +import java.util.List; +import java.util.Vector; + public class PDBChain { /** @@ -193,10 +193,10 @@ public class PDBChain if (features[i].getFeatureGroup().equals(pdbid)) { SequenceFeature tx = new SequenceFeature(features[i]); - tx.setBegin(1 + residues.elementAt(tx.getBegin() - - offset).atoms.elementAt(0).alignmentMapping); - tx.setEnd(1 + residues.elementAt(tx.getEnd() - - offset).atoms.elementAt(0).alignmentMapping); + tx.setBegin(1 + residues.elementAt(tx.getBegin() - offset).atoms + .elementAt(0).alignmentMapping); + tx.setEnd(1 + residues.elementAt(tx.getEnd() - offset).atoms + .elementAt(0).alignmentMapping); tx.setStatus(status + ((tx.getStatus() == null || tx.getStatus().length() == 0) ? "" : ":" + tx.getStatus())); @@ -409,8 +409,7 @@ public class PDBChain AlignmentAnnotation tfactorann = new AlignmentAnnotation( "Temperature Factor", "Temperature Factor for " + pdbid + id, - annots, 0, max, - AlignmentAnnotation.LINE_GRAPH); + annots, 0, max, AlignmentAnnotation.LINE_GRAPH); tfactorann.setSequenceRef(sequence); sequence.addAlignmentAnnotation(tfactorann); } @@ -474,12 +473,10 @@ public class PDBChain { try { - index = ResidueProperties.aa3Hash.get(b.at1.resName) - .intValue(); + index = ResidueProperties.aa3Hash.get(b.at1.resName).intValue(); b.startCol = cs.findColour(ResidueProperties.aa[index].charAt(0)); - index = ResidueProperties.aa3Hash.get(b.at2.resName) - .intValue(); + index = ResidueProperties.aa3Hash.get(b.at2.resName).intValue(); b.endCol = cs.findColour(ResidueProperties.aa[index].charAt(0)); } catch (Exception e) @@ -508,8 +505,8 @@ public class PDBChain * @param sqmpping * - mapping between destination sequence and local chain */ - public void transferResidueAnnotation( - StructureMapping mapping, jalview.datamodel.Mapping sqmpping) + public void transferResidueAnnotation(StructureMapping mapping, + jalview.datamodel.Mapping sqmpping) { SequenceI sq = mapping.getSequence(); SequenceI dsq = sq; diff --git a/src/MCview/PDBViewer.java b/src/MCview/PDBViewer.java index 12367b2..e1324d2 100755 --- a/src/MCview/PDBViewer.java +++ b/src/MCview/PDBViewer.java @@ -329,7 +329,8 @@ public class PDBViewer extends JInternalFrame implements Runnable } }); viewMenu.setText(MessageManager.getString("action.view")); - background.setText(MessageManager.getString("action.background_colour")); + background + .setText(MessageManager.getString("action.background_colour")); background.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -523,15 +524,14 @@ public class PDBViewer extends JInternalFrame implements Runnable if (type == jalview.util.ImageMaker.TYPE.PNG) { im = new jalview.util.ImageMaker(this, - jalview.util.ImageMaker.TYPE.PNG, - "Make PNG image from view", width, height, null, null); + jalview.util.ImageMaker.TYPE.PNG, "Make PNG image from view", + width, height, null, null); } else if (type == jalview.util.ImageMaker.TYPE.EPS) { im = new jalview.util.ImageMaker(this, - jalview.util.ImageMaker.TYPE.EPS, - "Make EPS file from view", width, height, null, - this.getTitle()); + jalview.util.ImageMaker.TYPE.EPS, "Make EPS file from view", + width, height, null, this.getTitle()); } else { diff --git a/src/MCview/PDBfile.java b/src/MCview/PDBfile.java index 58991f3..c1018a3 100755 --- a/src/MCview/PDBfile.java +++ b/src/MCview/PDBfile.java @@ -63,8 +63,8 @@ public class PDBfile extends jalview.io.AlignFile */ private boolean externalSecondaryStructure = false; - public PDBfile(boolean addAlignmentAnnotations, boolean predictSecondaryStructure, - boolean externalSecStr) + public PDBfile(boolean addAlignmentAnnotations, + boolean predictSecondaryStructure, boolean externalSecStr) { super(); this.visibleChainAnnotation = addAlignmentAnnotations; @@ -72,9 +72,9 @@ public class PDBfile extends jalview.io.AlignFile this.externalSecondaryStructure = externalSecStr; } - public PDBfile(boolean addAlignmentAnnotations, boolean predictSecondaryStructure, - boolean externalSecStr, String file, String protocol) - throws IOException + public PDBfile(boolean addAlignmentAnnotations, + boolean predictSecondaryStructure, boolean externalSecStr, + String file, String protocol) throws IOException { super(false, file, protocol); this.visibleChainAnnotation = addAlignmentAnnotations; @@ -83,8 +83,9 @@ public class PDBfile extends jalview.io.AlignFile doParse(); } - public PDBfile(boolean addAlignmentAnnotations, boolean predictSecondaryStructure, - boolean externalSecStr, FileParse source) throws IOException + public PDBfile(boolean addAlignmentAnnotations, + boolean predictSecondaryStructure, boolean externalSecStr, + FileParse source) throws IOException { super(false, source); this.visibleChainAnnotation = addAlignmentAnnotations; @@ -252,8 +253,7 @@ public class PDBfile extends jalview.io.AlignFile processPdbFileWithAnnotate3d(rnaSequences); } catch (Exception x) { - System.err - .println("Exceptions when dealing with RNA in pdb file"); + System.err.println("Exceptions when dealing with RNA in pdb file"); x.printStackTrace(); } @@ -339,7 +339,8 @@ public class PDBfile extends jalview.io.AlignFile public static String relocateCalcId(String calcId, Hashtable alreadyLoadedPDB) throws Exception { - int s = CALC_ID_PREFIX.length(), end = calcId.indexOf(CALC_ID_PREFIX, s); + int s = CALC_ID_PREFIX.length(), end = calcId + .indexOf(CALC_ID_PREFIX, s); String between = calcId.substring(s, end - 1); return CALC_ID_PREFIX + alreadyLoadedPDB.get(between) + ":" + calcId.substring(end); @@ -374,16 +375,15 @@ public class PDBfile extends jalview.io.AlignFile Class cl = Class.forName("jalview.ext.jmol.PDBFileWithJmol"); if (cl != null) { - final Constructor constructor = cl.getConstructor(new Class[] - { FileParse.class }); - final Object[] args = new Object[] - { new FileParse(getDataName(), type) }; + final Constructor constructor = cl + .getConstructor(new Class[] { FileParse.class }); + final Object[] args = new Object[] { new FileParse(getDataName(), + type) }; Object jmf = constructor.newInstance(args); AlignmentI al = new Alignment((SequenceI[]) cl.getMethod( - "getSeqsAsArray", new Class[] - {}).invoke(jmf)); - cl.getMethod("addAnnotations", new Class[] - { AlignmentI.class }).invoke(jmf, al); + "getSeqsAsArray", new Class[] {}).invoke(jmf)); + cl.getMethod("addAnnotations", new Class[] { AlignmentI.class }) + .invoke(jmf, al); for (SequenceI sq : al.getSequences()) { if (sq.getDatasetSequence() != null) @@ -402,8 +402,8 @@ public class PDBfile extends jalview.io.AlignFile } } - private void replaceAndUpdateChains(List prot, - AlignmentI al, String pep, boolean b) + private void replaceAndUpdateChains(List prot, AlignmentI al, + String pep, boolean b) { List> replaced = AlignSeq .replaceMatchingSeqsWith(seqs, annotations, prot, al, pep, @@ -445,13 +445,11 @@ public class PDBfile extends jalview.io.AlignFile { // TODO: use the PDB ID of the structure if one is available, to save // bandwidth and avoid uploading the whole structure to the service - Object annotate3d = cl.getConstructor(new Class[] - {}).newInstance(new Object[] - {}); + Object annotate3d = cl.getConstructor(new Class[] {}).newInstance( + new Object[] {}); AlignmentI al = ((AlignmentI) cl.getMethod("getRNAMLFor", - new Class[] - { FileParse.class }).invoke(annotate3d, new Object[] - { new FileParse(getDataName(), type) })); + new Class[] { FileParse.class }).invoke(annotate3d, + new Object[] { new FileParse(getDataName(), type) })); for (SequenceI sq : al.getSequences()) { if (sq.getDatasetSequence() != null) diff --git a/src/MCview/Zsort.java b/src/MCview/Zsort.java index 20f034c..6bdbafa 100755 --- a/src/MCview/Zsort.java +++ b/src/MCview/Zsort.java @@ -63,8 +63,7 @@ public class Zsort do { i++; - } while ((i < bonds.size()) - && (bonds.elementAt(i).start[2] < x)); + } while ((i < bonds.size()) && (bonds.elementAt(i).start[2] < x)); if (i < j) { diff --git a/src/com/github/reinert/jjschema/Attributes.java b/src/com/github/reinert/jjschema/Attributes.java index f6a3d47..c3bd6c4 100755 --- a/src/com/github/reinert/jjschema/Attributes.java +++ b/src/com/github/reinert/jjschema/Attributes.java @@ -29,39 +29,40 @@ import java.lang.annotation.Target; * @author reinert */ @Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD, ElementType.FIELD, ElementType.TYPE}) -public @interface Attributes { - String $ref() default ""; +@Target({ ElementType.METHOD, ElementType.FIELD, ElementType.TYPE }) +public @interface Attributes +{ + String $ref() default ""; - String id() default ""; + String id() default ""; - String title() default ""; + String title() default ""; - String description() default ""; + String description() default ""; - long maximum() default -1l; + long maximum() default -1l; - boolean exclusiveMaximum() default false; + boolean exclusiveMaximum() default false; - int minimum() default -1; + int minimum() default -1; - boolean exclusiveMinimum() default false; + boolean exclusiveMinimum() default false; - String pattern() default ""; + String pattern() default ""; - boolean required() default false; + boolean required() default false; - String[] enums() default {}; + String[] enums() default {}; - int minItems() default 0; + int minItems() default 0; - long maxItems() default -1l; + long maxItems() default -1l; - boolean uniqueItems() default false; + boolean uniqueItems() default false; - int multipleOf() default 0; + int multipleOf() default 0; - int minLength() default 0; + int minLength() default 0; - long maxLength() default -1l; + long maxLength() default -1l; } diff --git a/src/com/stevesoft/pat/Any.java b/src/com/stevesoft/pat/Any.java index c97599c..dbaa961 100755 --- a/src/com/stevesoft/pat/Any.java +++ b/src/com/stevesoft/pat/Any.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** * This is the '.' character in a Pattern. It matches any character. diff --git a/src/com/stevesoft/pat/BackG.java b/src/com/stevesoft/pat/BackG.java index 69f7f61..166b58c 100755 --- a/src/com/stevesoft/pat/BackG.java +++ b/src/com/stevesoft/pat/BackG.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** This class represents the \G pattern element. */ class BackG extends Pattern diff --git a/src/com/stevesoft/pat/BackMatch.java b/src/com/stevesoft/pat/BackMatch.java index 1b166e9..1d7499e 100755 --- a/src/com/stevesoft/pat/BackMatch.java +++ b/src/com/stevesoft/pat/BackMatch.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** * Provides the ability to match a backreference from within a Pattern. diff --git a/src/com/stevesoft/pat/Backup.java b/src/com/stevesoft/pat/Backup.java index 1986460..6602aca 100755 --- a/src/com/stevesoft/pat/Backup.java +++ b/src/com/stevesoft/pat/Backup.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** * Implements the (?<number) Pattern, where number is an integer telling us diff --git a/src/com/stevesoft/pat/Bits.java b/src/com/stevesoft/pat/Bits.java index 05b3d34..b47f794 100755 --- a/src/com/stevesoft/pat/Bits.java +++ b/src/com/stevesoft/pat/Bits.java @@ -60,8 +60,8 @@ public class Bits * StringWriter(); static PrintWriter pw_s = new PrintWriter(sw,true); public * static void test(String var,Tester t) throws Exception { * - * char[] ca = new char[(66536 >> 4)+1]; Bits b = new Bits(ca); FileWriter fw = - * new FileWriter("x.out",true); PrintWriter pw = new PrintWriter(fw); + * char[] ca = new char[(66536 >> 4)+1]; Bits b = new Bits(ca); FileWriter fw + * = new FileWriter("x.out",true); PrintWriter pw = new PrintWriter(fw); * * //pw_s.println(" "+var+"_f();"); pw.println(" public static Bits * "+var+";"); pw.println(" static void "+var+"_f() {"); pw.println(" char[] diff --git a/src/com/stevesoft/pat/Boundary.java b/src/com/stevesoft/pat/Boundary.java index 566b20e..af79f66 100755 --- a/src/com/stevesoft/pat/Boundary.java +++ b/src/com/stevesoft/pat/Boundary.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** This class implements the word boundary pattern element: \b. */ class Boundary extends Pattern diff --git a/src/com/stevesoft/pat/Bracket.java b/src/com/stevesoft/pat/Bracket.java index cec8af4..adbcded 100755 --- a/src/com/stevesoft/pat/Bracket.java +++ b/src/com/stevesoft/pat/Bracket.java @@ -7,7 +7,8 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; +import java.util.Vector; /** * The Bracket is a form of the Or class, implements the pattern element [ ]. diff --git a/src/com/stevesoft/pat/Ctrl.java b/src/com/stevesoft/pat/Ctrl.java index 5d40098..07b9d6d 100755 --- a/src/com/stevesoft/pat/Ctrl.java +++ b/src/com/stevesoft/pat/Ctrl.java @@ -9,53 +9,52 @@ com.stevesoft.pat; public class Ctrl { - public final static char[] cmap = - { (char) 64, (char) 65, (char) 66, (char) 67, (char) 68, (char) 69, - (char) 70, (char) 71, (char) 72, (char) 73, (char) 74, (char) 75, - (char) 76, (char) 77, (char) 78, (char) 79, (char) 80, (char) 81, - (char) 82, (char) 83, (char) 84, (char) 85, (char) 86, (char) 87, - (char) 88, (char) 89, (char) 90, (char) 91, (char) 92, (char) 93, - (char) 94, (char) 95, (char) 96, (char) 97, (char) 97, (char) 99, - (char) 100, (char) 101, (char) 102, (char) 103, (char) 104, - (char) 105, (char) 106, (char) 107, (char) 108, (char) 109, - (char) 110, (char) 111, (char) 112, (char) 113, (char) 114, - (char) 115, (char) 116, (char) 117, (char) 118, (char) 119, - (char) 120, (char) 121, (char) 122, (char) 123, (char) 124, - (char) 125, (char) 126, (char) 127, (char) 0, (char) 1, (char) 2, - (char) 3, (char) 4, (char) 5, (char) 6, (char) 7, (char) 8, (char) 9, - (char) 10, (char) 11, (char) 12, (char) 13, (char) 14, (char) 15, - (char) 16, (char) 17, (char) 18, (char) 19, (char) 20, (char) 21, - (char) 22, (char) 23, (char) 24, (char) 25, (char) 26, (char) 27, - (char) 27, (char) 29, (char) 30, (char) 31, (char) 32, (char) 1, - (char) 2, (char) 3, (char) 4, (char) 5, (char) 6, (char) 7, (char) 8, - (char) 9, (char) 10, (char) 11, (char) 12, (char) 13, (char) 14, - (char) 15, (char) 16, (char) 17, (char) 18, (char) 19, (char) 20, - (char) 21, (char) 22, (char) 23, (char) 24, (char) 25, (char) 26, - (char) 59, (char) 60, (char) 61, (char) 62, (char) 63, (char) 192, - (char) 193, (char) 194, (char) 195, (char) 196, (char) 197, - (char) 198, (char) 199, (char) 200, (char) 201, (char) 202, - (char) 203, (char) 204, (char) 205, (char) 206, (char) 207, - (char) 208, (char) 209, (char) 210, (char) 211, (char) 212, - (char) 213, (char) 214, (char) 215, (char) 216, (char) 217, - (char) 218, (char) 219, (char) 220, (char) 221, (char) 222, - (char) 223, (char) 224, (char) 225, (char) 226, (char) 227, - (char) 228, (char) 229, (char) 230, (char) 231, (char) 232, - (char) 233, (char) 234, (char) 235, (char) 236, (char) 237, - (char) 238, (char) 239, (char) 240, (char) 241, (char) 242, - (char) 243, (char) 244, (char) 245, (char) 246, (char) 247, - (char) 248, (char) 249, (char) 250, (char) 251, (char) 252, - (char) 253, (char) 254, (char) 255, (char) 128, (char) 129, - (char) 130, (char) 131, (char) 132, (char) 133, (char) 134, - (char) 135, (char) 136, (char) 137, (char) 138, (char) 139, - (char) 140, (char) 141, (char) 142, (char) 143, (char) 144, - (char) 145, (char) 146, (char) 147, (char) 148, (char) 149, - (char) 150, (char) 151, (char) 152, (char) 153, (char) 154, - (char) 155, (char) 156, (char) 157, (char) 158, (char) 159, - (char) 160, (char) 161, (char) 162, (char) 163, (char) 164, - (char) 165, (char) 166, (char) 167, (char) 168, (char) 169, - (char) 170, (char) 171, (char) 172, (char) 173, (char) 174, - (char) 175, (char) 176, (char) 177, (char) 178, (char) 179, - (char) 180, (char) 181, (char) 182, (char) 183, (char) 184, - (char) 185, (char) 186, (char) 187, (char) 188, (char) 189, - (char) 190, (char) 191 }; + public final static char[] cmap = { (char) 64, (char) 65, (char) 66, + (char) 67, (char) 68, (char) 69, (char) 70, (char) 71, (char) 72, + (char) 73, (char) 74, (char) 75, (char) 76, (char) 77, (char) 78, + (char) 79, (char) 80, (char) 81, (char) 82, (char) 83, (char) 84, + (char) 85, (char) 86, (char) 87, (char) 88, (char) 89, (char) 90, + (char) 91, (char) 92, (char) 93, (char) 94, (char) 95, (char) 96, + (char) 97, (char) 97, (char) 99, (char) 100, (char) 101, (char) 102, + (char) 103, (char) 104, (char) 105, (char) 106, (char) 107, + (char) 108, (char) 109, (char) 110, (char) 111, (char) 112, + (char) 113, (char) 114, (char) 115, (char) 116, (char) 117, + (char) 118, (char) 119, (char) 120, (char) 121, (char) 122, + (char) 123, (char) 124, (char) 125, (char) 126, (char) 127, (char) 0, + (char) 1, (char) 2, (char) 3, (char) 4, (char) 5, (char) 6, (char) 7, + (char) 8, (char) 9, (char) 10, (char) 11, (char) 12, (char) 13, + (char) 14, (char) 15, (char) 16, (char) 17, (char) 18, (char) 19, + (char) 20, (char) 21, (char) 22, (char) 23, (char) 24, (char) 25, + (char) 26, (char) 27, (char) 27, (char) 29, (char) 30, (char) 31, + (char) 32, (char) 1, (char) 2, (char) 3, (char) 4, (char) 5, + (char) 6, (char) 7, (char) 8, (char) 9, (char) 10, (char) 11, + (char) 12, (char) 13, (char) 14, (char) 15, (char) 16, (char) 17, + (char) 18, (char) 19, (char) 20, (char) 21, (char) 22, (char) 23, + (char) 24, (char) 25, (char) 26, (char) 59, (char) 60, (char) 61, + (char) 62, (char) 63, (char) 192, (char) 193, (char) 194, (char) 195, + (char) 196, (char) 197, (char) 198, (char) 199, (char) 200, + (char) 201, (char) 202, (char) 203, (char) 204, (char) 205, + (char) 206, (char) 207, (char) 208, (char) 209, (char) 210, + (char) 211, (char) 212, (char) 213, (char) 214, (char) 215, + (char) 216, (char) 217, (char) 218, (char) 219, (char) 220, + (char) 221, (char) 222, (char) 223, (char) 224, (char) 225, + (char) 226, (char) 227, (char) 228, (char) 229, (char) 230, + (char) 231, (char) 232, (char) 233, (char) 234, (char) 235, + (char) 236, (char) 237, (char) 238, (char) 239, (char) 240, + (char) 241, (char) 242, (char) 243, (char) 244, (char) 245, + (char) 246, (char) 247, (char) 248, (char) 249, (char) 250, + (char) 251, (char) 252, (char) 253, (char) 254, (char) 255, + (char) 128, (char) 129, (char) 130, (char) 131, (char) 132, + (char) 133, (char) 134, (char) 135, (char) 136, (char) 137, + (char) 138, (char) 139, (char) 140, (char) 141, (char) 142, + (char) 143, (char) 144, (char) 145, (char) 146, (char) 147, + (char) 148, (char) 149, (char) 150, (char) 151, (char) 152, + (char) 153, (char) 154, (char) 155, (char) 156, (char) 157, + (char) 158, (char) 159, (char) 160, (char) 161, (char) 162, + (char) 163, (char) 164, (char) 165, (char) 166, (char) 167, + (char) 168, (char) 169, (char) 170, (char) 171, (char) 172, + (char) 173, (char) 174, (char) 175, (char) 176, (char) 177, + (char) 178, (char) 179, (char) 180, (char) 181, (char) 182, + (char) 183, (char) 184, (char) 185, (char) 186, (char) 187, + (char) 188, (char) 189, (char) 190, (char) 191 }; } diff --git a/src/com/stevesoft/pat/Custom.java b/src/com/stevesoft/pat/Custom.java index 61879ac..3251fa3 100755 --- a/src/com/stevesoft/pat/Custom.java +++ b/src/com/stevesoft/pat/Custom.java @@ -7,13 +7,13 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** * Simple custom patterns. See deriv2.java and deriv3.java in the - * test directory. + * href="http://javaregex.com/code/deriv3.java.html">deriv3.java in the test + * directory. * * @see com.stevesoft.pat.CustomEndpoint */ diff --git a/src/com/stevesoft/pat/CustomEndpoint.java b/src/com/stevesoft/pat/CustomEndpoint.java index 9608f7e..bf122b7 100755 --- a/src/com/stevesoft/pat/CustomEndpoint.java +++ b/src/com/stevesoft/pat/CustomEndpoint.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** * This class is needed internally to make backtracking work correctly in diff --git a/src/com/stevesoft/pat/DotMulti.java b/src/com/stevesoft/pat/DotMulti.java index cc5f094..7fd055b 100755 --- a/src/com/stevesoft/pat/DotMulti.java +++ b/src/com/stevesoft/pat/DotMulti.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** * A special optimization of multi that is used when the common subpattern ".*" diff --git a/src/com/stevesoft/pat/End.java b/src/com/stevesoft/pat/End.java index 547f3d6..06aadda 100755 --- a/src/com/stevesoft/pat/End.java +++ b/src/com/stevesoft/pat/End.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; //class AddToEnd extends RegSyntax {}; diff --git a/src/com/stevesoft/pat/FastBracket.java b/src/com/stevesoft/pat/FastBracket.java index a10ec2b..af1bc37 100755 --- a/src/com/stevesoft/pat/FastBracket.java +++ b/src/com/stevesoft/pat/FastBracket.java @@ -7,7 +7,8 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.BitSet; +import java.util.Vector; /** * Uses table lookup to match [] type constructs, but only if it can use a diff --git a/src/com/stevesoft/pat/FastMulti.java b/src/com/stevesoft/pat/FastMulti.java index a8387b4..cad69ee 100755 --- a/src/com/stevesoft/pat/FastMulti.java +++ b/src/com/stevesoft/pat/FastMulti.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** * A special case of Multi, implemented when minChars().equals(maxChars()), and diff --git a/src/com/stevesoft/pat/FileRegex.java b/src/com/stevesoft/pat/FileRegex.java index 342d41c..fa57795 100755 --- a/src/com/stevesoft/pat/FileRegex.java +++ b/src/com/stevesoft/pat/FileRegex.java @@ -7,61 +7,65 @@ // package com.stevesoft.pat; -import java.io.*; -import java.util.*; +import java.io.File; +import java.util.StringTokenizer; +import java.util.Vector; /** * This class is a different form of Regex designed to work more like the file * matching utility of a Unix shell. It is implemented by some simple string - * transformations:
+ * transformations:
+ *
* - * - * + * + * * - * - * + * + * * - * - * + * + * * - * - * + * + * * - * - * + * + * * - * - * + * + * * - * - * + * + * * - * - * + * + * * - * - * + * + * * - * - * - *
FileRegex Regex FileRegexRegex
* .* *.*
. \. .\.
{ (?: {(?:
{?! (?! {?!(?!
{?= (?= {?=(?=
{?? (?? {??(??
} ) )
? . ?.
{,} (|)
Note that a FileRegex pattern always ends with the Regex - * pattern element "$". If you like to experiment, try making FileRegex's and - * then printing them out. The toString() method does a decompile of the pattern - * to a standard Regex. Here are some more complete examples:
+ * + * + *
{,}(|)
+ *
Note that a FileRegex pattern always ends with the Regex pattern + * element "$". If you like to experiment, try making FileRegex's and then + * printing them out. The toString() method does a decompile of the pattern to a + * standard Regex. Here are some more complete examples:
+ * * - * - * + * + * * - * - * + * + * * - * - * + * + * * - * - * - *
FileRegex Regex FileRegexRegex
*.java .*\.java$ *.java.*\.java$
*.{java,html} .*\.(java|html)$ *.{java,html}.*\.(java|html)$
foo.[chC] foo.[chC]$
+ * foo.[chC] + * foo.[chC]$ + * + * */ public class FileRegex extends Regex { @@ -82,8 +86,7 @@ public class FileRegex extends Regex * Compile a new pattern. Throws * * @exception com.stevesoft.pat.RegSyntax - * for nonsensical patterns like "[9-0]+" just as Regex - * does. + * for nonsensical patterns like "[9-0]+" just as Regex does. * @see com.stevesoft.pat#compile(java.lang.String) */ public void compile(String s) throws RegSyntax diff --git a/src/com/stevesoft/pat/Group.java b/src/com/stevesoft/pat/Group.java index e6f734c..22d9f81 100755 --- a/src/com/stevesoft/pat/Group.java +++ b/src/com/stevesoft/pat/Group.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** * This class implements the (?@<>) syntax that matches a balanced parenthesis. diff --git a/src/com/stevesoft/pat/Multi.java b/src/com/stevesoft/pat/Multi.java index 1fe197d..7798d12 100755 --- a/src/com/stevesoft/pat/Multi.java +++ b/src/com/stevesoft/pat/Multi.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** * Matches any number of instances of sub Pattern this was the hardest method to @@ -38,11 +38,11 @@ class Multi extends PatternSub /** * @param a - * The fewest number of times the sub pattern can match. + * The fewest number of times the sub pattern can match. * @param b - * The maximum number of times the sub pattern can match. + * The maximum number of times the sub pattern can match. * @param p - * The sub pattern. + * The sub pattern. * @see Multi_stage2 * @see MultiMin */ diff --git a/src/com/stevesoft/pat/Multi_stage2.java b/src/com/stevesoft/pat/Multi_stage2.java index b18ad1c..f5a54db 100755 --- a/src/com/stevesoft/pat/Multi_stage2.java +++ b/src/com/stevesoft/pat/Multi_stage2.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** * If Multi were not split into a second stage, then a nested Multi would try to diff --git a/src/com/stevesoft/pat/NoPattern.java b/src/com/stevesoft/pat/NoPattern.java index 444d094..37d6384 100755 --- a/src/com/stevesoft/pat/NoPattern.java +++ b/src/com/stevesoft/pat/NoPattern.java @@ -7,7 +7,7 @@ package // // com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** * The idea behind this class is simply to eliminate the need for testing to see diff --git a/src/com/stevesoft/pat/NullPattern.java b/src/com/stevesoft/pat/NullPattern.java index 09460de..accd3f1 100755 --- a/src/com/stevesoft/pat/NullPattern.java +++ b/src/com/stevesoft/pat/NullPattern.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** * This pattern matches nothing -- it is found in patterns like (hello|world|) diff --git a/src/com/stevesoft/pat/Or.java b/src/com/stevesoft/pat/Or.java index 8d405e5..d5ee673 100755 --- a/src/com/stevesoft/pat/Or.java +++ b/src/com/stevesoft/pat/Or.java @@ -7,7 +7,8 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; +import java.util.Vector; /** * This class implements the (?: ... ) extended Pattern. It provides a base diff --git a/src/com/stevesoft/pat/OrMark.java b/src/com/stevesoft/pat/OrMark.java index 89b8869..ce1ecad 100755 --- a/src/com/stevesoft/pat/OrMark.java +++ b/src/com/stevesoft/pat/OrMark.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** Implements the parenthesis pattern subelement. */ class OrMark extends Or diff --git a/src/com/stevesoft/pat/Pattern.java b/src/com/stevesoft/pat/Pattern.java index 3a3462c..1bc74f8 100755 --- a/src/com/stevesoft/pat/Pattern.java +++ b/src/com/stevesoft/pat/Pattern.java @@ -9,7 +9,7 @@ package com.stevesoft.pat; import jalview.util.MessageManager; -import java.util.*; +import java.util.Hashtable; /** Shareware: package pat @@ -261,7 +261,9 @@ public abstract class Pattern */ Pattern clone1(Hashtable h) { - throw new Error(MessageManager.formatMessage("error.no_such_method_as_clone1_for", new String[]{getClass().getName()})); + throw new Error(MessageManager.formatMessage( + "error.no_such_method_as_clone1_for", new String[] { getClass() + .getName() })); } Pattern clone(Hashtable h) diff --git a/src/com/stevesoft/pat/Pthings.java b/src/com/stevesoft/pat/Pthings.java index 69e8fed..8de2748 100755 --- a/src/com/stevesoft/pat/Pthings.java +++ b/src/com/stevesoft/pat/Pthings.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.BitSet; /** * Things that need to be kept track of during a match. Passed along with diff --git a/src/com/stevesoft/pat/PushRule.java b/src/com/stevesoft/pat/PushRule.java index c9aee2b..dd1ac9c 100755 --- a/src/com/stevesoft/pat/PushRule.java +++ b/src/com/stevesoft/pat/PushRule.java @@ -9,9 +9,8 @@ package com.stevesoft.pat; /** * See the example file trans3.java for - * further examples of how this is used. You will probably not want to call it - * directly. + * href="http://javaregex.com/code/trans3.java.html">trans3.java for further + * examples of how this is used. You will probably not want to call it directly. */ public class PushRule extends SpecialRule { diff --git a/src/com/stevesoft/pat/Range.java b/src/com/stevesoft/pat/Range.java index 610a4d5..02c5d3a 100755 --- a/src/com/stevesoft/pat/Range.java +++ b/src/com/stevesoft/pat/Range.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** Thrown when one encounters things like [z-a] */ class BadRangeArgs extends RegSyntax diff --git a/src/com/stevesoft/pat/RegOpt.java b/src/com/stevesoft/pat/RegOpt.java index 0d65139..50d799f 100755 --- a/src/com/stevesoft/pat/RegOpt.java +++ b/src/com/stevesoft/pat/RegOpt.java @@ -7,7 +7,9 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Vector; /** This class is just like oneChar, but doesn't worry about case. */ class FastChar extends oneChar diff --git a/src/com/stevesoft/pat/RegRes.java b/src/com/stevesoft/pat/RegRes.java index a204c47..a963a17 100755 --- a/src/com/stevesoft/pat/RegRes.java +++ b/src/com/stevesoft/pat/RegRes.java @@ -47,9 +47,7 @@ public class RegRes implements Cloneable for (int i = 0; i < numSubs(); i++) { int n = i + 1; - sb - .append(" sub(" + n + ")=" + matchedFrom(n) + ":" - + charsMatched(n)); + sb.append(" sub(" + n + ")=" + matchedFrom(n) + ":" + charsMatched(n)); } return sb.toString(); } diff --git a/src/com/stevesoft/pat/Regex.java b/src/com/stevesoft/pat/Regex.java index 861c33b..c00ddad 100755 --- a/src/com/stevesoft/pat/Regex.java +++ b/src/com/stevesoft/pat/Regex.java @@ -9,10 +9,12 @@ package com.stevesoft.pat; import jalview.util.MessageManager; -import java.io.*; -import java.util.*; +import java.io.File; +import java.io.FilenameFilter; +import java.util.BitSet; +import java.util.Hashtable; -import com.stevesoft.pat.wrap.*; +import com.stevesoft.pat.wrap.StringWrap; /** Matches a Unicode punctuation character. */ class UnicodePunct extends UniValidator @@ -252,7 +254,9 @@ class UnicodeLower extends UniValidator * *
  * \d+
- * 
, but note that the sequence + * + * + * , but note that the sequence * *
  * (?e=#)
@@ -262,8 +266,8 @@ class UnicodeLower extends UniValidator
  * small differences as well. I will either make my package conform or note them
  * as I become aware of them.
  * 

- * This package supports additional patterns not in perl5:

+ * This package supports additional patterns not in perl5:
+ *
* * * @@ -277,8 +281,8 @@ class UnicodeLower extends UniValidator * "look behind." It fails if it attempts to move to a position before the * beginning of the string. "x(?<1)" is equivalent to "(?=x)". The number, 1 * in this example, is the number of characters to move backwards. - *
(?@())Group
- * + * + * * * @author Steven R. Brandt * @version package com.stevesoft.pat, release 1.5.3 @@ -627,9 +631,8 @@ public class Regex extends RegRes implements FilenameFilter * search or matchAt methods. * * @exception com.stevesoft.pat.RegSyntax - * is thrown if a syntax error is encountered in the - * pattern. For example, "x{3,1}" or "*a" are not valid - * patterns. + * is thrown if a syntax error is encountered in the pattern. For + * example, "x{3,1}" or "*a" are not valid patterns. * @see com.stevesoft.pat.Regex#search * @see com.stevesoft.pat.Regex#matchAt */ @@ -777,7 +780,9 @@ public class Regex extends RegRes implements FilenameFilter { if (s == null) { - throw new NullPointerException(MessageManager.getString("exception.null_string_given_to_regex_search")); + throw new NullPointerException( + MessageManager + .getString("exception.null_string_given_to_regex_search")); } return _search(s, 0, s.length()); } @@ -786,7 +791,9 @@ public class Regex extends RegRes implements FilenameFilter { if (sl == null) { - throw new NullPointerException(MessageManager.getString("exception.null_string_like_given_to_regex_search")); + throw new NullPointerException( + MessageManager + .getString("exception.null_string_like_given_to_regex_search")); } return _search(sl, 0, sl.length()); } @@ -795,7 +802,9 @@ public class Regex extends RegRes implements FilenameFilter { if (s == null) { - throw new NullPointerException(MessageManager.getString("exception.null_string_given_to_regex_reverse_search")); + throw new NullPointerException( + MessageManager + .getString("exception.null_string_given_to_regex_reverse_search")); } return _reverseSearch(s, 0, s.length()); } @@ -804,7 +813,9 @@ public class Regex extends RegRes implements FilenameFilter { if (sl == null) { - throw new NullPointerException(MessageManager.getString("exception.null_string_like_given_to_regex_reverse_search")); + throw new NullPointerException( + MessageManager + .getString("exception.null_string_like_given_to_regex_reverse_search")); } return _reverseSearch(sl, 0, sl.length()); } @@ -821,7 +832,9 @@ public class Regex extends RegRes implements FilenameFilter { if (s == null) { - throw new NullPointerException(MessageManager.getString("exception.null_string_like_given_to_regex_search_from")); + throw new NullPointerException( + MessageManager + .getString("exception.null_string_like_given_to_regex_search_from")); } return _search(s, start, s.length()); } @@ -830,7 +843,9 @@ public class Regex extends RegRes implements FilenameFilter { if (s == null) { - throw new NullPointerException(MessageManager.getString("exception.null_string_like_given_to_regex_search_from")); + throw new NullPointerException( + MessageManager + .getString("exception.null_string_like_given_to_regex_search_from")); } return _search(s, start, s.length()); } @@ -842,7 +857,9 @@ public class Regex extends RegRes implements FilenameFilter { if (s == null) { - throw new NullPointerException(MessageManager.getString("exception.null_string_like_given_to_regex_search_region")); + throw new NullPointerException( + MessageManager + .getString("exception.null_string_like_given_to_regex_search_region")); } return _search(s, start, end); } @@ -963,13 +980,13 @@ public class Regex extends RegRes implements FilenameFilter * if(skipper == null) { for(long i=start;i<=up;i++) { charsMatched_ = * thePattern.matchAt(s,i,pt); if(charsMatched_ >= 0) { matchFrom_ = * thePattern.mfrom; marks = pt.marks; gFlagto = matchFrom_+charsMatched_; - * return didMatch_=true; } } } else { pt.no_check = true; for(long i=start;i<=up;i++) { - * i = skipper.find(src,i,up); if(i<0) { charsMatched_ = matchFrom_ = -1; - * return didMatch_ = false; } charsMatched_ = thePattern.matchAt(s,i,pt); - * if(charsMatched_ >= 0) { matchFrom_ = thePattern.mfrom; marks = pt.marks; - * gFlagto = matchFrom_+charsMatched_; gFlags = s; return didMatch_=true; } - * else { i = s.adjustIndex(i); up = s.adjustEnd(i); } } } return - * didMatch_=false; } + * return didMatch_=true; } } } else { pt.no_check = true; for(long + * i=start;i<=up;i++) { i = skipper.find(src,i,up); if(i<0) { charsMatched_ = + * matchFrom_ = -1; return didMatch_ = false; } charsMatched_ = + * thePattern.matchAt(s,i,pt); if(charsMatched_ >= 0) { matchFrom_ = + * thePattern.mfrom; marks = pt.marks; gFlagto = matchFrom_+charsMatched_; + * gFlags = s; return didMatch_=true; } else { i = s.adjustIndex(i); up = + * s.adjustEnd(i); } } } return didMatch_=false; } */ boolean _reverseSearch(String s, int start, int end) @@ -1097,8 +1114,8 @@ public class Regex extends RegRes implements FilenameFilter * the Pattern. * * @exception com.stevesoft.pat.RegSyntax - * is thrown when a nonsensensical pattern is supplied. For - * example, a pattern beginning with *. + * is thrown when a nonsensensical pattern is supplied. For + * example, a pattern beginning with *. */ protected void compile1(StrPos sp, Rthings mk) throws RegSyntax { @@ -1903,9 +1920,9 @@ public class Regex extends RegRes implements FilenameFilter * optimized() method. *

* This method will attempt to rewrite your pattern in a way that makes it - * faster (not all patterns execute at the same speed). In general, "(?: ... )" - * will be faster than "( ... )" so if you don't need the backreference, you - * should group using the former pattern. + * faster (not all patterns execute at the same speed). In general, + * "(?: ... )" will be faster than "( ... )" so if you don't need the + * backreference, you should group using the former pattern. *

* It will also introduce new pattern elements that you can't get to * otherwise, for example if you have a large table of strings, i.e. the diff --git a/src/com/stevesoft/pat/RegexReader.java b/src/com/stevesoft/pat/RegexReader.java index 2e10f16..837821e 100755 --- a/src/com/stevesoft/pat/RegexReader.java +++ b/src/com/stevesoft/pat/RegexReader.java @@ -7,9 +7,10 @@ // package com.stevesoft.pat; -import java.io.*; +import java.io.IOException; +import java.io.Reader; -import com.stevesoft.pat.wrap.*; +import com.stevesoft.pat.wrap.StringBufferWrap; /** * This class allows you to replace the text in strings as you read them in. Be diff --git a/src/com/stevesoft/pat/RegexTokenizer.java b/src/com/stevesoft/pat/RegexTokenizer.java index 0378f3a..31fa2ba 100755 --- a/src/com/stevesoft/pat/RegexTokenizer.java +++ b/src/com/stevesoft/pat/RegexTokenizer.java @@ -7,7 +7,8 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Enumeration; +import java.util.Vector; /** Shareware: package pat diff --git a/src/com/stevesoft/pat/ReplaceRule.java b/src/com/stevesoft/pat/ReplaceRule.java index bf56143..74a7a25 100755 --- a/src/com/stevesoft/pat/ReplaceRule.java +++ b/src/com/stevesoft/pat/ReplaceRule.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** * ReplaceRule is a singly linked list of Objects which describe how to replace diff --git a/src/com/stevesoft/pat/Replacer.java b/src/com/stevesoft/pat/Replacer.java index b886f6a..6eaf5f6 100755 --- a/src/com/stevesoft/pat/Replacer.java +++ b/src/com/stevesoft/pat/Replacer.java @@ -9,7 +9,7 @@ package com.stevesoft.pat; import jalview.util.MessageManager; -import com.stevesoft.pat.wrap.*; +import com.stevesoft.pat.wrap.StringWrap; /** Internally used class. */ class RegHolder @@ -180,7 +180,9 @@ public class Replacer lastMatchedTo = 0; if (rh.me == null) { - throw new NullPointerException(MessageManager.getString("exception.replace_null_regex_pointer")); + throw new NullPointerException( + MessageManager + .getString("exception.replace_null_regex_pointer")); } if (rh.me._search(s, start, end)) { diff --git a/src/com/stevesoft/pat/Skip.java b/src/com/stevesoft/pat/Skip.java index d3f3822..f04653e 100755 --- a/src/com/stevesoft/pat/Skip.java +++ b/src/com/stevesoft/pat/Skip.java @@ -175,8 +175,8 @@ public class Skip else if (p instanceof Or && ((Or) p).v.size() == 1 && !((Or) p).leftForm().equals("(?!") - && null != (subsk = findSkip((Pattern) ((Or) p).v - .elementAt(0), ignoreCase, trnc))) + && null != (subsk = findSkip( + (Pattern) ((Or) p).v.elementAt(0), ignoreCase, trnc))) { subsk.offset += offset; return subsk; diff --git a/src/com/stevesoft/pat/SkipBMH.java b/src/com/stevesoft/pat/SkipBMH.java index 1397b90..8257548 100755 --- a/src/com/stevesoft/pat/SkipBMH.java +++ b/src/com/stevesoft/pat/SkipBMH.java @@ -7,15 +7,15 @@ // package com.stevesoft.pat; -import com.stevesoft.pat.wrap.*; +import com.stevesoft.pat.wrap.StringWrap; /** * Like Skip, but implements a - * Boyer-Moore-Horspool type search method that has been modified to be - * more like a "T-search" (see the Michael Tamm''s article in C'T, magazin - * fuer computer und technic, August 97 p 292). Yet another important - * source of information for me was the type search method that has been modified to be more + * like a "T-search" (see the Michael Tamm''s article in C'T, magazin fuer + * computer und technic, August 97 p 292). Yet another important source of + * information for me was the Deep Magic * article on string searching. As of this writing, I can beat String's indexOf * method in many cases. diff --git a/src/com/stevesoft/pat/Skipped.java b/src/com/stevesoft/pat/Skipped.java index 551166b..2d20845 100755 --- a/src/com/stevesoft/pat/Skipped.java +++ b/src/com/stevesoft/pat/Skipped.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** * Implements the (?<number) Pattern, where number is an integer telling us @@ -31,8 +31,8 @@ class Skipped extends Pattern { // if(pt.no_check || s.regionMatches(pt.ignoreCase,0,pt.src,pos,s.length())) if (pt.no_check - || CaseMgr.regionMatches(s, pt.ignoreCase, 0, pt.src, pos, s - .length())) + || CaseMgr.regionMatches(s, pt.ignoreCase, 0, pt.src, pos, + s.length())) { return nextMatch(pos + s.length(), pt); } diff --git a/src/com/stevesoft/pat/Start.java b/src/com/stevesoft/pat/Start.java index 650e7a7..6cc0ce4 100755 --- a/src/com/stevesoft/pat/Start.java +++ b/src/com/stevesoft/pat/Start.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** The '^' or the '\A' Pattern, matches the start of a string. */ class Start extends Pattern diff --git a/src/com/stevesoft/pat/StringLike.java b/src/com/stevesoft/pat/StringLike.java index be98ff3..fa01fe6 100755 --- a/src/com/stevesoft/pat/StringLike.java +++ b/src/com/stevesoft/pat/StringLike.java @@ -11,10 +11,10 @@ com.stevesoft.pat; * Package pat can search anything that implements this interface. Package pat * assumes the following: *

    - *
  • The StringLike object will not change. Calls to charAt(int) will not - * vary with time. - *
  • The length of the object being searched is known before the search - * begins and does not vary with time. + *
  • The StringLike object will not change. Calls to charAt(int) will not vary + * with time. + *
  • The length of the object being searched is known before the search begins + * and does not vary with time. *
* Note that searching String is probably faster than searching other objects, * so searching String is still preferred if possible. diff --git a/src/com/stevesoft/pat/Transformer.java b/src/com/stevesoft/pat/Transformer.java index 84a3a46..901a92d 100755 --- a/src/com/stevesoft/pat/Transformer.java +++ b/src/com/stevesoft/pat/Transformer.java @@ -9,7 +9,7 @@ package com.stevesoft.pat; import jalview.util.MessageManager; -import com.stevesoft.pat.wrap.*; +import com.stevesoft.pat.wrap.StringWrap; /** * Replacement rule used by the Transformer. @@ -151,7 +151,9 @@ public class Transformer Regex r = Regex.perlCode(rs); if (r == null) { - throw new NullPointerException(MessageManager.formatMessage("exception.bad_pattern_to_regex_perl_code", new String[]{rs})); + throw new NullPointerException(MessageManager.formatMessage( + "exception.bad_pattern_to_regex_perl_code", + new String[] { rs })); } add(r); } diff --git a/src/com/stevesoft/pat/lookAhead.java b/src/com/stevesoft/pat/lookAhead.java index d7d71c3..5f2a1d0 100755 --- a/src/com/stevesoft/pat/lookAhead.java +++ b/src/com/stevesoft/pat/lookAhead.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** Implements "(?= )" and "(?! )" */ class lookAhead extends Or diff --git a/src/com/stevesoft/pat/oneChar.java b/src/com/stevesoft/pat/oneChar.java index ebbe991..b13c64d 100755 --- a/src/com/stevesoft/pat/oneChar.java +++ b/src/com/stevesoft/pat/oneChar.java @@ -7,7 +7,7 @@ // package com.stevesoft.pat; -import java.util.*; +import java.util.Hashtable; /** This class matches a single character. */ class oneChar extends Pattern diff --git a/src/com/stevesoft/pat/wrap/CharArrayBufferWrap.java b/src/com/stevesoft/pat/wrap/CharArrayBufferWrap.java index c014a57..2735f12 100755 --- a/src/com/stevesoft/pat/wrap/CharArrayBufferWrap.java +++ b/src/com/stevesoft/pat/wrap/CharArrayBufferWrap.java @@ -7,7 +7,8 @@ package // // com.stevesoft.pat.wrap; -import com.stevesoft.pat.*; +import com.stevesoft.pat.BasicStringBufferLike; +import com.stevesoft.pat.StringLike; /** * Allows the outcome of a replaceAll() or replaceFirst() to be an array of diff --git a/src/com/stevesoft/pat/wrap/CharArrayWrap.java b/src/com/stevesoft/pat/wrap/CharArrayWrap.java index bde9bd1..5fa0fb0 100755 --- a/src/com/stevesoft/pat/wrap/CharArrayWrap.java +++ b/src/com/stevesoft/pat/wrap/CharArrayWrap.java @@ -7,7 +7,8 @@ // package com.stevesoft.pat.wrap; -import com.stevesoft.pat.*; +import com.stevesoft.pat.BasicStringBufferLike; +import com.stevesoft.pat.StringLike; /** * This provides a wrapper for a char array so that it can be searched by Regex. diff --git a/src/com/stevesoft/pat/wrap/RandomAccessFileWrap.java b/src/com/stevesoft/pat/wrap/RandomAccessFileWrap.java index f5b61ab..66a1014 100755 --- a/src/com/stevesoft/pat/wrap/RandomAccessFileWrap.java +++ b/src/com/stevesoft/pat/wrap/RandomAccessFileWrap.java @@ -9,9 +9,12 @@ package com.stevesoft.pat.wrap; import jalview.util.MessageManager; -import java.io.*; +import java.io.IOException; +import java.io.RandomAccessFile; -import com.stevesoft.pat.*; +import com.stevesoft.pat.BasicStringBufferLike; +import com.stevesoft.pat.Regex; +import com.stevesoft.pat.StringLike; /** * Provides a wrapper for a RandomAccessFile so that it can be searched by @@ -86,11 +89,11 @@ public class RandomAccessFileWrap implements StringLike { } - throw new ArrayIndexOutOfBoundsException(MessageManager.formatMessage("exception.out_of_bounds_for_file", new String[]{ - Integer.valueOf(i).toString(), - Integer.valueOf(i0).toString(), - Integer.valueOf(iend).toString() - })); + throw new ArrayIndexOutOfBoundsException(MessageManager.formatMessage( + "exception.out_of_bounds_for_file", new String[] { + Integer.valueOf(i).toString(), + Integer.valueOf(i0).toString(), + Integer.valueOf(iend).toString() })); } public String toString() diff --git a/src/com/stevesoft/pat/wrap/StringBufferWrap.java b/src/com/stevesoft/pat/wrap/StringBufferWrap.java index d522461..29ec042 100755 --- a/src/com/stevesoft/pat/wrap/StringBufferWrap.java +++ b/src/com/stevesoft/pat/wrap/StringBufferWrap.java @@ -7,7 +7,8 @@ // package com.stevesoft.pat.wrap; -import com.stevesoft.pat.*; +import com.stevesoft.pat.BasicStringBufferLike; +import com.stevesoft.pat.StringLike; /** * This provides a wrapper for StringBuffer to capture the output of a diff --git a/src/com/stevesoft/pat/wrap/StringWrap.java b/src/com/stevesoft/pat/wrap/StringWrap.java index 3ddf7c5..8396dd9 100755 --- a/src/com/stevesoft/pat/wrap/StringWrap.java +++ b/src/com/stevesoft/pat/wrap/StringWrap.java @@ -7,7 +7,8 @@ // package com.stevesoft.pat.wrap; -import com.stevesoft.pat.*; +import com.stevesoft.pat.BasicStringBufferLike; +import com.stevesoft.pat.StringLike; /** * A basic wrapper for the String object. Regex does not search String directly diff --git a/src/com/stevesoft/pat/wrap/WriterWrap.java b/src/com/stevesoft/pat/wrap/WriterWrap.java index e72b5fa..189b0f2 100755 --- a/src/com/stevesoft/pat/wrap/WriterWrap.java +++ b/src/com/stevesoft/pat/wrap/WriterWrap.java @@ -7,9 +7,11 @@ // package com.stevesoft.pat.wrap; -import java.io.*; +import java.io.IOException; +import java.io.Writer; -import com.stevesoft.pat.*; +import com.stevesoft.pat.BasicStringBufferLike; +import com.stevesoft.pat.StringLike; /** * Allows the outcome of a replaceAll() or replaceFirst() to be directed to a diff --git a/src/ext/edu/ucsf/rbvi/strucviz2/ChimUtils.java b/src/ext/edu/ucsf/rbvi/strucviz2/ChimUtils.java index aedf657..03f51f7 100644 --- a/src/ext/edu/ucsf/rbvi/strucviz2/ChimUtils.java +++ b/src/ext/edu/ucsf/rbvi/strucviz2/ChimUtils.java @@ -11,745 +11,941 @@ import org.slf4j.LoggerFactory; import ext.edu.ucsf.rbvi.strucviz2.StructureManager.ModelType; - -public abstract class ChimUtils { - - private static Logger logger = LoggerFactory - .getLogger(ChimUtils.class); - - static int MAX_SUB_MODELS = 1000; - - public static final HashMap aaNames; - - public static String RESIDUE_ATTR = "ChimeraResidue"; - public static String RINALYZER_ATTR = "RINalyzerResidue"; - public static String DEFAULT_STRUCTURE_KEY = "pdbFileName"; - - /** - * Parse the model number returned by Chimera and return the int value - */ - // invoked by the ChimeraModel constructor - // line = model id #0 type Molecule name 1ert - public static int[] parseModelNumber(String inputLine) { - int hash = inputLine.indexOf('#'); - int space = inputLine.indexOf(' ', hash); - int decimal = inputLine.substring(hash + 1, space).indexOf('.'); - // model number is between hash+1 and space - int modelNumber = -1; - int subModelNumber = 0; - try { - if (decimal > 0) { - subModelNumber = Integer.parseInt(inputLine.substring(decimal + hash + 2, space)); - space = decimal + hash + 1; - } - modelNumber = Integer.parseInt(inputLine.substring(hash + 1, space)); - } catch (Exception e) { - logger.warn("Unexpected return from Chimera: " + inputLine, e); - } - return new int[] { modelNumber, subModelNumber }; - } - - /** - * Parse the model number returned by Chimera and return the int value - */ - // invoked by openModel in ChimeraManager - // line: #1, chain A: hiv-1 protease - public static int[] parseOpenedModelNumber(String inputLine) { - int hash = inputLine.indexOf('#'); - int space = inputLine.indexOf(',', hash); - int decimal = inputLine.substring(hash + 1, space).indexOf('.'); - // model number is between hash+1 and space - int modelNumber = -1; - int subModelNumber = 0; - try { - if (decimal > 0) { - subModelNumber = Integer.parseInt(inputLine.substring(decimal + hash + 2, space)); - space = decimal + hash + 1; - } - modelNumber = Integer.parseInt(inputLine.substring(hash + 1, space)); - } catch (Exception e) { - logger.warn("Unexpected return from Chimera: " + inputLine, e); - } - return new int[] { modelNumber, subModelNumber }; - } - - /** - * Parse the model identifier returned by Chimera and return the String value - */ - // invoked by the ChimeraModel constructor - // line = model id #0 type Molecule name 1ert - public static String parseModelName(String inputLine) { - int start = inputLine.indexOf("name "); - if (start < 0) - return null; - // Might get a quoted string (don't understand why, but there you have it) - if (inputLine.startsWith("\"", start + 5)) { - start += 6; // Skip over the first quote - int end = inputLine.lastIndexOf('"'); - if (end >= 1) { - return inputLine.substring(start, end); - } else - return inputLine.substring(start); - } else { - return inputLine.substring(start + 5); - } - } - - public static Color parseModelColor(String inputLine) { - try { - int colorStart = inputLine.indexOf("color "); - String colorString = inputLine.substring(colorStart + 6); - String[] rgbStrings = colorString.split(","); - float[] rgbValues = new float[4]; - for (int i = 0; i < rgbStrings.length; i++) { - Float f = new Float(rgbStrings[i]); - rgbValues[i] = f.floatValue(); - } - if (rgbStrings.length == 4) { - return new Color(rgbValues[0], rgbValues[1], rgbValues[2], rgbValues[3]); - } else { - return new Color(rgbValues[0], rgbValues[1], rgbValues[2]); - } - } catch (Exception ex) { - logger.warn("Unexpected return from Chimera: " + inputLine, ex); - } - return Color.white; - } - - /** - * Create the key to use for forming the model/submodel key into the modelHash - * - * @param model - * the model number - * @param subModel - * the submodel number - * @return the model key as an Integer - */ - public static Integer makeModelKey(int model, int subModel) { - return new Integer(model * MAX_SUB_MODELS + subModel); - } - - // invoked by the getResdiue (parseConnectivityReplies in CreateStructureNetworkTask) - // atomSpec = #0:1.A or #1:96.B@N - public static ChimeraModel getModel(String atomSpec, ChimeraManager chimeraManager) { - // System.out.println("getting model for "+atomSpec); - String[] split = atomSpec.split(":"); - // No model specified.... - if (split[0].length() == 0) { - logger.info("Unexpected return from Chimera: " + atomSpec); - return null; - } - // System.out.println("model = "+split[0].substring(1)); - int model = 0; - int submodel = 0; - try { - String[] subSplit = split[0].substring(1).split("\\."); - if (subSplit.length > 0) - model = Integer.parseInt(subSplit[0]); - else - model = Integer.parseInt(split[0].substring(1)); - - if (subSplit.length > 1) - submodel = Integer.parseInt(subSplit[1]); - } catch (Exception e) { - // ignore - logger.warn("Unexpected return from Chimera: " + atomSpec, e); - } - return chimeraManager.getChimeraModel(model, submodel); - } - - // invoked by the parseConnectivityReplies in CreateStructureNetworkTask - // atomSpec = #0:1.A or #1:96.B@N - public static ChimeraResidue getResidue(String atomSpec, ChimeraManager chimeraManager) { - // System.out.println("Getting residue from: "+atomSpec); - ChimeraModel model = getModel(atomSpec, chimeraManager); // Get the model - if (model == null) { - model = chimeraManager.getChimeraModel(); - } - return getResidue(atomSpec, model); - } - - // invoked by the getResdiue (parseConnectivityReplies in CreateStructureNetworkTask) - // atomSpec = #0:1.A or #1:96.B@N - public static ChimeraResidue getResidue(String atomSpec, ChimeraModel model) { - // System.out.println("Getting residue from: "+atomSpec); - String[] split = atomSpec.split(":|@"); - - // Split into residue and chain - String[] residueChain = split[1].split("\\."); - - if (residueChain[0].length() == 0) { - logger.info("Unexpected return from Chimera: " + atomSpec); - return null; - } - - if (residueChain.length == 2 && residueChain[1].length() > 0) { - ChimeraChain chain = model.getChain(residueChain[1]); - return chain.getResidue(residueChain[0]); - } - return model.getResidue("_", residueChain[0]); - } - - public static ChimeraChain getChain(String atomSpec, ChimeraModel model) { - String[] split = atomSpec.split(":|@"); - - // Split into residue and chain - String[] residueChain = split[1].split("\\."); - if (residueChain.length == 1) { - logger.info("Unexpected return from Chimera: " + atomSpec); - return null; - } - return model.getChain(residueChain[1]); - } - - public static String getAtomName(String atomSpec) { - String[] split = atomSpec.split("@"); - if (split.length > 1) { - return split[1]; - } - return atomSpec; - } - - public static boolean isBackbone(String atom) { - if (atom.equals("C") || atom.equals("CA") || atom.equals("N") || atom.equals("O") - || atom.equals("H")) - return true; - return false; - } - - public static String getIntSubtype(String node, String atom) { - String[] split = node.split("#| "); - String resType = ""; - if (split.length == 2) { - resType = split[0].trim().toUpperCase(); - } else if (split.length == 3) { - resType = split[1].trim().toUpperCase(); - } - if (resType.equalsIgnoreCase("HOH") || resType.equalsIgnoreCase("WAT")) { - return "water"; - } else if (aaNames.containsKey(resType)) { - if (atom.equals("C") || atom.equals("CA") || atom.equals("N") || atom.equals("O") - || atom.equals("H")) { - return "mc"; - } else { - return "sc"; - } - } else { - return "other"; - } - } - - - public static String[] getResKeyParts(String resKey) { - // [pdbID[.modelNo]#][residueID][.chainID] - // pdbID := 4-character code | "URL" | "path" - String[] resKeyParts = new String[4]; - String[] split = resKey.split("#"); - String resChain = null; - // if no "#" then it is either only a pdb id or a residue or a chain - if (split.length == 1) { - // pdb id without model - if (resKey.length() == 4 && resKey.indexOf("\\.") < 0) { - parseModelID(resKey, resKeyParts); - } - // pdb link or file - else if (resKey.startsWith("\"")) { - parseModelID(resKey, resKeyParts); - } - // chain and residue or model and number - else { - String[] splitSplit = resKey.split("\\."); - if (splitSplit.length == 1) { - // only a chain or a residue - resChain = resKey; - } else { - try { - // pdb with a model - Integer.parseInt(splitSplit[1]); - parseModelID(resKey, resKeyParts); - } catch (NumberFormatException ex) { - // residue and chain - resChain = resKey; - } - } - } - } else if (split.length == 2) { - // model and residue+chain - parseModelID(split[0], resKeyParts); - resChain = split[1]; - } else { - // model string with "#" - // TODO: [Optional] Are there more possibilities? - parseModelID(resKey.substring(0, resKey.lastIndexOf("#")), resKeyParts); - resChain = resKey.substring(resKey.lastIndexOf("#") + 1, resKey.length()); - } - if (resChain != null) { - //System.out.println(resChain); - String[] resChainSplit = resChain.split("\\."); - if (resChainSplit.length == 1) { - // TODO: [Optional] Find a better way to distinguish between chain and residue - // if only one character and not an int, probably a chain - if (resChainSplit[0].length() == 1) { - try { - Integer.parseInt(resChainSplit[0]); - resKeyParts[3] = resChainSplit[0]; - } catch (NumberFormatException ex) { - resKeyParts[2] = resChainSplit[0]; - } - } else { - resKeyParts[3] = resChainSplit[0]; - } - } else if (resChainSplit.length == 2) { - resKeyParts[2] = resChainSplit[0]; - resKeyParts[3] = resChainSplit[1]; - } else { - // too many dots? - logger.info("Could not parse residue identifier: " + resKey); - } - } - // String print = ""; - // for (int i = 0; i < resKeyParts.length; i++) { - // if (resKeyParts[i] == null) { - // print += i + ": null\t"; - // } else { - // print += i + ": " + resKeyParts[i] + ";"; - // } - // } - // System.out.println(print); - return resKeyParts; - } - - public static void parseModelID(String modelID, String[] resKeyParts) { - if (modelID.startsWith("\"")) { - if (modelID.endsWith("\"")) { - resKeyParts[0] = modelID.substring(1, modelID.length() - 1); - return; - } else { - try { - Integer.parseInt(modelID.substring(modelID.lastIndexOf("\"") + 2, - modelID.length())); - resKeyParts[0] = modelID.substring(0, modelID.lastIndexOf("\"") - 1); - resKeyParts[1] = modelID.substring(modelID.lastIndexOf("\"") + 2, - modelID.length()); - } catch (NumberFormatException ex) { - resKeyParts[0] = modelID.substring(1); - } - } - } else { - String[] modelIDNo = modelID.split("\\."); - if (modelIDNo.length == 1) { - resKeyParts[0] = modelIDNo[0]; - } else if (modelIDNo.length == 2) { - try { - Integer.parseInt(modelIDNo[1]); - resKeyParts[0] = modelIDNo[0]; - resKeyParts[1] = modelIDNo[1]; - } catch (NumberFormatException ex) { - resKeyParts[0] = modelID; - } - } else { - logger.info("Could not parse model identifier: " + modelID); - } - } - } - - /** - * This method takes a Cytoscape attribute specification ([structure#][residue][.chainID]) and - * returns the lowest-level object referenced by the spec. For example, if the spec is "1tkk", - * this method will return a ChimeraModel. If the spec is ".A", it will return a ChimeraChain, - * etc. - * - * @param attrSpec - * the specification string - * @param chimeraManager - * the Chimera object we're currently using - * @return a ChimeraStructuralObject of the lowest type - */ - public static ChimeraStructuralObject fromAttributeOld(String attrSpec, - ChimeraManager chimeraManager) { - if (attrSpec == null || attrSpec.indexOf(',') > 0 || attrSpec.indexOf('-') > 0) { - // No support for either lists or ranges - logger.warn("No support for identifier: " + attrSpec); - return null; - } - - String residue = null; - String model = null; - String chain = null; - - ChimeraModel chimeraModel = null; - ChimeraChain chimeraChain = null; - ChimeraResidue chimeraResidue = null; - - // System.out.println("Getting object from attribute: "+attrSpec); - try { - String[] split = attrSpec.split("#"); - String resChain = null; - if (split.length == 1) { - // no model - resChain = split[0]; - } else if (split.length == 2) { - // model and rest - model = split[0]; - resChain = split[1]; - } else { - // model string with "#" - model = attrSpec.substring(0, attrSpec.lastIndexOf("#")); - resChain = attrSpec.substring(attrSpec.lastIndexOf("#") + 1, attrSpec.length()); - } - if (resChain != null) { - String[] resChainSplit = resChain.split("\\."); - if (resChainSplit.length == 1) { - residue = resChainSplit[0]; - } else if (resChainSplit.length == 2) { - residue = resChainSplit[0]; - chain = resChainSplit[1]; - } else { - // too many dots? - logger.warn("No support for identifier: " + attrSpec); - } - } - - // if (split.length == 1) { - // // No model - // residue = split[0]; - // } else if (split.length == 3) { - // // We have all three - // model = split[0]; - // residue = split[1]; - // chain = split[2]; - // } else if (split.length == 2 && attrSpec.indexOf('#') > 0) { - // // Model and Residue - // model = split[0]; - // residue = split[1]; - // } else { - // // Residue and Chain - // residue = split[0]; - // chain = split[1]; - // } - - // System.out.println("model = " + model + " chain = " + chain + " residue = " + - // residue); - if (model != null) { - List models = chimeraManager.getChimeraModels(model, - ModelType.PDB_MODEL); - if (models.size() == 1) { - chimeraModel = models.get(0); - } else { - try { - chimeraModel = chimeraManager.getChimeraModel(Integer.valueOf(model), 0); - } catch (NumberFormatException ex) { - // ignore - } - } - } - if (chimeraModel == null) { - chimeraModel = chimeraManager.getChimeraModel(); - } - // System.out.println("ChimeraModel = " + chimeraModel); - - if (chain != null) { - chimeraChain = chimeraModel.getChain(chain); - // System.out.println("ChimeraChain = " + chimeraChain); - } - if (residue != null) { - if (chimeraChain != null) { - chimeraResidue = chimeraChain.getResidue(residue); - } else { - chimeraResidue = chimeraModel.getResidue("_", residue); - } - // System.out.println("ChimeraResidue = " + chimeraResidue); - } - - if (chimeraResidue != null) - return chimeraResidue; - - if (chimeraChain != null) - return chimeraChain; - - if (chimeraModel != null) - return chimeraModel; - - } catch (Exception ex) { - logger.warn("Could not parse residue identifier: " + attrSpec, ex); - } - return null; - } - - public static ChimeraStructuralObject fromAttribute(String attrSpec, - ChimeraManager chimeraManager) { - // TODO: Make sure it is OK to remove this: || attrSpec.indexOf('-') > 0 - if (attrSpec == null || attrSpec.indexOf(',') > 0) { - // No support for either lists or ranges - // System.out.println("No support for identifier: " + attrSpec); - logger.warn("No support for identifier: " + attrSpec); - return null; - } - String[] modelIDNoResChain = getResKeyParts(attrSpec); - - ChimeraModel chimeraModel = null; - ChimeraChain chimeraChain = null; - ChimeraResidue chimeraResidue = null; - - // System.out.println("Getting object from attribute: "+attrSpec); - try { - if (modelIDNoResChain[0] != null) { - String modelID = modelIDNoResChain[0]; - List models = chimeraManager.getChimeraModels(modelID, - ModelType.PDB_MODEL); - if (models.size() == 1) { // usual case with only one model - chimeraModel = models.get(0); - } else if (models.size() > 1 && modelIDNoResChain[1] != null) { - // there are several submodels - try { - int modelNo = Integer.valueOf(modelIDNoResChain[1]); - for (ChimeraModel model : models) { - if (model.getSubModelNumber() == modelNo) { - chimeraModel = model; - break; - } - } - } catch (NumberFormatException ex) { - // ignore - } - } else { - // TODO: [Optional] What is this doing? - try { - chimeraModel = chimeraManager.getChimeraModel(Integer.valueOf(modelID), 0); - } catch (NumberFormatException ex) { - // ignore - } - } - } - if (chimeraModel == null) { - // TODO: [Optional] Find a better way to handle this case - // If no model can be matched, continue - // System.out.println("No matching model could be find for " + attrSpec); - return null; - // chimeraModel = chimeraManager.getChimeraModel(); - // logger.warn("No matching model could be find for " + attrSpec + ". Trying with " - // + chimeraModel.toSpec()); - } - // System.out.println("ChimeraModel = " + chimeraModel); - - if (modelIDNoResChain[3] != null) { - chimeraChain = chimeraModel.getChain(modelIDNoResChain[3]); - // System.out.println("ChimeraChain = " + chimeraChain); - } - if (modelIDNoResChain[2] != null) { - String residue = modelIDNoResChain[2]; - if (chimeraChain != null) { - chimeraResidue = chimeraChain.getResidue(residue); - } else if (chimeraModel.getChain("_") != null) { - chimeraResidue = chimeraModel.getResidue("_", residue); - } else if (chimeraModel.getChainCount() == 1) { - chimeraResidue = chimeraModel.getResidue(chimeraModel.getChainNames() - .iterator().next(), residue); - } - // System.out.println("ChimeraResidue = " + chimeraResidue); - } - - if (chimeraResidue != null) - return chimeraResidue; - - if (chimeraChain != null) - return chimeraChain; - - if (chimeraModel != null) - return chimeraModel; - - } catch (Exception ex) { - // System.out.println("Could not parse chimera identifier: " + - // attrSpec+"("+ex.getMessage()+")"); - logger.warn("Could not parse chimera identifier: " + attrSpec, ex); - } - return null; - } - - /** - * Search for structure references in the residue list - * - * @param residueList - * the list of residues - * @return a concatenated list of structures encoded in the list - */ - public static String findStructures(String residueList) { - if (residueList == null) - return null; - String[] residues = residueList.split(","); - Map structureNameMap = new HashMap(); - for (int i = 0; i < residues.length; i++) { - String[] components = residues[i].split("#"); - if (components.length > 1) { - structureNameMap.put(components[0], components[1]); - } - } - if (structureNameMap.isEmpty()) - return null; - - String structure = null; - for (String struct : structureNameMap.keySet()) { - if (structure == null) - structure = new String(); - else - structure = structure.concat(","); - structure = structure.concat(struct); - } - return structure; - } - - // invoked by openStructures in StructureManager - public static List parseFuncRes(List residueNames, String modelName) { - List resRanges = new ArrayList(); - for (int i = 0; i < residueNames.size(); i++) { - String residue = residueNames.get(i); - // Parse out the structure, if there is one - String[] components = residue.split("#"); - if (components.length > 1 && !modelName.equals(components[0])) { - continue; - } else if (components.length > 1) { - residue = components[1]; - } else if (components.length == 1) { - residue = components[0]; - } - // Check to see if we have a range-spec - String resRange = ""; - if (residue == null || residue.equals("") || residue.length() == 0) { - continue; - } - String[] range = residue.split("-", 2); - String chain = null; - for (int res = 0; res < range.length; res++) { - if (res == 1) { - resRange = resRange.concat("-"); - if (chain != null && range[res].indexOf('.') == -1) - range[res] = range[res].concat("." + chain); - } - - if (res == 0 && range.length >= 2 && range[res].indexOf('.') > 0) { - // This is a range spec with the leading residue containing a chain spec - String[] resChain = range[res].split("\\."); - chain = resChain[1]; - range[res] = resChain[0]; - } - // Fix weird SFLD syntax... - if (range[res].indexOf('|') > 0 && Character.isDigit(range[res].charAt(0))) { - int offset = range[res].indexOf('|'); - String str = range[res].substring(offset + 1) + range[res].substring(0, offset); - range[res] = str; - } - - // Convert to legal atom-spec - if (Character.isDigit(range[res].charAt(0))) { - resRange = resRange.concat(range[res]); - } else if (Character.isDigit(range[res].charAt(1))) { - resRange = resRange.concat(range[res].substring(1)); - } else if (range[res].charAt(0) == '.') { - // Do we have a chain spec? - resRange = resRange.concat(range[res]); - } else { - resRange = resRange.concat(range[res].substring(3)); - } - } - if (!resRanges.contains(resRange)) { - resRanges.add(resRange); - } - } - return resRanges; - } - - static { - aaNames = new HashMap(); - aaNames.put("ALA", "A Ala Alanine N[C@@H](C)C(O)=O"); - aaNames.put("ARG", "R Arg Arginine N[C@@H](CCCNC(N)=N)C(O)=O"); - aaNames.put("ASN", "N Asn Asparagine N[C@@H](CC(N)=O)C(O)=O"); - aaNames.put("ASP", "D Asp Aspartic_acid N[C@@H](CC(O)=O)C(O)=O"); - aaNames.put("CYS", "C Cys Cysteine N[C@@H](CS)C(O)=O"); - aaNames.put("GLN", "Q Gln Glutamine N[C@H](C(O)=O)CCC(N)=O"); - aaNames.put("GLU", "E Glu Glumatic_acid N[C@H](C(O)=O)CCC(O)=O"); - aaNames.put("GLY", "G Gly Glycine NCC(O)=O"); - aaNames.put("HIS", "H His Histidine N[C@@H](CC1=CN=CN1)C(O)=O"); - aaNames.put("ILE", "I Ile Isoleucine N[C@]([C@H](C)CC)([H])C(O)=O"); - aaNames.put("LEU", "L Leu Leucine N[C@](CC(C)C)([H])C(O)=O"); - aaNames.put("LYS", "K Lys Lysine N[C@](CCCCN)([H])C(O)=O"); - aaNames.put("DLY", "K Dly D-Lysine NCCCC[C@@H](N)C(O)=O"); - aaNames.put("MET", "M Met Methionine N[C@](CCSC)([H])C(O)=O"); - aaNames.put("PHE", "F Phe Phenylalanine N[C@](CC1=CC=CC=C1)([H])C(O)=O"); - aaNames.put("PRO", "P Pro Proline OC([C@@]1([H])NCCC1)=O"); - aaNames.put("SER", "S Ser Serine OC[C@](C(O)=O)([H])N"); - aaNames.put("THR", "T Thr Threonine O[C@H](C)[C@](C(O)=O)([H])N"); - aaNames.put("TRP", "W Trp Tryptophan N[C@@]([H])(CC1=CN([H])C2=C1C=CC=C2)C(O)=O"); - aaNames.put("TYR", "Y Tyr Tyrosine N[C@@](C(O)=O)([H])CC1=CC=C(O)C=C1"); - aaNames.put("VAL", "V Val Valine N[C@@](C(O)=O)([H])C(C)C"); - aaNames.put("ASX", "B Asx Aspartic_acid_or_Asparagine"); - aaNames.put("GLX", "Z Glx Glutamine_or_Glutamic_acid"); - aaNames.put("XAA", "X Xaa Any_or_unknown_amino_acid"); - aaNames.put("HOH", "HOH HOH Water [H]O[H]"); - } - - /** - * Convert the amino acid type to a full name - * - * @param aaType - * the residue type to convert - * @return the full name of the residue - */ - public static String toFullName(String aaType) { - if (!aaNames.containsKey(aaType)) - return aaType; - String[] ids = ((String) aaNames.get(aaType)).split(" "); - return ids[2].replace('_', ' '); - } - - /** - * Convert the amino acid type to a single letter - * - * @param aaType - * the residue type to convert - * @return the single letter representation of the residue - */ - public static String toSingleLetter(String aaType) { - if (!aaNames.containsKey(aaType)) - return aaType; - String[] ids = ((String) aaNames.get(aaType)).split(" "); - return ids[0]; - } - - /** - * Convert the amino acid type to three letters - * - * @param aaType - * the residue type to convert - * @return the three letter representation of the residue - */ - public static String toThreeLetter(String aaType) { - if (!aaNames.containsKey(aaType)) - return aaType; - String[] ids = ((String) aaNames.get(aaType)).split(" "); - return ids[1]; - } - - /** - * Convert the amino acid type to its SMILES string - * - * @param aaType - * the residue type to convert - * @return the SMILES representation of the residue - */ - public static String toSMILES(String aaType) { - if (!aaNames.containsKey(aaType)) - return null; - String[] ids = ((String) aaNames.get(aaType)).split(" "); - if (ids.length < 4) - return null; - return ids[3]; - } - - public static String getAlignName(ChimeraStructuralObject chimObj) { - String name = chimObj.getChimeraModel().toString(); - if (chimObj instanceof ChimeraChain) { - name = ((ChimeraChain) chimObj).toString() + " [" + name + "]"; - } - return name; - } +public abstract class ChimUtils +{ + + private static Logger logger = LoggerFactory.getLogger(ChimUtils.class); + + static int MAX_SUB_MODELS = 1000; + + public static final HashMap aaNames; + + public static String RESIDUE_ATTR = "ChimeraResidue"; + + public static String RINALYZER_ATTR = "RINalyzerResidue"; + + public static String DEFAULT_STRUCTURE_KEY = "pdbFileName"; + + /** + * Parse the model number returned by Chimera and return the int value + */ + // invoked by the ChimeraModel constructor + // line = model id #0 type Molecule name 1ert + public static int[] parseModelNumber(String inputLine) + { + int hash = inputLine.indexOf('#'); + int space = inputLine.indexOf(' ', hash); + int decimal = inputLine.substring(hash + 1, space).indexOf('.'); + // model number is between hash+1 and space + int modelNumber = -1; + int subModelNumber = 0; + try + { + if (decimal > 0) + { + subModelNumber = Integer.parseInt(inputLine.substring(decimal + + hash + 2, space)); + space = decimal + hash + 1; + } + modelNumber = Integer.parseInt(inputLine.substring(hash + 1, space)); + } catch (Exception e) + { + logger.warn("Unexpected return from Chimera: " + inputLine, e); + } + return new int[] { modelNumber, subModelNumber }; + } + + /** + * Parse the model number returned by Chimera and return the int value + */ + // invoked by openModel in ChimeraManager + // line: #1, chain A: hiv-1 protease + public static int[] parseOpenedModelNumber(String inputLine) + { + int hash = inputLine.indexOf('#'); + int space = inputLine.indexOf(',', hash); + int decimal = inputLine.substring(hash + 1, space).indexOf('.'); + // model number is between hash+1 and space + int modelNumber = -1; + int subModelNumber = 0; + try + { + if (decimal > 0) + { + subModelNumber = Integer.parseInt(inputLine.substring(decimal + + hash + 2, space)); + space = decimal + hash + 1; + } + modelNumber = Integer.parseInt(inputLine.substring(hash + 1, space)); + } catch (Exception e) + { + logger.warn("Unexpected return from Chimera: " + inputLine, e); + } + return new int[] { modelNumber, subModelNumber }; + } + + /** + * Parse the model identifier returned by Chimera and return the String value + */ + // invoked by the ChimeraModel constructor + // line = model id #0 type Molecule name 1ert + public static String parseModelName(String inputLine) + { + int start = inputLine.indexOf("name "); + if (start < 0) + return null; + // Might get a quoted string (don't understand why, but there you have it) + if (inputLine.startsWith("\"", start + 5)) + { + start += 6; // Skip over the first quote + int end = inputLine.lastIndexOf('"'); + if (end >= 1) + { + return inputLine.substring(start, end); + } + else + return inputLine.substring(start); + } + else + { + return inputLine.substring(start + 5); + } + } + + public static Color parseModelColor(String inputLine) + { + try + { + int colorStart = inputLine.indexOf("color "); + String colorString = inputLine.substring(colorStart + 6); + String[] rgbStrings = colorString.split(","); + float[] rgbValues = new float[4]; + for (int i = 0; i < rgbStrings.length; i++) + { + Float f = new Float(rgbStrings[i]); + rgbValues[i] = f.floatValue(); + } + if (rgbStrings.length == 4) + { + return new Color(rgbValues[0], rgbValues[1], rgbValues[2], + rgbValues[3]); + } + else + { + return new Color(rgbValues[0], rgbValues[1], rgbValues[2]); + } + } catch (Exception ex) + { + logger.warn("Unexpected return from Chimera: " + inputLine, ex); + } + return Color.white; + } + + /** + * Create the key to use for forming the model/submodel key into the modelHash + * + * @param model + * the model number + * @param subModel + * the submodel number + * @return the model key as an Integer + */ + public static Integer makeModelKey(int model, int subModel) + { + return new Integer(model * MAX_SUB_MODELS + subModel); + } + + // invoked by the getResdiue (parseConnectivityReplies in + // CreateStructureNetworkTask) + // atomSpec = #0:1.A or #1:96.B@N + public static ChimeraModel getModel(String atomSpec, + ChimeraManager chimeraManager) + { + // System.out.println("getting model for "+atomSpec); + String[] split = atomSpec.split(":"); + // No model specified.... + if (split[0].length() == 0) + { + logger.info("Unexpected return from Chimera: " + atomSpec); + return null; + } + // System.out.println("model = "+split[0].substring(1)); + int model = 0; + int submodel = 0; + try + { + String[] subSplit = split[0].substring(1).split("\\."); + if (subSplit.length > 0) + model = Integer.parseInt(subSplit[0]); + else + model = Integer.parseInt(split[0].substring(1)); + + if (subSplit.length > 1) + submodel = Integer.parseInt(subSplit[1]); + } catch (Exception e) + { + // ignore + logger.warn("Unexpected return from Chimera: " + atomSpec, e); + } + return chimeraManager.getChimeraModel(model, submodel); + } + + // invoked by the parseConnectivityReplies in CreateStructureNetworkTask + // atomSpec = #0:1.A or #1:96.B@N + public static ChimeraResidue getResidue(String atomSpec, + ChimeraManager chimeraManager) + { + // System.out.println("Getting residue from: "+atomSpec); + ChimeraModel model = getModel(atomSpec, chimeraManager); // Get the model + if (model == null) + { + model = chimeraManager.getChimeraModel(); + } + return getResidue(atomSpec, model); + } + + // invoked by the getResdiue (parseConnectivityReplies in + // CreateStructureNetworkTask) + // atomSpec = #0:1.A or #1:96.B@N + public static ChimeraResidue getResidue(String atomSpec, + ChimeraModel model) + { + // System.out.println("Getting residue from: "+atomSpec); + String[] split = atomSpec.split(":|@"); + + // Split into residue and chain + String[] residueChain = split[1].split("\\."); + + if (residueChain[0].length() == 0) + { + logger.info("Unexpected return from Chimera: " + atomSpec); + return null; + } + + if (residueChain.length == 2 && residueChain[1].length() > 0) + { + ChimeraChain chain = model.getChain(residueChain[1]); + return chain.getResidue(residueChain[0]); + } + return model.getResidue("_", residueChain[0]); + } + + public static ChimeraChain getChain(String atomSpec, ChimeraModel model) + { + String[] split = atomSpec.split(":|@"); + + // Split into residue and chain + String[] residueChain = split[1].split("\\."); + if (residueChain.length == 1) + { + logger.info("Unexpected return from Chimera: " + atomSpec); + return null; + } + return model.getChain(residueChain[1]); + } + + public static String getAtomName(String atomSpec) + { + String[] split = atomSpec.split("@"); + if (split.length > 1) + { + return split[1]; + } + return atomSpec; + } + + public static boolean isBackbone(String atom) + { + if (atom.equals("C") || atom.equals("CA") || atom.equals("N") + || atom.equals("O") || atom.equals("H")) + return true; + return false; + } + + public static String getIntSubtype(String node, String atom) + { + String[] split = node.split("#| "); + String resType = ""; + if (split.length == 2) + { + resType = split[0].trim().toUpperCase(); + } + else if (split.length == 3) + { + resType = split[1].trim().toUpperCase(); + } + if (resType.equalsIgnoreCase("HOH") || resType.equalsIgnoreCase("WAT")) + { + return "water"; + } + else if (aaNames.containsKey(resType)) + { + if (atom.equals("C") || atom.equals("CA") || atom.equals("N") + || atom.equals("O") || atom.equals("H")) + { + return "mc"; + } + else + { + return "sc"; + } + } + else + { + return "other"; + } + } + + public static String[] getResKeyParts(String resKey) + { + // [pdbID[.modelNo]#][residueID][.chainID] + // pdbID := 4-character code | "URL" | "path" + String[] resKeyParts = new String[4]; + String[] split = resKey.split("#"); + String resChain = null; + // if no "#" then it is either only a pdb id or a residue or a chain + if (split.length == 1) + { + // pdb id without model + if (resKey.length() == 4 && resKey.indexOf("\\.") < 0) + { + parseModelID(resKey, resKeyParts); + } + // pdb link or file + else if (resKey.startsWith("\"")) + { + parseModelID(resKey, resKeyParts); + } + // chain and residue or model and number + else + { + String[] splitSplit = resKey.split("\\."); + if (splitSplit.length == 1) + { + // only a chain or a residue + resChain = resKey; + } + else + { + try + { + // pdb with a model + Integer.parseInt(splitSplit[1]); + parseModelID(resKey, resKeyParts); + } catch (NumberFormatException ex) + { + // residue and chain + resChain = resKey; + } + } + } + } + else if (split.length == 2) + { + // model and residue+chain + parseModelID(split[0], resKeyParts); + resChain = split[1]; + } + else + { + // model string with "#" + // TODO: [Optional] Are there more possibilities? + parseModelID(resKey.substring(0, resKey.lastIndexOf("#")), + resKeyParts); + resChain = resKey.substring(resKey.lastIndexOf("#") + 1, + resKey.length()); + } + if (resChain != null) + { + // System.out.println(resChain); + String[] resChainSplit = resChain.split("\\."); + if (resChainSplit.length == 1) + { + // TODO: [Optional] Find a better way to distinguish between chain and + // residue + // if only one character and not an int, probably a chain + if (resChainSplit[0].length() == 1) + { + try + { + Integer.parseInt(resChainSplit[0]); + resKeyParts[3] = resChainSplit[0]; + } catch (NumberFormatException ex) + { + resKeyParts[2] = resChainSplit[0]; + } + } + else + { + resKeyParts[3] = resChainSplit[0]; + } + } + else if (resChainSplit.length == 2) + { + resKeyParts[2] = resChainSplit[0]; + resKeyParts[3] = resChainSplit[1]; + } + else + { + // too many dots? + logger.info("Could not parse residue identifier: " + resKey); + } + } + // String print = ""; + // for (int i = 0; i < resKeyParts.length; i++) { + // if (resKeyParts[i] == null) { + // print += i + ": null\t"; + // } else { + // print += i + ": " + resKeyParts[i] + ";"; + // } + // } + // System.out.println(print); + return resKeyParts; + } + + public static void parseModelID(String modelID, String[] resKeyParts) + { + if (modelID.startsWith("\"")) + { + if (modelID.endsWith("\"")) + { + resKeyParts[0] = modelID.substring(1, modelID.length() - 1); + return; + } + else + { + try + { + Integer.parseInt(modelID.substring(modelID.lastIndexOf("\"") + 2, + modelID.length())); + resKeyParts[0] = modelID.substring(0, + modelID.lastIndexOf("\"") - 1); + resKeyParts[1] = modelID.substring(modelID.lastIndexOf("\"") + 2, + modelID.length()); + } catch (NumberFormatException ex) + { + resKeyParts[0] = modelID.substring(1); + } + } + } + else + { + String[] modelIDNo = modelID.split("\\."); + if (modelIDNo.length == 1) + { + resKeyParts[0] = modelIDNo[0]; + } + else if (modelIDNo.length == 2) + { + try + { + Integer.parseInt(modelIDNo[1]); + resKeyParts[0] = modelIDNo[0]; + resKeyParts[1] = modelIDNo[1]; + } catch (NumberFormatException ex) + { + resKeyParts[0] = modelID; + } + } + else + { + logger.info("Could not parse model identifier: " + modelID); + } + } + } + + /** + * This method takes a Cytoscape attribute specification + * ([structure#][residue][.chainID]) and returns the lowest-level object + * referenced by the spec. For example, if the spec is "1tkk", this method + * will return a ChimeraModel. If the spec is ".A", it will return a + * ChimeraChain, etc. + * + * @param attrSpec + * the specification string + * @param chimeraManager + * the Chimera object we're currently using + * @return a ChimeraStructuralObject of the lowest type + */ + public static ChimeraStructuralObject fromAttributeOld(String attrSpec, + ChimeraManager chimeraManager) + { + if (attrSpec == null || attrSpec.indexOf(',') > 0 + || attrSpec.indexOf('-') > 0) + { + // No support for either lists or ranges + logger.warn("No support for identifier: " + attrSpec); + return null; + } + + String residue = null; + String model = null; + String chain = null; + + ChimeraModel chimeraModel = null; + ChimeraChain chimeraChain = null; + ChimeraResidue chimeraResidue = null; + + // System.out.println("Getting object from attribute: "+attrSpec); + try + { + String[] split = attrSpec.split("#"); + String resChain = null; + if (split.length == 1) + { + // no model + resChain = split[0]; + } + else if (split.length == 2) + { + // model and rest + model = split[0]; + resChain = split[1]; + } + else + { + // model string with "#" + model = attrSpec.substring(0, attrSpec.lastIndexOf("#")); + resChain = attrSpec.substring(attrSpec.lastIndexOf("#") + 1, + attrSpec.length()); + } + if (resChain != null) + { + String[] resChainSplit = resChain.split("\\."); + if (resChainSplit.length == 1) + { + residue = resChainSplit[0]; + } + else if (resChainSplit.length == 2) + { + residue = resChainSplit[0]; + chain = resChainSplit[1]; + } + else + { + // too many dots? + logger.warn("No support for identifier: " + attrSpec); + } + } + + // if (split.length == 1) { + // // No model + // residue = split[0]; + // } else if (split.length == 3) { + // // We have all three + // model = split[0]; + // residue = split[1]; + // chain = split[2]; + // } else if (split.length == 2 && attrSpec.indexOf('#') > 0) { + // // Model and Residue + // model = split[0]; + // residue = split[1]; + // } else { + // // Residue and Chain + // residue = split[0]; + // chain = split[1]; + // } + + // System.out.println("model = " + model + " chain = " + chain + + // " residue = " + + // residue); + if (model != null) + { + List models = chimeraManager.getChimeraModels(model, + ModelType.PDB_MODEL); + if (models.size() == 1) + { + chimeraModel = models.get(0); + } + else + { + try + { + chimeraModel = chimeraManager.getChimeraModel( + Integer.valueOf(model), 0); + } catch (NumberFormatException ex) + { + // ignore + } + } + } + if (chimeraModel == null) + { + chimeraModel = chimeraManager.getChimeraModel(); + } + // System.out.println("ChimeraModel = " + chimeraModel); + + if (chain != null) + { + chimeraChain = chimeraModel.getChain(chain); + // System.out.println("ChimeraChain = " + chimeraChain); + } + if (residue != null) + { + if (chimeraChain != null) + { + chimeraResidue = chimeraChain.getResidue(residue); + } + else + { + chimeraResidue = chimeraModel.getResidue("_", residue); + } + // System.out.println("ChimeraResidue = " + chimeraResidue); + } + + if (chimeraResidue != null) + return chimeraResidue; + + if (chimeraChain != null) + return chimeraChain; + + if (chimeraModel != null) + return chimeraModel; + + } catch (Exception ex) + { + logger.warn("Could not parse residue identifier: " + attrSpec, ex); + } + return null; + } + + public static ChimeraStructuralObject fromAttribute(String attrSpec, + ChimeraManager chimeraManager) + { + // TODO: Make sure it is OK to remove this: || attrSpec.indexOf('-') > 0 + if (attrSpec == null || attrSpec.indexOf(',') > 0) + { + // No support for either lists or ranges + // System.out.println("No support for identifier: " + attrSpec); + logger.warn("No support for identifier: " + attrSpec); + return null; + } + String[] modelIDNoResChain = getResKeyParts(attrSpec); + + ChimeraModel chimeraModel = null; + ChimeraChain chimeraChain = null; + ChimeraResidue chimeraResidue = null; + + // System.out.println("Getting object from attribute: "+attrSpec); + try + { + if (modelIDNoResChain[0] != null) + { + String modelID = modelIDNoResChain[0]; + List models = chimeraManager.getChimeraModels( + modelID, ModelType.PDB_MODEL); + if (models.size() == 1) + { // usual case with only one model + chimeraModel = models.get(0); + } + else if (models.size() > 1 && modelIDNoResChain[1] != null) + { + // there are several submodels + try + { + int modelNo = Integer.valueOf(modelIDNoResChain[1]); + for (ChimeraModel model : models) + { + if (model.getSubModelNumber() == modelNo) + { + chimeraModel = model; + break; + } + } + } catch (NumberFormatException ex) + { + // ignore + } + } + else + { + // TODO: [Optional] What is this doing? + try + { + chimeraModel = chimeraManager.getChimeraModel( + Integer.valueOf(modelID), 0); + } catch (NumberFormatException ex) + { + // ignore + } + } + } + if (chimeraModel == null) + { + // TODO: [Optional] Find a better way to handle this case + // If no model can be matched, continue + // System.out.println("No matching model could be find for " + + // attrSpec); + return null; + // chimeraModel = chimeraManager.getChimeraModel(); + // logger.warn("No matching model could be find for " + attrSpec + + // ". Trying with " + // + chimeraModel.toSpec()); + } + // System.out.println("ChimeraModel = " + chimeraModel); + + if (modelIDNoResChain[3] != null) + { + chimeraChain = chimeraModel.getChain(modelIDNoResChain[3]); + // System.out.println("ChimeraChain = " + chimeraChain); + } + if (modelIDNoResChain[2] != null) + { + String residue = modelIDNoResChain[2]; + if (chimeraChain != null) + { + chimeraResidue = chimeraChain.getResidue(residue); + } + else if (chimeraModel.getChain("_") != null) + { + chimeraResidue = chimeraModel.getResidue("_", residue); + } + else if (chimeraModel.getChainCount() == 1) + { + chimeraResidue = chimeraModel.getResidue(chimeraModel + .getChainNames().iterator().next(), residue); + } + // System.out.println("ChimeraResidue = " + chimeraResidue); + } + + if (chimeraResidue != null) + return chimeraResidue; + + if (chimeraChain != null) + return chimeraChain; + + if (chimeraModel != null) + return chimeraModel; + + } catch (Exception ex) + { + // System.out.println("Could not parse chimera identifier: " + + // attrSpec+"("+ex.getMessage()+")"); + logger.warn("Could not parse chimera identifier: " + attrSpec, ex); + } + return null; + } + + /** + * Search for structure references in the residue list + * + * @param residueList + * the list of residues + * @return a concatenated list of structures encoded in the list + */ + public static String findStructures(String residueList) + { + if (residueList == null) + return null; + String[] residues = residueList.split(","); + Map structureNameMap = new HashMap(); + for (int i = 0; i < residues.length; i++) + { + String[] components = residues[i].split("#"); + if (components.length > 1) + { + structureNameMap.put(components[0], components[1]); + } + } + if (structureNameMap.isEmpty()) + return null; + + String structure = null; + for (String struct : structureNameMap.keySet()) + { + if (structure == null) + structure = new String(); + else + structure = structure.concat(","); + structure = structure.concat(struct); + } + return structure; + } + + // invoked by openStructures in StructureManager + public static List parseFuncRes(List residueNames, + String modelName) + { + List resRanges = new ArrayList(); + for (int i = 0; i < residueNames.size(); i++) + { + String residue = residueNames.get(i); + // Parse out the structure, if there is one + String[] components = residue.split("#"); + if (components.length > 1 && !modelName.equals(components[0])) + { + continue; + } + else if (components.length > 1) + { + residue = components[1]; + } + else if (components.length == 1) + { + residue = components[0]; + } + // Check to see if we have a range-spec + String resRange = ""; + if (residue == null || residue.equals("") || residue.length() == 0) + { + continue; + } + String[] range = residue.split("-", 2); + String chain = null; + for (int res = 0; res < range.length; res++) + { + if (res == 1) + { + resRange = resRange.concat("-"); + if (chain != null && range[res].indexOf('.') == -1) + range[res] = range[res].concat("." + chain); + } + + if (res == 0 && range.length >= 2 && range[res].indexOf('.') > 0) + { + // This is a range spec with the leading residue containing a chain + // spec + String[] resChain = range[res].split("\\."); + chain = resChain[1]; + range[res] = resChain[0]; + } + // Fix weird SFLD syntax... + if (range[res].indexOf('|') > 0 + && Character.isDigit(range[res].charAt(0))) + { + int offset = range[res].indexOf('|'); + String str = range[res].substring(offset + 1) + + range[res].substring(0, offset); + range[res] = str; + } + + // Convert to legal atom-spec + if (Character.isDigit(range[res].charAt(0))) + { + resRange = resRange.concat(range[res]); + } + else if (Character.isDigit(range[res].charAt(1))) + { + resRange = resRange.concat(range[res].substring(1)); + } + else if (range[res].charAt(0) == '.') + { + // Do we have a chain spec? + resRange = resRange.concat(range[res]); + } + else + { + resRange = resRange.concat(range[res].substring(3)); + } + } + if (!resRanges.contains(resRange)) + { + resRanges.add(resRange); + } + } + return resRanges; + } + + static + { + aaNames = new HashMap(); + aaNames.put("ALA", "A Ala Alanine N[C@@H](C)C(O)=O"); + aaNames.put("ARG", "R Arg Arginine N[C@@H](CCCNC(N)=N)C(O)=O"); + aaNames.put("ASN", "N Asn Asparagine N[C@@H](CC(N)=O)C(O)=O"); + aaNames.put("ASP", "D Asp Aspartic_acid N[C@@H](CC(O)=O)C(O)=O"); + aaNames.put("CYS", "C Cys Cysteine N[C@@H](CS)C(O)=O"); + aaNames.put("GLN", "Q Gln Glutamine N[C@H](C(O)=O)CCC(N)=O"); + aaNames.put("GLU", "E Glu Glumatic_acid N[C@H](C(O)=O)CCC(O)=O"); + aaNames.put("GLY", "G Gly Glycine NCC(O)=O"); + aaNames.put("HIS", "H His Histidine N[C@@H](CC1=CN=CN1)C(O)=O"); + aaNames.put("ILE", "I Ile Isoleucine N[C@]([C@H](C)CC)([H])C(O)=O"); + aaNames.put("LEU", "L Leu Leucine N[C@](CC(C)C)([H])C(O)=O"); + aaNames.put("LYS", "K Lys Lysine N[C@](CCCCN)([H])C(O)=O"); + aaNames.put("DLY", "K Dly D-Lysine NCCCC[C@@H](N)C(O)=O"); + aaNames.put("MET", "M Met Methionine N[C@](CCSC)([H])C(O)=O"); + aaNames.put("PHE", "F Phe Phenylalanine N[C@](CC1=CC=CC=C1)([H])C(O)=O"); + aaNames.put("PRO", "P Pro Proline OC([C@@]1([H])NCCC1)=O"); + aaNames.put("SER", "S Ser Serine OC[C@](C(O)=O)([H])N"); + aaNames.put("THR", "T Thr Threonine O[C@H](C)[C@](C(O)=O)([H])N"); + aaNames.put("TRP", + "W Trp Tryptophan N[C@@]([H])(CC1=CN([H])C2=C1C=CC=C2)C(O)=O"); + aaNames.put("TYR", "Y Tyr Tyrosine N[C@@](C(O)=O)([H])CC1=CC=C(O)C=C1"); + aaNames.put("VAL", "V Val Valine N[C@@](C(O)=O)([H])C(C)C"); + aaNames.put("ASX", "B Asx Aspartic_acid_or_Asparagine"); + aaNames.put("GLX", "Z Glx Glutamine_or_Glutamic_acid"); + aaNames.put("XAA", "X Xaa Any_or_unknown_amino_acid"); + aaNames.put("HOH", "HOH HOH Water [H]O[H]"); + } + + /** + * Convert the amino acid type to a full name + * + * @param aaType + * the residue type to convert + * @return the full name of the residue + */ + public static String toFullName(String aaType) + { + if (!aaNames.containsKey(aaType)) + return aaType; + String[] ids = ((String) aaNames.get(aaType)).split(" "); + return ids[2].replace('_', ' '); + } + + /** + * Convert the amino acid type to a single letter + * + * @param aaType + * the residue type to convert + * @return the single letter representation of the residue + */ + public static String toSingleLetter(String aaType) + { + if (!aaNames.containsKey(aaType)) + return aaType; + String[] ids = ((String) aaNames.get(aaType)).split(" "); + return ids[0]; + } + + /** + * Convert the amino acid type to three letters + * + * @param aaType + * the residue type to convert + * @return the three letter representation of the residue + */ + public static String toThreeLetter(String aaType) + { + if (!aaNames.containsKey(aaType)) + return aaType; + String[] ids = ((String) aaNames.get(aaType)).split(" "); + return ids[1]; + } + + /** + * Convert the amino acid type to its SMILES string + * + * @param aaType + * the residue type to convert + * @return the SMILES representation of the residue + */ + public static String toSMILES(String aaType) + { + if (!aaNames.containsKey(aaType)) + return null; + String[] ids = ((String) aaNames.get(aaType)).split(" "); + if (ids.length < 4) + return null; + return ids[3]; + } + + public static String getAlignName(ChimeraStructuralObject chimObj) + { + String name = chimObj.getChimeraModel().toString(); + if (chimObj instanceof ChimeraChain) + { + name = ((ChimeraChain) chimObj).toString() + " [" + name + "]"; + } + return name; + } } diff --git a/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraChain.java b/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraChain.java index 92193f2..9a29a99 100644 --- a/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraChain.java +++ b/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraChain.java @@ -44,287 +44,329 @@ import java.util.TreeMap; * */ // TODO: [Optional] Implement toAttr() method -public class ChimeraChain implements ChimeraStructuralObject { +public class ChimeraChain implements ChimeraStructuralObject +{ - /** - * The model/subModel number this chain is a part of - */ - private int modelNumber; - private int subModelNumber; + /** + * The model/subModel number this chain is a part of + */ + private int modelNumber; - /** - * A pointer to the model this chain is a part of - */ - private ChimeraModel chimeraModel; + private int subModelNumber; - /** - * The chainID (from the PDB record) - */ - private String chainId; + /** + * A pointer to the model this chain is a part of + */ + private ChimeraModel chimeraModel; - /** - * The residues that are part of this chain - */ - private TreeMap residueMap; + /** + * The chainID (from the PDB record) + */ + private String chainId; - /** - * userData to associate with this chain - */ - private Object userData; + /** + * The residues that are part of this chain + */ + private TreeMap residueMap; - /** - * Flag to indicate the selection state - */ - private boolean selected = false; + /** + * userData to associate with this chain + */ + private Object userData; - /** - * Constructor to create a new ChimeraChain - * - * @param model - * the model number this chain is part of - * @param subModel - * the subModel number this chain is part of - * @param chainId - * the chain ID for this chain - */ - public ChimeraChain(int model, int subModel, String chainId) { - this.modelNumber = model; - this.subModelNumber = subModel; - this.chainId = chainId; - residueMap = new TreeMap(); - } + /** + * Flag to indicate the selection state + */ + private boolean selected = false; - /** - * set the selected state of this chain - * - * @param selected - * a boolean to set the selected state to - */ - public void setSelected(boolean selected) { - this.selected = selected; - } + /** + * Constructor to create a new ChimeraChain + * + * @param model + * the model number this chain is part of + * @param subModel + * the subModel number this chain is part of + * @param chainId + * the chain ID for this chain + */ + public ChimeraChain(int model, int subModel, String chainId) + { + this.modelNumber = model; + this.subModelNumber = subModel; + this.chainId = chainId; + residueMap = new TreeMap(); + } - /** - * return the selected state of this chain - * - * @return the selected state - */ - public boolean isSelected() { - return selected; - } + /** + * set the selected state of this chain + * + * @param selected + * a boolean to set the selected state to + */ + public void setSelected(boolean selected) + { + this.selected = selected; + } - public boolean hasSelectedChildren() { - if (selected) { - return true; - } else { - for (ChimeraResidue residue : getResidues()) { - if (residue.isSelected()) - return true; - } - } - return false; - } + /** + * return the selected state of this chain + * + * @return the selected state + */ + public boolean isSelected() + { + return selected; + } - /** - * Return the list of selected residues - * - * @return all selected residues - */ - public List getSelectedResidues() { - List residueList = new ArrayList(); - if (selected) { - residueList.addAll(getResidues()); - } else { - for (ChimeraResidue residue : getResidues()) { - if (residue.isSelected()) - residueList.add(residue); - } - } - return residueList; - } + public boolean hasSelectedChildren() + { + if (selected) + { + return true; + } + else + { + for (ChimeraResidue residue : getResidues()) + { + if (residue.isSelected()) + return true; + } + } + return false; + } - /** - * Add a residue to the chain. - * - * @param residue - * the ChimeraResidue to add to the chain. - */ - public void addResidue(ChimeraResidue residue) { - String index = residue.getIndex(); - // Put it in our map so that we can return it in order - residueMap.put(index, residue); - } + /** + * Return the list of selected residues + * + * @return all selected residues + */ + public List getSelectedResidues() + { + List residueList = new ArrayList(); + if (selected) + { + residueList.addAll(getResidues()); + } + else + { + for (ChimeraResidue residue : getResidues()) + { + if (residue.isSelected()) + residueList.add(residue); + } + } + return residueList; + } - /** - * Return the list of residues in this chain in pdb residue order - * - * @return a Collection of residues in residue order - */ - public Collection getResidues() { - return residueMap.values(); - } + /** + * Add a residue to the chain. + * + * @param residue + * the ChimeraResidue to add to the chain. + */ + public void addResidue(ChimeraResidue residue) + { + String index = residue.getIndex(); + // Put it in our map so that we can return it in order + residueMap.put(index, residue); + } - /** - * Return the list of residues in this chain as a list - * - * @return List of residues - */ - public List getChildren() { - return new ArrayList(residueMap.values()); - } + /** + * Return the list of residues in this chain in pdb residue order + * + * @return a Collection of residues in residue order + */ + public Collection getResidues() + { + return residueMap.values(); + } - /** - * Get a specific residue - * - * @param residueIndex - * String representation of the residue index - * @return the ChimeraResidue represented by the residueIndex - */ - public ChimeraResidue getResidue(String index) { - // Integer index = new Integer(residueIndex); - if (residueMap.containsKey(index)) - return residueMap.get(index); - return null; - } + /** + * Return the list of residues in this chain as a list + * + * @return List of residues + */ + public List getChildren() + { + return new ArrayList(residueMap.values()); + } - /** - * Get a list of residues as a residue range - * - * @param residueRange - * String representation of the residue range - * @return the List of ChimeraResidues represented by the range - */ - public List getResidueRange(String residueRange) { - String[] range = residueRange.split("-", 2); - if (range[1] == null || range[1].length() == 0) { - range[1] = range[0]; - } - List resultRange = new ArrayList(); - int start = Integer.parseInt(range[0]); - int end = Integer.parseInt(range[1]); - for (int i = start; i <= end; i++) { - String index = String.valueOf(i); - if (residueMap.containsKey(index)) - resultRange.add(residueMap.get(index)); - } - return resultRange; - } + /** + * Get a specific residue + * + * @param residueIndex + * String representation of the residue index + * @return the ChimeraResidue represented by the residueIndex + */ + public ChimeraResidue getResidue(String index) + { + // Integer index = new Integer(residueIndex); + if (residueMap.containsKey(index)) + return residueMap.get(index); + return null; + } - /** - * Get the ID for this chain - * - * @return String value of the chainId - */ - public String getChainId() { - return chainId; - } + /** + * Get a list of residues as a residue range + * + * @param residueRange + * String representation of the residue range + * @return the List of ChimeraResidues represented by the range + */ + public List getResidueRange(String residueRange) + { + String[] range = residueRange.split("-", 2); + if (range[1] == null || range[1].length() == 0) + { + range[1] = range[0]; + } + List resultRange = new ArrayList(); + int start = Integer.parseInt(range[0]); + int end = Integer.parseInt(range[1]); + for (int i = start; i <= end; i++) + { + String index = String.valueOf(i); + if (residueMap.containsKey(index)) + resultRange.add(residueMap.get(index)); + } + return resultRange; + } - /** - * Get the model number for this chain - * - * @return the model number - */ - public int getModelNumber() { - return modelNumber; - } + /** + * Get the ID for this chain + * + * @return String value of the chainId + */ + public String getChainId() + { + return chainId; + } - /** - * Get the sub-model number for this chain - * - * @return the sub-model number - */ - public int getSubModelNumber() { - return subModelNumber; - } + /** + * Get the model number for this chain + * + * @return the model number + */ + public int getModelNumber() + { + return modelNumber; + } - /** - * Return a string representation of this chain as follows: Chain chainId - * (residue_count residues) - * - * @return String representation of chain - */ - public String displayName() { - if (chainId.equals("_")) { - return ("Chain (no ID) (" + getResidueCount() + " residues)"); - } else { - return ("Chain " + chainId + " (" + getResidueCount() + " residues)"); - } - } + /** + * Get the sub-model number for this chain + * + * @return the sub-model number + */ + public int getSubModelNumber() + { + return subModelNumber; + } - /** - * Return a string representation of this chain as follows: Node xxx [Model yyyy Chain - * chainId] - * - * @return String representation of chain - */ - public String toString() { - String displayName = chimeraModel.getModelName(); - if (displayName.length() > 14) - displayName = displayName.substring(0, 13) + "..."; - if (chainId.equals("_")) { - return (displayName + " Chain (no ID) (" + getResidueCount() + " residues)"); - } else { - return (displayName + " Chain " + chainId + " (" + getResidueCount() + " residues)"); - } - } + /** + * Return a string representation of this chain as follows: Chain + * chainId (residue_count residues) + * + * @return String representation of chain + */ + public String displayName() + { + if (chainId.equals("_")) + { + return ("Chain (no ID) (" + getResidueCount() + " residues)"); + } + else + { + return ("Chain " + chainId + " (" + getResidueCount() + " residues)"); + } + } - /** - * Return the Chimera specification for this chain - * - * @return Chimera specification - */ - public String toSpec() { - if (chainId.equals("_")) { - return ("#" + modelNumber + "." + subModelNumber + ":."); - } else { - return ("#" + modelNumber + "." + subModelNumber + ":." + chainId); - } - } + /** + * Return a string representation of this chain as follows: Node xxx [Model + * yyyy Chain chainId] + * + * @return String representation of chain + */ + public String toString() + { + String displayName = chimeraModel.getModelName(); + if (displayName.length() > 14) + displayName = displayName.substring(0, 13) + "..."; + if (chainId.equals("_")) + { + return (displayName + " Chain (no ID) (" + getResidueCount() + " residues)"); + } + else + { + return (displayName + " Chain " + chainId + " (" + getResidueCount() + " residues)"); + } + } - /** - * Return the number of residues in this chain - * - * @return integer number of residues - */ - public int getResidueCount() { - return residueMap.size(); - } + /** + * Return the Chimera specification for this chain + * + * @return Chimera specification + */ + public String toSpec() + { + if (chainId.equals("_")) + { + return ("#" + modelNumber + "." + subModelNumber + ":."); + } + else + { + return ("#" + modelNumber + "." + subModelNumber + ":." + chainId); + } + } - /** - * Set the ChimeraModel for this chain - * - * @param model - * ChimeraModel to associate with this chain - */ - public void setChimeraModel(ChimeraModel model) { - this.chimeraModel = model; - } + /** + * Return the number of residues in this chain + * + * @return integer number of residues + */ + public int getResidueCount() + { + return residueMap.size(); + } - /** - * Get the ChimeraModel for this chain - * - * @return ChimeraModel associated with this chain - */ - public ChimeraModel getChimeraModel() { - return chimeraModel; - } + /** + * Set the ChimeraModel for this chain + * + * @param model + * ChimeraModel to associate with this chain + */ + public void setChimeraModel(ChimeraModel model) + { + this.chimeraModel = model; + } - /** - * Get the user data for this Chain - * - * @return user data - */ - public Object getUserData() { - return userData; - } + /** + * Get the ChimeraModel for this chain + * + * @return ChimeraModel associated with this chain + */ + public ChimeraModel getChimeraModel() + { + return chimeraModel; + } - /** - * Set the user data for this Chain - * - * @param data - * the user data to associate with this chain - */ - public void setUserData(Object data) { - this.userData = data; - } + /** + * Get the user data for this Chain + * + * @return user data + */ + public Object getUserData() + { + return userData; + } + + /** + * Set the user data for this Chain + * + * @param data + * the user data to associate with this chain + */ + public void setUserData(Object data) + { + this.userData = data; + } } diff --git a/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraManager.java b/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraManager.java index d53d498..2de2829 100644 --- a/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraManager.java +++ b/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraManager.java @@ -302,13 +302,12 @@ public class ChimeraManager // TODO: [Optional] Convert path to name in a better way if (modelPath.lastIndexOf(File.separator) > 0) { - modelName = modelPath.substring(modelPath - .lastIndexOf(File.separator) + 1); + modelName = modelPath + .substring(modelPath.lastIndexOf(File.separator) + 1); } else if (modelPath.lastIndexOf("/") > 0) { - modelName = modelPath - .substring(modelPath.lastIndexOf("/") + 1); + modelName = modelPath.substring(modelPath.lastIndexOf("/") + 1); } return modelName; } @@ -355,7 +354,8 @@ public class ChimeraManager public void startListening(String uri) { sendChimeraCommand("listen start models url " + uri - + ";listen start select prefix SelectionChanged url " + uri, false); + + ";listen start select prefix SelectionChanged url " + uri, + false); } /** @@ -379,7 +379,7 @@ public class ChimeraManager { chimera = null; currentModelsMap.clear(); - this.chimeraRestPort = 0; + this.chimeraRestPort = 0; structureManager.clearOnChimeraExit(); } @@ -630,8 +630,7 @@ public class ChimeraManager } catch (Exception e) { logger.error("Failed to get REST port number from " + responses - + ": " - + e.getMessage()); + + ": " + e.getMessage()); } finally { try @@ -776,7 +775,7 @@ public class ChimeraManager */ public List sendChimeraCommand(String command, boolean reply) { -// System.out.println("chimeradebug>> " + command); + // System.out.println("chimeradebug>> " + command); if (!isChimeraLaunched() || command == null || "".equals(command.trim())) { @@ -827,11 +826,13 @@ public class ChimeraManager List reply = new ArrayList(); BufferedReader response = null; - try { + try + { response = HttpClientUtils .doHttpUrlPost(restUrl, commands, 100, 5000); String line = ""; - while ((line = response.readLine()) != null) { + while ((line = response.readLine()) != null) + { reply.add(line); } } catch (Exception e) diff --git a/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraModel.java b/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraModel.java index 432c6fb..0700565 100644 --- a/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraModel.java +++ b/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraModel.java @@ -3,464 +3,555 @@ package ext.edu.ucsf.rbvi.strucviz2; import java.awt.Color; import java.util.ArrayList; import java.util.Collection; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Set; import java.util.TreeMap; import ext.edu.ucsf.rbvi.strucviz2.StructureManager.ModelType; /** - * This class provides the implementation for the ChimeraModel, ChimeraChain, and ChimeraResidue - * objects + * This class provides the implementation for the ChimeraModel, ChimeraChain, + * and ChimeraResidue objects * * @author scooter * */ -public class ChimeraModel implements ChimeraStructuralObject { - - private String name; // The name of this model - private ModelType type; // The type of the model - private int modelNumber; // The model number - private int subModelNumber; // The sub-model number - - private Color modelColor = null; // The color of this model (from Chimera) - private Object userData = null; // User data associated with this model - private boolean selected = false; // The selected state of this model - - private TreeMap chainMap; // The list of chains - // private TreeMap residueMap; // The list of residues - private HashSet funcResidues; // List of functional residues - - /** - * Constructor to create a model - * - * @param name - * the name of this model - * @param color - * the model Color - * @param modelNumber - * the model number - * @param subModelNumber - * the sub-model number - */ - public ChimeraModel(String name, ModelType type, int modelNumber, int subModelNumber) { - this.name = name; - this.type = type; - this.modelNumber = modelNumber; - this.subModelNumber = subModelNumber; - - this.chainMap = new TreeMap(); - this.funcResidues = new HashSet(); - } - - /** - * Constructor to create a model from the Chimera input line - * - * @param inputLine - * Chimera input line from which to construct this model - */ - // TODO: [Optional] How to distinguish between PDB and MODBASE? - // invoked when listing models: listm type molecule; lists level molecule - // line = model id #0 type Molecule name 1ert - public ChimeraModel(String inputLine) { - this.name = ChimUtils.parseModelName(inputLine); - // TODO: [Optional] Write a separate method to get model type - if (name.startsWith("smiles")) { - this.type = ModelType.SMILES; - } else { - this.type = ModelType.PDB_MODEL; - } - this.modelNumber = ChimUtils.parseModelNumber(inputLine)[0]; - this.subModelNumber = ChimUtils.parseModelNumber(inputLine)[1]; - - this.chainMap = new TreeMap(); - this.funcResidues = new HashSet(); - } - - /** - * Add a residue to this model - * - * @param residue - * to add to the model - */ - public void addResidue(ChimeraResidue residue) { - residue.setChimeraModel(this); - // residueMap.put(residue.getIndex(), residue); - String chainId = residue.getChainId(); - if (chainId != null) { - addResidue(chainId, residue); - } else { - addResidue("_", residue); - } - // Put it in our map so that we can return it in order - // residueMap.put(residue.getIndex(), residue); - } - - /** - * Add a residue to a chain in this model. If the chain associated with chainId doesn't exist, - * it will be created. - * - * @param chainId - * to add the residue to - * @param residue - * to add to the chain - */ - public void addResidue(String chainId, ChimeraResidue residue) { - ChimeraChain chain = null; - if (!chainMap.containsKey(chainId)) { - chain = new ChimeraChain(this.modelNumber, this.subModelNumber, chainId); - chain.setChimeraModel(this); - chainMap.put(chainId, chain); - } else { - chain = chainMap.get(chainId); - } - chain.addResidue(residue); - } - - /** - * Get the ChimeraModel (required for ChimeraStructuralObject interface) - * - * @return ChimeraModel - */ - public ChimeraModel getChimeraModel() { - return this; - } - - /** - * Get the model color of this model - * - * @return model color of this model - */ - public Color getModelColor() { - return this.modelColor; - } - - /** - * Set the color of this model - * - * @param color - * Color of this model - */ - public void setModelColor(Color color) { - this.modelColor = color; - } - - /** - * Return the name of this model - * - * @return model name - */ - public String getModelName() { - return name; - } - - /** - * Set the name of this model - * - * @param name - * model name - */ - public void setModelName(String name) { - this.name = name; - } - - /** - * Get the model number of this model - * - * @return integer model number - */ - public int getModelNumber() { - return modelNumber; - } - - /** - * Set the model number of this model - * - * @param modelNumber - * integer model number - */ - public void setModelNumber(int modelNumber) { - this.modelNumber = modelNumber; - } - - /** - * Get the sub-model number of this model - * - * @return integer sub-model number - */ - public int getSubModelNumber() { - return subModelNumber; - } - - /** - * Set the sub-model number of this model - * - * @param subModelNumber - * integer model number - */ - public void setSubModelNumber(int subModelNumber) { - this.subModelNumber = subModelNumber; - } - - public ModelType getModelType() { - return type; - } - - public void setModelType(ModelType type) { - this.type = type; - } - - public HashSet getFuncResidues() { - return funcResidues; - } - - public void setFuncResidues(List residues) { - for (String residue : residues) { - for (ChimeraChain chain : getChains()) { - if (residue.indexOf("-") > 0) { - funcResidues.addAll(chain.getResidueRange(residue)); - } else { - funcResidues.add(chain.getResidue(residue)); - } - } - } - } - - /** - * Get the user data for this model - * - * @return user data - */ - public Object getUserData() { - return userData; - } - - /** - * Set the user data for this model - * - * @param data - * user data to associate with this model - */ - public void setUserData(Object data) { - this.userData = data; - } - - /** - * Return the selected state of this model - * - * @return the selected state - */ - public boolean isSelected() { - return selected; - } - - /** - * Set the selected state of this model - * - * @param selected - * a boolean to set the selected state to - */ - public void setSelected(boolean selected) { - this.selected = selected; - } - - /** - * Return the chains in this model as a List - * - * @return the chains in this model as a list - */ - public List getChildren() { - return new ArrayList(chainMap.values()); - } - - /** - * Return the chains in this model as a colleciton - * - * @return the chains in this model - */ - public Collection getChains() { - return chainMap.values(); - } - - /** - * Get the number of chains in this model - * - * @return integer chain count - */ - public int getChainCount() { - return chainMap.size(); - } - - /** - * Get the list of chain names associated with this model - * - * @return return the list of chain names for this model - */ - public Collection getChainNames() { - return chainMap.keySet(); - } - - /** - * Get the residues associated with this model - * - * @return the list of residues in this model - */ - public Collection getResidues() { - Collection residues = new ArrayList(); - for (ChimeraChain chain : getChains()) { - residues.addAll(chain.getResidues()); - } - return residues; - } - - /** - * Get the number of residues in this model - * - * @return integer residues count - */ - public int getResidueCount() { - int count = 0; - for (ChimeraChain chain : getChains()) { - count += chain.getResidueCount(); - } - return count; - } - - /** - * Get a specific chain from the model - * - * @param chain - * the ID of the chain to return - * @return ChimeraChain associated with the chain - */ - public ChimeraChain getChain(String chain) { - if (chainMap.containsKey(chain)) { - return chainMap.get(chain); - } - return null; - } - - /** - * Return a specific residue based on its index - * - * @param index - * of the residue to return - * @return the residue associated with that index - */ - public ChimeraResidue getResidue(String chainId, String index) { - if (chainMap.containsKey(chainId)) { - return chainMap.get(chainId).getResidue(index); - } - return null; - } - - /** - * Checks if this model has selected children. - */ - public boolean hasSelectedChildren() { - if (selected) { - return true; - } else { - for (ChimeraChain chain : getChains()) { - if (chain.hasSelectedChildren()) { - return true; - } - } - } - return false; - } - - /** - * Return the list of selected residues - * - * @return all selected residues - */ - public List getSelectedResidues() { - List residueList = new ArrayList(); - for (ChimeraChain chain : getChains()) { - if (selected) { - residueList.addAll(chain.getSelectedResidues()); - } else { - residueList.addAll(getResidues()); - } - } - return residueList; - } - - - /** - * Return the Chimera specification for this model. - */ - public String toSpec() { - if (subModelNumber == 0) - return ("#" + modelNumber); - return ("#" + modelNumber + "." + subModelNumber); - } - - /** - * Return a string representation for the model. Shorten if longer than 100 characters. - */ - public String toString() { - String modelName = ""; - // TODO: [Optional] Change cutoff for shortening model names in the structure naviagator dialog - if (getChainCount() > 0) { - modelName = "Model " + toSpec() + " " + name + " (" + getChainCount() + " chains, " - + getResidueCount() + " residues)"; - } else if (getResidueCount() > 0) { - modelName = "Model " + toSpec() + " " + name + " (" + getResidueCount() + " residues)"; - } else { - modelName = "Model " + toSpec() + " " + name + ""; - } - - Set networkNames = new HashSet(); - Set nodeNames = new HashSet(); - Set edgeNames = new HashSet(); - - String cytoName = " ["; - if (networkNames.size() > 0) { - if (networkNames.size() == 1) { - cytoName += "Network {"; - } else if (networkNames.size() > 1) { - cytoName += "Networks {"; - } - for (String cName : networkNames) { - cytoName += cName + ","; - } - cytoName = cytoName.substring(0, cytoName.length() - 1) + "}, "; - } - if (nodeNames.size() > 0) { - if (nodeNames.size() == 1) { - cytoName += "Node {"; - } else if (nodeNames.size() > 1) { - cytoName += "Nodes {"; - } - for (String cName : nodeNames) { - cytoName += cName + ","; - } - cytoName = cytoName.substring(0, cytoName.length() - 1) + "}, "; - } - if (edgeNames.size() > 0) { - if (edgeNames.size() == 1) { - cytoName += "Edge {"; - } else if (edgeNames.size() > 1) { - cytoName += "Edges {"; - } - for (String cName : edgeNames) { - cytoName += cName + ","; - } - cytoName = cytoName.substring(0, cytoName.length() - 1) + "}, "; - } - if (cytoName.endsWith(", ")) { - cytoName = cytoName.substring(0, cytoName.length() - 2); - } - cytoName += "]"; - String nodeName = modelName + cytoName; - if (nodeName.length() > 100) { - nodeName = nodeName.substring(0, 100) + "..."; - } - return nodeName; - } +public class ChimeraModel implements ChimeraStructuralObject +{ + + private String name; // The name of this model + + private ModelType type; // The type of the model + + private int modelNumber; // The model number + + private int subModelNumber; // The sub-model number + + private Color modelColor = null; // The color of this model (from Chimera) + + private Object userData = null; // User data associated with this model + + private boolean selected = false; // The selected state of this model + + private TreeMap chainMap; // The list of chains + + // private TreeMap residueMap; // The list of residues + private HashSet funcResidues; // List of functional residues + + /** + * Constructor to create a model + * + * @param name + * the name of this model + * @param color + * the model Color + * @param modelNumber + * the model number + * @param subModelNumber + * the sub-model number + */ + public ChimeraModel(String name, ModelType type, int modelNumber, + int subModelNumber) + { + this.name = name; + this.type = type; + this.modelNumber = modelNumber; + this.subModelNumber = subModelNumber; + + this.chainMap = new TreeMap(); + this.funcResidues = new HashSet(); + } + + /** + * Constructor to create a model from the Chimera input line + * + * @param inputLine + * Chimera input line from which to construct this model + */ + // TODO: [Optional] How to distinguish between PDB and MODBASE? + // invoked when listing models: listm type molecule; lists level molecule + // line = model id #0 type Molecule name 1ert + public ChimeraModel(String inputLine) + { + this.name = ChimUtils.parseModelName(inputLine); + // TODO: [Optional] Write a separate method to get model type + if (name.startsWith("smiles")) + { + this.type = ModelType.SMILES; + } + else + { + this.type = ModelType.PDB_MODEL; + } + this.modelNumber = ChimUtils.parseModelNumber(inputLine)[0]; + this.subModelNumber = ChimUtils.parseModelNumber(inputLine)[1]; + + this.chainMap = new TreeMap(); + this.funcResidues = new HashSet(); + } + + /** + * Add a residue to this model + * + * @param residue + * to add to the model + */ + public void addResidue(ChimeraResidue residue) + { + residue.setChimeraModel(this); + // residueMap.put(residue.getIndex(), residue); + String chainId = residue.getChainId(); + if (chainId != null) + { + addResidue(chainId, residue); + } + else + { + addResidue("_", residue); + } + // Put it in our map so that we can return it in order + // residueMap.put(residue.getIndex(), residue); + } + + /** + * Add a residue to a chain in this model. If the chain associated with + * chainId doesn't exist, it will be created. + * + * @param chainId + * to add the residue to + * @param residue + * to add to the chain + */ + public void addResidue(String chainId, ChimeraResidue residue) + { + ChimeraChain chain = null; + if (!chainMap.containsKey(chainId)) + { + chain = new ChimeraChain(this.modelNumber, this.subModelNumber, + chainId); + chain.setChimeraModel(this); + chainMap.put(chainId, chain); + } + else + { + chain = chainMap.get(chainId); + } + chain.addResidue(residue); + } + + /** + * Get the ChimeraModel (required for ChimeraStructuralObject interface) + * + * @return ChimeraModel + */ + public ChimeraModel getChimeraModel() + { + return this; + } + + /** + * Get the model color of this model + * + * @return model color of this model + */ + public Color getModelColor() + { + return this.modelColor; + } + + /** + * Set the color of this model + * + * @param color + * Color of this model + */ + public void setModelColor(Color color) + { + this.modelColor = color; + } + + /** + * Return the name of this model + * + * @return model name + */ + public String getModelName() + { + return name; + } + + /** + * Set the name of this model + * + * @param name + * model name + */ + public void setModelName(String name) + { + this.name = name; + } + + /** + * Get the model number of this model + * + * @return integer model number + */ + public int getModelNumber() + { + return modelNumber; + } + + /** + * Set the model number of this model + * + * @param modelNumber + * integer model number + */ + public void setModelNumber(int modelNumber) + { + this.modelNumber = modelNumber; + } + + /** + * Get the sub-model number of this model + * + * @return integer sub-model number + */ + public int getSubModelNumber() + { + return subModelNumber; + } + + /** + * Set the sub-model number of this model + * + * @param subModelNumber + * integer model number + */ + public void setSubModelNumber(int subModelNumber) + { + this.subModelNumber = subModelNumber; + } + + public ModelType getModelType() + { + return type; + } + + public void setModelType(ModelType type) + { + this.type = type; + } + + public HashSet getFuncResidues() + { + return funcResidues; + } + + public void setFuncResidues(List residues) + { + for (String residue : residues) + { + for (ChimeraChain chain : getChains()) + { + if (residue.indexOf("-") > 0) + { + funcResidues.addAll(chain.getResidueRange(residue)); + } + else + { + funcResidues.add(chain.getResidue(residue)); + } + } + } + } + + /** + * Get the user data for this model + * + * @return user data + */ + public Object getUserData() + { + return userData; + } + + /** + * Set the user data for this model + * + * @param data + * user data to associate with this model + */ + public void setUserData(Object data) + { + this.userData = data; + } + + /** + * Return the selected state of this model + * + * @return the selected state + */ + public boolean isSelected() + { + return selected; + } + + /** + * Set the selected state of this model + * + * @param selected + * a boolean to set the selected state to + */ + public void setSelected(boolean selected) + { + this.selected = selected; + } + + /** + * Return the chains in this model as a List + * + * @return the chains in this model as a list + */ + public List getChildren() + { + return new ArrayList(chainMap.values()); + } + + /** + * Return the chains in this model as a colleciton + * + * @return the chains in this model + */ + public Collection getChains() + { + return chainMap.values(); + } + + /** + * Get the number of chains in this model + * + * @return integer chain count + */ + public int getChainCount() + { + return chainMap.size(); + } + + /** + * Get the list of chain names associated with this model + * + * @return return the list of chain names for this model + */ + public Collection getChainNames() + { + return chainMap.keySet(); + } + + /** + * Get the residues associated with this model + * + * @return the list of residues in this model + */ + public Collection getResidues() + { + Collection residues = new ArrayList(); + for (ChimeraChain chain : getChains()) + { + residues.addAll(chain.getResidues()); + } + return residues; + } + + /** + * Get the number of residues in this model + * + * @return integer residues count + */ + public int getResidueCount() + { + int count = 0; + for (ChimeraChain chain : getChains()) + { + count += chain.getResidueCount(); + } + return count; + } + + /** + * Get a specific chain from the model + * + * @param chain + * the ID of the chain to return + * @return ChimeraChain associated with the chain + */ + public ChimeraChain getChain(String chain) + { + if (chainMap.containsKey(chain)) + { + return chainMap.get(chain); + } + return null; + } + + /** + * Return a specific residue based on its index + * + * @param index + * of the residue to return + * @return the residue associated with that index + */ + public ChimeraResidue getResidue(String chainId, String index) + { + if (chainMap.containsKey(chainId)) + { + return chainMap.get(chainId).getResidue(index); + } + return null; + } + + /** + * Checks if this model has selected children. + */ + public boolean hasSelectedChildren() + { + if (selected) + { + return true; + } + else + { + for (ChimeraChain chain : getChains()) + { + if (chain.hasSelectedChildren()) + { + return true; + } + } + } + return false; + } + + /** + * Return the list of selected residues + * + * @return all selected residues + */ + public List getSelectedResidues() + { + List residueList = new ArrayList(); + for (ChimeraChain chain : getChains()) + { + if (selected) + { + residueList.addAll(chain.getSelectedResidues()); + } + else + { + residueList.addAll(getResidues()); + } + } + return residueList; + } + + /** + * Return the Chimera specification for this model. + */ + public String toSpec() + { + if (subModelNumber == 0) + return ("#" + modelNumber); + return ("#" + modelNumber + "." + subModelNumber); + } + + /** + * Return a string representation for the model. Shorten if longer than 100 + * characters. + */ + public String toString() + { + String modelName = ""; + // TODO: [Optional] Change cutoff for shortening model names in the + // structure naviagator dialog + if (getChainCount() > 0) + { + modelName = "Model " + toSpec() + " " + name + " (" + getChainCount() + + " chains, " + getResidueCount() + " residues)"; + } + else if (getResidueCount() > 0) + { + modelName = "Model " + toSpec() + " " + name + " (" + + getResidueCount() + " residues)"; + } + else + { + modelName = "Model " + toSpec() + " " + name + ""; + } + + Set networkNames = new HashSet(); + Set nodeNames = new HashSet(); + Set edgeNames = new HashSet(); + + String cytoName = " ["; + if (networkNames.size() > 0) + { + if (networkNames.size() == 1) + { + cytoName += "Network {"; + } + else if (networkNames.size() > 1) + { + cytoName += "Networks {"; + } + for (String cName : networkNames) + { + cytoName += cName + ","; + } + cytoName = cytoName.substring(0, cytoName.length() - 1) + "}, "; + } + if (nodeNames.size() > 0) + { + if (nodeNames.size() == 1) + { + cytoName += "Node {"; + } + else if (nodeNames.size() > 1) + { + cytoName += "Nodes {"; + } + for (String cName : nodeNames) + { + cytoName += cName + ","; + } + cytoName = cytoName.substring(0, cytoName.length() - 1) + "}, "; + } + if (edgeNames.size() > 0) + { + if (edgeNames.size() == 1) + { + cytoName += "Edge {"; + } + else if (edgeNames.size() > 1) + { + cytoName += "Edges {"; + } + for (String cName : edgeNames) + { + cytoName += cName + ","; + } + cytoName = cytoName.substring(0, cytoName.length() - 1) + "}, "; + } + if (cytoName.endsWith(", ")) + { + cytoName = cytoName.substring(0, cytoName.length() - 2); + } + cytoName += "]"; + String nodeName = modelName + cytoName; + if (nodeName.length() > 100) + { + nodeName = nodeName.substring(0, 100) + "..."; + } + return nodeName; + } } diff --git a/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraResidue.java b/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraResidue.java index 10825ae..0045e97 100644 --- a/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraResidue.java +++ b/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraResidue.java @@ -46,349 +46,411 @@ import org.slf4j.LoggerFactory; * */ -public class ChimeraResidue implements ChimeraStructuralObject, Comparable { - - /* Constants */ - public static final int SINGLE_LETTER = 0; // Display residues as a single - // letter - public static final int THREE_LETTER = 1; // Display residues as three letters - public static final int FULL_NAME = 2; // Display full residue names - - private String type; // Residue type - private String index; // Residue index - private String chainId; // ChainID for this residue - private int modelNumber; // model number for this residue - private int subModelNumber; // sub-model number for this residue - protected int residueNumber; - protected String insertionCode; - private ChimeraModel chimeraModel; // ChimeraModel the residue is part of - private Object userData; // user data to associate with this residue - // public static HashMap aaNames = null; // a map of amino acid - // names - private static int displayType = THREE_LETTER; // the current display type - private boolean selected = false; // the selection state - - /** - * Constructor to create a new ChimeraResidue - * - * @param type - * the residue type - * @param index - * the index of the residue - * @param modelNumber - * the model number this residue is part of - */ - public ChimeraResidue(String type, String index, int modelNumber) { - this(type, index, modelNumber, 0); - } - - /** - * Constructor to create a new ChimeraResidue - * - * @param type - * the residue type - * @param index - * the index of the residue - * @param modelNumber - * the model number this residue is part of - * @param subModelNumber - * the sub-model number this residue is part of - */ - public ChimeraResidue(String type, String index, int modelNumber, int subModelNumber) { - this.type = type; - this.index = index; - this.modelNumber = modelNumber; - this.subModelNumber = subModelNumber; - splitInsertionCode(this.index); - // if (aaNames == null) { - // initNames(); - // } - } - - /** - * Constructor to create a new ChimeraResidue from an input line - * - * @param chimeraInputLine - * a Chimera residue description - */ - // invoked when listing (selected) residues: listr spec #0; lists level residue - // Line: residue id #0:37.A type MET - public ChimeraResidue(String chimeraInputLine) { - // initNames(); - String[] split1 = chimeraInputLine.split(":"); - - // First half has model number -- get the number - int numberOffset = split1[0].indexOf('#'); - String model = split1[0].substring(numberOffset + 1); - int decimalOffset = model.indexOf('.'); // Do we have a sub-model? - try { - this.subModelNumber = 0; - if (decimalOffset > 0) { - this.subModelNumber = Integer.parseInt(model.substring(decimalOffset + 1)); - this.modelNumber = Integer.parseInt(model.substring(0, decimalOffset)); - } else { - this.modelNumber = Integer.parseInt(model); - } - } catch (Exception e) { - LoggerFactory.getLogger(ChimeraResidue.class) - .error("Unexpected return from Chimera: " + model); - this.modelNumber = -1; - } - - // Second half has residue info: index & type - String[] rTokens = split1[1].split(" "); - this.type = rTokens[2]; - - String[] iTokens = rTokens[0].split("\\."); - if (iTokens.length > 0) { - this.index = iTokens[0]; - - // Careful, might or might not have a chainID - if (iTokens.length > 1) - this.chainId = iTokens[1]; - else - this.chainId = "_"; - } else - this.index = rTokens[0]; - - splitInsertionCode(this.index); - } - - /** - * Set the selected state for this residue - * - * @param selected - * the selection state to set - */ - public void setSelected(boolean selected) { - this.selected = selected; - } - - /** - * Return the selected state of this residue - * - * @return the selected state - */ - public boolean isSelected() { - return selected; - } - - /** - * Return an array made up of this residue (required for ChimeraStructuralObject interface - * - * @return a List with this residue as its sole member - */ - public List getChildren() { - List v = new ArrayList(); - v.add(this); - return v; - } - - /** - * Return the string representation of this residue as follows: "residue_name index" - * where residue_name could be either the single letter, three letter, or full name - * representation of the amino acid. - * - * @return the string representation - */ - public String displayName() { - return toString(); - } - - /** - * Return the string representation of this residue as follows: "residue_name index" - * where residue_name could be either the single letter, three letter, or full name - * representation of the amino acid. - * - * @return the string representation - */ - public String toString() { - if (displayType == FULL_NAME) { - return (ChimUtils.toFullName(type) + " " + index); - } else if (displayType == SINGLE_LETTER) { - return (ChimUtils.toSingleLetter(type) + " " + index); - } else if (displayType == THREE_LETTER) { - return (ChimUtils.toThreeLetter(type) + " " + index); - } else { - return (type + " " + index); - } - } - - /** - * Return the Chimera specification for this Residue - * - * @return Chimera specification - */ - public String toSpec() { - if (!chainId.equals("_")) - return ("#" + modelNumber + ":" + index + "." + chainId); - else - return ("#" + modelNumber + ":" + index + "."); - } - - /** - * Get the index of this residue - * - * @return residue index - */ - public String getIndex() { - return this.index; - } - - /** - * Get the chainID for this residue - * - * @return String value of the chainId - */ - public String getChainId() { - return this.chainId; - } - - /** - * Get the type for this residue - * - * @return residue type - */ - public String getType() { - return this.type; - } - - /** - * Get the model number for this residue - * - * @return the model number - */ - public int getModelNumber() { - return this.modelNumber; - } - - /** - * Get the sub-model number for this residue - * - * @return the sub-model number - */ - public int getSubModelNumber() { - return this.subModelNumber; - } - - /** - * Get the model this residue is part of - * - * @return the ChimeraModel - */ - public ChimeraModel getChimeraModel() { - return this.chimeraModel; - } - - /** - * Set the model this residue is part of - * - * @param chimeraModel - * the ChimeraModel this model is part of - */ - public void setChimeraModel(ChimeraModel chimeraModel) { - this.chimeraModel = chimeraModel; - } - - /** - * Get the user data for this residue - * - * @return user data - */ - public Object getUserData() { - return userData; - } - - /** - * Set the user data for this Residue - * - * @param data - * the user data to associate with this residue - */ - public void setUserData(Object data) { - this.userData = data; - } - - public int compareTo(ChimeraResidue c2) { - if (residueNumber < c2.residueNumber) - return -1; - else if (residueNumber == c2.residueNumber) { - if (insertionCode == null && c2.insertionCode == null) - return 0; - else if (insertionCode == null) - return -1; - else if (c2.insertionCode == null) - return 1; - return (insertionCode.compareTo(c2.insertionCode)); - } - return 1; - } - - public void splitInsertionCode(String residue) { - // OK, split the index into number and insertion code - Pattern p = Pattern.compile("(\\d*)([A-Z]?)"); - Matcher m = p.matcher(residue); - if (m.matches()) { - this.residueNumber = Integer.parseInt(m.group(1)); - if (m.groupCount() > 1) - this.insertionCode = m.group(2); - else - this.insertionCode = null; - } - } - - /********************************************** - * Static routines - *********************************************/ - - /** - * Initialize the residue names - */ - // private static void initNames() { - // // Create our residue name table - // aaNames = new HashMap(); - // aaNames.put("ALA", "A Ala Alanine N[C@@H](C)C(O)=O"); - // aaNames.put("ARG", "R Arg Arginine N[C@@H](CCCNC(N)=N)C(O)=O"); - // aaNames.put("ASN", "N Asn Asparagine N[C@@H](CC(N)=O)C(O)=O"); - // aaNames.put("ASP", "D Asp Aspartic_acid N[C@@H](CC(O)=O)C(O)=O"); - // aaNames.put("CYS", "C Cys Cysteine N[C@@H](CS)C(O)=O"); - // aaNames.put("GLN", "Q Gln Glutamine N[C@H](C(O)=O)CCC(N)=O"); - // aaNames.put("GLU", "E Glu Glumatic_acid N[C@H](C(O)=O)CCC(O)=O"); - // aaNames.put("GLY", "G Gly Glycine NCC(O)=O"); - // aaNames.put("HIS", "H His Histidine N[C@@H](CC1=CN=CN1)C(O)=O"); - // aaNames.put("ILE", "I Ile Isoleucine N[C@]([C@H](C)CC)([H])C(O)=O"); - // aaNames.put("LEU", "L Leu Leucine N[C@](CC(C)C)([H])C(O)=O"); - // aaNames.put("LYS", "K Lys Lysine N[C@](CCCCN)([H])C(O)=O"); - // aaNames.put("DLY", "K Dly D-Lysine NCCCC[C@@H](N)C(O)=O"); - // aaNames.put("MET", "M Met Methionine N[C@](CCSC)([H])C(O)=O"); - // aaNames.put("PHE", "F Phe Phenylalanine N[C@](CC1=CC=CC=C1)([H])C(O)=O"); - // aaNames.put("PRO", "P Pro Proline OC([C@@]1([H])NCCC1)=O"); - // aaNames.put("SER", "S Ser Serine OC[C@](C(O)=O)([H])N"); - // aaNames.put("THR", "T Thr Threonine O[C@H](C)[C@](C(O)=O)([H])N"); - // aaNames.put("TRP", "W Trp Tryptophan N[C@@]([H])(CC1=CN([H])C2=C1C=CC=C2)C(O)=O"); - // aaNames.put("TYR", "Y Tyr Tyrosine N[C@@](C(O)=O)([H])CC1=CC=C(O)C=C1"); - // aaNames.put("VAL", "V Val Valine N[C@@](C(O)=O)([H])C(C)C"); - // aaNames.put("ASX", "B Asx Aspartic_acid_or_Asparagine"); - // aaNames.put("GLX", "Z Glx Glutamine_or_Glutamic_acid"); - // aaNames.put("XAA", "X Xaa Any_or_unknown_amino_acid"); - // aaNames.put("HOH", "HOH HOH Water [H]O[H]"); - // } - - /** - * Set the display type. - * - * @param type - * the display type - */ - public static void setDisplayType(int type) { - displayType = type; - } - - public static int getDisplayType() { - return displayType; - } - - public boolean hasSelectedChildren() { - return false; - } +public class ChimeraResidue implements ChimeraStructuralObject, + Comparable +{ + + /* Constants */ + public static final int SINGLE_LETTER = 0; // Display residues as a single + // letter + + public static final int THREE_LETTER = 1; // Display residues as three letters + + public static final int FULL_NAME = 2; // Display full residue names + + private String type; // Residue type + + private String index; // Residue index + + private String chainId; // ChainID for this residue + + private int modelNumber; // model number for this residue + + private int subModelNumber; // sub-model number for this residue + + protected int residueNumber; + + protected String insertionCode; + + private ChimeraModel chimeraModel; // ChimeraModel the residue is part of + + private Object userData; // user data to associate with this residue + + // public static HashMap aaNames = null; // a map of amino + // acid + // names + private static int displayType = THREE_LETTER; // the current display type + + private boolean selected = false; // the selection state + + /** + * Constructor to create a new ChimeraResidue + * + * @param type + * the residue type + * @param index + * the index of the residue + * @param modelNumber + * the model number this residue is part of + */ + public ChimeraResidue(String type, String index, int modelNumber) + { + this(type, index, modelNumber, 0); + } + + /** + * Constructor to create a new ChimeraResidue + * + * @param type + * the residue type + * @param index + * the index of the residue + * @param modelNumber + * the model number this residue is part of + * @param subModelNumber + * the sub-model number this residue is part of + */ + public ChimeraResidue(String type, String index, int modelNumber, + int subModelNumber) + { + this.type = type; + this.index = index; + this.modelNumber = modelNumber; + this.subModelNumber = subModelNumber; + splitInsertionCode(this.index); + // if (aaNames == null) { + // initNames(); + // } + } + + /** + * Constructor to create a new ChimeraResidue from an input line + * + * @param chimeraInputLine + * a Chimera residue description + */ + // invoked when listing (selected) residues: listr spec #0; lists level + // residue + // Line: residue id #0:37.A type MET + public ChimeraResidue(String chimeraInputLine) + { + // initNames(); + String[] split1 = chimeraInputLine.split(":"); + + // First half has model number -- get the number + int numberOffset = split1[0].indexOf('#'); + String model = split1[0].substring(numberOffset + 1); + int decimalOffset = model.indexOf('.'); // Do we have a sub-model? + try + { + this.subModelNumber = 0; + if (decimalOffset > 0) + { + this.subModelNumber = Integer.parseInt(model + .substring(decimalOffset + 1)); + this.modelNumber = Integer.parseInt(model.substring(0, + decimalOffset)); + } + else + { + this.modelNumber = Integer.parseInt(model); + } + } catch (Exception e) + { + LoggerFactory.getLogger(ChimeraResidue.class).error( + "Unexpected return from Chimera: " + model); + this.modelNumber = -1; + } + + // Second half has residue info: index & type + String[] rTokens = split1[1].split(" "); + this.type = rTokens[2]; + + String[] iTokens = rTokens[0].split("\\."); + if (iTokens.length > 0) + { + this.index = iTokens[0]; + + // Careful, might or might not have a chainID + if (iTokens.length > 1) + this.chainId = iTokens[1]; + else + this.chainId = "_"; + } + else + this.index = rTokens[0]; + + splitInsertionCode(this.index); + } + + /** + * Set the selected state for this residue + * + * @param selected + * the selection state to set + */ + public void setSelected(boolean selected) + { + this.selected = selected; + } + + /** + * Return the selected state of this residue + * + * @return the selected state + */ + public boolean isSelected() + { + return selected; + } + + /** + * Return an array made up of this residue (required for + * ChimeraStructuralObject interface + * + * @return a List with this residue as its sole member + */ + public List getChildren() + { + List v = new ArrayList(); + v.add(this); + return v; + } + + /** + * Return the string representation of this residue as follows: + * "residue_name index" where residue_name could be + * either the single letter, three letter, or full name representation of the + * amino acid. + * + * @return the string representation + */ + public String displayName() + { + return toString(); + } + + /** + * Return the string representation of this residue as follows: + * "residue_name index" where residue_name could be + * either the single letter, three letter, or full name representation of the + * amino acid. + * + * @return the string representation + */ + public String toString() + { + if (displayType == FULL_NAME) + { + return (ChimUtils.toFullName(type) + " " + index); + } + else if (displayType == SINGLE_LETTER) + { + return (ChimUtils.toSingleLetter(type) + " " + index); + } + else if (displayType == THREE_LETTER) + { + return (ChimUtils.toThreeLetter(type) + " " + index); + } + else + { + return (type + " " + index); + } + } + + /** + * Return the Chimera specification for this Residue + * + * @return Chimera specification + */ + public String toSpec() + { + if (!chainId.equals("_")) + return ("#" + modelNumber + ":" + index + "." + chainId); + else + return ("#" + modelNumber + ":" + index + "."); + } + + /** + * Get the index of this residue + * + * @return residue index + */ + public String getIndex() + { + return this.index; + } + + /** + * Get the chainID for this residue + * + * @return String value of the chainId + */ + public String getChainId() + { + return this.chainId; + } + + /** + * Get the type for this residue + * + * @return residue type + */ + public String getType() + { + return this.type; + } + + /** + * Get the model number for this residue + * + * @return the model number + */ + public int getModelNumber() + { + return this.modelNumber; + } + + /** + * Get the sub-model number for this residue + * + * @return the sub-model number + */ + public int getSubModelNumber() + { + return this.subModelNumber; + } + + /** + * Get the model this residue is part of + * + * @return the ChimeraModel + */ + public ChimeraModel getChimeraModel() + { + return this.chimeraModel; + } + + /** + * Set the model this residue is part of + * + * @param chimeraModel + * the ChimeraModel this model is part of + */ + public void setChimeraModel(ChimeraModel chimeraModel) + { + this.chimeraModel = chimeraModel; + } + + /** + * Get the user data for this residue + * + * @return user data + */ + public Object getUserData() + { + return userData; + } + + /** + * Set the user data for this Residue + * + * @param data + * the user data to associate with this residue + */ + public void setUserData(Object data) + { + this.userData = data; + } + + public int compareTo(ChimeraResidue c2) + { + if (residueNumber < c2.residueNumber) + return -1; + else if (residueNumber == c2.residueNumber) + { + if (insertionCode == null && c2.insertionCode == null) + return 0; + else if (insertionCode == null) + return -1; + else if (c2.insertionCode == null) + return 1; + return (insertionCode.compareTo(c2.insertionCode)); + } + return 1; + } + + public void splitInsertionCode(String residue) + { + // OK, split the index into number and insertion code + Pattern p = Pattern.compile("(\\d*)([A-Z]?)"); + Matcher m = p.matcher(residue); + if (m.matches()) + { + this.residueNumber = Integer.parseInt(m.group(1)); + if (m.groupCount() > 1) + this.insertionCode = m.group(2); + else + this.insertionCode = null; + } + } + + /********************************************** + * Static routines + *********************************************/ + + /** + * Initialize the residue names + */ + // private static void initNames() { + // // Create our residue name table + // aaNames = new HashMap(); + // aaNames.put("ALA", "A Ala Alanine N[C@@H](C)C(O)=O"); + // aaNames.put("ARG", "R Arg Arginine N[C@@H](CCCNC(N)=N)C(O)=O"); + // aaNames.put("ASN", "N Asn Asparagine N[C@@H](CC(N)=O)C(O)=O"); + // aaNames.put("ASP", "D Asp Aspartic_acid N[C@@H](CC(O)=O)C(O)=O"); + // aaNames.put("CYS", "C Cys Cysteine N[C@@H](CS)C(O)=O"); + // aaNames.put("GLN", "Q Gln Glutamine N[C@H](C(O)=O)CCC(N)=O"); + // aaNames.put("GLU", "E Glu Glumatic_acid N[C@H](C(O)=O)CCC(O)=O"); + // aaNames.put("GLY", "G Gly Glycine NCC(O)=O"); + // aaNames.put("HIS", "H His Histidine N[C@@H](CC1=CN=CN1)C(O)=O"); + // aaNames.put("ILE", "I Ile Isoleucine N[C@]([C@H](C)CC)([H])C(O)=O"); + // aaNames.put("LEU", "L Leu Leucine N[C@](CC(C)C)([H])C(O)=O"); + // aaNames.put("LYS", "K Lys Lysine N[C@](CCCCN)([H])C(O)=O"); + // aaNames.put("DLY", "K Dly D-Lysine NCCCC[C@@H](N)C(O)=O"); + // aaNames.put("MET", "M Met Methionine N[C@](CCSC)([H])C(O)=O"); + // aaNames.put("PHE", "F Phe Phenylalanine N[C@](CC1=CC=CC=C1)([H])C(O)=O"); + // aaNames.put("PRO", "P Pro Proline OC([C@@]1([H])NCCC1)=O"); + // aaNames.put("SER", "S Ser Serine OC[C@](C(O)=O)([H])N"); + // aaNames.put("THR", "T Thr Threonine O[C@H](C)[C@](C(O)=O)([H])N"); + // aaNames.put("TRP", + // "W Trp Tryptophan N[C@@]([H])(CC1=CN([H])C2=C1C=CC=C2)C(O)=O"); + // aaNames.put("TYR", "Y Tyr Tyrosine N[C@@](C(O)=O)([H])CC1=CC=C(O)C=C1"); + // aaNames.put("VAL", "V Val Valine N[C@@](C(O)=O)([H])C(C)C"); + // aaNames.put("ASX", "B Asx Aspartic_acid_or_Asparagine"); + // aaNames.put("GLX", "Z Glx Glutamine_or_Glutamic_acid"); + // aaNames.put("XAA", "X Xaa Any_or_unknown_amino_acid"); + // aaNames.put("HOH", "HOH HOH Water [H]O[H]"); + // } + + /** + * Set the display type. + * + * @param type + * the display type + */ + public static void setDisplayType(int type) + { + displayType = type; + } + + public static int getDisplayType() + { + return displayType; + } + + public boolean hasSelectedChildren() + { + return false; + } } diff --git a/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraStructuralObject.java b/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraStructuralObject.java index 1678317..64568a7 100644 --- a/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraStructuralObject.java +++ b/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraStructuralObject.java @@ -32,81 +32,81 @@ */ package ext.edu.ucsf.rbvi.strucviz2; -import java.lang.String; import java.util.List; /** - * This interface provides a common set of methods that are implemented by the ChimeraModel, - * ChimeraChain, and ChimeraResidue classes. + * This interface provides a common set of methods that are implemented by the + * ChimeraModel, ChimeraChain, and ChimeraResidue classes. * * @author scooter * */ -public interface ChimeraStructuralObject { +public interface ChimeraStructuralObject +{ - /** - * Return the Chimera selection specification for this object - * - * @return a String representing a Chimera atom-spec - */ - public String toSpec(); + /** + * Return the Chimera selection specification for this object + * + * @return a String representing a Chimera atom-spec + */ + public String toSpec(); - /** - * Return a String representation for this object - * - * @return a String representing the object name - */ - public String toString(); + /** + * Return a String representation for this object + * + * @return a String representing the object name + */ + public String toString(); - /** - * Return the userData for this object - * - * @return an Object representing the userData (usually TreePath) - */ - public Object getUserData(); + /** + * Return the userData for this object + * + * @return an Object representing the userData (usually TreePath) + */ + public Object getUserData(); - /** - * Set the userData for this object - * - * @param userData - * the Object representing the userData (usually TreePath) - */ - public void setUserData(Object userData); + /** + * Set the userData for this object + * + * @param userData + * the Object representing the userData (usually TreePath) + */ + public void setUserData(Object userData); - /** - * Return the ChimeraModel for this object - * - * @return the ChimeraModel this object is part of - */ - public ChimeraModel getChimeraModel(); + /** + * Return the ChimeraModel for this object + * + * @return the ChimeraModel this object is part of + */ + public ChimeraModel getChimeraModel(); - /** - * Set the "selected" state of this object - * - * @param selected - * boolean value as to whether this object is selected - */ - public void setSelected(boolean selected); + /** + * Set the "selected" state of this object + * + * @param selected + * boolean value as to whether this object is selected + */ + public void setSelected(boolean selected); - /** - * Get the "selected" state of this object - * - * @return the selected state of this object - */ - public boolean isSelected(); + /** + * Get the "selected" state of this object + * + * @return the selected state of this object + */ + public boolean isSelected(); - /** - * Get the selected state of this object and its children. - * - * @return true if any child is selected. - */ - public boolean hasSelectedChildren(); + /** + * Get the selected state of this object and its children. + * + * @return true if any child is selected. + */ + public boolean hasSelectedChildren(); - /** - * Get the children of this object (if any) - * - * @return the children of the object - */ - public List getChildren(); + /** + * Get the children of this object (if any) + * + * @return the children of the object + */ + public List getChildren(); } diff --git a/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraTreeModel.java b/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraTreeModel.java index f3447ce..9ecc6a7 100644 --- a/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraTreeModel.java +++ b/src/ext/edu/ucsf/rbvi/strucviz2/ChimeraTreeModel.java @@ -46,149 +46,171 @@ import javax.swing.tree.TreePath; // StructureViz imports /** - * The ChimeraTreeModel class provides the underlying model - * for the navigation tree in the ModelNavigatorDialog. + * The ChimeraTreeModel class provides the underlying model for the navigation + * tree in the ModelNavigatorDialog. * * @author scooter * @see ModelNavigatorDialog - */ -public class ChimeraTreeModel extends DefaultTreeModel { - private ChimeraManager chimeraManager; - private JTree navigationTree; - private int residueDisplay = ChimeraResidue.THREE_LETTER; - - /** - * Constructor for the ChimeraTreeModel. - * - * @param chimeraObject the Chimera object that this tree represents - * @param tree the JTree used to display the object - * @see Chimera - */ - public ChimeraTreeModel (ChimeraManager chimeraManager, JTree tree) { - super(new DefaultMutableTreeNode()); - this.chimeraManager = chimeraManager; - this.navigationTree = tree; - DefaultMutableTreeNode rootNode = buildTree(); - this.setRoot(rootNode); - } - - /** - * Set the display type for the residues. The display type - * must be one of: - * - * ChimeraResidue.THREE_LETTER - * ChimeraResidue.SINGLE_LETTER - * ChimeraResidue.FULL_NAME - * - * @param newDisplay the display type - * @see ChimeraResidue - */ - public void setResidueDisplay(int newDisplay) { - this.residueDisplay = newDisplay; - } - - /** - * This method is called to rebuild the tree model "from scratch" - */ - public void reload() { - // First, rebuild the tree with the new data - DefaultMutableTreeNode rootNode = buildTree(); - this.setRoot(rootNode); - - // Now let the superclass do all of the work - super.reload(); - } - - /** - * Rebuild an existing tree - */ - public void rebuildTree() { - DefaultMutableTreeNode rootNode = buildTree(); - DefaultTreeModel model = (DefaultTreeModel)navigationTree.getModel(); - model.setRoot(rootNode); - model.reload(); - } - - /** - * Build the tree from the current Chimera data - * - * @return DefaultMutableTreeNode that represents the currently loaded Chimera models - */ - private DefaultMutableTreeNode buildTree() { - int modelCount = chimeraManager.getChimeraModelsCount(true); - DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(modelCount+" Open Chimera Models"); - TreePath rootPath = new TreePath(rootNode); - - TreePath path = null; - DefaultMutableTreeNode model = null; - - // Add all of the Chimera models - for (ChimeraModel chimeraModel: chimeraManager.getChimeraModels()) { - model = new DefaultMutableTreeNode(chimeraModel); - path = rootPath.pathByAddingChild(model); - chimeraModel.setUserData(path); - addChainNodes(chimeraModel, model, path); - rootNode.add(model); - } - return rootNode; - } - - /** - * add chains to a tree model - * - * @param chimeraModel the ChimeraModel to get the chains from - * @param treeModel the tree model to add the chains to - * @param treePath the tree path where the chains should be added - */ - private void addChainNodes(ChimeraModel chimeraModel, - DefaultMutableTreeNode treeModel, - TreePath treePath) { - DefaultMutableTreeNode chain = null; - TreePath chainPath = null; - - // Get the list of chains - Collection chainList = chimeraModel.getChains(); - - if (chainList.size() == 0) { - // No chains! Just add the residues - addResidues(chimeraModel.getResidues(), treeModel, treePath); - return; - } - - // Iterate over the chains and add the chain and all of - // the chain's residues - for (ChimeraChain chimeraChain: chainList) { - chain = new DefaultMutableTreeNode(chimeraChain); - chainPath = treePath.pathByAddingChild(chain); - chimeraChain.setUserData(chainPath); - addResidues(chimeraChain.getResidues(), chain, chainPath); - treeModel.add(chain); - } - } - - /** - * add residues to a tree model - * - * @param residues the residues to add - * @param treeModel the tree model to add the residues to - * @param treePath the tree path where the residues should be added - */ - private void addResidues(Collection residues, - DefaultMutableTreeNode treeModel, - TreePath treePath) { - DefaultMutableTreeNode residue = null; - TreePath residuePath = null; - - List sortedResidues = new ArrayList(residues); - Collections.sort(sortedResidues); - - // Iterate over all residues & add them to the tree - for (ChimeraResidue res: sortedResidues) { - res.setDisplayType(this.residueDisplay); - residue = new DefaultMutableTreeNode(res); - residuePath = treePath.pathByAddingChild(residue); - res.setUserData(residuePath); - treeModel.add(residue); - } - } + */ +public class ChimeraTreeModel extends DefaultTreeModel +{ + private ChimeraManager chimeraManager; + + private JTree navigationTree; + + private int residueDisplay = ChimeraResidue.THREE_LETTER; + + /** + * Constructor for the ChimeraTreeModel. + * + * @param chimeraObject + * the Chimera object that this tree represents + * @param tree + * the JTree used to display the object + * @see Chimera + */ + public ChimeraTreeModel(ChimeraManager chimeraManager, JTree tree) + { + super(new DefaultMutableTreeNode()); + this.chimeraManager = chimeraManager; + this.navigationTree = tree; + DefaultMutableTreeNode rootNode = buildTree(); + this.setRoot(rootNode); + } + + /** + * Set the display type for the residues. The display type must be one of: + * + * ChimeraResidue.THREE_LETTER ChimeraResidue.SINGLE_LETTER + * ChimeraResidue.FULL_NAME + * + * @param newDisplay + * the display type + * @see ChimeraResidue + */ + public void setResidueDisplay(int newDisplay) + { + this.residueDisplay = newDisplay; + } + + /** + * This method is called to rebuild the tree model "from scratch" + */ + public void reload() + { + // First, rebuild the tree with the new data + DefaultMutableTreeNode rootNode = buildTree(); + this.setRoot(rootNode); + + // Now let the superclass do all of the work + super.reload(); + } + + /** + * Rebuild an existing tree + */ + public void rebuildTree() + { + DefaultMutableTreeNode rootNode = buildTree(); + DefaultTreeModel model = (DefaultTreeModel) navigationTree.getModel(); + model.setRoot(rootNode); + model.reload(); + } + + /** + * Build the tree from the current Chimera data + * + * @return DefaultMutableTreeNode that represents the currently loaded Chimera + * models + */ + private DefaultMutableTreeNode buildTree() + { + int modelCount = chimeraManager.getChimeraModelsCount(true); + DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(modelCount + + " Open Chimera Models"); + TreePath rootPath = new TreePath(rootNode); + + TreePath path = null; + DefaultMutableTreeNode model = null; + + // Add all of the Chimera models + for (ChimeraModel chimeraModel : chimeraManager.getChimeraModels()) + { + model = new DefaultMutableTreeNode(chimeraModel); + path = rootPath.pathByAddingChild(model); + chimeraModel.setUserData(path); + addChainNodes(chimeraModel, model, path); + rootNode.add(model); + } + return rootNode; + } + + /** + * add chains to a tree model + * + * @param chimeraModel + * the ChimeraModel to get the chains from + * @param treeModel + * the tree model to add the chains to + * @param treePath + * the tree path where the chains should be added + */ + private void addChainNodes(ChimeraModel chimeraModel, + DefaultMutableTreeNode treeModel, TreePath treePath) + { + DefaultMutableTreeNode chain = null; + TreePath chainPath = null; + + // Get the list of chains + Collection chainList = chimeraModel.getChains(); + + if (chainList.size() == 0) + { + // No chains! Just add the residues + addResidues(chimeraModel.getResidues(), treeModel, treePath); + return; + } + + // Iterate over the chains and add the chain and all of + // the chain's residues + for (ChimeraChain chimeraChain : chainList) + { + chain = new DefaultMutableTreeNode(chimeraChain); + chainPath = treePath.pathByAddingChild(chain); + chimeraChain.setUserData(chainPath); + addResidues(chimeraChain.getResidues(), chain, chainPath); + treeModel.add(chain); + } + } + + /** + * add residues to a tree model + * + * @param residues + * the residues to add + * @param treeModel + * the tree model to add the residues to + * @param treePath + * the tree path where the residues should be added + */ + private void addResidues(Collection residues, + DefaultMutableTreeNode treeModel, TreePath treePath) + { + DefaultMutableTreeNode residue = null; + TreePath residuePath = null; + + List sortedResidues = new ArrayList( + residues); + Collections.sort(sortedResidues); + + // Iterate over all residues & add them to the tree + for (ChimeraResidue res : sortedResidues) + { + res.setDisplayType(this.residueDisplay); + residue = new DefaultMutableTreeNode(res); + residuePath = treePath.pathByAddingChild(residue); + res.setUserData(residuePath); + treeModel.add(residue); + } + } } diff --git a/src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java b/src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java index 4797b37..6fd6340 100644 --- a/src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java +++ b/src/ext/edu/ucsf/rbvi/strucviz2/StructureManager.java @@ -24,15 +24,15 @@ import org.slf4j.LoggerFactory; public class StructureManager { - static final String[] defaultStructureKeys = - { "Structure", "pdb", "pdbFileName", "PDB ID", "structure", - "biopax.xref.PDB", "pdb_ids", "ModelName", "ModelNumber" }; + static final String[] defaultStructureKeys = { "Structure", "pdb", + "pdbFileName", "PDB ID", "structure", "biopax.xref.PDB", "pdb_ids", + "ModelName", "ModelNumber" }; - static final String[] defaultChemStructKeys = - { "Smiles", "smiles", "SMILES" }; + static final String[] defaultChemStructKeys = { "Smiles", "smiles", + "SMILES" }; - static final String[] defaultResidueKeys = - { "FunctionalResidues", "ResidueList", "Residues" }; + static final String[] defaultResidueKeys = { "FunctionalResidues", + "ResidueList", "Residues" }; public enum ModelType { diff --git a/src/ext/edu/ucsf/rbvi/strucviz2/StructureSettings.java b/src/ext/edu/ucsf/rbvi/strucviz2/StructureSettings.java index 161ab13..08a6cb7 100644 --- a/src/ext/edu/ucsf/rbvi/strucviz2/StructureSettings.java +++ b/src/ext/edu/ucsf/rbvi/strucviz2/StructureSettings.java @@ -1,25 +1,30 @@ package ext.edu.ucsf.rbvi.strucviz2; /** - * This object maintains the relationship between Chimera objects and Cytoscape objects. + * This object maintains the relationship between Chimera objects and Cytoscape + * objects. */ -public class StructureSettings { +public class StructureSettings +{ -// @Tunable(description = "Path to UCSF Chimera application", gravity = 4.0) - public String chimeraPath = null; + // @Tunable(description = "Path to UCSF Chimera application", gravity = 4.0) + public String chimeraPath = null; - public StructureSettings(StructureManager manager) { - - chimeraPath = manager.getCurrentChimeraPath(null); + public StructureSettings(StructureManager manager) + { - // This seems a little strange, but it has to do with the order of tunable interceptor - // handling. We need to set these selectors in our structure manager and dynamically - // pull the data out as needed.... - manager.setStructureSettings( this); - } + chimeraPath = manager.getCurrentChimeraPath(null); + // This seems a little strange, but it has to do with the order of tunable + // interceptor + // handling. We need to set these selectors in our structure manager and + // dynamically + // pull the data out as needed.... + manager.setStructureSettings(this); + } - public String getChimeraPath() { - return chimeraPath; - } + public String getChimeraPath() + { + return chimeraPath; + } } diff --git a/src/ext/vamsas/IRegistryServiceLocator.java b/src/ext/vamsas/IRegistryServiceLocator.java index f419e52..5da24db 100755 --- a/src/ext/vamsas/IRegistryServiceLocator.java +++ b/src/ext/vamsas/IRegistryServiceLocator.java @@ -111,7 +111,10 @@ public class IRegistryServiceLocator extends org.apache.axis.client.Service { throw new javax.xml.rpc.ServiceException(t); } - throw new javax.xml.rpc.ServiceException(MessageManager.formatMessage("exception.no_stub_implementation_for_interface", new String[]{(serviceEndpointInterface == null ? "null": serviceEndpointInterface.getName())})); + throw new javax.xml.rpc.ServiceException(MessageManager.formatMessage( + "exception.no_stub_implementation_for_interface", + new String[] { (serviceEndpointInterface == null ? "null" + : serviceEndpointInterface.getName()) })); } /** @@ -168,7 +171,10 @@ public class IRegistryServiceLocator extends org.apache.axis.client.Service } else { // Unknown Port Name - throw new javax.xml.rpc.ServiceException(MessageManager.formatMessage("exception.cannot_set_endpoint_address_unknown_port", new String[]{portName})); + throw new javax.xml.rpc.ServiceException( + MessageManager.formatMessage( + "exception.cannot_set_endpoint_address_unknown_port", + new String[] { portName })); } } diff --git a/src/ext/vamsas/JpredServiceLocator.java b/src/ext/vamsas/JpredServiceLocator.java index 802e3df..aa6d6ba 100755 --- a/src/ext/vamsas/JpredServiceLocator.java +++ b/src/ext/vamsas/JpredServiceLocator.java @@ -109,7 +109,10 @@ public class JpredServiceLocator extends org.apache.axis.client.Service { throw new javax.xml.rpc.ServiceException(t); } - throw new javax.xml.rpc.ServiceException(MessageManager.formatMessage("exception.no_stub_implementation_for_interface", new String[]{(serviceEndpointInterface == null ? "null": serviceEndpointInterface.getName())})); + throw new javax.xml.rpc.ServiceException(MessageManager.formatMessage( + "exception.no_stub_implementation_for_interface", + new String[] { (serviceEndpointInterface == null ? "null" + : serviceEndpointInterface.getName()) })); } /** @@ -166,7 +169,10 @@ public class JpredServiceLocator extends org.apache.axis.client.Service } else { // Unknown Port Name - throw new javax.xml.rpc.ServiceException(MessageManager.formatMessage("exception.cannot_set_endpoint_address_unknown_port", new String[]{portName})); + throw new javax.xml.rpc.ServiceException( + MessageManager.formatMessage( + "exception.cannot_set_endpoint_address_unknown_port", + new String[] { portName })); } } diff --git a/src/ext/vamsas/JpredSoapBindingStub.java b/src/ext/vamsas/JpredSoapBindingStub.java index 2ec1562..cff8081 100755 --- a/src/ext/vamsas/JpredSoapBindingStub.java +++ b/src/ext/vamsas/JpredSoapBindingStub.java @@ -277,8 +277,7 @@ public class JpredSoapBindingStub extends org.apache.axis.client.Stub setRequestHeaders(_call); setAttachments(_call); - java.lang.Object _resp = _call.invoke(new java.lang.Object[] - { seq }); + java.lang.Object _resp = _call.invoke(new java.lang.Object[] { seq }); if (_resp instanceof java.rmi.RemoteException) { @@ -316,8 +315,7 @@ public class JpredSoapBindingStub extends org.apache.axis.client.Stub setRequestHeaders(_call); setAttachments(_call); - java.lang.Object _resp = _call.invoke(new java.lang.Object[] - { msf }); + java.lang.Object _resp = _call.invoke(new java.lang.Object[] { msf }); if (_resp instanceof java.rmi.RemoteException) { @@ -354,8 +352,8 @@ public class JpredSoapBindingStub extends org.apache.axis.client.Stub setRequestHeaders(_call); setAttachments(_call); - java.lang.Object _resp = _call.invoke(new java.lang.Object[] - { job_id }); + java.lang.Object _resp = _call + .invoke(new java.lang.Object[] { job_id }); if (_resp instanceof java.rmi.RemoteException) { @@ -392,8 +390,8 @@ public class JpredSoapBindingStub extends org.apache.axis.client.Stub setRequestHeaders(_call); setAttachments(_call); - java.lang.Object _resp = _call.invoke(new java.lang.Object[] - { job_id }); + java.lang.Object _resp = _call + .invoke(new java.lang.Object[] { job_id }); if (_resp instanceof java.rmi.RemoteException) { diff --git a/src/ext/vamsas/MuscleWSServiceLocator.java b/src/ext/vamsas/MuscleWSServiceLocator.java index 0725555..2427405 100755 --- a/src/ext/vamsas/MuscleWSServiceLocator.java +++ b/src/ext/vamsas/MuscleWSServiceLocator.java @@ -117,7 +117,10 @@ public class MuscleWSServiceLocator extends org.apache.axis.client.Service throw new javax.xml.rpc.ServiceException(t); } - throw new javax.xml.rpc.ServiceException(MessageManager.formatMessage("exception.no_stub_implementation_for_interface", new String[]{(serviceEndpointInterface == null ? "null": serviceEndpointInterface.getName())})); + throw new javax.xml.rpc.ServiceException(MessageManager.formatMessage( + "exception.no_stub_implementation_for_interface", + new String[] { (serviceEndpointInterface == null ? "null" + : serviceEndpointInterface.getName()) })); } /** @@ -176,7 +179,10 @@ public class MuscleWSServiceLocator extends org.apache.axis.client.Service } else { // Unknown Port Name - throw new javax.xml.rpc.ServiceException(MessageManager.formatMessage("exception.cannot_set_endpoint_address_unknown_port", new String[]{portName})); + throw new javax.xml.rpc.ServiceException( + MessageManager.formatMessage( + "exception.cannot_set_endpoint_address_unknown_port", + new String[] { portName })); } } diff --git a/src/ext/vamsas/MuscleWSSoapBindingStub.java b/src/ext/vamsas/MuscleWSSoapBindingStub.java index f01c1fe..1f8d231 100755 --- a/src/ext/vamsas/MuscleWSSoapBindingStub.java +++ b/src/ext/vamsas/MuscleWSSoapBindingStub.java @@ -315,8 +315,8 @@ public class MuscleWSSoapBindingStub extends org.apache.axis.client.Stub setRequestHeaders(_call); setAttachments(_call); - java.lang.Object _resp = _call.invoke(new java.lang.Object[] - { seqSet }); + java.lang.Object _resp = _call + .invoke(new java.lang.Object[] { seqSet }); if (_resp instanceof java.rmi.RemoteException) { @@ -356,8 +356,8 @@ public class MuscleWSSoapBindingStub extends org.apache.axis.client.Stub setRequestHeaders(_call); setAttachments(_call); - java.lang.Object _resp = _call.invoke(new java.lang.Object[] - { job_id }); + java.lang.Object _resp = _call + .invoke(new java.lang.Object[] { job_id }); if (_resp instanceof java.rmi.RemoteException) { @@ -397,8 +397,8 @@ public class MuscleWSSoapBindingStub extends org.apache.axis.client.Stub setRequestHeaders(_call); setAttachments(_call); - java.lang.Object _resp = _call.invoke(new java.lang.Object[] - { job_id }); + java.lang.Object _resp = _call + .invoke(new java.lang.Object[] { job_id }); if (_resp instanceof java.rmi.RemoteException) { @@ -437,8 +437,7 @@ public class MuscleWSSoapBindingStub extends org.apache.axis.client.Stub setRequestHeaders(_call); setAttachments(_call); - java.lang.Object _resp = _call.invoke(new java.lang.Object[] - { jobId }); + java.lang.Object _resp = _call.invoke(new java.lang.Object[] { jobId }); if (_resp instanceof java.rmi.RemoteException) { diff --git a/src/ext/vamsas/RegistryServiceSoapBindingStub.java b/src/ext/vamsas/RegistryServiceSoapBindingStub.java index 4798fa3..08b2a6b 100755 --- a/src/ext/vamsas/RegistryServiceSoapBindingStub.java +++ b/src/ext/vamsas/RegistryServiceSoapBindingStub.java @@ -209,8 +209,7 @@ public class RegistryServiceSoapBindingStub extends setRequestHeaders(_call); setAttachments(_call); - java.lang.Object _resp = _call.invoke(new java.lang.Object[] - {}); + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {}); if (_resp instanceof java.rmi.RemoteException) { diff --git a/src/ext/vamsas/SeqSearchServiceLocator.java b/src/ext/vamsas/SeqSearchServiceLocator.java index f7ef5aa..daf7dd3 100644 --- a/src/ext/vamsas/SeqSearchServiceLocator.java +++ b/src/ext/vamsas/SeqSearchServiceLocator.java @@ -111,7 +111,10 @@ public class SeqSearchServiceLocator extends org.apache.axis.client.Service { throw new javax.xml.rpc.ServiceException(t); } - throw new javax.xml.rpc.ServiceException(MessageManager.formatMessage("exception.no_stub_implementation_for_interface", new String[]{(serviceEndpointInterface == null ? "null": serviceEndpointInterface.getName())})); + throw new javax.xml.rpc.ServiceException(MessageManager.formatMessage( + "exception.no_stub_implementation_for_interface", + new String[] { (serviceEndpointInterface == null ? "null" + : serviceEndpointInterface.getName()) })); } /** @@ -168,7 +171,10 @@ public class SeqSearchServiceLocator extends org.apache.axis.client.Service } else { // Unknown Port Name - throw new javax.xml.rpc.ServiceException(MessageManager.formatMessage("exception.cannot_set_endpoint_address_unknown_port", new String[]{portName})); + throw new javax.xml.rpc.ServiceException( + MessageManager.formatMessage( + "exception.cannot_set_endpoint_address_unknown_port", + new String[] { portName })); } } diff --git a/src/ext/vamsas/SeqSearchServiceSoapBindingStub.java b/src/ext/vamsas/SeqSearchServiceSoapBindingStub.java index da7a7a8..390ceb6 100644 --- a/src/ext/vamsas/SeqSearchServiceSoapBindingStub.java +++ b/src/ext/vamsas/SeqSearchServiceSoapBindingStub.java @@ -315,8 +315,7 @@ public class SeqSearchServiceSoapBindingStub extends setRequestHeaders(_call); setAttachments(_call); - java.lang.Object _resp = _call.invoke(new java.lang.Object[] - {}); + java.lang.Object _resp = _call.invoke(new java.lang.Object[] {}); if (_resp instanceof java.rmi.RemoteException) { @@ -353,8 +352,8 @@ public class SeqSearchServiceSoapBindingStub extends setRequestHeaders(_call); setAttachments(_call); - java.lang.Object _resp = _call.invoke(new java.lang.Object[] - { job_id }); + java.lang.Object _resp = _call + .invoke(new java.lang.Object[] { job_id }); if (_resp instanceof java.rmi.RemoteException) { @@ -392,8 +391,8 @@ public class SeqSearchServiceSoapBindingStub extends setRequestHeaders(_call); setAttachments(_call); - java.lang.Object _resp = _call.invoke(new java.lang.Object[] - { al, database }); + java.lang.Object _resp = _call.invoke(new java.lang.Object[] { al, + database }); if (_resp instanceof java.rmi.RemoteException) { @@ -430,8 +429,8 @@ public class SeqSearchServiceSoapBindingStub extends setRequestHeaders(_call); setAttachments(_call); - java.lang.Object _resp = _call.invoke(new java.lang.Object[] - { s, database }); + java.lang.Object _resp = _call.invoke(new java.lang.Object[] { s, + database }); if (_resp instanceof java.rmi.RemoteException) { @@ -467,8 +466,7 @@ public class SeqSearchServiceSoapBindingStub extends setRequestHeaders(_call); setAttachments(_call); - java.lang.Object _resp = _call.invoke(new java.lang.Object[] - { jobId }); + java.lang.Object _resp = _call.invoke(new java.lang.Object[] { jobId }); if (_resp instanceof java.rmi.RemoteException) { diff --git a/src/jalview/analysis/AAFrequency.java b/src/jalview/analysis/AAFrequency.java index 50045dc..5227795 100755 --- a/src/jalview/analysis/AAFrequency.java +++ b/src/jalview/analysis/AAFrequency.java @@ -198,9 +198,8 @@ public class AAFrequency if (profile) { // TODO use a 1-dimensional array with jSize, nongap in [0] and [1] - residueHash.put(PROFILE, new int[][] - { values, new int[] - { jSize, nongap } }); + residueHash.put(PROFILE, new int[][] { values, + new int[] { jSize, nongap } }); } residueHash.put(MAXCOUNT, new Integer(maxCount)); residueHash.put(MAXRESIDUE, maxResidue); @@ -369,8 +368,7 @@ public class AAFrequency .append("%"); } consensus.annotations[i] = new Annotation(maxRes, - mouseOver.toString(), ' ', - value); + mouseOver.toString(), ' ', value); } } @@ -462,7 +460,8 @@ public class AAFrequency * @param hashtable * @return */ - public static int[] extractCdnaProfile(Hashtable hashtable, boolean ignoreGaps) + public static int[] extractCdnaProfile(Hashtable hashtable, + boolean ignoreGaps) { // this holds #seqs, #ungapped, and then codon count, indexed by encoded // codon triplet @@ -507,7 +506,7 @@ public class AAFrequency result[1] = distinctValuesCount; return Arrays.copyOfRange(result, 0, j); } - + /** * Compute a consensus for the cDNA coding for a protein alignment. * @@ -664,8 +663,7 @@ public class AAFrequency final int pct = codonCount * 100 / totalCount; String codon = String .valueOf(CodingUtils.decodeCodon(codonEncoded)); - percent = fmt == null ? Integer.toString(pct) : fmt - .form(pct); + percent = fmt == null ? Integer.toString(pct) : fmt.form(pct); if (showProfileLogo || codonCount == modalCodonCount) { if (percent.equals(lastPercent) && j > 0) @@ -678,8 +676,7 @@ public class AAFrequency if (samePercent.length() > 0) { mouseOver.append(samePercent).append(": ") - .append(lastPercent) - .append("% "); + .append(lastPercent).append("% "); } samePercent.setLength(0); samePercent.append(codon); diff --git a/src/jalview/analysis/AlignSeq.java b/src/jalview/analysis/AlignSeq.java index 5612133..3ca3d90 100755 --- a/src/jalview/analysis/AlignSeq.java +++ b/src/jalview/analysis/AlignSeq.java @@ -20,13 +20,6 @@ */ package jalview.analysis; -import java.awt.Color; -import java.awt.Graphics; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.StringTokenizer; - import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.datamodel.Mapping; @@ -39,6 +32,13 @@ import jalview.util.Format; import jalview.util.MapList; import jalview.util.MessageManager; +import java.awt.Color; +import java.awt.Graphics; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.StringTokenizer; + /** * * @@ -53,13 +53,11 @@ public class AlignSeq private static final String NEWLINE = System.lineSeparator(); - static String[] dna = - { "A", "C", "G", "T", "-" }; + static String[] dna = { "A", "C", "G", "T", "-" }; // "C", "T", "A", "G", "-"}; - static String[] pep = - { "A", "R", "N", "D", "C", "Q", "E", "G", "H", "I", "L", "K", "M", "F", - "P", "S", "T", "W", "Y", "V", "B", "Z", "X", "-" }; + static String[] pep = { "A", "R", "N", "D", "C", "Q", "E", "G", "H", "I", + "L", "K", "M", "F", "P", "S", "T", "W", "Y", "V", "B", "Z", "X", "-" }; int[][] score; @@ -451,7 +449,8 @@ public class AlignSeq else { output.append("Wrong type = dna or pep only"); - throw new Error(MessageManager.formatMessage("error.unknown_type_dna_or_pep", new String[]{type2})); + throw new Error(MessageManager.formatMessage( + "error.unknown_type_dna_or_pep", new String[] { type2 })); } } @@ -1097,8 +1096,8 @@ public class AlignSeq */ public static List> replaceMatchingSeqsWith( List seqs, List annotations, - List ochains, - AlignmentI al, String dnaOrProtein, boolean removeOldAnnots) + List ochains, AlignmentI al, String dnaOrProtein, + boolean removeOldAnnots) { List orig = new ArrayList(), repl = new ArrayList(); List aligs = new ArrayList(); @@ -1106,7 +1105,7 @@ public class AlignSeq { ArrayList matches = new ArrayList(); ArrayList aligns = new ArrayList(); - + for (SequenceI sq : ochains) { SequenceI bestm = null; @@ -1114,8 +1113,7 @@ public class AlignSeq int bestscore = 0; for (SequenceI msq : al.getSequences()) { - AlignSeq aseq = doGlobalNWAlignment(msq, sq, - dnaOrProtein); + AlignSeq aseq = doGlobalNWAlignment(msq, sq, dnaOrProtein); if (bestm == null || aseq.getMaxScore() > bestscore) { bestscore = aseq.getMaxScore(); @@ -1141,7 +1139,8 @@ public class AlignSeq sq.setName(sp.getName()); sq.setDescription(sp.getDescription()); Mapping sp2sq; - sq.transferAnnotation(sp, sp2sq = aligns.get(q).getMappingFromS1(false)); + sq.transferAnnotation(sp, + sp2sq = aligns.get(q).getMappingFromS1(false)); aligs.add(aligns.get(q)); int inspos = -1; for (int ap = 0; ap < annotations.size();) @@ -1152,9 +1151,12 @@ public class AlignSeq { inspos = ap; } - if (removeOldAnnots) { + if (removeOldAnnots) + { annotations.remove(ap); - } else { + } + else + { AlignmentAnnotation alan = annotations.remove(ap); alan.liftOver(sq, sp2sq); alan.setSequenceRef(sq); diff --git a/src/jalview/analysis/AlignmentAnnotationUtils.java b/src/jalview/analysis/AlignmentAnnotationUtils.java index e02aa9e..a8e61e9 100644 --- a/src/jalview/analysis/AlignmentAnnotationUtils.java +++ b/src/jalview/analysis/AlignmentAnnotationUtils.java @@ -1,5 +1,9 @@ package jalview.analysis; +import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.SequenceI; +import jalview.renderer.AnnotationRenderer; + import java.util.ArrayList; import java.util.Arrays; import java.util.BitSet; @@ -8,10 +12,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import jalview.datamodel.AlignmentAnnotation; -import jalview.datamodel.SequenceI; -import jalview.renderer.AnnotationRenderer; - public class AlignmentAnnotationUtils { diff --git a/src/jalview/analysis/AlignmentSorter.java b/src/jalview/analysis/AlignmentSorter.java index 0022af6..b810050 100755 --- a/src/jalview/analysis/AlignmentSorter.java +++ b/src/jalview/analysis/AlignmentSorter.java @@ -551,8 +551,7 @@ public class AlignmentSorter * @return DOCUMENT ME! */ private static List _sortByTree(SequenceNode node, - List tmp, - List seqset) + List tmp, List seqset) { if (node == null) { @@ -719,9 +718,9 @@ public class AlignmentSorter public static void sortByFeature(String featureLabel, String groupLabel, int start, int stop, AlignmentI alignment, String method) { - sortByFeature(featureLabel == null ? null : new String[] - { featureLabel }, groupLabel == null ? null : new String[] - { groupLabel }, start, stop, alignment, method); + sortByFeature(featureLabel == null ? null + : new String[] { featureLabel }, groupLabel == null ? null + : new String[] { groupLabel }, start, stop, alignment, method); } private static boolean containsIgnoreCase(final String lab, @@ -752,7 +751,9 @@ public class AlignmentSorter if (method != FEATURE_SCORE && method != FEATURE_LABEL && method != FEATURE_DENSITY) { - throw new Error(MessageManager.getString("error.implementation_error_sortbyfeature")); + throw new Error( + MessageManager + .getString("error.implementation_error_sortbyfeature")); } boolean ignoreScore = method != FEATURE_SCORE; StringBuffer scoreLabel = new StringBuffer(); @@ -928,7 +929,8 @@ public class AlignmentSorter { if (method == FEATURE_LABEL) { - throw new Error(MessageManager.getString("error.not_yet_implemented")); + throw new Error( + MessageManager.getString("error.not_yet_implemented")); } } if (lastSortByFeatureScore == null diff --git a/src/jalview/analysis/AlignmentUtils.java b/src/jalview/analysis/AlignmentUtils.java index 3af4913..cbd9c96 100644 --- a/src/jalview/analysis/AlignmentUtils.java +++ b/src/jalview/analysis/AlignmentUtils.java @@ -228,8 +228,7 @@ public class AlignmentUtils * @param cdnaAlignment * @return */ - public static boolean mapProteinToCdna( - final AlignmentI proteinAlignment, + public static boolean mapProteinToCdna(final AlignmentI proteinAlignment, final AlignmentI cdnaAlignment) { if (proteinAlignment == null || cdnaAlignment == null) @@ -414,8 +413,7 @@ public class AlignmentUtils if (cdnaLength != mappedLength && cdnaLength > 2 && String.valueOf(cdnaSeqChars, 0, 3).toUpperCase() - .equals( - ResidueProperties.START)) + .equals(ResidueProperties.START)) { cdnaStart += 3; cdnaLength -= 3; @@ -429,9 +427,8 @@ public class AlignmentUtils { return null; } - MapList map = new MapList(new int[] - { cdnaStart, cdnaEnd }, new int[] - { proteinStart, proteinEnd }, 3, 1); + MapList map = new MapList(new int[] { cdnaStart, cdnaEnd }, new int[] { + proteinStart, proteinEnd }, 3, 1); return map; } @@ -458,8 +455,7 @@ public class AlignmentUtils && aaResidue < aaSeqChars.length; i += 3, aaResidue++) { String codon = String.valueOf(cdnaSeqChars, i, 3); - final String translated = ResidueProperties.codonTranslate( - codon); + final String translated = ResidueProperties.codonTranslate(codon); /* * allow * in protein to match untranslatable in dna */ @@ -468,8 +464,7 @@ public class AlignmentUtils { continue; } - if (translated == null - || !(aaRes == translated.charAt(0))) + if (translated == null || !(aaRes == translated.charAt(0))) { // debug // System.out.println(("Mismatch at " + i + "/" + aaResidue + ": " @@ -500,7 +495,8 @@ public class AlignmentUtils boolean preserveUnmappedGaps) { /* - * Get any mappings from the source alignment to the target (dataset) sequence. + * Get any mappings from the source alignment to the target (dataset) + * sequence. */ // TODO there may be one AlignedCodonFrame per dataset sequence, or one with // all mappings. Would it help to constrain this? @@ -509,7 +505,7 @@ public class AlignmentUtils { return false; } - + /* * Locate the aligned source sequence whose dataset sequence is mapped. We * just take the first match here (as we can't align cDNA like more than one @@ -526,7 +522,7 @@ public class AlignmentUtils break; } } - + if (alignFrom == null) { return false; @@ -551,15 +547,15 @@ public class AlignmentUtils * @param preserveMappedGaps */ public static void alignSequenceAs(SequenceI alignTo, - SequenceI alignFrom, - AlignedCodonFrame mapping, String myGap, char sourceGap, - boolean preserveMappedGaps, boolean preserveUnmappedGaps) + SequenceI alignFrom, AlignedCodonFrame mapping, String myGap, + char sourceGap, boolean preserveMappedGaps, + boolean preserveUnmappedGaps) { // TODO generalise to work for Protein-Protein, dna-dna, dna-protein final char[] thisSeq = alignTo.getSequence(); final char[] thatAligned = alignFrom.getSequence(); StringBuilder thisAligned = new StringBuilder(2 * thisSeq.length); - + // aligned and dataset sequence positions, all base zero int thisSeqPos = 0; int sourceDsPos = 0; @@ -696,8 +692,8 @@ public class AlignmentUtils */ protected static int calculateGapsToInsert(boolean preserveMappedGaps, boolean preserveUnmappedGaps, int sourceGapMappedLength, - boolean inExon, int trailingGapLength, - int intronLength, final boolean startOfCodon) + boolean inExon, int trailingGapLength, int intronLength, + final boolean startOfCodon) { int gapsToAdd = 0; if (startOfCodon) @@ -821,8 +817,8 @@ public class AlignmentUtils // mapping is from protein to nucleotide toDna = true; // should ideally get gap count ratio from mapping - gap = String.valueOf(new char[] - { gapCharacter, gapCharacter, gapCharacter }); + gap = String.valueOf(new char[] { gapCharacter, gapCharacter, + gapCharacter }); } else { @@ -965,9 +961,9 @@ public class AlignmentUtils int column = 0; for (AlignedCodon codon : alignedCodons.keySet()) { - final Map columnResidues = alignedCodons.get(codon); - for (Entry entry : columnResidues - .entrySet()) + final Map columnResidues = alignedCodons + .get(codon); + for (Entry entry : columnResidues.entrySet()) { // place translated codon at its column position in sequence entry.getKey().getSequence()[column] = entry.getValue().charAt(0); @@ -994,8 +990,7 @@ public class AlignmentUtils * the map we are building up */ static void addCodonPositions(SequenceI dna, SequenceI protein, - char gapChar, - Mapping seqMap, + char gapChar, Mapping seqMap, Map> alignedCodons) { Iterator codons = seqMap.getCodonIterator(dna, gapChar); @@ -1068,23 +1063,25 @@ public class AlignmentUtils * @return */ protected static boolean isMappable(SequenceI dnaSeq, - SequenceI proteinSeq, - Set mappings) + SequenceI proteinSeq, Set mappings) { if (dnaSeq == null || proteinSeq == null) { return false; } - SequenceI dnaDs = dnaSeq.getDatasetSequence() == null ? dnaSeq : dnaSeq.getDatasetSequence(); + SequenceI dnaDs = dnaSeq.getDatasetSequence() == null ? dnaSeq : dnaSeq + .getDatasetSequence(); SequenceI proteinDs = proteinSeq.getDatasetSequence() == null ? proteinSeq : proteinSeq.getDatasetSequence(); - + /* * Already mapped? */ - for (AlignedCodonFrame mapping : mappings) { - if ( proteinDs == mapping.getAaForDnaSeq(dnaDs)) { + for (AlignedCodonFrame mapping : mappings) + { + if (proteinDs == mapping.getAaForDnaSeq(dnaDs)) + { return true; } } @@ -1112,7 +1109,8 @@ public class AlignmentUtils * the alignment to check for presence of annotations */ public static void findAddableReferenceAnnotations( - List sequenceScope, Map labelForCalcId, + List sequenceScope, + Map labelForCalcId, final Map> candidates, AlignmentI al) { @@ -1120,7 +1118,7 @@ public class AlignmentUtils { return; } - + /* * For each sequence in scope, make a list of any annotations on the * underlying dataset sequence which are not already on the alignment. @@ -1148,8 +1146,7 @@ public class AlignmentUtils * sequence. */ final Iterable matchedAlignmentAnnotations = al - .findAnnotations(seq, dsann.getCalcId(), - dsann.label); + .findAnnotations(seq, dsann.getCalcId(), dsann.label); if (!matchedAlignmentAnnotations.iterator().hasNext()) { result.add(dsann); @@ -1197,7 +1194,7 @@ public class AlignmentUtils endRes = selectionGroup.getEndRes(); } copyAnn.restrict(startRes, endRes); - + /* * Add to the sequence (sets copyAnn.datasetSequence), unless the * original annotation is already on the sequence. @@ -1235,8 +1232,7 @@ public class AlignmentUtils Collection types, List forSequences, boolean anyType, boolean doShow) { - for (AlignmentAnnotation aa : al - .getAlignmentAnnotation()) + for (AlignmentAnnotation aa : al.getAlignmentAnnotation()) { if (anyType || types.contains(aa.label)) { @@ -1311,7 +1307,7 @@ public class AlignmentUtils { Set newMappings = new LinkedHashSet(); List exonSequences = new ArrayList(); - + for (SequenceI dnaSeq : dna) { final SequenceI ds = dnaSeq.getDatasetSequence(); @@ -1414,11 +1410,9 @@ public class AlignmentUtils * contiguous exons */ List exonRange = new ArrayList(); - exonRange.add(new int[] - { 1, newSequence.length() }); + exonRange.add(new int[] { 1, newSequence.length() }); MapList map = new MapList(exonRange, seqMapping.getMap() - .getToRanges(), - 3, 1); + .getToRanges(), 3, 1); newMapping.addMap(exon.getDatasetSequence(), seqMapping.getTo(), map); MapList cdsToDnaMap = new MapList(dnaExonRanges, exonRange, 1, 1); newMapping.addMap(dnaSeq, exon.getDatasetSequence(), cdsToDnaMap); diff --git a/src/jalview/analysis/AnnotationSorter.java b/src/jalview/analysis/AnnotationSorter.java index 0873f89..b0cfe20 100644 --- a/src/jalview/analysis/AnnotationSorter.java +++ b/src/jalview/analysis/AnnotationSorter.java @@ -46,7 +46,8 @@ public class AnnotationSorter return description; } - public static SequenceAnnotationOrder forDescription(String d) { + public static SequenceAnnotationOrder forDescription(String d) + { for (SequenceAnnotationOrder order : values()) { if (order.toString().equals(d)) @@ -279,9 +280,11 @@ public class AnnotationSorter AlignmentAnnotation[] alignmentAnnotations) { sequenceIndices.clear(); - for (AlignmentAnnotation ann : alignmentAnnotations) { + for (AlignmentAnnotation ann : alignmentAnnotations) + { SequenceI seq = ann.sequenceRef; - if (seq != null) { + if (seq != null) + { int index = AlignmentUtils.getSequenceIndex(alignment, seq); sequenceIndices.put(seq, index); } diff --git a/src/jalview/analysis/Conservation.java b/src/jalview/analysis/Conservation.java index b8f1d92..d4ae57d 100755 --- a/src/jalview/analysis/Conservation.java +++ b/src/jalview/analysis/Conservation.java @@ -280,8 +280,7 @@ public class Conservation resultHash.put(type, ht.get("-")); } } - else if (((Integer) resultHash.get(type)).equals(ht - .get(res)) == false) + else if (((Integer) resultHash.get(type)).equals(ht.get(res)) == false) { resultHash.put(type, new Integer(-1)); } @@ -374,14 +373,14 @@ public class Conservation { consString.append('-'); } - consSymbs = new String[end-start+1]; + consSymbs = new String[end - start + 1]; for (int i = start; i <= end; i++) { gapcons = countConsNGaps(i); totGaps = gapcons[1]; pgaps = ((float) totGaps * 100) / sequences.length; - consSymbs[i-start]=new String(); - + consSymbs[i - start] = new String(); + if (percentageGaps > pgaps) { resultHash = total[i - start]; @@ -398,7 +397,7 @@ public class Conservation { if (result.intValue() == 1) { - consSymbs[i-start] = type+" "+consSymbs[i-start]; + consSymbs[i - start] = type + " " + consSymbs[i - start]; count++; } } @@ -406,14 +405,17 @@ public class Conservation { if (result.intValue() != -1) { - { - if (result.intValue()==0) { - consSymbs[i-start] = consSymbs[i-start]+ " !"+type; - } else { - consSymbs[i-start] = type+" "+consSymbs[i-start]; - } + { + if (result.intValue() == 0) + { + consSymbs[i - start] = consSymbs[i - start] + " !" + type; + } + else + { + consSymbs[i - start] = type + " " + consSymbs[i - start]; + } } - + count++; } } @@ -702,9 +704,8 @@ public class Conservation String conssym = (value > 0 && consp > -1 && consp < consSymbs.length) ? consSymbs[consp] : ""; conservation.annotations[i] = new Annotation(String.valueOf(c), - conssym, ' ', value, new Color(minR - + (maxR * vprop), minG + (maxG * vprop), minB - + (maxB * vprop))); + conssym, ' ', value, new Color(minR + (maxR * vprop), minG + + (maxG * vprop), minB + (maxB * vprop))); // Quality calc if (quality2 != null) diff --git a/src/jalview/analysis/CrossRef.java b/src/jalview/analysis/CrossRef.java index 7238239..2e6431c 100644 --- a/src/jalview/analysis/CrossRef.java +++ b/src/jalview/analysis/CrossRef.java @@ -20,10 +20,6 @@ */ package jalview.analysis; -import java.util.ArrayList; -import java.util.List; -import java.util.Vector; - import jalview.datamodel.AlignedCodonFrame; import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentI; @@ -35,6 +31,10 @@ import jalview.util.DBRefUtils; import jalview.ws.SequenceFetcher; import jalview.ws.seqfetcher.ASequenceFetcher; +import java.util.ArrayList; +import java.util.List; +import java.util.Vector; + /** * Functions for cross-referencing sequence databases. user must first specify * if cross-referencing from protein or dna (set dna==true) @@ -267,7 +267,7 @@ public class CrossRef { found |= searchDataset(dss, xrfs[r], dataset, rseqs, cf); // ,false,!dna); if (found) - { + { xrfs[r] = null; // we've recovered seqs for this one. } } @@ -408,8 +408,7 @@ public class CrossRef */ private static boolean searchDatasetXrefs(SequenceI sequenceI, boolean dna, DBRefEntry[] lrfs, AlignmentI dataset, - List rseqs, - AlignedCodonFrame cf) + List rseqs, AlignedCodonFrame cf) { boolean found = false; if (lrfs == null) diff --git a/src/jalview/analysis/Dna.java b/src/jalview/analysis/Dna.java index 5696838..9ce00cc 100644 --- a/src/jalview/analysis/Dna.java +++ b/src/jalview/analysis/Dna.java @@ -208,9 +208,8 @@ public class Dna for (int gd = 0; gd < selection.length; gd++) { SequenceI dna = selection[gd]; - DBRefEntry[] dnarefs = DBRefUtils - .selectRefs(dna.getDBRef(), - jalview.datamodel.DBRefSource.DNACODINGDBS); + DBRefEntry[] dnarefs = DBRefUtils.selectRefs(dna.getDBRef(), + jalview.datamodel.DBRefSource.DNACODINGDBS); if (dnarefs != null) { // intersect with pep @@ -300,8 +299,7 @@ public class Dna aa.graphHeight = annotation.graphHeight; if (annotation.getThreshold() != null) { - aa.setThreshold(new GraphLine(annotation - .getThreshold())); + aa.setThreshold(new GraphLine(annotation.getThreshold())); } if (annotation.hasScore) { @@ -446,8 +444,10 @@ public class Dna aa = gapString; if (skipint == null) { - skipint = new int[] - { alignedCodon.pos1, alignedCodon.pos3 /* cdp[0], cdp[2] */}; + skipint = new int[] { alignedCodon.pos1, alignedCodon.pos3 /* + * cdp[0], + * cdp[2] + */}; } skipint[1] = alignedCodon.pos3; // cdp[2]; } @@ -683,8 +683,7 @@ public class Dna * range iv[0] = skipint[1]; } else { } } } else if (iv[0] proteinSeqs) + protected void insertAAGap(int pos, List proteinSeqs) { aaWidth++; for (SequenceI seq : proteinSeqs) diff --git a/src/jalview/analysis/Finder.java b/src/jalview/analysis/Finder.java index 875322b..72097e0 100644 --- a/src/jalview/analysis/Finder.java +++ b/src/jalview/analysis/Finder.java @@ -206,7 +206,7 @@ public class Finder { continue; } -// if invalid string used, then regex has no matched to/from + // if invalid string used, then regex has no matched to/from int sres = seq .findPosition(resIndex + Integer.parseInt(spaces.elementAt(resIndex) diff --git a/src/jalview/analysis/Grouping.java b/src/jalview/analysis/Grouping.java index 787e036..51a818f 100644 --- a/src/jalview/analysis/Grouping.java +++ b/src/jalview/analysis/Grouping.java @@ -91,8 +91,8 @@ public class Grouping i = 0; for (String key : gps.keySet()) { - SequenceGroup group = new SequenceGroup(gps.get(key), - "Subseq: " + key, null, true, true, false, 0, width - 1); + SequenceGroup group = new SequenceGroup(gps.get(key), "Subseq: " + + key, null, true, true, false, 0, width - 1); groups[i++] = group; } diff --git a/src/jalview/analysis/NJTree.java b/src/jalview/analysis/NJTree.java index 3470dbc..4489783 100644 --- a/src/jalview/analysis/NJTree.java +++ b/src/jalview/analysis/NJTree.java @@ -1099,8 +1099,7 @@ public class NJTree + ((SequenceI) node.element()).getName()); } - System.out.println(" dist = " + node.dist + " " - + node.count + " " + System.out.println(" dist = " + node.dist + " " + node.count + " " + node.height); } diff --git a/src/jalview/analysis/PCA.java b/src/jalview/analysis/PCA.java index caf7baf..06a139b 100755 --- a/src/jalview/analysis/PCA.java +++ b/src/jalview/analysis/PCA.java @@ -20,14 +20,14 @@ */ package jalview.analysis; -import java.io.*; - -import jalview.datamodel.*; +import jalview.datamodel.BinarySequence; import jalview.datamodel.BinarySequence.InvalidSequenceTypeException; -import jalview.math.*; +import jalview.math.Matrix; import jalview.schemes.ResidueProperties; import jalview.schemes.ScoreMatrix; +import java.io.PrintStream; + /** * Performs Principal Component Analysis on given sequences * diff --git a/src/jalview/analysis/ParseProperties.java b/src/jalview/analysis/ParseProperties.java index 3347800..eb639b6 100644 --- a/src/jalview/analysis/ParseProperties.java +++ b/src/jalview/analysis/ParseProperties.java @@ -20,12 +20,12 @@ */ package jalview.analysis; -import com.stevesoft.pat.Regex; - import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceI; +import com.stevesoft.pat.Regex; + public class ParseProperties { /** @@ -57,9 +57,8 @@ public class ParseProperties public int getScoresFromDescription(String ScoreName, String ScoreDescriptions, String regex, boolean repeat) { - return getScoresFromDescription(new String[] - { ScoreName }, new String[] - { ScoreDescriptions }, regex, repeat); + return getScoresFromDescription(new String[] { ScoreName }, + new String[] { ScoreDescriptions }, regex, repeat); } public int getScoresFromDescription(String[] ScoreNames, diff --git a/src/jalview/analysis/Rna.java b/src/jalview/analysis/Rna.java index 1b89cd1..e752126 100644 --- a/src/jalview/analysis/Rna.java +++ b/src/jalview/analysis/Rna.java @@ -42,15 +42,13 @@ public class Rna static Hashtable pairHash = new Hashtable(); - private static final Character[] openingPars = - { '(', '[', '{', '<', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', - 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', - 'Y', 'Z' }; + private static final Character[] openingPars = { '(', '[', '{', '<', 'A', + 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' }; - private static final Character[] closingPars = - { ')', ']', '}', '>', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', - 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', - 'y', 'z' }; + private static final Character[] closingPars = { ')', ']', '}', '>', 'a', + 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' }; private static HashSet openingParsSet = new HashSet( Arrays.asList(openingPars)); @@ -86,7 +84,11 @@ public class Rna { if (!isClosingParenthesis(closingParenthesis)) { - throw new WUSSParseException(MessageManager.formatMessage("exception.querying_matching_opening_parenthesis_for_non_closing_parenthesis", new String[]{new StringBuffer(closingParenthesis).toString()}), -1); + throw new WUSSParseException( + MessageManager.formatMessage( + "exception.querying_matching_opening_parenthesis_for_non_closing_parenthesis", + new String[] { new StringBuffer(closingParenthesis) + .toString() }), -1); } return closingToOpening.get(closingParenthesis); @@ -130,14 +132,18 @@ public class Rna if (!stacks.containsKey(opening)) { - throw new WUSSParseException(MessageManager.formatMessage("exception.mismatched_unseen_closing_char", new String[]{new StringBuffer(base).toString()}), i); + throw new WUSSParseException(MessageManager.formatMessage( + "exception.mismatched_unseen_closing_char", + new String[] { new StringBuffer(base).toString() }), i); } Stack stack = stacks.get(opening); if (stack.isEmpty()) { // error whilst parsing i'th position. pass back - throw new WUSSParseException(MessageManager.formatMessage("exception.mismatched_closing_char", new String[]{new StringBuffer(base).toString()}), i); + throw new WUSSParseException(MessageManager.formatMessage( + "exception.mismatched_closing_char", + new String[] { new StringBuffer(base).toString() }), i); } int temp = stack.pop(); @@ -150,7 +156,10 @@ public class Rna Stack stack = stacks.get(opening); if (!stack.empty()) { - throw new WUSSParseException(MessageManager.formatMessage("exception.mismatched_opening_char", new String[]{new StringBuffer(opening).toString(),Integer.valueOf(stack.pop()).toString()}), i); + throw new WUSSParseException(MessageManager.formatMessage( + "exception.mismatched_opening_char", + new String[] { new StringBuffer(opening).toString(), + Integer.valueOf(stack.pop()).toString() }), i); } } return pairs; diff --git a/src/jalview/analysis/SeqsetUtils.java b/src/jalview/analysis/SeqsetUtils.java index c23f03c..40bedad 100755 --- a/src/jalview/analysis/SeqsetUtils.java +++ b/src/jalview/analysis/SeqsetUtils.java @@ -20,15 +20,15 @@ */ package jalview.analysis; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; - import jalview.datamodel.PDBEntry; import jalview.datamodel.Sequence; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Vector; + public class SeqsetUtils { @@ -60,8 +60,9 @@ public class SeqsetUtils } } sqinfo.put("SeqFeatures", sfeat); - sqinfo.put("PdbId", (seq.getAllPDBEntries() != null) ? seq.getAllPDBEntries() - : new Vector()); + sqinfo.put("PdbId", + (seq.getAllPDBEntries() != null) ? seq.getAllPDBEntries() + : new Vector()); sqinfo.put("datasetSequence", (seq.getDatasetSequence() != null) ? seq.getDatasetSequence() : new Sequence("THISISAPLACEHOLDER", "")); diff --git a/src/jalview/analysis/SequenceIdMatcher.java b/src/jalview/analysis/SequenceIdMatcher.java index 5b812dd..35a72e3 100755 --- a/src/jalview/analysis/SequenceIdMatcher.java +++ b/src/jalview/analysis/SequenceIdMatcher.java @@ -58,7 +58,7 @@ public class SequenceIdMatcher // associated with this key. names.put(new SeqIdName(seq.getDisplayId(true)), seq); SequenceI dbseq = seq; - while (dbseq.getDatasetSequence()!=null) + while (dbseq.getDatasetSequence() != null) { dbseq = dbseq.getDatasetSequence(); } @@ -191,7 +191,7 @@ public class SequenceIdMatcher SeqIdName nam = new SeqIdName(seqnam); List m = findAllIdMatches(nam); - if (m!=null) + if (m != null) { return m.toArray(new SequenceI[m.size()]); } diff --git a/src/jalview/analysis/StructureFrequency.java b/src/jalview/analysis/StructureFrequency.java index 3c8274e..88387dd 100644 --- a/src/jalview/analysis/StructureFrequency.java +++ b/src/jalview/analysis/StructureFrequency.java @@ -194,9 +194,8 @@ public class StructureFrequency if (profile) { // TODO 1-dim array with jsize in [0], nongapped in [1]; or Pojo - residueHash.put(PROFILE, new int[][] - { values, new int[] - { jSize, (jSize - values['-']) } }); + residueHash.put(PROFILE, new int[][] { values, + new int[] { jSize, (jSize - values['-']) } }); residueHash.put(PAIRPROFILE, pairs); } @@ -239,9 +238,8 @@ public class StructureFrequency } if (profile) { - residueHash.put(PROFILE, new int[][] - { values, new int[] - { jSize, (jSize - values['-']) } }); + residueHash.put(PROFILE, new int[][] { values, + new int[] { jSize, (jSize - values['-']) } }); residueHash.put(PAIRPROFILE, pairs); } @@ -427,8 +425,7 @@ public class StructureFrequency { for (int d = 65; d < 90; d++) { - ca[x] = new int[] - { c, d }; + ca[x] = new int[] { c, d }; vl[x] = pairs[c][d]; x++; } @@ -447,8 +444,7 @@ public class StructureFrequency { tval = (vl[c] * 100f / divisor); mouseOver += ((p == 0) ? "" : "; ") + (char) ca[c][0] - + (char) ca[c][1] + " " + fmt.form(tval) - + "%"; + + (char) ca[c][1] + " " + fmt.form(tval) + "%"; p++; } @@ -493,8 +489,7 @@ public class StructureFrequency { for (int d = 65; d < 90; d++) { - ca[x] = new int[] - { c, d }; + ca[x] = new int[] { c, d }; vl[x] = pairs[c][d]; x++; } diff --git a/src/jalview/analysis/scoremodels/PairwiseSeqScoreModel.java b/src/jalview/analysis/scoremodels/PairwiseSeqScoreModel.java index 52e8451..2ff2518 100644 --- a/src/jalview/analysis/scoremodels/PairwiseSeqScoreModel.java +++ b/src/jalview/analysis/scoremodels/PairwiseSeqScoreModel.java @@ -22,7 +22,6 @@ package jalview.analysis.scoremodels; import jalview.api.analysis.ScoreModelI; import jalview.datamodel.AlignmentView; -import jalview.schemes.ScoreMatrix; import jalview.util.Comparison; public abstract class PairwiseSeqScoreModel implements ScoreModelI diff --git a/src/jalview/api/AlignViewControllerGuiI.java b/src/jalview/api/AlignViewControllerGuiI.java index 4896b35..86e61e7 100644 --- a/src/jalview/api/AlignViewControllerGuiI.java +++ b/src/jalview/api/AlignViewControllerGuiI.java @@ -43,9 +43,9 @@ public interface AlignViewControllerGuiI void addHistoryItem(CommandI command); void setShowSeqFeatures(boolean show); - + void setMenusForViewport(); - + void changeColour(ColourSchemeI cs); /** diff --git a/src/jalview/api/AlignViewControllerI.java b/src/jalview/api/AlignViewControllerI.java index fef9f14..a2f2204 100644 --- a/src/jalview/api/AlignViewControllerI.java +++ b/src/jalview/api/AlignViewControllerI.java @@ -65,14 +65,20 @@ public interface AlignViewControllerI boolean extendCurrent, boolean clearColumns, String featureType); /** - * sort the alignment or current selection by average score over the given set of features - * @param typ list of feature names or null to use currently displayed features + * sort the alignment or current selection by average score over the given set + * of features + * + * @param typ + * list of feature names or null to use currently displayed features */ void sortAlignmentByFeatureScore(String[] typ); /** - * sort the alignment or current selection by distribution of the given set of features - * @param typ list of feature names or null to use currently displayed features + * sort the alignment or current selection by distribution of the given set of + * features + * + * @param typ + * list of feature names or null to use currently displayed features */ void sortAlignmentByFeatureDensity(String[] typ); diff --git a/src/jalview/api/AlignViewportI.java b/src/jalview/api/AlignViewportI.java index 93b2134..5df38d6 100644 --- a/src/jalview/api/AlignViewportI.java +++ b/src/jalview/api/AlignViewportI.java @@ -178,7 +178,7 @@ public interface AlignViewportI extends ViewStyleI */ void updateGroupAnnotationSettings(boolean applyGlobalSettings, boolean preserveNewGroupSettings); - + void setSequenceColour(SequenceI seq, Color col); Color getSequenceColour(SequenceI seq); @@ -251,8 +251,11 @@ public interface AlignViewportI extends ViewStyleI /** * get a copy of the currently visible alignment annotation - * @param selectedOnly if true - trim to selected regions on the alignment - * @return an empty list or new alignment annotation objects shown only visible columns trimmed to selected region only + * + * @param selectedOnly + * if true - trim to selected regions on the alignment + * @return an empty list or new alignment annotation objects shown only + * visible columns trimmed to selected region only */ List getVisibleAlignmentAnnotation( boolean selectedOnly); diff --git a/src/jalview/api/AlignmentViewPanel.java b/src/jalview/api/AlignmentViewPanel.java index f0fd2e1..ef59996 100644 --- a/src/jalview/api/AlignmentViewPanel.java +++ b/src/jalview/api/AlignmentViewPanel.java @@ -56,7 +56,7 @@ public interface AlignmentViewPanel extends OOMHandlerI FeatureRenderer getFeatureRenderer(); FeatureRenderer cloneFeatureRenderer(); - + /** * * @return displayed name for the view diff --git a/src/jalview/api/FeatureRenderer.java b/src/jalview/api/FeatureRenderer.java index cf98b2f..0d0adaa 100644 --- a/src/jalview/api/FeatureRenderer.java +++ b/src/jalview/api/FeatureRenderer.java @@ -85,7 +85,7 @@ public interface FeatureRenderer * * @return */ - Map getFeatureColours(); + Map getFeatureColours(); /** * query the alignment view to find all features @@ -100,7 +100,7 @@ public interface FeatureRenderer * * @return */ - Map getDisplayedFeatureCols(); + Map getDisplayedFeatureCols(); /** * get all registered groups diff --git a/src/jalview/api/FeatureSettingsControllerI.java b/src/jalview/api/FeatureSettingsControllerI.java index 2bcd667..3f1b863 100644 --- a/src/jalview/api/FeatureSettingsControllerI.java +++ b/src/jalview/api/FeatureSettingsControllerI.java @@ -4,5 +4,5 @@ public interface FeatureSettingsControllerI { void discoverAllFeatureData(); - + } diff --git a/src/jalview/api/ViewStyleI.java b/src/jalview/api/ViewStyleI.java index 933c270..85fa2df 100644 --- a/src/jalview/api/ViewStyleI.java +++ b/src/jalview/api/ViewStyleI.java @@ -157,7 +157,7 @@ public interface ViewStyleI void setUpperCasebold(boolean upperCasebold); boolean isUpperCasebold(); - + boolean sameStyle(ViewStyleI them); void setFontName(String name); diff --git a/src/jalview/api/analysis/ViewBasedAnalysisI.java b/src/jalview/api/analysis/ViewBasedAnalysisI.java index 3404afc..55deaae 100644 --- a/src/jalview/api/analysis/ViewBasedAnalysisI.java +++ b/src/jalview/api/analysis/ViewBasedAnalysisI.java @@ -1,6 +1,5 @@ package jalview.api.analysis; -import jalview.api.AlignViewportI; import jalview.api.AlignmentViewPanel; public interface ViewBasedAnalysisI @@ -8,6 +7,7 @@ public interface ViewBasedAnalysisI /** * Parameterise the analysis model using the current view + * * @param view * @return true if model is applicable and calculation should proceed */ diff --git a/src/jalview/api/structures/JalviewStructureDisplayI.java b/src/jalview/api/structures/JalviewStructureDisplayI.java index edbbbbf..fd66388 100644 --- a/src/jalview/api/structures/JalviewStructureDisplayI.java +++ b/src/jalview/api/structures/JalviewStructureDisplayI.java @@ -54,8 +54,10 @@ public interface JalviewStructureDisplayI * if true, force close any linked external viewer process */ void closeViewer(boolean closeExternalViewer); + /** * apply a colourscheme to the structures in the viewer + * * @param colourScheme */ void setJalviewColourScheme(ColourSchemeI colourScheme); diff --git a/src/jalview/appletgui/APopupMenu.java b/src/jalview/appletgui/APopupMenu.java index 30f2e7f..1d2feb2 100644 --- a/src/jalview/appletgui/APopupMenu.java +++ b/src/jalview/appletgui/APopupMenu.java @@ -181,7 +181,7 @@ public class APopupMenu extends java.awt.PopupMenu implements MessageManager.getString("label.sequence_details")); MenuItem makeReferenceSeq = new MenuItem(); - + SequenceI seq; MenuItem revealAll = new MenuItem(); @@ -231,8 +231,7 @@ public class APopupMenu extends java.awt.PopupMenu implements if (sg != null && sg.getSize() > 0) { editGroupName.setLabel(MessageManager.formatMessage( - "label.name_param", new Object[] - { sg.getName() })); + "label.name_param", new Object[] { sg.getName() })); showText.setState(sg.getDisplayText()); showColourText.setState(sg.getColourText()); showBoxes.setState(sg.getDisplayBoxes()); @@ -275,8 +274,7 @@ public class APopupMenu extends java.awt.PopupMenu implements // collect matching db-refs DBRefEntry[] dbr = jalview.util.DBRefUtils.selectRefs( - seq.getDBRef(), new String[] - { target }); + seq.getDBRef(), new String[] { target }); // collect id string too String id = seq.getName(); String descr = seq.getDescription(); @@ -390,8 +388,7 @@ public class APopupMenu extends java.awt.PopupMenu implements .getString("action.set_as_reference")); // ); } repGroup.setLabel(MessageManager.formatMessage( - "label.represent_group_with", new Object[] - { seq.getName() })); + "label.represent_group_with", new Object[] { seq.getName() })); } else { @@ -720,7 +717,8 @@ public class APopupMenu extends java.awt.PopupMenu implements if (dialog.accept) { - EditCommand editCommand = new EditCommand(MessageManager.getString("label.edit_sequences"), + EditCommand editCommand = new EditCommand( + MessageManager.getString("label.edit_sequences"), Action.REPLACE, dialog.getName().replace(' ', ap.av.getGapCharacter()), sg.getSequencesAsArray(ap.av.getHiddenRepSequences()), @@ -807,7 +805,8 @@ public class APopupMenu extends java.awt.PopupMenu implements features, true, ap)) { ap.alignFrame.sequenceFeatures.setState(true); - ap.av.setShowSequenceFeatures(true);; + ap.av.setShowSequenceFeatures(true); + ; ap.highlightSearchResults(null); } } @@ -825,8 +824,8 @@ public class APopupMenu extends java.awt.PopupMenu implements Frame frame = new Frame(); frame.add(cap); jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage( - "label.selection_output_command", new Object[] - { e.getActionCommand() }), 600, 500); + "label.selection_output_command", + new Object[] { e.getActionCommand() }), 600, 500); // JBPNote: getSelectionAsNewSequence behaviour has changed - this method // now returns a full copy of sequence data // TODO consider using getSequenceSelection instead here @@ -843,8 +842,7 @@ public class APopupMenu extends java.awt.PopupMenu implements protected void showSequenceDetails() { - createSequenceDetailsReport(new SequenceI[] - { seq }); + createSequenceDetailsReport(new SequenceI[] { seq }); } public void createSequenceDetailsReport(SequenceI[] sequences) @@ -856,17 +854,16 @@ public class APopupMenu extends java.awt.PopupMenu implements for (SequenceI seq : sequences) { contents.append(MessageManager.formatMessage( - "label.annotation_for_displayid", new Object[] - { seq.getDisplayId(true) })); - new SequenceAnnotationReport(null) - .createSequenceAnnotationReport( - contents, - seq, - true, - true, - false, - (ap.seqPanel.seqCanvas.fr != null) ? ap.seqPanel.seqCanvas.fr.getMinMax() - : null); + "label.annotation_for_displayid", + new Object[] { seq.getDisplayId(true) })); + new SequenceAnnotationReport(null).createSequenceAnnotationReport( + contents, + seq, + true, + true, + false, + (ap.seqPanel.seqCanvas.fr != null) ? ap.seqPanel.seqCanvas.fr + .getMinMax() : null); contents.append("

"); } Frame frame = new Frame(); @@ -875,8 +872,7 @@ public class APopupMenu extends java.awt.PopupMenu implements + (sequences.length == 1 ? sequences[0].getDisplayId(true) : "Selection"), 600, 500); cap.setText(MessageManager.formatMessage("label.html_content", - new Object[] - { contents.toString() })); + new Object[] { contents.toString() })); } void editName() @@ -902,13 +898,13 @@ public class APopupMenu extends java.awt.PopupMenu implements if (ap.av.applet.jmolAvailable) { - new jalview.appletgui.AppletJmol(entry, new SequenceI[] - { seq }, null, ap, AppletFormatAdapter.URL); + new jalview.appletgui.AppletJmol(entry, new SequenceI[] { seq }, + null, ap, AppletFormatAdapter.URL); } else { - new MCview.AppletPDBViewer(entry, new SequenceI[] - { seq }, null, ap, AppletFormatAdapter.URL); + new MCview.AppletPDBViewer(entry, new SequenceI[] { seq }, null, + ap, AppletFormatAdapter.URL); } } @@ -920,8 +916,8 @@ public class APopupMenu extends java.awt.PopupMenu implements Frame frame = new Frame(); frame.add(cap); jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage( - "label.paste_pdb_file_for_sequence", new Object[] - { seq.getName() }), 400, 300); + "label.paste_pdb_file_for_sequence", + new Object[] { seq.getName() }), 400, 300); } } @@ -964,8 +960,7 @@ public class APopupMenu extends java.awt.PopupMenu implements pdb.setLabel(MessageManager.getString("label.view_pdb_structure")); hideSeqs.setLabel(MessageManager.getString("action.hide_sequences")); repGroup.setLabel(MessageManager.formatMessage( - "label.represent_group_with", new Object[] - { "" })); + "label.represent_group_with", new Object[] { "" })); revealAll.setLabel(MessageManager.getString("action.reveal_all")); revealSeq.setLabel(MessageManager.getString("action.reveal_sequences")); menu1.setLabel(MessageManager.getString("label.group") + ":"); @@ -1005,32 +1000,39 @@ public class APopupMenu extends java.awt.PopupMenu implements noColourmenuItem.setLabel(MessageManager.getString("label.none")); noColourmenuItem.addActionListener(this); - clustalColour.setLabel(MessageManager.getString("label.clustalx_colours")); + clustalColour.setLabel(MessageManager + .getString("label.clustalx_colours")); clustalColour.addActionListener(this); zappoColour.setLabel(MessageManager.getString("label.zappo")); zappoColour.addActionListener(this); taylorColour.setLabel(MessageManager.getString("label.taylor")); taylorColour.addActionListener(this); - hydrophobicityColour.setLabel(MessageManager.getString("label.hydrophobicity")); + hydrophobicityColour.setLabel(MessageManager + .getString("label.hydrophobicity")); hydrophobicityColour.addActionListener(this); - helixColour.setLabel(MessageManager.getString("label.helix_propensity")); + helixColour + .setLabel(MessageManager.getString("label.helix_propensity")); helixColour.addActionListener(this); - strandColour.setLabel(MessageManager.getString("label.strand_propensity")); + strandColour.setLabel(MessageManager + .getString("label.strand_propensity")); strandColour.addActionListener(this); turnColour.setLabel(MessageManager.getString("label.turn_propensity")); turnColour.addActionListener(this); buriedColour.setLabel(MessageManager.getString("label.buried_index")); buriedColour.addActionListener(this); - abovePIDColour.setLabel(MessageManager.getString("label.above_identity_percentage")); + abovePIDColour.setLabel(MessageManager + .getString("label.above_identity_percentage")); - userDefinedColour.setLabel(MessageManager.getString("action.user_defined")); + userDefinedColour.setLabel(MessageManager + .getString("action.user_defined")); userDefinedColour.addActionListener(this); PIDColour.setLabel(MessageManager .getString("label.percentage_identity")); PIDColour.addActionListener(this); BLOSUM62Colour.setLabel("BLOSUM62"); BLOSUM62Colour.addActionListener(this); - conservationMenuItem.setLabel(MessageManager.getString("label.conservation")); + conservationMenuItem.setLabel(MessageManager + .getString("label.conservation")); editMenu.add(copy); copy.addActionListener(this); @@ -1259,6 +1261,7 @@ public class APopupMenu extends java.awt.PopupMenu implements getGroup().setDisplayText(showText.getState()); refresh(); } + public void makeReferenceSeq_actionPerformed() { if (!ap.av.getAlignment().hasSeqrep()) @@ -1299,8 +1302,7 @@ public class APopupMenu extends java.awt.PopupMenu implements SequenceGroup sg = ap.av.getSelectionGroup(); if (sg == null || sg.getSize() < 1) { - ap.av.hideSequence(new SequenceI[] - { seq }); + ap.av.hideSequence(new SequenceI[] { seq }); return; } @@ -1348,17 +1350,17 @@ public class APopupMenu extends java.awt.PopupMenu implements { showMenu.removeAll(); hideMenu.removeAll(); - + final List all = Arrays.asList(ALL_ANNOTATIONS); addAnnotationTypeToShowHide(showMenu, forSequences, "", all, true, true); addAnnotationTypeToShowHide(hideMenu, forSequences, "", all, true, false); showMenu.addSeparator(); hideMenu.addSeparator(); - + final AlignmentAnnotation[] annotations = ap.getAlignment() .getAlignmentAnnotation(); - + /* * Find shown/hidden annotations types, distinguished by source (calcId), * and grouped by graphGroup. Using LinkedHashMap means we will retrieve in @@ -1367,28 +1369,26 @@ public class APopupMenu extends java.awt.PopupMenu implements */ Map>> shownTypes = new LinkedHashMap>>(); Map>> hiddenTypes = new LinkedHashMap>>(); - AlignmentAnnotationUtils.getShownHiddenTypes(shownTypes, - hiddenTypes, - AlignmentAnnotationUtils.asList(annotations), - forSequences); - + AlignmentAnnotationUtils.getShownHiddenTypes(shownTypes, hiddenTypes, + AlignmentAnnotationUtils.asList(annotations), forSequences); + for (String calcId : hiddenTypes.keySet()) { for (List type : hiddenTypes.get(calcId)) { - addAnnotationTypeToShowHide(showMenu, forSequences, - calcId, type, false, true); + addAnnotationTypeToShowHide(showMenu, forSequences, calcId, type, + false, true); } } // grey out 'show annotations' if none are hidden showMenu.setEnabled(!hiddenTypes.isEmpty()); - + for (String calcId : shownTypes.keySet()) { for (List type : shownTypes.get(calcId)) { - addAnnotationTypeToShowHide(hideMenu, forSequences, - calcId, type, false, false); + addAnnotationTypeToShowHide(hideMenu, forSequences, calcId, type, + false, false); } } // grey out 'hide annotations' if none are shown @@ -1425,8 +1425,8 @@ public class APopupMenu extends java.awt.PopupMenu implements @Override public void actionPerformed(ActionEvent e) { - AlignmentUtils.showOrHideSequenceAnnotations(ap.getAlignment(), types, - forSequences, allTypes, actionIsShow); + AlignmentUtils.showOrHideSequenceAnnotations(ap.getAlignment(), + types, forSequences, allTypes, actionIsShow); refresh(); } }); diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index b490eb6..3996dee 100644 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -139,8 +139,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, * @param title * @param embedded */ - public AlignFrame(AlignmentI al, JalviewLite applet, - String title, boolean embedded) + public AlignFrame(AlignmentI al, JalviewLite applet, String title, + boolean embedded) { this(al, applet, title, embedded, true); } @@ -155,8 +155,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, * @param embedded * @param addToDisplay */ - public AlignFrame(AlignmentI al, JalviewLite applet, - String title, boolean embedded, boolean addToDisplay) + public AlignFrame(AlignmentI al, JalviewLite applet, String title, + boolean embedded, boolean addToDisplay) { this(al, null, null, applet, title, embedded, addToDisplay); } @@ -365,11 +365,11 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, boolean featuresFile = false; try { - featuresFile = new jalview.io.FeaturesFile(file, type) - .parse(viewport.getAlignment(), alignPanel.seqPanel.seqCanvas - .getFeatureRenderer().getFeatureColours(), featureLinks, - true, viewport.applet.getDefaultParameter( - "relaxedidmatch", false)); + featuresFile = new jalview.io.FeaturesFile(file, type).parse(viewport + .getAlignment(), alignPanel.seqPanel.seqCanvas + .getFeatureRenderer().getFeatureColours(), featureLinks, + true, viewport.applet.getDefaultParameter("relaxedidmatch", + false)); } catch (Exception ex) { ex.printStackTrace(); @@ -552,8 +552,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, case KeyEvent.VK_F2: viewport.cursorMode = !viewport.cursorMode; statusBar.setText(MessageManager.formatMessage( - "label.keyboard_editing_mode", new String[] - { (viewport.cursorMode ? "on" : "off") })); + "label.keyboard_editing_mode", + new String[] { (viewport.cursorMode ? "on" : "off") })); if (viewport.cursorMode) { alignPanel.seqPanel.seqCanvas.cursorX = viewport.startRes; @@ -926,7 +926,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, { boolean visible = (aa.sequenceRef == null ? showForAlignment : showForSequences); - aa.visible = visible; + aa.visible = visible; } alignPanel.validateAnnotationDimensions(true); validate(); @@ -1179,8 +1179,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, Frame frame = new Frame(); frame.add(cap); jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage( - "label.alignment_properties", new String[] - { getTitle() }), 400, 250); + "label.alignment_properties", new String[] { getTitle() }), + 400, 250); } else if (source == overviewMenuItem) { @@ -1341,8 +1341,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, Frame frame = new Frame(); frame.add(cap); jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage( - "label.alignment_output_command", new Object[] - { e.getActionCommand() }), 600, 500); + "label.alignment_output_command", + new Object[] { e.getActionCommand() }), 600, 500); FeatureRenderer fr = this.alignPanel.cloneFeatureRenderer(); cap.setText(new AppletFormatAdapter(alignPanel).formatSequences( @@ -1381,13 +1381,13 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, return annotation; } - private Map getDisplayedFeatureCols() + private Map getDisplayedFeatureCols() { if (alignPanel.getFeatureRenderer() != null - && viewport.getFeaturesDisplayed()!= null) + && viewport.getFeaturesDisplayed() != null) { return alignPanel.getFeatureRenderer().getDisplayedFeatureCols(); - + } return null; } @@ -1570,8 +1570,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, undoMenuItem.setEnabled(true); CommandI command = viewport.getHistoryList().peek(); undoMenuItem.setLabel(MessageManager.formatMessage( - "label.undo_command", new Object[] - { command.getDescription() })); + "label.undo_command", + new Object[] { command.getDescription() })); } else { @@ -1585,8 +1585,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, CommandI command = viewport.getRedoList().peek(); redoMenuItem.setLabel(MessageManager.formatMessage( - "label.redo_command", new Object[] - { command.getDescription() })); + "label.redo_command", + new Object[] { command.getDescription() })); } else { @@ -1881,8 +1881,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, int hiddenOffset = viewport.getSelectionGroup().getStartRes(); for (int[] region : viewport.getColumnSelection().getHiddenColumns()) { - copiedHiddenColumns.addElement(new int[] - { region[0] - hiddenOffset, region[1] - hiddenOffset }); + copiedHiddenColumns.addElement(new int[] { + region[0] - hiddenOffset, region[1] - hiddenOffset }); } } else @@ -1979,14 +1979,17 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, if (newAlignment) { - String newtitle = MessageManager.getString("label.copied_sequences"); - if (getTitle().startsWith(MessageManager.getString("label.copied_sequences"))) + String newtitle = MessageManager + .getString("label.copied_sequences"); + if (getTitle().startsWith( + MessageManager.getString("label.copied_sequences"))) { newtitle = getTitle(); } else { - newtitle = newtitle.concat(MessageManager.formatMessage("label.from_msname", new String[]{getTitle()})); + newtitle = newtitle.concat(MessageManager.formatMessage( + "label.from_msname", new String[] { getTitle() })); } AlignFrame af = new AlignFrame(new Alignment(newSeqs), viewport.applet, newtitle, false); @@ -2276,8 +2279,9 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, } statusBar.setText(MessageManager.formatMessage( - "label.removed_columns", new String[] - { Integer.valueOf(trimRegion.getSize()).toString() })); + "label.removed_columns", + new String[] { Integer.valueOf(trimRegion.getSize()) + .toString() })); addHistoryItem(trimRegion); for (SequenceGroup sg : viewport.getAlignment().getGroups()) @@ -2318,8 +2322,9 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, addHistoryItem(removeGapCols); statusBar.setText(MessageManager.formatMessage( - "label.removed_empty_columns", new String[] - { Integer.valueOf(removeGapCols.getSize()).toString() })); + "label.removed_empty_columns", + new String[] { Integer.valueOf(removeGapCols.getSize()) + .toString() })); // This is to maintain viewport position on first residue // of first sequence @@ -2501,7 +2506,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, if (alignPanel != null && (fr = alignPanel.getFeatureRenderer()) != null) { - + fr.setGroupVisibility(Arrays.asList(groups), state); alignPanel.seqPanel.seqCanvas.repaint(); if (alignPanel.overviewPanel != null) @@ -2552,8 +2557,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, frame.add(overview); // +50 must allow for applet frame window jalview.bin.JalviewLite.addFrame(frame, MessageManager.formatMessage( - "label.overview_params", new String[] - { this.getTitle() }), overview.getPreferredSize().width, + "label.overview_params", new String[] { this.getTitle() }), + overview.getPreferredSize().width, overview.getPreferredSize().height + 50); frame.pack(); @@ -2829,8 +2834,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, // addHistoryItem(new HistoryItem("Sort", viewport.alignment, // HistoryItem.SORT)); addHistoryItem(new OrderCommand(MessageManager.formatMessage( - "label.order_by_params", new String[] - { title }), oldOrder, viewport.getAlignment())); + "label.order_by_params", new String[] { title }), oldOrder, + viewport.getAlignment())); alignPanel.paintAlignment(true); } @@ -2927,12 +2932,12 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, // lite and application g.setFont(new Font("Helvetica", Font.BOLD, 14)); g.drawString(MessageManager.formatMessage( - "label.jalviewLite_release", new String[] - { version }), x, y += fh); + "label.jalviewLite_release", new String[] { version }), x, + y += fh); g.setFont(new Font("Helvetica", Font.BOLD, 12)); g.drawString(MessageManager.formatMessage( - "label.jaview_build_date", new String[] - { builddate }), x, y += fh); + "label.jaview_build_date", new String[] { builddate }), x, + y += fh); g.setFont(new Font("Helvetica", Font.PLAIN, 12)); g.drawString(MessageManager.getString("label.jalview_authors_1"), x, y += fh * 1.5); @@ -3798,8 +3803,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, add(statusBar, BorderLayout.SOUTH); add(alignPanel, BorderLayout.CENTER); // and register with the applet so it can pass external API calls to us - jalview.bin.JalviewLite.addFrame(this, this.getTitle(), - frameWidth, + jalview.bin.JalviewLite.addFrame(this, this.getTitle(), frameWidth, frameHeight); } } @@ -3915,8 +3919,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, // TODO: search for a jmv that involves viewer if (jmv == null) { // create a new viewer/jalview binding. - jmv = new ExtJmol(viewer, alignPanel, new SequenceI[][] - { seqs }); + jmv = new ExtJmol(viewer, alignPanel, new SequenceI[][] { seqs }); } return jmv; @@ -3999,8 +4002,8 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, { if (seqs[i] != null) { - sequences.addElement(new Object[] - { seqs[i], (chains != null) ? chains[i] : null }); + sequences.addElement(new Object[] { seqs[i], + (chains != null) ? chains[i] : null }); } } seqs = new SequenceI[sequences.size()]; @@ -4013,8 +4016,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, chains[i] = (String) oj[1]; } } - return new Object[] - { seqs, chains }; + return new Object[] { seqs, chains }; } @@ -4202,7 +4204,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, this.splitFrame = sf; } - // may not need this + // may not need this @Override public void setShowSeqFeatures(boolean b) { @@ -4217,6 +4219,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, // setMenusFromViewport(viewport); } + @Override public void refreshFeatureUI(boolean enableIfNecessary) { diff --git a/src/jalview/appletgui/AlignViewport.java b/src/jalview/appletgui/AlignViewport.java index e4e3e17..e434825 100644 --- a/src/jalview/appletgui/AlignViewport.java +++ b/src/jalview/appletgui/AlignViewport.java @@ -287,7 +287,6 @@ public class AlignViewport extends AlignmentViewport implements return font; } - public void resetSeqLimits(int height) { setEndSeq(height / getCharHeight()); @@ -303,7 +302,6 @@ public class AlignViewport extends AlignmentViewport implements return currentTree; } - boolean centreColumnLabels; public boolean getCentreColumnLabels() @@ -325,8 +323,8 @@ public class AlignViewport extends AlignmentViewport implements public void sendSelection() { getStructureSelectionManager().sendSelection( - new SequenceGroup(getSelectionGroup()), - new ColumnSelection(getColumnSelection()), this); + new SequenceGroup(getSelectionGroup()), + new ColumnSelection(getColumnSelection()), this); } /** @@ -467,5 +465,4 @@ public class AlignViewport extends AlignmentViewport implements } } - } diff --git a/src/jalview/appletgui/AlignmentPanel.java b/src/jalview/appletgui/AlignmentPanel.java index fd6652b..34e0cc0 100644 --- a/src/jalview/appletgui/AlignmentPanel.java +++ b/src/jalview/appletgui/AlignmentPanel.java @@ -162,15 +162,18 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, { return av; } + public SequenceRenderer getSequenceRenderer() { return seqPanel.seqCanvas.sr; } + @Override public jalview.api.FeatureRenderer getFeatureRenderer() { return seqPanel.seqCanvas.fr; } + @Override public jalview.api.FeatureRenderer cloneFeatureRenderer() { @@ -178,6 +181,7 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, nfr.transferSettings(seqPanel.seqCanvas.fr); return nfr; } + public void alignmentChanged() { av.alignmentChanged(this); @@ -449,37 +453,37 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, // setScrollValues(start, seqIndex); // } // logic copied from jalview.gui.AlignmentPanel: - if ((startv = av.getStartRes()) >= start) - { - /* - * Scroll left to make start of search results visible - */ - setScrollValues(start - 1, seqIndex); - } - else if ((endv = av.getEndRes()) <= end) - { - /* - * Scroll right to make end of search results visible - */ - setScrollValues(startv + 1 + end - endv, seqIndex); - } - else if ((starts = av.getStartSeq()) > seqIndex) - { - /* - * Scroll up to make start of search results visible - */ - setScrollValues(av.getStartRes(), seqIndex); - } - else if ((ends = av.getEndSeq()) <= seqIndex) - { - /* - * Scroll down to make end of search results visible - */ - setScrollValues(av.getStartRes(), starts + seqIndex - ends + 1); - } + if ((startv = av.getStartRes()) >= start) + { + /* + * Scroll left to make start of search results visible + */ + setScrollValues(start - 1, seqIndex); + } + else if ((endv = av.getEndRes()) <= end) + { + /* + * Scroll right to make end of search results visible + */ + setScrollValues(startv + 1 + end - endv, seqIndex); + } + else if ((starts = av.getStartSeq()) > seqIndex) + { /* - * Else results are already visible - no need to scroll + * Scroll up to make start of search results visible */ + setScrollValues(av.getStartRes(), seqIndex); + } + else if ((ends = av.getEndSeq()) <= seqIndex) + { + /* + * Scroll down to make end of search results visible + */ + setScrollValues(av.getStartRes(), starts + seqIndex - ends + 1); + } + /* + * Else results are already visible - no need to scroll + */ } else { diff --git a/src/jalview/appletgui/AnnotationColumnChooser.java b/src/jalview/appletgui/AnnotationColumnChooser.java index 6ad8648..c07dfb4 100644 --- a/src/jalview/appletgui/AnnotationColumnChooser.java +++ b/src/jalview/appletgui/AnnotationColumnChooser.java @@ -569,8 +569,7 @@ public class AnnotationColumnChooser extends AnnotationRowFilter implements updateView(); } - public class FurtherActionPanel extends Panel implements - ItemListener + public class FurtherActionPanel extends Panel implements ItemListener { private AnnotationColumnChooser aColChooser; diff --git a/src/jalview/appletgui/AnnotationLabels.java b/src/jalview/appletgui/AnnotationLabels.java index 67faf11..5727e9c 100755 --- a/src/jalview/appletgui/AnnotationLabels.java +++ b/src/jalview/appletgui/AnnotationLabels.java @@ -20,6 +20,14 @@ */ package jalview.appletgui; +import jalview.analysis.AlignmentUtils; +import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.Annotation; +import jalview.datamodel.SequenceGroup; +import jalview.datamodel.SequenceI; +import jalview.util.MessageManager; +import jalview.util.ParseHtmlBodyAndLinks; + import java.awt.Checkbox; import java.awt.CheckboxMenuItem; import java.awt.Color; @@ -44,14 +52,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.Vector; -import jalview.analysis.AlignmentUtils; -import jalview.datamodel.AlignmentAnnotation; -import jalview.datamodel.Annotation; -import jalview.datamodel.SequenceGroup; -import jalview.datamodel.SequenceI; -import jalview.util.MessageManager; -import jalview.util.ParseHtmlBodyAndLinks; - public class AnnotationLabels extends Panel implements ActionListener, MouseListener, MouseMotionListener { @@ -540,7 +540,8 @@ public class AnnotationLabels extends Panel implements ActionListener, if (aaa.groupRef != null) { final CheckboxMenuItem chist = new CheckboxMenuItem( - MessageManager.getString("label.show_group_histogram"), + MessageManager + .getString("label.show_group_histogram"), aa[selectedRow].groupRef.isShowConsensusHistogram()); chist.addItemListener(new ItemListener() { @@ -579,7 +580,8 @@ public class AnnotationLabels extends Panel implements ActionListener, popup.add(cprofl); final CheckboxMenuItem cprofn = new CheckboxMenuItem( - MessageManager.getString("label.normalise_group_logo"), + MessageManager + .getString("label.normalise_group_logo"), aa[selectedRow].groupRef.isNormaliseSequenceLogo()); cprofn.addItemListener(new ItemListener() { @@ -602,7 +604,8 @@ public class AnnotationLabels extends Panel implements ActionListener, else { final CheckboxMenuItem chist = new CheckboxMenuItem( - MessageManager.getString("label.show_histogram"), av.isShowConsensusHistogram()); + MessageManager.getString("label.show_histogram"), + av.isShowConsensusHistogram()); chist.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) @@ -624,7 +627,8 @@ public class AnnotationLabels extends Panel implements ActionListener, }); popup.add(chist); final CheckboxMenuItem cprof = new CheckboxMenuItem( - MessageManager.getString("label.show_logo"), av.isShowSequenceLogo()); + MessageManager.getString("label.show_logo"), + av.isShowSequenceLogo()); cprof.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) @@ -647,7 +651,8 @@ public class AnnotationLabels extends Panel implements ActionListener, }); popup.add(cprof); final CheckboxMenuItem cprofn = new CheckboxMenuItem( - MessageManager.getString("label.normalise_logo"), av.isNormaliseSequenceLogo()); + MessageManager.getString("label.normalise_logo"), + av.isNormaliseSequenceLogo()); cprofn.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) @@ -710,36 +715,44 @@ public class AnnotationLabels extends Panel implements ActionListener, { if (evt.getClickCount() == 1) { - ap.seqPanel.ap.idPanel.highlightSearchResults(Arrays - .asList(new SequenceI[] - { aa[selectedRow].sequenceRef })); + ap.seqPanel.ap.idPanel + .highlightSearchResults(Arrays + .asList(new SequenceI[] { aa[selectedRow].sequenceRef })); } else if (evt.getClickCount() >= 2) { ap.seqPanel.ap.idPanel.highlightSearchResults(null); SequenceGroup sg = ap.av.getSelectionGroup(); - if (sg!=null) + if (sg != null) { - // we make a copy rather than edit the current selection if no modifiers pressed + // we make a copy rather than edit the current selection if no + // modifiers pressed // see Enhancement JAL-1557 if (!(evt.isControlDown() || evt.isShiftDown())) { sg = new SequenceGroup(sg); sg.clear(); sg.addSequence(aa[selectedRow].sequenceRef, false); - } else { + } + else + { if (evt.isControlDown()) { sg.addOrRemove(aa[selectedRow].sequenceRef, true); - } else { - // notionally, we should also add intermediate sequences from last added sequence ? + } + else + { + // notionally, we should also add intermediate sequences from + // last added sequence ? sg.addSequence(aa[selectedRow].sequenceRef, true); } } - } else { + } + else + { sg = new SequenceGroup(); sg.setStartRes(0); - sg.setEndRes(ap.av.getAlignment().getWidth()-1); + sg.setEndRes(ap.av.getAlignment().getWidth() - 1); sg.addSequence(aa[selectedRow].sequenceRef, false); } ap.av.setSelectionGroup(sg); @@ -776,8 +789,7 @@ public class AnnotationLabels extends Panel implements ActionListener, for (int[] region : av.getColumnSelection().getHiddenColumns()) { jalview.appletgui.AlignFrame.copiedHiddenColumns - .addElement(new int[] - { region[0], region[1] }); + .addElement(new int[] { region[0], region[1] }); } } } diff --git a/src/jalview/appletgui/AnnotationRowFilter.java b/src/jalview/appletgui/AnnotationRowFilter.java index 8a0a44a..b78f273 100644 --- a/src/jalview/appletgui/AnnotationRowFilter.java +++ b/src/jalview/appletgui/AnnotationRowFilter.java @@ -13,8 +13,6 @@ import java.awt.TextField; import java.awt.event.ActionEvent; import java.util.Vector; - - @SuppressWarnings("serial") public abstract class AnnotationRowFilter extends Panel { @@ -56,7 +54,6 @@ public abstract class AnnotationRowFilter extends Panel */ protected boolean sliderDragging = false; - public AnnotationRowFilter(AlignViewport av, final AlignmentPanel ap) { this.av = av; @@ -68,7 +65,6 @@ public abstract class AnnotationRowFilter extends Panel } - public Vector getAnnotationItems(boolean isSeqAssociated) { Vector list = new Vector(); @@ -167,7 +163,6 @@ public abstract class AnnotationRowFilter extends Panel } } - protected void populateThresholdComboBox(Choice threshold) { threshold.addItem(MessageManager @@ -178,7 +173,6 @@ public abstract class AnnotationRowFilter extends Panel .getString("label.threshold_feature_below_thereshold")); } - public jalview.datamodel.AlignmentAnnotation getCurrentAnnotation() { return currentAnnotation; diff --git a/src/jalview/appletgui/AppletJmol.java b/src/jalview/appletgui/AppletJmol.java index 0379615..b9acac0 100644 --- a/src/jalview/appletgui/AppletJmol.java +++ b/src/jalview/appletgui/AppletJmol.java @@ -179,10 +179,8 @@ public class AppletJmol extends EmbmenuFrame implements { this.ap = ap; jmb = new AppletJmolBinding(this, ap.getStructureSelectionManager(), - new PDBEntry[] - { pdbentry }, new SequenceI[][] - { seq }, new String[][] - { chains }, protocol); + new PDBEntry[] { pdbentry }, new SequenceI[][] { seq }, + new String[][] { chains }, protocol); jmb.setColourBySequence(true); if (pdbentry.getId() == null || pdbentry.getId().length() < 1) { @@ -347,7 +345,9 @@ public class AppletJmol extends EmbmenuFrame implements } if (freader == null) { - throw new Exception(MessageManager.getString("exception.invalid_datasource_couldnt_obtain_reader")); + throw new Exception( + MessageManager + .getString("exception.invalid_datasource_couldnt_obtain_reader")); } jmb.viewer.openReader(pdbentry.getFile(), pdbentry.getId(), freader); diff --git a/src/jalview/appletgui/CutAndPasteTransfer.java b/src/jalview/appletgui/CutAndPasteTransfer.java index 535dc62..5617c64 100644 --- a/src/jalview/appletgui/CutAndPasteTransfer.java +++ b/src/jalview/appletgui/CutAndPasteTransfer.java @@ -204,8 +204,8 @@ public class CutAndPasteTransfer extends Panel implements ActionListener, // TODO: JAL-1102 - should have a warning message in dialog, not simply // overwrite the broken input data with the exception textarea.setText(MessageManager.formatMessage( - "label.could_not_parse_newick_file", new Object[] - { ex.getMessage() })); + "label.could_not_parse_newick_file", + new Object[] { ex.getMessage() })); return false; } return false; @@ -295,7 +295,8 @@ public class CutAndPasteTransfer extends Panel implements ActionListener, */ protected boolean openSplitFrame(AlignmentI al, String format) { - final AlignmentI thisAlignment = this.alignFrame.getAlignViewport().getAlignment(); + final AlignmentI thisAlignment = this.alignFrame.getAlignViewport() + .getAlignment(); if (thisAlignment.isNucleotide() == al.isNucleotide()) { // both nucleotide or both protein @@ -324,7 +325,7 @@ public class CutAndPasteTransfer extends Panel implements ActionListener, dialog.setMainPanel(question); dialog.setVisible(true); dialog.toFront(); - + if (!dialog.accept) { return false; @@ -341,8 +342,7 @@ public class CutAndPasteTransfer extends Panel implements ActionListener, AlignFrame newFrame = new AlignFrame(al, alignFrame.viewport.applet, "Cut & Paste input - " + format, false, false); AlignFrame dnaFrame = al.isNucleotide() ? newFrame : copyFrame; - AlignFrame proteinFrame = al.isNucleotide() ? copyFrame - : newFrame; + AlignFrame proteinFrame = al.isNucleotide() ? copyFrame : newFrame; SplitFrame sf = new SplitFrame(dnaFrame, proteinFrame); sf.addToDisplay(false, applet); return true; @@ -361,8 +361,7 @@ public class CutAndPasteTransfer extends Panel implements ActionListener, jalview.io.AppletFormatAdapter.PASTE); if (tcf.isValid()) { - if (tcf.annotateAlignment(alignFrame.viewport.getAlignment(), - true)) + if (tcf.annotateAlignment(alignFrame.viewport.getAlignment(), true)) { alignFrame.tcoffeeColour.setEnabled(true); alignFrame.alignPanel.fontChanged(); @@ -377,8 +376,7 @@ public class CutAndPasteTransfer extends Panel implements ActionListener, // file valid but didn't get added to alignment for some reason alignFrame.statusBar.setText(MessageManager.formatMessage( "label.failed_add_tcoffee_scores", - new Object[] - { (tcf.getWarningMessage() != null ? tcf + new Object[] { (tcf.getWarningMessage() != null ? tcf .getWarningMessage() : "") })); } } @@ -393,8 +391,7 @@ public class CutAndPasteTransfer extends Panel implements ActionListener, if (tcf == null) { if (new AnnotationFile().annotateAlignmentView(alignFrame.viewport, - textarea.getText(), - jalview.io.AppletFormatAdapter.PASTE)) + textarea.getText(), jalview.io.AppletFormatAdapter.PASTE)) { alignFrame.alignPanel.fontChanged(); alignFrame.alignPanel.setScrollValues(0, 0); @@ -429,13 +426,13 @@ public class CutAndPasteTransfer extends Panel implements ActionListener, if (alignFrame.alignPanel.av.applet.jmolAvailable) { - new jalview.appletgui.AppletJmol(pdb, new SequenceI[] - { seq }, null, alignFrame.alignPanel, AppletFormatAdapter.PASTE); + new jalview.appletgui.AppletJmol(pdb, new SequenceI[] { seq }, null, + alignFrame.alignPanel, AppletFormatAdapter.PASTE); } else { - new MCview.AppletPDBViewer(pdb, new SequenceI[] - { seq }, null, alignFrame.alignPanel, AppletFormatAdapter.PASTE); + new MCview.AppletPDBViewer(pdb, new SequenceI[] { seq }, null, + alignFrame.alignPanel, AppletFormatAdapter.PASTE); } } diff --git a/src/jalview/appletgui/EditNameDialog.java b/src/jalview/appletgui/EditNameDialog.java index 24a7023..2f6469b 100644 --- a/src/jalview/appletgui/EditNameDialog.java +++ b/src/jalview/appletgui/EditNameDialog.java @@ -20,7 +20,12 @@ */ package jalview.appletgui; -import java.awt.*; +import java.awt.BorderLayout; +import java.awt.Font; +import java.awt.Frame; +import java.awt.Label; +import java.awt.Panel; +import java.awt.TextField; public class EditNameDialog extends JVDialog { diff --git a/src/jalview/appletgui/EmbmenuFrame.java b/src/jalview/appletgui/EmbmenuFrame.java index be4eab6..f61077a 100644 --- a/src/jalview/appletgui/EmbmenuFrame.java +++ b/src/jalview/appletgui/EmbmenuFrame.java @@ -51,8 +51,8 @@ import java.util.Map; */ public class EmbmenuFrame extends Frame implements MouseListener { - protected static final Font FONT_ARIAL_PLAIN_11 = new Font( - "Arial", Font.PLAIN, 11); + protected static final Font FONT_ARIAL_PLAIN_11 = new Font("Arial", + Font.PLAIN, 11); public static final Font DEFAULT_MENU_FONT = FONT_ARIAL_PLAIN_11; @@ -156,8 +156,7 @@ public class EmbmenuFrame extends Frame implements MouseListener * @return the panel instance for convenience. */ protected Panel makeEmbeddedPopupMenu(MenuBar menuBar, Font font, - boolean overrideFonts, - Panel embeddedMenu, + boolean overrideFonts, Panel embeddedMenu, MouseListener clickHandler) { if (overrideFonts) diff --git a/src/jalview/appletgui/FeatureColourChooser.java b/src/jalview/appletgui/FeatureColourChooser.java index b4367bf..46a67c4 100644 --- a/src/jalview/appletgui/FeatureColourChooser.java +++ b/src/jalview/appletgui/FeatureColourChooser.java @@ -20,15 +20,33 @@ */ package jalview.appletgui; -import java.util.*; - -import java.awt.*; -import java.awt.event.*; - -import jalview.datamodel.*; -import jalview.schemes.*; +import jalview.datamodel.GraphLine; +import jalview.schemes.AnnotationColourGradient; +import jalview.schemes.GraduatedColor; import jalview.util.MessageManager; +import java.awt.Checkbox; +import java.awt.Choice; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.Frame; +import java.awt.GridLayout; +import java.awt.Label; +import java.awt.Panel; +import java.awt.Scrollbar; +import java.awt.TextField; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.AdjustmentEvent; +import java.awt.event.AdjustmentListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.Hashtable; + public class FeatureColourChooser extends Panel implements ActionListener, AdjustmentListener, ItemListener, MouseListener { @@ -117,8 +135,8 @@ public class FeatureColourChooser extends Panel implements ActionListener, slider.addMouseListener(this); owner = (af != null) ? af : fs.frame; frame = new JVDialog(owner, MessageManager.formatMessage( - "label.graduated_color_for_params", new String[] - { type }), true, 480, 248); + "label.graduated_color_for_params", new String[] { type }), + true, 480, 248); frame.setMainPanel(this); validate(); frame.setVisible(true); diff --git a/src/jalview/appletgui/FeatureRenderer.java b/src/jalview/appletgui/FeatureRenderer.java index 4536b1a..4655ba5 100644 --- a/src/jalview/appletgui/FeatureRenderer.java +++ b/src/jalview/appletgui/FeatureRenderer.java @@ -20,6 +20,14 @@ */ package jalview.appletgui; +import jalview.datamodel.SearchResults; +import jalview.datamodel.SequenceFeature; +import jalview.datamodel.SequenceI; +import jalview.schemes.AnnotationColourGradient; +import jalview.schemes.GraduatedColor; +import jalview.util.MessageManager; +import jalview.viewmodel.AlignmentViewport; + import java.awt.BorderLayout; import java.awt.Button; import java.awt.Choice; @@ -37,14 +45,6 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Hashtable; -import jalview.datamodel.SearchResults; -import jalview.datamodel.SequenceFeature; -import jalview.datamodel.SequenceI; -import jalview.schemes.AnnotationColourGradient; -import jalview.schemes.GraduatedColor; -import jalview.util.MessageManager; -import jalview.viewmodel.AlignmentViewport; - /** * DOCUMENT ME! * @@ -326,8 +326,7 @@ public class FeatureRenderer extends String title = newFeatures ? MessageManager .getString("label.create_new_sequence_features") : MessageManager.formatMessage("label.amend_delete_features", - new String[] - { sequences[0].getName() }); + new String[] { sequences[0].getName() }); final JVDialog dialog = new JVDialog(ap.alignFrame, title, true, 385, 240); diff --git a/src/jalview/appletgui/FeatureSettings.java b/src/jalview/appletgui/FeatureSettings.java index f1e9835..1c156dc 100755 --- a/src/jalview/appletgui/FeatureSettings.java +++ b/src/jalview/appletgui/FeatureSettings.java @@ -119,7 +119,8 @@ public class FeatureSettings extends Panel implements ItemListener, this.setLayout(new BorderLayout()); scrollPane = new ScrollPane(); scrollPane.add(featurePanel); - if (fr.getAllFeatureColours()!=null && fr.getAllFeatureColours().size()>0) + if (fr.getAllFeatureColours() != null + && fr.getAllFeatureColours().size() > 0) { add(scrollPane, BorderLayout.CENTER); } @@ -150,10 +151,11 @@ public class FeatureSettings extends Panel implements ItemListener, if (groupPanel != null) { - groupPanel - .setLayout(new GridLayout( - (fr.getFeatureGroupsSize()) / 4 + 1, - 4)); // JBPNote - this was scaled on number of visible groups. seems broken + groupPanel.setLayout(new GridLayout( + (fr.getFeatureGroupsSize()) / 4 + 1, 4)); // JBPNote - this was + // scaled on number of + // visible groups. seems + // broken groupPanel.validate(); add(groupPanel, BorderLayout.NORTH); @@ -180,8 +182,7 @@ public class FeatureSettings extends Panel implements ItemListener, int width = 300; jalview.bin.JalviewLite.addFrame(frame, MessageManager.getString("label.sequence_feature_settings"), - width, - height); + width, height); } public void paint(Graphics g) @@ -203,8 +204,7 @@ public class FeatureSettings extends Panel implements ItemListener, final String type = check.type; final Object typeCol = fr.getFeatureStyle(type); java.awt.PopupMenu men = new PopupMenu(MessageManager.formatMessage( - "label.settings_for_type", new String[] - { type })); + "label.settings_for_type", new String[] { type })); java.awt.MenuItem scr = new MenuItem( MessageManager.getString("label.sort_by_score")); men.add(scr); @@ -214,8 +214,8 @@ public class FeatureSettings extends Panel implements ItemListener, public void actionPerformed(ActionEvent e) { - me.ap.alignFrame.avc.sortAlignmentByFeatureScore(new String[] - { type }); + me.ap.alignFrame.avc + .sortAlignmentByFeatureScore(new String[] { type }); } }); @@ -226,8 +226,8 @@ public class FeatureSettings extends Panel implements ItemListener, public void actionPerformed(ActionEvent e) { - me.ap.alignFrame.avc.sortAlignmentByFeatureDensity(new String[] - { type }); + me.ap.alignFrame.avc + .sortAlignmentByFeatureDensity(new String[] { type }); } }); @@ -283,7 +283,8 @@ public class FeatureSettings extends Panel implements ItemListener, @Override public void discoverAllFeatureData() { - if (fr.getAllFeatureColours()!=null && fr.getAllFeatureColours().size()>0) + if (fr.getAllFeatureColours() != null + && fr.getAllFeatureColours().size() > 0) { rebuildGroups(); @@ -308,7 +309,7 @@ public class FeatureSettings extends Panel implements ItemListener, } // TODO: JAL-964 - smoothly incorporate new group entries if panel already // displayed and new groups present - for (String group:fr.getFeatureGroups()) + for (String group : fr.getFeatureGroups()) { boolean vis = fr.checkGroupVisibility(group, false); Checkbox check = new MyCheckbox(group, vis, @@ -326,6 +327,7 @@ public class FeatureSettings extends Panel implements ItemListener, groupPanel.validate(); } } + // This routine adds and removes checkboxes depending on // Group selection states void resetTable(boolean groupsChanged) @@ -482,11 +484,12 @@ public class FeatureSettings extends Panel implements ItemListener, selectionChanged(); } - private ItemListener groupItemListener = new ItemListener() { - public void itemStateChanged(ItemEvent evt) { + private ItemListener groupItemListener = new ItemListener() + { + public void itemStateChanged(ItemEvent evt) + { Checkbox source = (Checkbox) evt.getSource(); - fr.setGroupVisibility(source.getLabel(), - source.getState()); + fr.setGroupVisibility(source.getLabel(), source.getState()); ap.seqPanel.seqCanvas.repaint(); if (ap.overviewPanel != null) { @@ -496,6 +499,7 @@ public class FeatureSettings extends Panel implements ItemListener, return; }; }; + public void itemStateChanged(ItemEvent evt) { selectionChanged(); @@ -615,7 +619,9 @@ public class FeatureSettings extends Panel implements ItemListener, } else { - throw new Error(MessageManager.getString("error.implementation_error_unsupported_feature_colour_object")); + throw new Error( + MessageManager + .getString("error.implementation_error_unsupported_feature_colour_object")); } refreshTable(); } @@ -711,7 +717,9 @@ public class FeatureSettings extends Panel implements ItemListener, } else { - throw new Error(MessageManager.getString("error.invalid_colour_for_mycheckbox")); + throw new Error( + MessageManager + .getString("error.invalid_colour_for_mycheckbox")); } if (col != null) { diff --git a/src/jalview/appletgui/Finder.java b/src/jalview/appletgui/Finder.java index 5412472..75d9b9e 100644 --- a/src/jalview/appletgui/Finder.java +++ b/src/jalview/appletgui/Finder.java @@ -204,16 +204,15 @@ public class Finder extends Panel implements ActionListener message += searchResults.getSize() + " subsequence matches."; } ap.alignFrame.statusBar.setText(MessageManager.formatMessage( - "label.search_results", new String[] - { searchString, message })); + "label.search_results", new String[] { searchString, + message })); } else { // TODO: indicate sequence and matching position in status bar ap.alignFrame.statusBar.setText(MessageManager.formatMessage( - "label.found_match_for", new String[] - { searchString })); + "label.found_match_for", new String[] { searchString })); } } } diff --git a/src/jalview/appletgui/FontChooser.java b/src/jalview/appletgui/FontChooser.java index 6456878..59f6957 100644 --- a/src/jalview/appletgui/FontChooser.java +++ b/src/jalview/appletgui/FontChooser.java @@ -20,6 +20,9 @@ */ package jalview.appletgui; +import jalview.api.ViewStyleI; +import jalview.util.MessageManager; + import java.awt.BorderLayout; import java.awt.Button; import java.awt.Checkbox; @@ -37,9 +40,6 @@ import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; -import jalview.api.ViewStyleI; -import jalview.util.MessageManager; - /** * This dialog allows the user to try different font settings and related * options. Changes are immediately visible on the alignment or tree. The user diff --git a/src/jalview/appletgui/IdCanvas.java b/src/jalview/appletgui/IdCanvas.java index 5204094..16bba0b 100755 --- a/src/jalview/appletgui/IdCanvas.java +++ b/src/jalview/appletgui/IdCanvas.java @@ -57,8 +57,7 @@ public class IdCanvas extends Panel } public void drawIdString(Graphics gg, boolean hiddenRows, SequenceI s, - int i, int starty, - int ypos) + int i, int starty, int ypos) { int charHeight = av.getCharHeight(); @@ -187,6 +186,7 @@ public class IdCanvas extends Panel * local copy of av.getCharHeight set at top of drawIds */ private int avcharHeight; + void drawIds(int starty, int endy) { // hardwired italic IDs in applet currently @@ -356,19 +356,17 @@ public class IdCanvas extends Panel gg.setColor(Color.blue); if (below) { - gg.fillPolygon(new int[] - { getSize().width - avcharHeight, getSize().width - avcharHeight, - getSize().width }, new int[] - { (i - starty) * avcharHeight + yoffset, + gg.fillPolygon(new int[] { getSize().width - avcharHeight, + getSize().width - avcharHeight, getSize().width }, new int[] { + (i - starty) * avcharHeight + yoffset, (i - starty) * avcharHeight + yoffset + avcharHeight / 4, (i - starty) * avcharHeight + yoffset }, 3); } if (above) { - gg.fillPolygon(new int[] - { getSize().width - avcharHeight, getSize().width - avcharHeight, - getSize().width }, new int[] - { (i - starty + 1) * avcharHeight + yoffset, + gg.fillPolygon(new int[] { getSize().width - avcharHeight, + getSize().width - avcharHeight, getSize().width }, new int[] { + (i - starty + 1) * avcharHeight + yoffset, (i - starty + 1) * avcharHeight + yoffset - avcharHeight / 4, (i - starty + 1) * avcharHeight + yoffset }, 3); diff --git a/src/jalview/appletgui/JVDialog.java b/src/jalview/appletgui/JVDialog.java index 19d7b4c..58c4feb 100644 --- a/src/jalview/appletgui/JVDialog.java +++ b/src/jalview/appletgui/JVDialog.java @@ -20,8 +20,14 @@ */ package jalview.appletgui; -import java.awt.*; -import java.awt.event.*; +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Dialog; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Panel; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; public class JVDialog extends Dialog implements ActionListener { diff --git a/src/jalview/appletgui/OverviewPanel.java b/src/jalview/appletgui/OverviewPanel.java index f09bda5..bc64728 100755 --- a/src/jalview/appletgui/OverviewPanel.java +++ b/src/jalview/appletgui/OverviewPanel.java @@ -357,8 +357,8 @@ public class OverviewPanel extends Panel implements Runnable, } if (hiddenRow - || (hasHiddenCols && !av.getColumnSelection() - .isVisible(lastcol))) + || (hasHiddenCols && !av.getColumnSelection().isVisible( + lastcol))) { color = color.darker().darker(); } diff --git a/src/jalview/appletgui/PCAPanel.java b/src/jalview/appletgui/PCAPanel.java index 10969b9..c5ec0c1 100644 --- a/src/jalview/appletgui/PCAPanel.java +++ b/src/jalview/appletgui/PCAPanel.java @@ -20,13 +20,31 @@ */ package jalview.appletgui; -import java.awt.*; -import java.awt.event.*; - -import jalview.datamodel.*; +import jalview.datamodel.Alignment; +import jalview.datamodel.AlignmentView; +import jalview.datamodel.ColumnSelection; +import jalview.datamodel.SeqCigar; +import jalview.datamodel.SequenceI; import jalview.util.MessageManager; import jalview.viewmodel.PCAModel; +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.CheckboxMenuItem; +import java.awt.Choice; +import java.awt.Color; +import java.awt.FlowLayout; +import java.awt.Frame; +import java.awt.Label; +import java.awt.Menu; +import java.awt.MenuBar; +import java.awt.MenuItem; +import java.awt.Panel; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.ItemEvent; +import java.awt.event.ItemListener; + public class PCAPanel extends EmbmenuFrame implements Runnable, ActionListener, ItemListener { diff --git a/src/jalview/appletgui/PaintRefresher.java b/src/jalview/appletgui/PaintRefresher.java index 7b54b1c..7c6fad0 100755 --- a/src/jalview/appletgui/PaintRefresher.java +++ b/src/jalview/appletgui/PaintRefresher.java @@ -20,12 +20,14 @@ */ package jalview.appletgui; -import java.util.*; -import java.util.List; - -import java.awt.*; +import jalview.datamodel.AlignmentI; +import jalview.datamodel.SequenceI; -import jalview.datamodel.*; +import java.awt.Component; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.List; +import java.util.Vector; /** * DOCUMENT ME! diff --git a/src/jalview/appletgui/RedundancyPanel.java b/src/jalview/appletgui/RedundancyPanel.java index c4a6989..4aea837 100644 --- a/src/jalview/appletgui/RedundancyPanel.java +++ b/src/jalview/appletgui/RedundancyPanel.java @@ -206,7 +206,8 @@ public class RedundancyPanel extends SliderPanel implements Runnable, } } - EditCommand cut = new EditCommand(MessageManager.getString("action.remove_redundancy"), + EditCommand cut = new EditCommand( + MessageManager.getString("action.remove_redundancy"), Action.CUT, deleted, 0, width, ap.av.getAlignment()); AlignmentI alignment = ap.av.getAlignment(); for (int i = 0; i < del.size(); i++) @@ -223,7 +224,8 @@ public class RedundancyPanel extends SliderPanel implements Runnable, ap.alignFrame.addHistoryItem(cut); PaintRefresher.Refresh(this, ap.av.getSequenceSetId(), true, true); - ap.av.firePropertyChange("alignment", null, ap.av.getAlignment().getSequences()); + ap.av.firePropertyChange("alignment", null, ap.av.getAlignment() + .getSequences()); } } @@ -237,7 +239,8 @@ public class RedundancyPanel extends SliderPanel implements Runnable, { ap.av.getHistoryList().remove(command); ap.alignFrame.updateEditMenuBar(); - ap.av.firePropertyChange("alignment", null, ap.av.getAlignment().getSequences()); + ap.av.firePropertyChange("alignment", null, ap.av.getAlignment() + .getSequences()); } ap.paintAlignment(true); diff --git a/src/jalview/appletgui/RotatableCanvas.java b/src/jalview/appletgui/RotatableCanvas.java index 377186a..5c91ea8 100755 --- a/src/jalview/appletgui/RotatableCanvas.java +++ b/src/jalview/appletgui/RotatableCanvas.java @@ -20,16 +20,28 @@ */ package jalview.appletgui; -import java.util.*; -import java.awt.*; -import java.awt.event.*; - import jalview.api.RotatableCanvasI; -import jalview.datamodel.*; -import jalview.math.*; -import jalview.util.*; +import jalview.datamodel.SequenceGroup; +import jalview.datamodel.SequenceI; +import jalview.datamodel.SequencePoint; +import jalview.math.RotatableMatrix; +import jalview.util.Format; +import jalview.util.MessageManager; import jalview.viewmodel.AlignmentViewport; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.Panel; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.util.Vector; + public class RotatableCanvas extends Panel implements MouseListener, MouseMotionListener, KeyListener, RotatableCanvasI { diff --git a/src/jalview/appletgui/ScalePanel.java b/src/jalview/appletgui/ScalePanel.java index 3bb676f..769ac8b 100755 --- a/src/jalview/appletgui/ScalePanel.java +++ b/src/jalview/appletgui/ScalePanel.java @@ -414,21 +414,17 @@ public class ScalePanel extends Panel implements MouseMotionListener, maxX = (i - startx + 1) * avcharWidth + fm.stringWidth(string); } - gg.drawLine( -((i - startx - 1) * avcharWidth) + (avcharWidth / 2), + gg.drawLine(((i - startx - 1) * avcharWidth) + (avcharWidth / 2), y + 2, - ((i - startx - 1) * avcharWidth) + (avcharWidth / 2), - y + (fm.getDescent() * 2)); + ((i - startx - 1) * avcharWidth) + (avcharWidth / 2), y + + (fm.getDescent() * 2)); } else { - gg.drawLine( -((i - startx - 1) * avcharWidth) + (avcharWidth / 2), - y + fm.getDescent(), - ((i - startx - 1) * avcharWidth) - + (avcharWidth / 2), - y + (fm.getDescent() * 2)); + gg.drawLine(((i - startx - 1) * avcharWidth) + (avcharWidth / 2), y + + fm.getDescent(), ((i - startx - 1) * avcharWidth) + + (avcharWidth / 2), y + (fm.getDescent() * 2)); } } @@ -450,12 +446,10 @@ public class ScalePanel extends Panel implements MouseMotionListener, continue; } - gg.fillPolygon(new int[] - { res * avcharWidth - avcharHeight / 4, + gg.fillPolygon(new int[] { res * avcharWidth - avcharHeight / 4, res * avcharWidth + avcharHeight / 4, res * avcharWidth }, - new int[] - { y - avcharHeight / 2, y - avcharHeight / 2, y + 8 }, - 3); + new int[] { y - avcharHeight / 2, y - avcharHeight / 2, + y + 8 }, 3); } } diff --git a/src/jalview/appletgui/SeqCanvas.java b/src/jalview/appletgui/SeqCanvas.java index 522151c..ce70597 100755 --- a/src/jalview/appletgui/SeqCanvas.java +++ b/src/jalview/appletgui/SeqCanvas.java @@ -473,11 +473,10 @@ public class SeqCanvas extends Panel continue; } - gg.fillPolygon(new int[] - { res * avcharWidth - avcharHeight / 4, + gg.fillPolygon(new int[] { res * avcharWidth - avcharHeight / 4, res * avcharWidth + avcharHeight / 4, res * avcharWidth }, - new int[] - { ypos - (avcharHeight / 2), ypos - (avcharHeight / 2), + new int[] { ypos - (avcharHeight / 2), + ypos - (avcharHeight / 2), ypos - (avcharHeight / 2) + 8 }, 3); } @@ -529,11 +528,9 @@ public class SeqCanvas extends Panel } private void drawPanel(Graphics g1, int startRes, int endRes, - int startSeq, - int endSeq, int offset) + int startSeq, int endSeq, int offset) { - if (!av.hasHiddenColumns()) { draw(g1, startRes, endRes, startSeq, endSeq, offset); @@ -827,8 +824,7 @@ public class SeqCanvas extends Panel break; } - group = av.getAlignment().getGroups() - .get(groupIndex); + group = av.getAlignment().getGroups().get(groupIndex); } while (groupIndex < av.getAlignment().getGroups().size()); } diff --git a/src/jalview/appletgui/SeqPanel.java b/src/jalview/appletgui/SeqPanel.java index 4dd131a..9870e68 100644 --- a/src/jalview/appletgui/SeqPanel.java +++ b/src/jalview/appletgui/SeqPanel.java @@ -564,8 +564,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, } if (features != null && features.length > 0) { - seqCanvas.getFeatureRenderer().amendFeatures(new SequenceI[] - { sequence }, features, false, ap); + seqCanvas.getFeatureRenderer().amendFeatures( + new SequenceI[] { sequence }, features, false, ap); seqCanvas.highlightSearchResults(null); } @@ -607,8 +607,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, } int cHeight = av.getAlignment().getHeight() * av.getCharHeight() - + hgap - + seqCanvas.getAnnotationHeight(); + + hgap + seqCanvas.getAnnotationHeight(); int y = evt.getY(); y -= hgap; @@ -665,8 +664,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, } int cHeight = av.getAlignment().getHeight() * av.getCharHeight() - + hgap - + seqCanvas.getAnnotationHeight(); + + hgap + seqCanvas.getAnnotationHeight(); y -= hgap; @@ -800,8 +798,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, } else { - obj = "X".equalsIgnoreCase(ch) ? "X" - : ResidueProperties.aa2Triplet.get(ch); + obj = "X".equalsIgnoreCase(ch) ? "X" : ResidueProperties.aa2Triplet + .get(ch); if (obj != null) { text.append(" Residue: ").append(obj); @@ -885,13 +883,15 @@ public class SeqPanel extends Panel implements MouseMotionListener, for (int i = 0; i < features.length; i++) { if (av.getFeaturesDisplayed() == null - || !av.getFeaturesDisplayed().isVisible(features[i].getType())) + || !av.getFeaturesDisplayed().isVisible( + features[i].getType())) { continue; } if (features[i].featureGroup != null - && !seqCanvas.fr.checkGroupVisibility(features[i].featureGroup,false)) + && !seqCanvas.fr.checkGroupVisibility( + features[i].featureGroup, false)) { continue; } @@ -1047,8 +1047,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, if (editCommand == null) { editCommand = new EditCommand(MessageManager.formatMessage( - "label.edit_params", new String[] - { label })); + "label.edit_params", new String[] { label })); } } @@ -1282,14 +1281,14 @@ public class SeqPanel extends Panel implements MouseMotionListener, { for (int j = lastres; j < startres; j++) { - insertChar(j, new SequenceI[] - { seq }, fixedRight); + insertChar(j, new SequenceI[] { seq }, fixedRight); } } else { - editCommand.appendEdit(Action.INSERT_GAP, new SequenceI[] - { seq }, lastres, startres - lastres, av.getAlignment(), true); + editCommand.appendEdit(Action.INSERT_GAP, + new SequenceI[] { seq }, lastres, startres - lastres, + av.getAlignment(), true); } } else @@ -1304,8 +1303,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, endEditing(); break; } - deleteChar(startres, new SequenceI[] - { seq }, fixedRight); + deleteChar(startres, new SequenceI[] { seq }, fixedRight); } } else @@ -1323,8 +1321,9 @@ public class SeqPanel extends Panel implements MouseMotionListener, if (max > 0) { - editCommand.appendEdit(Action.DELETE_GAP, new SequenceI[] - { seq }, startres, max, av.getAlignment(), true); + editCommand.appendEdit(Action.DELETE_GAP, + new SequenceI[] { seq }, startres, max, + av.getAlignment(), true); } } } @@ -1929,22 +1928,24 @@ public class SeqPanel extends Panel implements MouseMotionListener, protected boolean selectionFromTranslation(SequenceGroup seqsel, ColumnSelection colsel, SelectionSource source) { - if (!(source instanceof AlignViewportI)) { + if (!(source instanceof AlignViewportI)) + { return false; } final AlignViewportI sourceAv = (AlignViewportI) source; - if (sourceAv.getCodingComplement() != av && av.getCodingComplement() != sourceAv) + if (sourceAv.getCodingComplement() != av + && av.getCodingComplement() != sourceAv) { return false; } - + /* * Map sequence selection */ SequenceGroup sg = MappingUtils.mapSequenceGroup(seqsel, sourceAv, av); av.setSelectionGroup(sg); av.isSelectionGroupChanged(true); - + /* * Map column selection */ @@ -1952,10 +1953,10 @@ public class SeqPanel extends Panel implements MouseMotionListener, av); av.setColumnSelection(cs); av.isColSelChanged(true); - + ap.scalePanelHolder.repaint(); ap.repaint(); - + return true; } diff --git a/src/jalview/appletgui/SequenceRenderer.java b/src/jalview/appletgui/SequenceRenderer.java index e07fcb2..09b50c4 100755 --- a/src/jalview/appletgui/SequenceRenderer.java +++ b/src/jalview/appletgui/SequenceRenderer.java @@ -256,8 +256,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer } if (currentSequenceGroup.getShowNonconserved()) { - s = getDisplayChar(srep, i, s, - '.'); + s = getDisplayChar(srep, i, s, '.'); } } else @@ -281,8 +280,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer } if (av.getShowUnconserved()) { - s = getDisplayChar(srep, i, s, - '.'); + s = getDisplayChar(srep, i, s, '.'); } } @@ -314,13 +312,15 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer } - private char getDisplayChar(final boolean usesrep, int position, - char s, char c) + private char getDisplayChar(final boolean usesrep, int position, char s, + char c) { // TODO - use currentSequenceGroup rather than alignment // currentSequenceGroup.getConsensus() - char conschar = (usesrep) ? av.getAlignment().getSeqrep().getCharAt(position) : av.getAlignmentConsensusAnnotation().annotations[position].displayCharacter - .charAt(0); + char conschar = (usesrep) ? av.getAlignment().getSeqrep() + .getCharAt(position) + : av.getAlignmentConsensusAnnotation().annotations[position].displayCharacter + .charAt(0); if (!jalview.util.Comparison.isGap(conschar) && s == conschar) { s = c; diff --git a/src/jalview/appletgui/SliderPanel.java b/src/jalview/appletgui/SliderPanel.java index 65622aa..2fc15d0 100644 --- a/src/jalview/appletgui/SliderPanel.java +++ b/src/jalview/appletgui/SliderPanel.java @@ -74,7 +74,10 @@ public class SliderPanel extends Panel implements ActionListener, sp.cs = cs; } - conservationSlider.setTitle(MessageManager.formatMessage("label.conservation_colour_increment", new String[]{source})); + conservationSlider + .setTitle(MessageManager.formatMessage( + "label.conservation_colour_increment", + new String[] { source })); if (ap.av.getAlignment().getGroups() != null) { sp.setAllGroupsCheckEnabled(true); @@ -128,7 +131,9 @@ public class SliderPanel extends Panel implements ActionListener, pid = (SliderPanel) PIDSlider.getComponent(0); pid.cs = cs; } - PIDSlider.setTitle(MessageManager.formatMessage("label.percentage_identity_thereshold", new String[]{source})); + PIDSlider.setTitle(MessageManager + .formatMessage("label.percentage_identity_thereshold", + new String[] { source })); if (ap.av.getAlignment().getGroups() != null) { diff --git a/src/jalview/appletgui/SplitFrame.java b/src/jalview/appletgui/SplitFrame.java index 888208a..bdda465 100644 --- a/src/jalview/appletgui/SplitFrame.java +++ b/src/jalview/appletgui/SplitFrame.java @@ -1,10 +1,5 @@ package jalview.appletgui; -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.GridLayout; -import java.awt.Panel; - import jalview.analysis.AlignmentUtils; import jalview.api.AlignmentViewPanel; import jalview.api.ViewStyleI; @@ -13,6 +8,11 @@ import jalview.datamodel.AlignmentI; import jalview.structure.StructureSelectionManager; import jalview.viewmodel.AlignmentViewport; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.GridLayout; +import java.awt.Panel; + public class SplitFrame extends EmbmenuFrame { private static final long serialVersionUID = 1L; diff --git a/src/jalview/appletgui/Tooltip.java b/src/jalview/appletgui/Tooltip.java index c9df482..7a65ec3 100755 --- a/src/jalview/appletgui/Tooltip.java +++ b/src/jalview/appletgui/Tooltip.java @@ -20,11 +20,20 @@ */ package jalview.appletgui; -import java.applet.*; -import java.util.*; - -import java.awt.*; -import java.awt.event.*; +import java.applet.Applet; +import java.awt.Canvas; +import java.awt.Color; +import java.awt.Component; +import java.awt.Container; +import java.awt.FontMetrics; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.Image; +import java.awt.LayoutManager; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.util.StringTokenizer; public class Tooltip extends Canvas implements MouseListener, MouseMotionListener diff --git a/src/jalview/appletgui/UserDefinedColours.java b/src/jalview/appletgui/UserDefinedColours.java index 277bd55..57cf669 100644 --- a/src/jalview/appletgui/UserDefinedColours.java +++ b/src/jalview/appletgui/UserDefinedColours.java @@ -20,6 +20,13 @@ */ package jalview.appletgui; +import jalview.datamodel.SequenceGroup; +import jalview.schemes.ColourSchemeI; +import jalview.schemes.GraduatedColor; +import jalview.schemes.ResidueProperties; +import jalview.schemes.UserColourScheme; +import jalview.util.MessageManager; + import java.awt.Button; import java.awt.Color; import java.awt.Component; @@ -42,13 +49,6 @@ import java.awt.event.FocusListener; import java.awt.event.MouseEvent; import java.util.Vector; -import jalview.datamodel.SequenceGroup; -import jalview.schemes.ColourSchemeI; -import jalview.schemes.GraduatedColor; -import jalview.schemes.ResidueProperties; -import jalview.schemes.UserColourScheme; -import jalview.util.MessageManager; - public class UserDefinedColours extends Panel implements ActionListener, AdjustmentListener, FocusListener { @@ -189,7 +189,8 @@ public class UserDefinedColours extends Panel implements ActionListener, setTargetColour(colour); okcancelPanel.setBounds(new Rectangle(0, 113, 400, 35)); - frame.setTitle(MessageManager.getString("label.user_defined_colours") + " - " + label); + frame.setTitle(MessageManager.getString("label.user_defined_colours") + + " - " + label); frame.setSize(420, 200); } @@ -208,7 +209,9 @@ public class UserDefinedColours extends Panel implements ActionListener, // // not 1.1 compatible! // dialog = new Dialog(((JVDialog)alignframe), title, true); // } else { - throw new Error(MessageManager.getString("label.error_unsupported_owwner_user_colour_scheme")); + throw new Error( + MessageManager + .getString("label.error_unsupported_owwner_user_colour_scheme")); } dialog.add(this); diff --git a/src/jalview/bin/BuildDetails.java b/src/jalview/bin/BuildDetails.java index 0a1e227..2ead42f 100644 --- a/src/jalview/bin/BuildDetails.java +++ b/src/jalview/bin/BuildDetails.java @@ -2,7 +2,6 @@ package jalview.bin; import jalview.api.BuildDetailsI; - public class BuildDetails implements BuildDetailsI { private static String buildDate; @@ -53,6 +52,4 @@ public class BuildDetails implements BuildDetailsI BuildDetails.installation = installation; } - - } diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 641815d..ee46581 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -222,11 +222,13 @@ public class Cache public static Logger log; /** Jalview Properties */ - public static Properties applicationProperties = new Properties() { + public static Properties applicationProperties = new Properties() + { // override results in properties output in alphabetical order @Override - public synchronized Enumeration keys() { - return Collections.enumeration(new TreeSet(super.keySet())); + public synchronized Enumeration keys() + { + return Collections.enumeration(new TreeSet(super.keySet())); } }; @@ -315,9 +317,9 @@ public class Cache fis = new FileInputStream(propertiesFile); } applicationProperties.load(fis); - + // remove any old build properties - + deleteBuildProperties(); fis.close(); } catch (Exception ex) @@ -718,21 +720,22 @@ public class Cache try { // Google analytics tracking code for Library Finder - tracker = jgoogleanalyticstracker.getConstructor(new Class[] - { String.class, String.class, String.class }).newInstance( - new Object[] - { - "Jalview Desktop", - (vrs = jalview.bin.Cache.getProperty("VERSION") - + "_" - + jalview.bin.Cache.getDefault("BUILD_DATE", - "unknown")), "UA-9060947-1" }); + tracker = jgoogleanalyticstracker.getConstructor( + new Class[] { String.class, String.class, String.class }) + .newInstance( + new Object[] { + "Jalview Desktop", + (vrs = jalview.bin.Cache.getProperty("VERSION") + + "_" + + jalview.bin.Cache.getDefault( + "BUILD_DATE", "unknown")), + "UA-9060947-1" }); jgoogleanalyticstracker.getMethod("trackAsynchronously", - new Class[] - { trackerfocus }).invoke(tracker, new Object[] - { trackerfocus.getConstructor(new Class[] - { String.class }).newInstance(new Object[] - { "Application Started." }) }); + new Class[] { trackerfocus }).invoke( + tracker, + new Object[] { trackerfocus.getConstructor( + new Class[] { String.class }).newInstance( + new Object[] { "Application Started." }) }); } catch (RuntimeException e) { re = e; diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 177d56f..dfd0924 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -240,8 +240,7 @@ public class Jalview } else { - System.err -.println("CMD [-noquestionnaire] executed successfully!"); + System.err.println("CMD [-noquestionnaire] executed successfully!"); } desktop.checkForNews(); } @@ -358,7 +357,8 @@ public class Jalview { if (!headless) { - desktop.setProgressBar(MessageManager.getString("status.processing_commandline_args"), + desktop.setProgressBar(MessageManager + .getString("status.processing_commandline_args"), progress = System.currentTimeMillis()); } System.out.println("CMD [-open " + file + "] executed successfully!"); @@ -445,8 +445,7 @@ public class Jalview af.getViewport().setSortByTree(true); if (af.getViewport().getSortByTree()) { - System.out -.println("CMD [-sortbytree] executed successfully!"); + System.out.println("CMD [-sortbytree] executed successfully!"); } } if (aparser.contains("no-annotation")) @@ -454,8 +453,7 @@ public class Jalview af.getViewport().setShowAnnotation(false); if (!af.getViewport().isShowAnnotation()) { - System.out -.println("CMD no-annotation executed successfully!"); + System.out.println("CMD no-annotation executed successfully!"); } } if (aparser.contains("nosortbytree")) @@ -519,8 +517,7 @@ public class Jalview if (jalview.bin.Cache.groovyJarsPresent()) { System.out.println("Executing script " + groovyscript); - executeGroovyScript(groovyscript, new Object[] - { desktop, af }); + executeGroovyScript(groovyscript, new Object[] { desktop, af }); System.out.println("CMD groovy[" + groovyscript + "] executed successfully!"); @@ -655,8 +652,8 @@ public class Jalview if (jalview.bin.Cache.groovyJarsPresent()) { System.out.println("Executing script " + groovyscript); - executeGroovyScript(groovyscript, new Object[] - { desktop, startUpAlframe }); + executeGroovyScript(groovyscript, new Object[] { desktop, + startUpAlframe }); } else { @@ -865,8 +862,7 @@ public class Jalview Object[] binding; int blen = ((jalviewContext[0] == null) ? 0 : 1) + ((jalviewContext[1] == null) ? 0 : 1); - String cnames[] = new String[] - { "Jalview", "currentAlFrame" }; + String cnames[] = new String[] { "Jalview", "currentAlFrame" }; bspec = new Class[blen * 2]; binding = new Object[blen * 2]; blen = 0; @@ -907,15 +903,15 @@ public class Jalview } Class gsec = cl.loadClass("groovy.util.GroovyScriptEngine"); - Constructor gseccons = gsec.getConstructor(new Class[] - { URL[].class }); // String[].class }); - Object gse = gseccons.newInstance(new Object[] - { new URL[] - { sfile } }); // .toString() } }); - java.lang.reflect.Method run = gsec.getMethod("run", new Class[] - { String.class, gbindingc }); - run.invoke(gse, new Object[] - { sfile.toString(), gbinding }); + Constructor gseccons = gsec + .getConstructor(new Class[] { URL[].class }); // String[].class + // }); + Object gse = gseccons + .newInstance(new Object[] { new URL[] { sfile } }); // .toString() + // } }); + java.lang.reflect.Method run = gsec.getMethod("run", new Class[] { + String.class, gbindingc }); + run.invoke(gse, new Object[] { sfile.toString(), gbinding }); success = true; } catch (Exception e) { @@ -1181,7 +1177,8 @@ class FeatureFetcher running++; } - af.setProgressBar(MessageManager.getString("status.das_features_being_retrived"), id); + af.setProgressBar(MessageManager + .getString("status.das_features_being_retrived"), id); af.featureSettings_actionPerformed(null); af.featureSettings.fetchDasFeatures(dasSources, true); af.setProgressBar(null, id); diff --git a/src/jalview/bin/JalviewLite.java b/src/jalview/bin/JalviewLite.java index d0c3829..3024e66 100644 --- a/src/jalview/bin/JalviewLite.java +++ b/src/jalview/bin/JalviewLite.java @@ -1385,8 +1385,7 @@ public class JalviewLite extends Applet implements String externalsviewer = getParameter("externalstructureviewer"); if (externalsviewer != null) { - useXtrnalSviewer = externalsviewer.trim().toLowerCase() - .equals(TRUE); + useXtrnalSviewer = externalsviewer.trim().toLowerCase().equals(TRUE); } /** * if true disable the check for jmol @@ -1412,7 +1411,9 @@ public class JalviewLite extends Applet implements } else { - throw new Error(MessageManager.getString("error.invalid_separator_parameter")); + throw new Error( + MessageManager + .getString("error.invalid_separator_parameter")); } } int r = 255; @@ -1921,7 +1922,8 @@ public class JalviewLite extends Applet implements AlignmentI al = null; try { - al = new AppletFormatAdapter().readFile(resolvedFile, protocol, format); + al = new AppletFormatAdapter().readFile(resolvedFile, protocol, + format); if ((al != null) && (al.getHeight() > 0)) { dbgMsg("Successfully loaded file."); @@ -1939,13 +1941,13 @@ public class JalviewLite extends Applet implements if (protocol == AppletFormatAdapter.PASTE) { newAlignFrame.setTitle(MessageManager.formatMessage( - "label.sequences_from", new Object[] - { applet.getDocumentBase().toString() })); + "label.sequences_from", new Object[] { applet + .getDocumentBase().toString() })); } newAlignFrame.statusBar.setText(MessageManager.formatMessage( - "label.successfully_loaded_file", new Object[] - { resolvedFile })); + "label.successfully_loaded_file", + new Object[] { resolvedFile })); return newAlignFrame; } @@ -2040,10 +2042,9 @@ public class JalviewLite extends Applet implements String sequence = applet.getParameter("PDBSEQ"); if (sequence != null) { - seqs = new SequenceI[] - { matcher == null ? (Sequence) alignFrame.getAlignViewport() - .getAlignment().findName(sequence) : matcher - .findIdMatch(sequence) }; + seqs = new SequenceI[] { matcher == null ? (Sequence) alignFrame + .getAlignViewport().getAlignment().findName(sequence) + : matcher.findIdMatch(sequence) }; } } @@ -2125,8 +2126,8 @@ public class JalviewLite extends Applet implements } else { - pdbs.addElement(new Object[] - { pdb, seqs, chains, new String(protocol) }); + pdbs.addElement(new Object[] { pdb, seqs, chains, + new String(protocol) }); } } } @@ -2401,8 +2402,7 @@ public class JalviewLite extends Applet implements if (debug) { System.err.println("Prepended document base '" + documentBase - + "' to make: '" + url - + "'"); + + "' to make: '" + url + "'"); } return url; } @@ -2911,8 +2911,7 @@ public class JalviewLite extends Applet implements if (url.indexOf("/") == 0) { String localfile = localref.getFile(); - url = codebase.substring(0, codebase.length() - - localfile.length()) + url = codebase.substring(0, codebase.length() - localfile.length()) + url; } else diff --git a/src/jalview/binding/Alignment.java b/src/jalview/binding/Alignment.java index 5b107b5..b8fcb2c 100644 --- a/src/jalview/binding/Alignment.java +++ b/src/jalview/binding/Alignment.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,151 +19,162 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Alignment implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _annotation. - */ - private jalview.binding.Annotation _annotation; - - /** - * Field _sequenceSet. - */ - private jalview.binding.SequenceSet _sequenceSet; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Alignment() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Returns the value of field 'annotation'. - * - * @return the value of field 'Annotation'. - */ - public jalview.binding.Annotation getAnnotation( - ) { - return this._annotation; - } - - /** - * Returns the value of field 'sequenceSet'. - * - * @return the value of field 'SequenceSet'. - */ - public jalview.binding.SequenceSet getSequenceSet( - ) { - return this._sequenceSet; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'annotation'. - * - * @param annotation the value of field 'annotation'. - */ - public void setAnnotation( - final jalview.binding.Annotation annotation) { - this._annotation = annotation; - } - - /** - * Sets the value of field 'sequenceSet'. - * - * @param sequenceSet the value of field 'sequenceSet'. - */ - public void setSequenceSet( - final jalview.binding.SequenceSet sequenceSet) { - this._sequenceSet = sequenceSet; - } - - /** - * 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.binding.Alignment - */ - public static jalview.binding.Alignment unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.Alignment) Unmarshaller.unmarshal(jalview.binding.Alignment.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); +public class Alignment implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _annotation. + */ + private jalview.binding.Annotation _annotation; + + /** + * Field _sequenceSet. + */ + private jalview.binding.SequenceSet _sequenceSet; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Alignment() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Returns the value of field 'annotation'. + * + * @return the value of field 'Annotation'. + */ + public jalview.binding.Annotation getAnnotation() + { + return this._annotation; + } + + /** + * Returns the value of field 'sequenceSet'. + * + * @return the value of field 'SequenceSet'. + */ + public jalview.binding.SequenceSet getSequenceSet() + { + return this._sequenceSet; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'annotation'. + * + * @param annotation + * the value of field 'annotation'. + */ + public void setAnnotation(final jalview.binding.Annotation annotation) + { + this._annotation = annotation; + } + + /** + * Sets the value of field 'sequenceSet'. + * + * @param sequenceSet + * the value of field 'sequenceSet'. + */ + public void setSequenceSet(final jalview.binding.SequenceSet sequenceSet) + { + this._sequenceSet = sequenceSet; + } + + /** + * 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.binding.Alignment + */ + public static jalview.binding.Alignment unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.Alignment) Unmarshaller.unmarshal( + jalview.binding.Alignment.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/binding/Annotation.java b/src/jalview/binding/Annotation.java index 108d3ad..86f1a63 100644 --- a/src/jalview/binding/Annotation.java +++ b/src/jalview/binding/Annotation.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,414 +19,441 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Annotation implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _graph. - */ - private boolean _graph; - - /** - * keeps track of state for field: _graph - */ - private boolean _has_graph; - - /** - * Field _graphType. - */ - private int _graphType; - - /** - * keeps track of state for field: _graphType - */ - private boolean _has_graphType; - - /** - * Field _annotationElementList. - */ - private java.util.Vector _annotationElementList; - - /** - * Field _label. - */ - private java.lang.String _label; - - /** - * Field _description. - */ - private java.lang.String _description; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Annotation() { - super(); - this._annotationElementList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vAnnotationElement - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addAnnotationElement( - final jalview.binding.AnnotationElement vAnnotationElement) - throws java.lang.IndexOutOfBoundsException { - this._annotationElementList.addElement(vAnnotationElement); - } - - /** - * - * - * @param index - * @param vAnnotationElement - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addAnnotationElement( - final int index, - final jalview.binding.AnnotationElement vAnnotationElement) - throws java.lang.IndexOutOfBoundsException { - this._annotationElementList.add(index, vAnnotationElement); - } - - /** - */ - public void deleteGraph( - ) { - this._has_graph= false; - } - - /** - */ - public void deleteGraphType( - ) { - this._has_graphType= false; - } - - /** - * Method enumerateAnnotationElement. - * - * @return an Enumeration over all - * jalview.binding.AnnotationElement elements - */ - public java.util.Enumeration enumerateAnnotationElement( - ) { - return this._annotationElementList.elements(); - } - - /** - * Method getAnnotationElement. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the jalview.binding.AnnotationElement - * at the given index - */ - public jalview.binding.AnnotationElement getAnnotationElement( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._annotationElementList.size()) { - throw new IndexOutOfBoundsException("getAnnotationElement: Index value '" + index + "' not in range [0.." + (this._annotationElementList.size() - 1) + "]"); - } - - return (jalview.binding.AnnotationElement) _annotationElementList.get(index); - } - - /** - * Method getAnnotationElement.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 jalview.binding.AnnotationElement[] getAnnotationElement( - ) { - jalview.binding.AnnotationElement[] array = new jalview.binding.AnnotationElement[0]; - return (jalview.binding.AnnotationElement[]) this._annotationElementList.toArray(array); - } - - /** - * Method getAnnotationElementCount. - * - * @return the size of this collection - */ - public int getAnnotationElementCount( - ) { - return this._annotationElementList.size(); - } - - /** - * Returns the value of field 'description'. - * - * @return the value of field 'Description'. - */ - public java.lang.String getDescription( - ) { - return this._description; - } - - /** - * Returns the value of field 'graph'. - * - * @return the value of field 'Graph'. - */ - public boolean getGraph( - ) { - return this._graph; +public class Annotation implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _graph. + */ + private boolean _graph; + + /** + * keeps track of state for field: _graph + */ + private boolean _has_graph; + + /** + * Field _graphType. + */ + private int _graphType; + + /** + * keeps track of state for field: _graphType + */ + private boolean _has_graphType; + + /** + * Field _annotationElementList. + */ + private java.util.Vector _annotationElementList; + + /** + * Field _label. + */ + private java.lang.String _label; + + /** + * Field _description. + */ + private java.lang.String _description; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Annotation() + { + super(); + this._annotationElementList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vAnnotationElement + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addAnnotationElement( + final jalview.binding.AnnotationElement vAnnotationElement) + throws java.lang.IndexOutOfBoundsException + { + this._annotationElementList.addElement(vAnnotationElement); + } + + /** + * + * + * @param index + * @param vAnnotationElement + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addAnnotationElement(final int index, + final jalview.binding.AnnotationElement vAnnotationElement) + throws java.lang.IndexOutOfBoundsException + { + this._annotationElementList.add(index, vAnnotationElement); + } + + /** + */ + public void deleteGraph() + { + this._has_graph = false; + } + + /** + */ + public void deleteGraphType() + { + this._has_graphType = false; + } + + /** + * Method enumerateAnnotationElement. + * + * @return an Enumeration over all jalview.binding.AnnotationElement elements + */ + public java.util.Enumeration enumerateAnnotationElement() + { + return this._annotationElementList.elements(); + } + + /** + * Method getAnnotationElement. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.binding.AnnotationElement at the given + * index + */ + public jalview.binding.AnnotationElement getAnnotationElement( + final int index) throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._annotationElementList.size()) + { + throw new IndexOutOfBoundsException( + "getAnnotationElement: Index value '" + index + + "' not in range [0.." + + (this._annotationElementList.size() - 1) + "]"); } - /** - * Returns the value of field 'graphType'. - * - * @return the value of field 'GraphType'. - */ - public int getGraphType( - ) { - return this._graphType; - } - - /** - * Returns the value of field 'label'. - * - * @return the value of field 'Label'. - */ - public java.lang.String getLabel( - ) { - return this._label; - } - - /** - * Method hasGraph. - * - * @return true if at least one Graph has been added - */ - public boolean hasGraph( - ) { - return this._has_graph; - } - - /** - * Method hasGraphType. - * - * @return true if at least one GraphType has been added - */ - public boolean hasGraphType( - ) { - return this._has_graphType; - } - - /** - * Returns the value of field 'graph'. - * - * @return the value of field 'Graph'. - */ - public boolean isGraph( - ) { - return this._graph; - } - - /** - * 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 removeAllAnnotationElement( - ) { - this._annotationElementList.clear(); - } - - /** - * Method removeAnnotationElement. - * - * @param vAnnotationElement - * @return true if the object was removed from the collection. - */ - public boolean removeAnnotationElement( - final jalview.binding.AnnotationElement vAnnotationElement) { - boolean removed = _annotationElementList.remove(vAnnotationElement); - return removed; - } - - /** - * Method removeAnnotationElementAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.binding.AnnotationElement removeAnnotationElementAt( - final int index) { - java.lang.Object obj = this._annotationElementList.remove(index); - return (jalview.binding.AnnotationElement) obj; - } - - /** - * - * - * @param index - * @param vAnnotationElement - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setAnnotationElement( - final int index, - final jalview.binding.AnnotationElement vAnnotationElement) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._annotationElementList.size()) { - throw new IndexOutOfBoundsException("setAnnotationElement: Index value '" + index + "' not in range [0.." + (this._annotationElementList.size() - 1) + "]"); - } - - this._annotationElementList.set(index, vAnnotationElement); - } - - /** - * - * - * @param vAnnotationElementArray - */ - public void setAnnotationElement( - final jalview.binding.AnnotationElement[] vAnnotationElementArray) { - //-- copy array - _annotationElementList.clear(); - - for (int i = 0; i < vAnnotationElementArray.length; i++) { - this._annotationElementList.add(vAnnotationElementArray[i]); - } - } - - /** - * Sets the value of field 'description'. - * - * @param description the value of field 'description'. - */ - public void setDescription( - final java.lang.String description) { - this._description = description; + return (jalview.binding.AnnotationElement) _annotationElementList + .get(index); + } + + /** + * Method getAnnotationElement.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 jalview.binding.AnnotationElement[] getAnnotationElement() + { + jalview.binding.AnnotationElement[] array = new jalview.binding.AnnotationElement[0]; + return (jalview.binding.AnnotationElement[]) this._annotationElementList + .toArray(array); + } + + /** + * Method getAnnotationElementCount. + * + * @return the size of this collection + */ + public int getAnnotationElementCount() + { + return this._annotationElementList.size(); + } + + /** + * Returns the value of field 'description'. + * + * @return the value of field 'Description'. + */ + public java.lang.String getDescription() + { + return this._description; + } + + /** + * Returns the value of field 'graph'. + * + * @return the value of field 'Graph'. + */ + public boolean getGraph() + { + return this._graph; + } + + /** + * Returns the value of field 'graphType'. + * + * @return the value of field 'GraphType'. + */ + public int getGraphType() + { + return this._graphType; + } + + /** + * Returns the value of field 'label'. + * + * @return the value of field 'Label'. + */ + public java.lang.String getLabel() + { + return this._label; + } + + /** + * Method hasGraph. + * + * @return true if at least one Graph has been added + */ + public boolean hasGraph() + { + return this._has_graph; + } + + /** + * Method hasGraphType. + * + * @return true if at least one GraphType has been added + */ + public boolean hasGraphType() + { + return this._has_graphType; + } + + /** + * Returns the value of field 'graph'. + * + * @return the value of field 'Graph'. + */ + public boolean isGraph() + { + return this._graph; + } + + /** + * 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; } - - /** - * Sets the value of field 'graph'. - * - * @param graph the value of field 'graph'. - */ - public void setGraph( - final boolean graph) { - this._graph = graph; - this._has_graph = true; + 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 removeAllAnnotationElement() + { + this._annotationElementList.clear(); + } + + /** + * Method removeAnnotationElement. + * + * @param vAnnotationElement + * @return true if the object was removed from the collection. + */ + public boolean removeAnnotationElement( + final jalview.binding.AnnotationElement vAnnotationElement) + { + boolean removed = _annotationElementList.remove(vAnnotationElement); + return removed; + } + + /** + * Method removeAnnotationElementAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.binding.AnnotationElement removeAnnotationElementAt( + final int index) + { + java.lang.Object obj = this._annotationElementList.remove(index); + return (jalview.binding.AnnotationElement) obj; + } + + /** + * + * + * @param index + * @param vAnnotationElement + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setAnnotationElement(final int index, + final jalview.binding.AnnotationElement vAnnotationElement) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._annotationElementList.size()) + { + throw new IndexOutOfBoundsException( + "setAnnotationElement: Index value '" + index + + "' not in range [0.." + + (this._annotationElementList.size() - 1) + "]"); } - /** - * Sets the value of field 'graphType'. - * - * @param graphType the value of field 'graphType'. - */ - public void setGraphType( - final int graphType) { - this._graphType = graphType; - this._has_graphType = true; - } - - /** - * Sets the value of field 'label'. - * - * @param label the value of field 'label'. - */ - public void setLabel( - final java.lang.String label) { - this._label = label; - } - - /** - * 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.binding.Annotation - */ - public static jalview.binding.Annotation unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.Annotation) Unmarshaller.unmarshal(jalview.binding.Annotation.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._annotationElementList.set(index, vAnnotationElement); + } + + /** + * + * + * @param vAnnotationElementArray + */ + public void setAnnotationElement( + final jalview.binding.AnnotationElement[] vAnnotationElementArray) + { + // -- copy array + _annotationElementList.clear(); + + for (int i = 0; i < vAnnotationElementArray.length; i++) + { + this._annotationElementList.add(vAnnotationElementArray[i]); } + } + + /** + * Sets the value of field 'description'. + * + * @param description + * the value of field 'description'. + */ + public void setDescription(final java.lang.String description) + { + this._description = description; + } + + /** + * Sets the value of field 'graph'. + * + * @param graph + * the value of field 'graph'. + */ + public void setGraph(final boolean graph) + { + this._graph = graph; + this._has_graph = true; + } + + /** + * Sets the value of field 'graphType'. + * + * @param graphType + * the value of field 'graphType'. + */ + public void setGraphType(final int graphType) + { + this._graphType = graphType; + this._has_graphType = true; + } + + /** + * Sets the value of field 'label'. + * + * @param label + * the value of field 'label'. + */ + public void setLabel(final java.lang.String label) + { + this._label = label; + } + + /** + * 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.binding.Annotation + */ + public static jalview.binding.Annotation unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.Annotation) Unmarshaller.unmarshal( + jalview.binding.Annotation.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/binding/AnnotationElement.java b/src/jalview/binding/AnnotationElement.java index d133fe0..1f583c7 100644 --- a/src/jalview/binding/AnnotationElement.java +++ b/src/jalview/binding/AnnotationElement.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,273 +19,287 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class AnnotationElement implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _position. - */ - private int _position; - - /** - * keeps track of state for field: _position - */ - private boolean _has_position; - - /** - * Field _displayCharacter. - */ - private java.lang.String _displayCharacter; - - /** - * Field _description. - */ - private java.lang.String _description; - - /** - * Field _secondaryStructure. - */ - private java.lang.String _secondaryStructure; - - /** - * Field _value. - */ - private float _value; - - /** - * keeps track of state for field: _value - */ - private boolean _has_value; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public AnnotationElement() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deletePosition( - ) { - this._has_position= false; - } - - /** - */ - public void deleteValue( - ) { - this._has_value= false; - } - - /** - * Returns the value of field 'description'. - * - * @return the value of field 'Description'. - */ - public java.lang.String getDescription( - ) { - return this._description; - } - - /** - * Returns the value of field 'displayCharacter'. - * - * @return the value of field 'DisplayCharacter'. - */ - public java.lang.String getDisplayCharacter( - ) { - return this._displayCharacter; - } - - /** - * Returns the value of field 'position'. - * - * @return the value of field 'Position'. - */ - public int getPosition( - ) { - return this._position; - } - - /** - * Returns the value of field 'secondaryStructure'. - * - * @return the value of field 'SecondaryStructure'. - */ - public java.lang.String getSecondaryStructure( - ) { - return this._secondaryStructure; - } - - /** - * Returns the value of field 'value'. - * - * @return the value of field 'Value'. - */ - public float getValue( - ) { - return this._value; - } - - /** - * Method hasPosition. - * - * @return true if at least one Position has been added - */ - public boolean hasPosition( - ) { - return this._has_position; - } - - /** - * Method hasValue. - * - * @return true if at least one Value has been added - */ - public boolean hasValue( - ) { - return this._has_value; - } - - /** - * 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 class AnnotationElement implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _position. + */ + private int _position; + + /** + * keeps track of state for field: _position + */ + private boolean _has_position; + + /** + * Field _displayCharacter. + */ + private java.lang.String _displayCharacter; + + /** + * Field _description. + */ + private java.lang.String _description; + + /** + * Field _secondaryStructure. + */ + private java.lang.String _secondaryStructure; + + /** + * Field _value. + */ + private float _value; + + /** + * keeps track of state for field: _value + */ + private boolean _has_value; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public AnnotationElement() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'description'. - * - * @param description the value of field 'description'. - */ - public void setDescription( - final java.lang.String description) { - this._description = description; - } - - /** - * Sets the value of field 'displayCharacter'. - * - * @param displayCharacter the value of field 'displayCharacter' - */ - public void setDisplayCharacter( - final java.lang.String displayCharacter) { - this._displayCharacter = displayCharacter; - } - - /** - * Sets the value of field 'position'. - * - * @param position the value of field 'position'. - */ - public void setPosition( - final int position) { - this._position = position; - this._has_position = true; - } - - /** - * Sets the value of field 'secondaryStructure'. - * - * @param secondaryStructure the value of field - * 'secondaryStructure'. - */ - public void setSecondaryStructure( - final java.lang.String secondaryStructure) { - this._secondaryStructure = secondaryStructure; - } - - /** - * Sets the value of field 'value'. - * - * @param value the value of field 'value'. - */ - public void setValue( - final float value) { - this._value = value; - this._has_value = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled jalview.binding.AnnotationElement - */ - public static jalview.binding.AnnotationElement unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.AnnotationElement) Unmarshaller.unmarshal(jalview.binding.AnnotationElement.class, reader); - } + public void deletePosition() + { + this._has_position = false; + } - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema + /** */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); + public void deleteValue() + { + this._has_value = false; + } + + /** + * Returns the value of field 'description'. + * + * @return the value of field 'Description'. + */ + public java.lang.String getDescription() + { + return this._description; + } + + /** + * Returns the value of field 'displayCharacter'. + * + * @return the value of field 'DisplayCharacter'. + */ + public java.lang.String getDisplayCharacter() + { + return this._displayCharacter; + } + + /** + * Returns the value of field 'position'. + * + * @return the value of field 'Position'. + */ + public int getPosition() + { + return this._position; + } + + /** + * Returns the value of field 'secondaryStructure'. + * + * @return the value of field 'SecondaryStructure'. + */ + public java.lang.String getSecondaryStructure() + { + return this._secondaryStructure; + } + + /** + * Returns the value of field 'value'. + * + * @return the value of field 'Value'. + */ + public float getValue() + { + return this._value; + } + + /** + * Method hasPosition. + * + * @return true if at least one Position has been added + */ + public boolean hasPosition() + { + return this._has_position; + } + + /** + * Method hasValue. + * + * @return true if at least one Value has been added + */ + public boolean hasValue() + { + return this._has_value; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'description'. + * + * @param description + * the value of field 'description'. + */ + public void setDescription(final java.lang.String description) + { + this._description = description; + } + + /** + * Sets the value of field 'displayCharacter'. + * + * @param displayCharacter + * the value of field 'displayCharacter' + */ + public void setDisplayCharacter(final java.lang.String displayCharacter) + { + this._displayCharacter = displayCharacter; + } + + /** + * Sets the value of field 'position'. + * + * @param position + * the value of field 'position'. + */ + public void setPosition(final int position) + { + this._position = position; + this._has_position = true; + } + + /** + * Sets the value of field 'secondaryStructure'. + * + * @param secondaryStructure + * the value of field 'secondaryStructure'. + */ + public void setSecondaryStructure( + final java.lang.String secondaryStructure) + { + this._secondaryStructure = secondaryStructure; + } + + /** + * Sets the value of field 'value'. + * + * @param value + * the value of field 'value'. + */ + public void setValue(final float value) + { + this._value = value; + this._has_value = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.binding.AnnotationElement + */ + public static jalview.binding.AnnotationElement unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.AnnotationElement) Unmarshaller.unmarshal( + jalview.binding.AnnotationElement.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/binding/Colour.java b/src/jalview/binding/Colour.java index c041723..c1de152 100644 --- a/src/jalview/binding/Colour.java +++ b/src/jalview/binding/Colour.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,465 +19,480 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Colour implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _name. - */ - private java.lang.String _name; - - /** - * Field _RGB. - */ - private java.lang.String _RGB; - - /** - * Field _minRGB. - */ - private java.lang.String _minRGB; - - /** - * loosely specified enumeration: NONE,ABOVE, or BELOW - */ - private java.lang.String _threshType; - - /** - * Field _threshold. - */ - private float _threshold; - - /** - * keeps track of state for field: _threshold - */ - private boolean _has_threshold; - - /** - * Field _max. - */ - private float _max; - - /** - * keeps track of state for field: _max - */ - private boolean _has_max; - - /** - * Field _min. - */ - private float _min; - - /** - * keeps track of state for field: _min - */ - private boolean _has_min; - - /** - * Field _colourByLabel. - */ - private boolean _colourByLabel; - - /** - * keeps track of state for field: _colourByLabel - */ - private boolean _has_colourByLabel; - - /** - * Field _autoScale. - */ - private boolean _autoScale; - - /** - * keeps track of state for field: _autoScale - */ - private boolean _has_autoScale; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Colour() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deleteAutoScale( - ) { - this._has_autoScale= false; - } - - /** - */ - public void deleteColourByLabel( - ) { - this._has_colourByLabel= false; - } - - /** - */ - public void deleteMax( - ) { - this._has_max= false; - } - - /** - */ - public void deleteMin( - ) { - this._has_min= false; - } - - /** - */ - public void deleteThreshold( - ) { - this._has_threshold= false; - } - - /** - * Returns the value of field 'autoScale'. - * - * @return the value of field 'AutoScale'. - */ - public boolean getAutoScale( - ) { - return this._autoScale; - } - - /** - * Returns the value of field 'colourByLabel'. - * - * @return the value of field 'ColourByLabel'. - */ - public boolean getColourByLabel( - ) { - return this._colourByLabel; - } - - /** - * Returns the value of field 'max'. - * - * @return the value of field 'Max'. - */ - public float getMax( - ) { - return this._max; - } - - /** - * Returns the value of field 'min'. - * - * @return the value of field 'Min'. - */ - public float getMin( - ) { - return this._min; - } - - /** - * Returns the value of field 'minRGB'. - * - * @return the value of field 'MinRGB'. - */ - public java.lang.String getMinRGB( - ) { - return this._minRGB; - } - - /** - * Returns the value of field 'name'. - * - * @return the value of field 'Name'. - */ - public java.lang.String getName( - ) { - return this._name; - } - - /** - * Returns the value of field 'RGB'. - * - * @return the value of field 'RGB'. - */ - public java.lang.String getRGB( - ) { - return this._RGB; - } - - /** - * Returns the value of field 'threshType'. The field - * 'threshType' has the following description: loosely - * specified enumeration: NONE,ABOVE, or BELOW - * - * @return the value of field 'ThreshType'. - */ - public java.lang.String getThreshType( - ) { - return this._threshType; - } - - /** - * Returns the value of field 'threshold'. - * - * @return the value of field 'Threshold'. - */ - public float getThreshold( - ) { - return this._threshold; - } - - /** - * Method hasAutoScale. - * - * @return true if at least one AutoScale has been added - */ - public boolean hasAutoScale( - ) { - return this._has_autoScale; - } - - /** - * Method hasColourByLabel. - * - * @return true if at least one ColourByLabel has been added - */ - public boolean hasColourByLabel( - ) { - return this._has_colourByLabel; - } - - /** - * Method hasMax. - * - * @return true if at least one Max has been added - */ - public boolean hasMax( - ) { - return this._has_max; - } - - /** - * Method hasMin. - * - * @return true if at least one Min has been added - */ - public boolean hasMin( - ) { - return this._has_min; - } - - /** - * Method hasThreshold. - * - * @return true if at least one Threshold has been added - */ - public boolean hasThreshold( - ) { - return this._has_threshold; - } - - /** - * Returns the value of field 'autoScale'. - * - * @return the value of field 'AutoScale'. - */ - public boolean isAutoScale( - ) { - return this._autoScale; - } - - /** - * Returns the value of field 'colourByLabel'. - * - * @return the value of field 'ColourByLabel'. - */ - public boolean isColourByLabel( - ) { - return this._colourByLabel; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'autoScale'. - * - * @param autoScale the value of field 'autoScale'. - */ - public void setAutoScale( - final boolean autoScale) { - this._autoScale = autoScale; - this._has_autoScale = true; - } - - /** - * Sets the value of field 'colourByLabel'. - * - * @param colourByLabel the value of field 'colourByLabel'. - */ - public void setColourByLabel( - final boolean colourByLabel) { - this._colourByLabel = colourByLabel; - this._has_colourByLabel = true; - } - - /** - * Sets the value of field 'max'. - * - * @param max the value of field 'max'. - */ - public void setMax( - final float max) { - this._max = max; - this._has_max = true; - } - - /** - * Sets the value of field 'min'. - * - * @param min the value of field 'min'. - */ - public void setMin( - final float min) { - this._min = min; - this._has_min = true; - } - - /** - * Sets the value of field 'minRGB'. - * - * @param minRGB the value of field 'minRGB'. - */ - public void setMinRGB( - final java.lang.String minRGB) { - this._minRGB = minRGB; - } - - /** - * Sets the value of field 'name'. - * - * @param name the value of field 'name'. - */ - public void setName( - final java.lang.String name) { - this._name = name; - } - - /** - * Sets the value of field 'RGB'. - * - * @param RGB the value of field 'RGB'. - */ - public void setRGB( - final java.lang.String RGB) { - this._RGB = RGB; - } - - /** - * Sets the value of field 'threshType'. The field 'threshType' - * has the following description: loosely specified - * enumeration: NONE,ABOVE, or BELOW - * - * @param threshType the value of field 'threshType'. - */ - public void setThreshType( - final java.lang.String threshType) { - this._threshType = threshType; - } - - /** - * Sets the value of field 'threshold'. - * - * @param threshold the value of field 'threshold'. - */ - public void setThreshold( - final float threshold) { - this._threshold = threshold; - this._has_threshold = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled jalview.binding.Colour - */ - public static jalview.binding.Colour unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.Colour) Unmarshaller.unmarshal(jalview.binding.Colour.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class Colour implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _name. + */ + private java.lang.String _name; + + /** + * Field _RGB. + */ + private java.lang.String _RGB; + + /** + * Field _minRGB. + */ + private java.lang.String _minRGB; + + /** + * loosely specified enumeration: NONE,ABOVE, or BELOW + */ + private java.lang.String _threshType; + + /** + * Field _threshold. + */ + private float _threshold; + + /** + * keeps track of state for field: _threshold + */ + private boolean _has_threshold; + + /** + * Field _max. + */ + private float _max; + + /** + * keeps track of state for field: _max + */ + private boolean _has_max; + + /** + * Field _min. + */ + private float _min; + + /** + * keeps track of state for field: _min + */ + private boolean _has_min; + + /** + * Field _colourByLabel. + */ + private boolean _colourByLabel; + + /** + * keeps track of state for field: _colourByLabel + */ + private boolean _has_colourByLabel; + + /** + * Field _autoScale. + */ + private boolean _autoScale; + + /** + * keeps track of state for field: _autoScale + */ + private boolean _has_autoScale; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Colour() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + */ + public void deleteAutoScale() + { + this._has_autoScale = false; + } + + /** + */ + public void deleteColourByLabel() + { + this._has_colourByLabel = false; + } + + /** + */ + public void deleteMax() + { + this._has_max = false; + } + + /** + */ + public void deleteMin() + { + this._has_min = false; + } + + /** + */ + public void deleteThreshold() + { + this._has_threshold = false; + } + + /** + * Returns the value of field 'autoScale'. + * + * @return the value of field 'AutoScale'. + */ + public boolean getAutoScale() + { + return this._autoScale; + } + + /** + * Returns the value of field 'colourByLabel'. + * + * @return the value of field 'ColourByLabel'. + */ + public boolean getColourByLabel() + { + return this._colourByLabel; + } + + /** + * Returns the value of field 'max'. + * + * @return the value of field 'Max'. + */ + public float getMax() + { + return this._max; + } + + /** + * Returns the value of field 'min'. + * + * @return the value of field 'Min'. + */ + public float getMin() + { + return this._min; + } + + /** + * Returns the value of field 'minRGB'. + * + * @return the value of field 'MinRGB'. + */ + public java.lang.String getMinRGB() + { + return this._minRGB; + } + + /** + * Returns the value of field 'name'. + * + * @return the value of field 'Name'. + */ + public java.lang.String getName() + { + return this._name; + } + + /** + * Returns the value of field 'RGB'. + * + * @return the value of field 'RGB'. + */ + public java.lang.String getRGB() + { + return this._RGB; + } + + /** + * Returns the value of field 'threshType'. The field 'threshType' has the + * following description: loosely specified enumeration: NONE,ABOVE, or BELOW + * + * @return the value of field 'ThreshType'. + */ + public java.lang.String getThreshType() + { + return this._threshType; + } + + /** + * Returns the value of field 'threshold'. + * + * @return the value of field 'Threshold'. + */ + public float getThreshold() + { + return this._threshold; + } + + /** + * Method hasAutoScale. + * + * @return true if at least one AutoScale has been added + */ + public boolean hasAutoScale() + { + return this._has_autoScale; + } + + /** + * Method hasColourByLabel. + * + * @return true if at least one ColourByLabel has been added + */ + public boolean hasColourByLabel() + { + return this._has_colourByLabel; + } + + /** + * Method hasMax. + * + * @return true if at least one Max has been added + */ + public boolean hasMax() + { + return this._has_max; + } + + /** + * Method hasMin. + * + * @return true if at least one Min has been added + */ + public boolean hasMin() + { + return this._has_min; + } + + /** + * Method hasThreshold. + * + * @return true if at least one Threshold has been added + */ + public boolean hasThreshold() + { + return this._has_threshold; + } + + /** + * Returns the value of field 'autoScale'. + * + * @return the value of field 'AutoScale'. + */ + public boolean isAutoScale() + { + return this._autoScale; + } + + /** + * Returns the value of field 'colourByLabel'. + * + * @return the value of field 'ColourByLabel'. + */ + public boolean isColourByLabel() + { + return this._colourByLabel; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; + } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'autoScale'. + * + * @param autoScale + * the value of field 'autoScale'. + */ + public void setAutoScale(final boolean autoScale) + { + this._autoScale = autoScale; + this._has_autoScale = true; + } + + /** + * Sets the value of field 'colourByLabel'. + * + * @param colourByLabel + * the value of field 'colourByLabel'. + */ + public void setColourByLabel(final boolean colourByLabel) + { + this._colourByLabel = colourByLabel; + this._has_colourByLabel = true; + } + + /** + * Sets the value of field 'max'. + * + * @param max + * the value of field 'max'. + */ + public void setMax(final float max) + { + this._max = max; + this._has_max = true; + } + + /** + * Sets the value of field 'min'. + * + * @param min + * the value of field 'min'. + */ + public void setMin(final float min) + { + this._min = min; + this._has_min = true; + } + + /** + * Sets the value of field 'minRGB'. + * + * @param minRGB + * the value of field 'minRGB'. + */ + public void setMinRGB(final java.lang.String minRGB) + { + this._minRGB = minRGB; + } + + /** + * Sets the value of field 'name'. + * + * @param name + * the value of field 'name'. + */ + public void setName(final java.lang.String name) + { + this._name = name; + } + + /** + * Sets the value of field 'RGB'. + * + * @param RGB + * the value of field 'RGB'. + */ + public void setRGB(final java.lang.String RGB) + { + this._RGB = RGB; + } + + /** + * Sets the value of field 'threshType'. The field 'threshType' has the + * following description: loosely specified enumeration: NONE,ABOVE, or BELOW + * + * @param threshType + * the value of field 'threshType'. + */ + public void setThreshType(final java.lang.String threshType) + { + this._threshType = threshType; + } + + /** + * Sets the value of field 'threshold'. + * + * @param threshold + * the value of field 'threshold'. + */ + public void setThreshold(final float threshold) + { + this._threshold = threshold; + this._has_threshold = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.binding.Colour + */ + public static jalview.binding.Colour unmarshal(final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.Colour) Unmarshaller.unmarshal( + jalview.binding.Colour.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/binding/Feature.java b/src/jalview/binding/Feature.java index d429df3..1cb6eee 100644 --- a/src/jalview/binding/Feature.java +++ b/src/jalview/binding/Feature.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,272 +19,286 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Feature implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _begin. - */ - private int _begin; - - /** - * keeps track of state for field: _begin - */ - private boolean _has_begin; - - /** - * Field _end. - */ - private int _end; - - /** - * keeps track of state for field: _end - */ - private boolean _has_end; - - /** - * Field _type. - */ - private java.lang.String _type; - - /** - * Field _description. - */ - private java.lang.String _description; - - /** - * Field _status. - */ - private java.lang.String _status; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Feature() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deleteBegin( - ) { - this._has_begin= false; - } - - /** - */ - public void deleteEnd( - ) { - this._has_end= false; - } - - /** - * Returns the value of field 'begin'. - * - * @return the value of field 'Begin'. - */ - public int getBegin( - ) { - return this._begin; - } - - /** - * Returns the value of field 'description'. - * - * @return the value of field 'Description'. - */ - public java.lang.String getDescription( - ) { - return this._description; - } - - /** - * Returns the value of field 'end'. - * - * @return the value of field 'End'. - */ - public int getEnd( - ) { - return this._end; - } - - /** - * Returns the value of field 'status'. - * - * @return the value of field 'Status'. - */ - public java.lang.String getStatus( - ) { - return this._status; - } - - /** - * Returns the value of field 'type'. - * - * @return the value of field 'Type'. - */ - public java.lang.String getType( - ) { - return this._type; - } - - /** - * Method hasBegin. - * - * @return true if at least one Begin has been added - */ - public boolean hasBegin( - ) { - return this._has_begin; - } - - /** - * Method hasEnd. - * - * @return true if at least one End has been added - */ - public boolean hasEnd( - ) { - return this._has_end; - } - - /** - * 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 class Feature implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _begin. + */ + private int _begin; + + /** + * keeps track of state for field: _begin + */ + private boolean _has_begin; + + /** + * Field _end. + */ + private int _end; + + /** + * keeps track of state for field: _end + */ + private boolean _has_end; + + /** + * Field _type. + */ + private java.lang.String _type; + + /** + * Field _description. + */ + private java.lang.String _description; + + /** + * Field _status. + */ + private java.lang.String _status; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Feature() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'begin'. - * - * @param begin the value of field 'begin'. - */ - public void setBegin( - final int begin) { - this._begin = begin; - this._has_begin = true; - } - - /** - * Sets the value of field 'description'. - * - * @param description the value of field 'description'. - */ - public void setDescription( - final java.lang.String description) { - this._description = description; - } - - /** - * Sets the value of field 'end'. - * - * @param end the value of field 'end'. - */ - public void setEnd( - final int end) { - this._end = end; - this._has_end = true; - } - - /** - * Sets the value of field 'status'. - * - * @param status the value of field 'status'. - */ - public void setStatus( - final java.lang.String status) { - this._status = status; - } - - /** - * Sets the value of field 'type'. - * - * @param type the value of field 'type'. - */ - public void setType( - final java.lang.String type) { - this._type = type; - } - - /** - * 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.binding.Feature - */ - public static jalview.binding.Feature unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.Feature) Unmarshaller.unmarshal(jalview.binding.Feature.class, reader); - } + public void deleteBegin() + { + this._has_begin = false; + } - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema + /** */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); + public void deleteEnd() + { + this._has_end = false; + } + + /** + * Returns the value of field 'begin'. + * + * @return the value of field 'Begin'. + */ + public int getBegin() + { + return this._begin; + } + + /** + * Returns the value of field 'description'. + * + * @return the value of field 'Description'. + */ + public java.lang.String getDescription() + { + return this._description; + } + + /** + * Returns the value of field 'end'. + * + * @return the value of field 'End'. + */ + public int getEnd() + { + return this._end; + } + + /** + * Returns the value of field 'status'. + * + * @return the value of field 'Status'. + */ + public java.lang.String getStatus() + { + return this._status; + } + + /** + * Returns the value of field 'type'. + * + * @return the value of field 'Type'. + */ + public java.lang.String getType() + { + return this._type; + } + + /** + * Method hasBegin. + * + * @return true if at least one Begin has been added + */ + public boolean hasBegin() + { + return this._has_begin; + } + + /** + * Method hasEnd. + * + * @return true if at least one End has been added + */ + public boolean hasEnd() + { + return this._has_end; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'begin'. + * + * @param begin + * the value of field 'begin'. + */ + public void setBegin(final int begin) + { + this._begin = begin; + this._has_begin = true; + } + + /** + * Sets the value of field 'description'. + * + * @param description + * the value of field 'description'. + */ + public void setDescription(final java.lang.String description) + { + this._description = description; + } + + /** + * Sets the value of field 'end'. + * + * @param end + * the value of field 'end'. + */ + public void setEnd(final int end) + { + this._end = end; + this._has_end = true; + } + + /** + * Sets the value of field 'status'. + * + * @param status + * the value of field 'status'. + */ + public void setStatus(final java.lang.String status) + { + this._status = status; + } + + /** + * Sets the value of field 'type'. + * + * @param type + * the value of field 'type'. + */ + public void setType(final java.lang.String type) + { + this._type = type; + } + + /** + * 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.binding.Feature + */ + public static jalview.binding.Feature unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.Feature) Unmarshaller.unmarshal( + jalview.binding.Feature.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/binding/FeatureSettings.java b/src/jalview/binding/FeatureSettings.java index f3d06be..c4d5c4f 100644 --- a/src/jalview/binding/FeatureSettings.java +++ b/src/jalview/binding/FeatureSettings.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,257 +19,271 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class FeatureSettings implements java.io.Serializable { +public class FeatureSettings implements java.io.Serializable +{ + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ + /** + * Field _settingList. + */ + private java.util.Vector _settingList; - /** - * Field _settingList. - */ - private java.util.Vector _settingList; + // ----------------/ + // - Constructors -/ + // ----------------/ + public FeatureSettings() + { + super(); + this._settingList = new java.util.Vector(); + } - //----------------/ - //- Constructors -/ - //----------------/ + // -----------/ + // - Methods -/ + // -----------/ - public FeatureSettings() { - super(); - this._settingList = new java.util.Vector(); - } + /** + * + * + * @param vSetting + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSetting(final jalview.binding.Setting vSetting) + throws java.lang.IndexOutOfBoundsException + { + this._settingList.addElement(vSetting); + } + /** + * + * + * @param index + * @param vSetting + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSetting(final int index, + final jalview.binding.Setting vSetting) + throws java.lang.IndexOutOfBoundsException + { + this._settingList.add(index, vSetting); + } - //-----------/ - //- Methods -/ - //-----------/ + /** + * Method enumerateSetting. + * + * @return an Enumeration over all jalview.binding.Setting elements + */ + public java.util.Enumeration enumerateSetting() + { + return this._settingList.elements(); + } - /** - * - * - * @param vSetting - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSetting( - final jalview.binding.Setting vSetting) - throws java.lang.IndexOutOfBoundsException { - this._settingList.addElement(vSetting); + /** + * Method getSetting. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.binding.Setting at the given index + */ + public jalview.binding.Setting getSetting(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._settingList.size()) + { + throw new IndexOutOfBoundsException("getSetting: Index value '" + + index + "' not in range [0.." + + (this._settingList.size() - 1) + "]"); } - /** - * - * - * @param index - * @param vSetting - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSetting( - final int index, - final jalview.binding.Setting vSetting) - throws java.lang.IndexOutOfBoundsException { - this._settingList.add(index, vSetting); - } + return (jalview.binding.Setting) _settingList.get(index); + } - /** - * Method enumerateSetting. - * - * @return an Enumeration over all jalview.binding.Setting - * elements - */ - public java.util.Enumeration enumerateSetting( - ) { - return this._settingList.elements(); - } + /** + * Method getSetting.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 jalview.binding.Setting[] getSetting() + { + jalview.binding.Setting[] array = new jalview.binding.Setting[0]; + return (jalview.binding.Setting[]) this._settingList.toArray(array); + } - /** - * Method getSetting. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the jalview.binding.Setting at the - * given index - */ - public jalview.binding.Setting getSetting( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._settingList.size()) { - throw new IndexOutOfBoundsException("getSetting: Index value '" + index + "' not in range [0.." + (this._settingList.size() - 1) + "]"); - } - - return (jalview.binding.Setting) _settingList.get(index); - } + /** + * Method getSettingCount. + * + * @return the size of this collection + */ + public int getSettingCount() + { + return this._settingList.size(); + } - /** - * Method getSetting.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 jalview.binding.Setting[] getSetting( - ) { - jalview.binding.Setting[] array = new jalview.binding.Setting[0]; - return (jalview.binding.Setting[]) this._settingList.toArray(array); + /** + * 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; + } - /** - * Method getSettingCount. - * - * @return the size of this collection - */ - public int getSettingCount( - ) { - return this._settingList.size(); - } + /** + * + * + * @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); + } - /** - * 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 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); + } - /** - * - * - * @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); - } + public void removeAllSetting() + { + this._settingList.clear(); + } - /** - * - * - * @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); - } + /** + * Method removeSetting. + * + * @param vSetting + * @return true if the object was removed from the collection. + */ + public boolean removeSetting(final jalview.binding.Setting vSetting) + { + boolean removed = _settingList.remove(vSetting); + return removed; + } - /** - */ - public void removeAllSetting( - ) { - this._settingList.clear(); - } + /** + * Method removeSettingAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.binding.Setting removeSettingAt(final int index) + { + java.lang.Object obj = this._settingList.remove(index); + return (jalview.binding.Setting) obj; + } - /** - * Method removeSetting. - * - * @param vSetting - * @return true if the object was removed from the collection. - */ - public boolean removeSetting( - final jalview.binding.Setting vSetting) { - boolean removed = _settingList.remove(vSetting); - return removed; + /** + * + * + * @param index + * @param vSetting + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setSetting(final int index, + final jalview.binding.Setting vSetting) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._settingList.size()) + { + throw new IndexOutOfBoundsException("setSetting: Index value '" + + index + "' not in range [0.." + + (this._settingList.size() - 1) + "]"); } - /** - * Method removeSettingAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.binding.Setting removeSettingAt( - final int index) { - java.lang.Object obj = this._settingList.remove(index); - return (jalview.binding.Setting) obj; - } + this._settingList.set(index, vSetting); + } - /** - * - * - * @param index - * @param vSetting - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setSetting( - final int index, - final jalview.binding.Setting vSetting) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._settingList.size()) { - throw new IndexOutOfBoundsException("setSetting: Index value '" + index + "' not in range [0.." + (this._settingList.size() - 1) + "]"); - } - - this._settingList.set(index, vSetting); - } + /** + * + * + * @param vSettingArray + */ + public void setSetting(final jalview.binding.Setting[] vSettingArray) + { + // -- copy array + _settingList.clear(); - /** - * - * - * @param vSettingArray - */ - public void setSetting( - final jalview.binding.Setting[] vSettingArray) { - //-- copy array - _settingList.clear(); - - for (int i = 0; i < vSettingArray.length; i++) { - this._settingList.add(vSettingArray[i]); - } + for (int i = 0; i < vSettingArray.length; i++) + { + this._settingList.add(vSettingArray[i]); } + } - /** - * 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.binding.FeatureSettings - */ - public static jalview.binding.FeatureSettings unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.FeatureSettings) Unmarshaller.unmarshal(jalview.binding.FeatureSettings.class, reader); - } + /** + * 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.binding.FeatureSettings + */ + public static jalview.binding.FeatureSettings unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.FeatureSettings) Unmarshaller.unmarshal( + jalview.binding.FeatureSettings.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); - } + /** + * + * + * @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/binding/Features.java b/src/jalview/binding/Features.java index e50ae7c..c730f4b 100644 --- a/src/jalview/binding/Features.java +++ b/src/jalview/binding/Features.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,98 +19,106 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Features extends Feature -implements java.io.Serializable +public class Features extends Feature implements java.io.Serializable { + // ----------------/ + // - Constructors -/ + // ----------------/ - //----------------/ - //- Constructors -/ - //----------------/ - - public Features() { - super(); - } - + public Features() + { + super(); + } - //-----------/ - //- Methods -/ - //-----------/ + // -----------/ + // - Methods -/ + // -----------/ - /** - * 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; + /** + * 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 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); - } + /** + * + * + * @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); + } - /** - * 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.binding.Feature - */ - public static jalview.binding.Feature unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.Feature) Unmarshaller.unmarshal(jalview.binding.Features.class, reader); - } + /** + * 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.binding.Feature + */ + public static jalview.binding.Feature unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.Feature) Unmarshaller.unmarshal( + jalview.binding.Features.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); - } + /** + * + * + * @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/binding/JGroup.java b/src/jalview/binding/JGroup.java index 862eebd..477cc30 100644 --- a/src/jalview/binding/JGroup.java +++ b/src/jalview/binding/JGroup.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,721 +19,742 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class JGroup implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _start. - */ - private int _start; - - /** - * keeps track of state for field: _start - */ - private boolean _has_start; - - /** - * Field _end. - */ - private int _end; - - /** - * keeps track of state for field: _end - */ - private boolean _has_end; - - /** - * Field _name. - */ - private java.lang.String _name; - - /** - * Field _colour. - */ - private java.lang.String _colour; - - /** - * Field _consThreshold. - */ - private int _consThreshold; - - /** - * keeps track of state for field: _consThreshold - */ - private boolean _has_consThreshold; - - /** - * Field _pidThreshold. - */ - private int _pidThreshold; - - /** - * keeps track of state for field: _pidThreshold - */ - private boolean _has_pidThreshold; - - /** - * Field _outlineColour. - */ - private int _outlineColour; - - /** - * keeps track of state for field: _outlineColour - */ - private boolean _has_outlineColour; - - /** - * Field _displayBoxes. - */ - private boolean _displayBoxes; - - /** - * keeps track of state for field: _displayBoxes - */ - private boolean _has_displayBoxes; - - /** - * Field _displayText. - */ - private boolean _displayText; - - /** - * keeps track of state for field: _displayText - */ - private boolean _has_displayText; - - /** - * Field _colourText. - */ - private boolean _colourText; - - /** - * keeps track of state for field: _colourText - */ - private boolean _has_colourText; - - /** - * Field _seqList. - */ - private java.util.Vector _seqList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public JGroup() { - super(); - this._seqList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vSeq - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSeq( - final int vSeq) - throws java.lang.IndexOutOfBoundsException { - this._seqList.addElement(new java.lang.Integer(vSeq)); - } - - /** - * - * - * @param index - * @param vSeq - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSeq( - final int index, - final int vSeq) - throws java.lang.IndexOutOfBoundsException { - this._seqList.add(index, new java.lang.Integer(vSeq)); - } - - /** - */ - public void deleteColourText( - ) { - this._has_colourText= false; - } - - /** - */ - public void deleteConsThreshold( - ) { - this._has_consThreshold= false; - } - - /** - */ - public void deleteDisplayBoxes( - ) { - this._has_displayBoxes= false; - } - - /** - */ - public void deleteDisplayText( - ) { - this._has_displayText= false; - } - - /** - */ - public void deleteEnd( - ) { - this._has_end= false; - } - - /** - */ - public void deleteOutlineColour( - ) { - this._has_outlineColour= false; - } - - /** - */ - public void deletePidThreshold( - ) { - this._has_pidThreshold= false; - } - - /** - */ - public void deleteStart( - ) { - this._has_start= false; - } - - /** - * Method enumerateSeq. - * - * @return an Enumeration over all int elements - */ - public java.util.Enumeration enumerateSeq( - ) { - return this._seqList.elements(); - } - - /** - * Returns the value of field 'colour'. - * - * @return the value of field 'Colour'. - */ - public java.lang.String getColour( - ) { - return this._colour; - } - - /** - * Returns the value of field 'colourText'. - * - * @return the value of field 'ColourText'. - */ - public boolean getColourText( - ) { - return this._colourText; - } - - /** - * Returns the value of field 'consThreshold'. - * - * @return the value of field 'ConsThreshold'. - */ - public int getConsThreshold( - ) { - return this._consThreshold; - } - - /** - * Returns the value of field 'displayBoxes'. - * - * @return the value of field 'DisplayBoxes'. - */ - public boolean getDisplayBoxes( - ) { - return this._displayBoxes; - } - - /** - * Returns the value of field 'displayText'. - * - * @return the value of field 'DisplayText'. - */ - public boolean getDisplayText( - ) { - return this._displayText; - } - - /** - * Returns the value of field 'end'. - * - * @return the value of field 'End'. - */ - public int getEnd( - ) { - return this._end; - } - - /** - * Returns the value of field 'name'. - * - * @return the value of field 'Name'. - */ - public java.lang.String getName( - ) { - return this._name; - } - - /** - * Returns the value of field 'outlineColour'. - * - * @return the value of field 'OutlineColour'. - */ - public int getOutlineColour( - ) { - return this._outlineColour; - } - - /** - * Returns the value of field 'pidThreshold'. - * - * @return the value of field 'PidThreshold'. - */ - public int getPidThreshold( - ) { - return this._pidThreshold; - } - - /** - * Method getSeq. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the int at the given index - */ - public int getSeq( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._seqList.size()) { - throw new IndexOutOfBoundsException("getSeq: Index value '" + index + "' not in range [0.." + (this._seqList.size() - 1) + "]"); - } - - return ((java.lang.Integer) _seqList.get(index)).intValue(); - } - - /** - * Method getSeq.Returns the contents of the collection in an - * Array. - * - * @return this collection as an Array - */ - public int[] getSeq( - ) { - int size = this._seqList.size(); - int[] array = new int[size]; - java.util.Iterator iter = _seqList.iterator(); - for (int index = 0; index < size; index++) { - array[index] = ((java.lang.Integer) iter.next()).intValue(); - } - return array; - } - - /** - * Method getSeqCount. - * - * @return the size of this collection - */ - public int getSeqCount( - ) { - return this._seqList.size(); - } - - /** - * Returns the value of field 'start'. - * - * @return the value of field 'Start'. - */ - public int getStart( - ) { - return this._start; - } - - /** - * Method hasColourText. - * - * @return true if at least one ColourText has been added - */ - public boolean hasColourText( - ) { - return this._has_colourText; - } - - /** - * Method hasConsThreshold. - * - * @return true if at least one ConsThreshold has been added - */ - public boolean hasConsThreshold( - ) { - return this._has_consThreshold; - } - - /** - * Method hasDisplayBoxes. - * - * @return true if at least one DisplayBoxes has been added - */ - public boolean hasDisplayBoxes( - ) { - return this._has_displayBoxes; - } - - /** - * Method hasDisplayText. - * - * @return true if at least one DisplayText has been added - */ - public boolean hasDisplayText( - ) { - return this._has_displayText; - } - - /** - * Method hasEnd. - * - * @return true if at least one End has been added - */ - public boolean hasEnd( - ) { - return this._has_end; - } - - /** - * Method hasOutlineColour. - * - * @return true if at least one OutlineColour has been added - */ - public boolean hasOutlineColour( - ) { - return this._has_outlineColour; - } - - /** - * Method hasPidThreshold. - * - * @return true if at least one PidThreshold has been added - */ - public boolean hasPidThreshold( - ) { - return this._has_pidThreshold; - } - - /** - * Method hasStart. - * - * @return true if at least one Start has been added - */ - public boolean hasStart( - ) { - return this._has_start; - } - - /** - * Returns the value of field 'colourText'. - * - * @return the value of field 'ColourText'. - */ - public boolean isColourText( - ) { - return this._colourText; - } - - /** - * Returns the value of field 'displayBoxes'. - * - * @return the value of field 'DisplayBoxes'. - */ - public boolean isDisplayBoxes( - ) { - return this._displayBoxes; - } - - /** - * Returns the value of field 'displayText'. - * - * @return the value of field 'DisplayText'. - */ - public boolean isDisplayText( - ) { - return this._displayText; - } - - /** - * 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 removeAllSeq( - ) { - this._seqList.clear(); - } - - /** - * Method removeSeq. - * - * @param vSeq - * @return true if the object was removed from the collection. - */ - public boolean removeSeq( - final int vSeq) { - boolean removed = _seqList.remove(new java.lang.Integer(vSeq)); - return removed; - } - - /** - * Method removeSeqAt. - * - * @param index - * @return the element removed from the collection - */ - public int removeSeqAt( - final int index) { - java.lang.Object obj = this._seqList.remove(index); - return ((java.lang.Integer) obj).intValue(); - } - - /** - * Sets the value of field 'colour'. - * - * @param colour the value of field 'colour'. - */ - public void setColour( - final java.lang.String colour) { - this._colour = colour; - } - - /** - * Sets the value of field 'colourText'. - * - * @param colourText the value of field 'colourText'. - */ - public void setColourText( - final boolean colourText) { - this._colourText = colourText; - this._has_colourText = true; - } - - /** - * Sets the value of field 'consThreshold'. - * - * @param consThreshold the value of field 'consThreshold'. - */ - public void setConsThreshold( - final int consThreshold) { - this._consThreshold = consThreshold; - this._has_consThreshold = true; - } - - /** - * Sets the value of field 'displayBoxes'. - * - * @param displayBoxes the value of field 'displayBoxes'. - */ - public void setDisplayBoxes( - final boolean displayBoxes) { - this._displayBoxes = displayBoxes; - this._has_displayBoxes = true; - } - - /** - * Sets the value of field 'displayText'. - * - * @param displayText the value of field 'displayText'. - */ - public void setDisplayText( - final boolean displayText) { - this._displayText = displayText; - this._has_displayText = true; - } - - /** - * Sets the value of field 'end'. - * - * @param end the value of field 'end'. - */ - public void setEnd( - final int end) { - this._end = end; - this._has_end = true; - } - - /** - * Sets the value of field 'name'. - * - * @param name the value of field 'name'. - */ - public void setName( - final java.lang.String name) { - this._name = name; - } - - /** - * Sets the value of field 'outlineColour'. - * - * @param outlineColour the value of field 'outlineColour'. - */ - public void setOutlineColour( - final int outlineColour) { - this._outlineColour = outlineColour; - this._has_outlineColour = true; - } - - /** - * Sets the value of field 'pidThreshold'. - * - * @param pidThreshold the value of field 'pidThreshold'. - */ - public void setPidThreshold( - final int pidThreshold) { - this._pidThreshold = pidThreshold; - this._has_pidThreshold = true; - } - - /** - * - * - * @param index - * @param vSeq - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setSeq( - final int index, - final int vSeq) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._seqList.size()) { - throw new IndexOutOfBoundsException("setSeq: Index value '" + index + "' not in range [0.." + (this._seqList.size() - 1) + "]"); - } - - this._seqList.set(index, new java.lang.Integer(vSeq)); - } - - /** - * - * - * @param vSeqArray - */ - public void setSeq( - final int[] vSeqArray) { - //-- copy array - _seqList.clear(); - - for (int i = 0; i < vSeqArray.length; i++) { - this._seqList.add(new java.lang.Integer(vSeqArray[i])); - } - } - - /** - * Sets the value of field 'start'. - * - * @param start the value of field 'start'. - */ - public void setStart( - final int start) { - this._start = start; - this._has_start = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled jalview.binding.JGroup - */ - public static jalview.binding.JGroup unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.JGroup) Unmarshaller.unmarshal(jalview.binding.JGroup.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class JGroup implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _start. + */ + private int _start; + + /** + * keeps track of state for field: _start + */ + private boolean _has_start; + + /** + * Field _end. + */ + private int _end; + + /** + * keeps track of state for field: _end + */ + private boolean _has_end; + + /** + * Field _name. + */ + private java.lang.String _name; + + /** + * Field _colour. + */ + private java.lang.String _colour; + + /** + * Field _consThreshold. + */ + private int _consThreshold; + + /** + * keeps track of state for field: _consThreshold + */ + private boolean _has_consThreshold; + + /** + * Field _pidThreshold. + */ + private int _pidThreshold; + + /** + * keeps track of state for field: _pidThreshold + */ + private boolean _has_pidThreshold; + + /** + * Field _outlineColour. + */ + private int _outlineColour; + + /** + * keeps track of state for field: _outlineColour + */ + private boolean _has_outlineColour; + + /** + * Field _displayBoxes. + */ + private boolean _displayBoxes; + + /** + * keeps track of state for field: _displayBoxes + */ + private boolean _has_displayBoxes; + + /** + * Field _displayText. + */ + private boolean _displayText; + + /** + * keeps track of state for field: _displayText + */ + private boolean _has_displayText; + + /** + * Field _colourText. + */ + private boolean _colourText; + + /** + * keeps track of state for field: _colourText + */ + private boolean _has_colourText; + + /** + * Field _seqList. + */ + private java.util.Vector _seqList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public JGroup() + { + super(); + this._seqList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vSeq + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSeq(final int vSeq) + throws java.lang.IndexOutOfBoundsException + { + this._seqList.addElement(new java.lang.Integer(vSeq)); + } + + /** + * + * + * @param index + * @param vSeq + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSeq(final int index, final int vSeq) + throws java.lang.IndexOutOfBoundsException + { + this._seqList.add(index, new java.lang.Integer(vSeq)); + } + + /** + */ + public void deleteColourText() + { + this._has_colourText = false; + } + + /** + */ + public void deleteConsThreshold() + { + this._has_consThreshold = false; + } + + /** + */ + public void deleteDisplayBoxes() + { + this._has_displayBoxes = false; + } + + /** + */ + public void deleteDisplayText() + { + this._has_displayText = false; + } + + /** + */ + public void deleteEnd() + { + this._has_end = false; + } + + /** + */ + public void deleteOutlineColour() + { + this._has_outlineColour = false; + } + + /** + */ + public void deletePidThreshold() + { + this._has_pidThreshold = false; + } + + /** + */ + public void deleteStart() + { + this._has_start = false; + } + + /** + * Method enumerateSeq. + * + * @return an Enumeration over all int elements + */ + public java.util.Enumeration enumerateSeq() + { + return this._seqList.elements(); + } + + /** + * Returns the value of field 'colour'. + * + * @return the value of field 'Colour'. + */ + public java.lang.String getColour() + { + return this._colour; + } + + /** + * Returns the value of field 'colourText'. + * + * @return the value of field 'ColourText'. + */ + public boolean getColourText() + { + return this._colourText; + } + + /** + * Returns the value of field 'consThreshold'. + * + * @return the value of field 'ConsThreshold'. + */ + public int getConsThreshold() + { + return this._consThreshold; + } + + /** + * Returns the value of field 'displayBoxes'. + * + * @return the value of field 'DisplayBoxes'. + */ + public boolean getDisplayBoxes() + { + return this._displayBoxes; + } + + /** + * Returns the value of field 'displayText'. + * + * @return the value of field 'DisplayText'. + */ + public boolean getDisplayText() + { + return this._displayText; + } + + /** + * Returns the value of field 'end'. + * + * @return the value of field 'End'. + */ + public int getEnd() + { + return this._end; + } + + /** + * Returns the value of field 'name'. + * + * @return the value of field 'Name'. + */ + public java.lang.String getName() + { + return this._name; + } + + /** + * Returns the value of field 'outlineColour'. + * + * @return the value of field 'OutlineColour'. + */ + public int getOutlineColour() + { + return this._outlineColour; + } + + /** + * Returns the value of field 'pidThreshold'. + * + * @return the value of field 'PidThreshold'. + */ + public int getPidThreshold() + { + return this._pidThreshold; + } + + /** + * Method getSeq. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the int at the given index + */ + public int getSeq(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._seqList.size()) + { + throw new IndexOutOfBoundsException("getSeq: Index value '" + index + + "' not in range [0.." + (this._seqList.size() - 1) + "]"); + } + + return ((java.lang.Integer) _seqList.get(index)).intValue(); + } + + /** + * Method getSeq.Returns the contents of the collection in an Array. + * + * @return this collection as an Array + */ + public int[] getSeq() + { + int size = this._seqList.size(); + int[] array = new int[size]; + java.util.Iterator iter = _seqList.iterator(); + for (int index = 0; index < size; index++) + { + array[index] = ((java.lang.Integer) iter.next()).intValue(); + } + return array; + } + + /** + * Method getSeqCount. + * + * @return the size of this collection + */ + public int getSeqCount() + { + return this._seqList.size(); + } + + /** + * Returns the value of field 'start'. + * + * @return the value of field 'Start'. + */ + public int getStart() + { + return this._start; + } + + /** + * Method hasColourText. + * + * @return true if at least one ColourText has been added + */ + public boolean hasColourText() + { + return this._has_colourText; + } + + /** + * Method hasConsThreshold. + * + * @return true if at least one ConsThreshold has been added + */ + public boolean hasConsThreshold() + { + return this._has_consThreshold; + } + + /** + * Method hasDisplayBoxes. + * + * @return true if at least one DisplayBoxes has been added + */ + public boolean hasDisplayBoxes() + { + return this._has_displayBoxes; + } + + /** + * Method hasDisplayText. + * + * @return true if at least one DisplayText has been added + */ + public boolean hasDisplayText() + { + return this._has_displayText; + } + + /** + * Method hasEnd. + * + * @return true if at least one End has been added + */ + public boolean hasEnd() + { + return this._has_end; + } + + /** + * Method hasOutlineColour. + * + * @return true if at least one OutlineColour has been added + */ + public boolean hasOutlineColour() + { + return this._has_outlineColour; + } + + /** + * Method hasPidThreshold. + * + * @return true if at least one PidThreshold has been added + */ + public boolean hasPidThreshold() + { + return this._has_pidThreshold; + } + + /** + * Method hasStart. + * + * @return true if at least one Start has been added + */ + public boolean hasStart() + { + return this._has_start; + } + + /** + * Returns the value of field 'colourText'. + * + * @return the value of field 'ColourText'. + */ + public boolean isColourText() + { + return this._colourText; + } + + /** + * Returns the value of field 'displayBoxes'. + * + * @return the value of field 'DisplayBoxes'. + */ + public boolean isDisplayBoxes() + { + return this._displayBoxes; + } + + /** + * Returns the value of field 'displayText'. + * + * @return the value of field 'DisplayText'. + */ + public boolean isDisplayText() + { + return this._displayText; + } + + /** + * 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 removeAllSeq() + { + this._seqList.clear(); + } + + /** + * Method removeSeq. + * + * @param vSeq + * @return true if the object was removed from the collection. + */ + public boolean removeSeq(final int vSeq) + { + boolean removed = _seqList.remove(new java.lang.Integer(vSeq)); + return removed; + } + + /** + * Method removeSeqAt. + * + * @param index + * @return the element removed from the collection + */ + public int removeSeqAt(final int index) + { + java.lang.Object obj = this._seqList.remove(index); + return ((java.lang.Integer) obj).intValue(); + } + + /** + * Sets the value of field 'colour'. + * + * @param colour + * the value of field 'colour'. + */ + public void setColour(final java.lang.String colour) + { + this._colour = colour; + } + + /** + * Sets the value of field 'colourText'. + * + * @param colourText + * the value of field 'colourText'. + */ + public void setColourText(final boolean colourText) + { + this._colourText = colourText; + this._has_colourText = true; + } + + /** + * Sets the value of field 'consThreshold'. + * + * @param consThreshold + * the value of field 'consThreshold'. + */ + public void setConsThreshold(final int consThreshold) + { + this._consThreshold = consThreshold; + this._has_consThreshold = true; + } + + /** + * Sets the value of field 'displayBoxes'. + * + * @param displayBoxes + * the value of field 'displayBoxes'. + */ + public void setDisplayBoxes(final boolean displayBoxes) + { + this._displayBoxes = displayBoxes; + this._has_displayBoxes = true; + } + + /** + * Sets the value of field 'displayText'. + * + * @param displayText + * the value of field 'displayText'. + */ + public void setDisplayText(final boolean displayText) + { + this._displayText = displayText; + this._has_displayText = true; + } + + /** + * Sets the value of field 'end'. + * + * @param end + * the value of field 'end'. + */ + public void setEnd(final int end) + { + this._end = end; + this._has_end = true; + } + + /** + * Sets the value of field 'name'. + * + * @param name + * the value of field 'name'. + */ + public void setName(final java.lang.String name) + { + this._name = name; + } + + /** + * Sets the value of field 'outlineColour'. + * + * @param outlineColour + * the value of field 'outlineColour'. + */ + public void setOutlineColour(final int outlineColour) + { + this._outlineColour = outlineColour; + this._has_outlineColour = true; + } + + /** + * Sets the value of field 'pidThreshold'. + * + * @param pidThreshold + * the value of field 'pidThreshold'. + */ + public void setPidThreshold(final int pidThreshold) + { + this._pidThreshold = pidThreshold; + this._has_pidThreshold = true; + } + + /** + * + * + * @param index + * @param vSeq + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setSeq(final int index, final int vSeq) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._seqList.size()) + { + throw new IndexOutOfBoundsException("setSeq: Index value '" + index + + "' not in range [0.." + (this._seqList.size() - 1) + "]"); + } + + this._seqList.set(index, new java.lang.Integer(vSeq)); + } + + /** + * + * + * @param vSeqArray + */ + public void setSeq(final int[] vSeqArray) + { + // -- copy array + _seqList.clear(); + + for (int i = 0; i < vSeqArray.length; i++) + { + this._seqList.add(new java.lang.Integer(vSeqArray[i])); + } + } + + /** + * Sets the value of field 'start'. + * + * @param start + * the value of field 'start'. + */ + public void setStart(final int start) + { + this._start = start; + this._has_start = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.binding.JGroup + */ + public static jalview.binding.JGroup unmarshal(final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.JGroup) Unmarshaller.unmarshal( + jalview.binding.JGroup.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/binding/JSeq.java b/src/jalview/binding/JSeq.java index 14b1f2f..996a807 100644 --- a/src/jalview/binding/JSeq.java +++ b/src/jalview/binding/JSeq.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,605 +19,627 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class JSeq implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _colour. - */ - private int _colour; - - /** - * keeps track of state for field: _colour - */ - private boolean _has_colour; - - /** - * Field _start. - */ - private int _start; - - /** - * keeps track of state for field: _start - */ - private boolean _has_start; - - /** - * Field _end. - */ - private int _end; - - /** - * keeps track of state for field: _end - */ - private boolean _has_end; - - /** - * Field _id. - */ - private int _id; - - /** - * keeps track of state for field: _id - */ - private boolean _has_id; - - /** - * Field _featuresList. - */ - private java.util.Vector _featuresList; - - /** - * Field _pdbidsList. - */ - private java.util.Vector _pdbidsList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public JSeq() { - super(); - this._featuresList = new java.util.Vector(); - this._pdbidsList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vFeatures - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addFeatures( - final jalview.binding.Features vFeatures) - throws java.lang.IndexOutOfBoundsException { - this._featuresList.addElement(vFeatures); - } - - /** - * - * - * @param index - * @param vFeatures - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addFeatures( - final int index, - final jalview.binding.Features vFeatures) - throws java.lang.IndexOutOfBoundsException { - this._featuresList.add(index, vFeatures); - } - - /** - * - * - * @param vPdbids - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addPdbids( - final jalview.binding.Pdbids vPdbids) - throws java.lang.IndexOutOfBoundsException { - this._pdbidsList.addElement(vPdbids); - } - - /** - * - * - * @param index - * @param vPdbids - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addPdbids( - final int index, - final jalview.binding.Pdbids vPdbids) - throws java.lang.IndexOutOfBoundsException { - this._pdbidsList.add(index, vPdbids); - } - - /** - */ - public void deleteColour( - ) { - this._has_colour= false; - } - - /** - */ - public void deleteEnd( - ) { - this._has_end= false; - } - - /** - */ - public void deleteId( - ) { - this._has_id= false; - } - - /** - */ - public void deleteStart( - ) { - this._has_start= false; - } - - /** - * Method enumerateFeatures. - * - * @return an Enumeration over all jalview.binding.Features - * elements - */ - public java.util.Enumeration enumerateFeatures( - ) { - return this._featuresList.elements(); - } - - /** - * Method enumeratePdbids. - * - * @return an Enumeration over all jalview.binding.Pdbids - * elements - */ - public java.util.Enumeration enumeratePdbids( - ) { - return this._pdbidsList.elements(); - } - - /** - * Returns the value of field 'colour'. - * - * @return the value of field 'Colour'. - */ - public int getColour( - ) { - return this._colour; - } - - /** - * Returns the value of field 'end'. - * - * @return the value of field 'End'. - */ - public int getEnd( - ) { - return this._end; - } - - /** - * Method getFeatures. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the jalview.binding.Features at the - * given index - */ - public jalview.binding.Features getFeatures( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._featuresList.size()) { - throw new IndexOutOfBoundsException("getFeatures: Index value '" + index + "' not in range [0.." + (this._featuresList.size() - 1) + "]"); - } - - return (jalview.binding.Features) _featuresList.get(index); - } - - /** - * Method getFeatures.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 jalview.binding.Features[] getFeatures( - ) { - jalview.binding.Features[] array = new jalview.binding.Features[0]; - return (jalview.binding.Features[]) this._featuresList.toArray(array); - } - - /** - * Method getFeaturesCount. - * - * @return the size of this collection - */ - public int getFeaturesCount( - ) { - return this._featuresList.size(); - } - - /** - * Returns the value of field 'id'. - * - * @return the value of field 'Id'. - */ - public int getId( - ) { - return this._id; - } - - /** - * Method getPdbids. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the jalview.binding.Pdbids at the given - * index - */ - public jalview.binding.Pdbids getPdbids( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._pdbidsList.size()) { - throw new IndexOutOfBoundsException("getPdbids: Index value '" + index + "' not in range [0.." + (this._pdbidsList.size() - 1) + "]"); - } - - return (jalview.binding.Pdbids) _pdbidsList.get(index); - } - - /** - * Method getPdbids.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 jalview.binding.Pdbids[] getPdbids( - ) { - jalview.binding.Pdbids[] array = new jalview.binding.Pdbids[0]; - return (jalview.binding.Pdbids[]) this._pdbidsList.toArray(array); - } - - /** - * Method getPdbidsCount. - * - * @return the size of this collection - */ - public int getPdbidsCount( - ) { - return this._pdbidsList.size(); - } - - /** - * Returns the value of field 'start'. - * - * @return the value of field 'Start'. - */ - public int getStart( - ) { - return this._start; - } - - /** - * Method hasColour. - * - * @return true if at least one Colour has been added - */ - public boolean hasColour( - ) { - return this._has_colour; - } - - /** - * Method hasEnd. - * - * @return true if at least one End has been added - */ - public boolean hasEnd( - ) { - return this._has_end; - } - - /** - * Method hasId. - * - * @return true if at least one Id has been added - */ - public boolean hasId( - ) { - return this._has_id; - } - - /** - * Method hasStart. - * - * @return true if at least one Start has been added - */ - public boolean hasStart( - ) { - return this._has_start; - } - - /** - * 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 removeAllFeatures( - ) { - this._featuresList.clear(); - } - - /** - */ - public void removeAllPdbids( - ) { - this._pdbidsList.clear(); - } - - /** - * Method removeFeatures. - * - * @param vFeatures - * @return true if the object was removed from the collection. - */ - public boolean removeFeatures( - final jalview.binding.Features vFeatures) { - boolean removed = _featuresList.remove(vFeatures); - return removed; - } - - /** - * Method removeFeaturesAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.binding.Features removeFeaturesAt( - final int index) { - java.lang.Object obj = this._featuresList.remove(index); - return (jalview.binding.Features) obj; - } - - /** - * Method removePdbids. - * - * @param vPdbids - * @return true if the object was removed from the collection. - */ - public boolean removePdbids( - final jalview.binding.Pdbids vPdbids) { - boolean removed = _pdbidsList.remove(vPdbids); - return removed; - } - - /** - * Method removePdbidsAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.binding.Pdbids removePdbidsAt( - final int index) { - java.lang.Object obj = this._pdbidsList.remove(index); - return (jalview.binding.Pdbids) obj; - } - - /** - * Sets the value of field 'colour'. - * - * @param colour the value of field 'colour'. - */ - public void setColour( - final int colour) { - this._colour = colour; - this._has_colour = true; - } - - /** - * Sets the value of field 'end'. - * - * @param end the value of field 'end'. - */ - public void setEnd( - final int end) { - this._end = end; - this._has_end = true; - } - - /** - * - * - * @param index - * @param vFeatures - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setFeatures( - final int index, - final jalview.binding.Features vFeatures) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._featuresList.size()) { - throw new IndexOutOfBoundsException("setFeatures: Index value '" + index + "' not in range [0.." + (this._featuresList.size() - 1) + "]"); - } - - this._featuresList.set(index, vFeatures); - } - - /** - * - * - * @param vFeaturesArray - */ - public void setFeatures( - final jalview.binding.Features[] vFeaturesArray) { - //-- copy array - _featuresList.clear(); - - for (int i = 0; i < vFeaturesArray.length; i++) { - this._featuresList.add(vFeaturesArray[i]); - } - } - - /** - * Sets the value of field 'id'. - * - * @param id the value of field 'id'. - */ - public void setId( - final int id) { - this._id = id; - this._has_id = true; - } - - /** - * - * - * @param index - * @param vPdbids - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setPdbids( - final int index, - final jalview.binding.Pdbids vPdbids) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._pdbidsList.size()) { - throw new IndexOutOfBoundsException("setPdbids: Index value '" + index + "' not in range [0.." + (this._pdbidsList.size() - 1) + "]"); - } - - this._pdbidsList.set(index, vPdbids); - } - - /** - * - * - * @param vPdbidsArray - */ - public void setPdbids( - final jalview.binding.Pdbids[] vPdbidsArray) { - //-- copy array - _pdbidsList.clear(); - - for (int i = 0; i < vPdbidsArray.length; i++) { - this._pdbidsList.add(vPdbidsArray[i]); - } - } - - /** - * Sets the value of field 'start'. - * - * @param start the value of field 'start'. - */ - public void setStart( - final int start) { - this._start = start; - this._has_start = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled jalview.binding.JSeq - */ - public static jalview.binding.JSeq unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.JSeq) Unmarshaller.unmarshal(jalview.binding.JSeq.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class JSeq implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _colour. + */ + private int _colour; + + /** + * keeps track of state for field: _colour + */ + private boolean _has_colour; + + /** + * Field _start. + */ + private int _start; + + /** + * keeps track of state for field: _start + */ + private boolean _has_start; + + /** + * Field _end. + */ + private int _end; + + /** + * keeps track of state for field: _end + */ + private boolean _has_end; + + /** + * Field _id. + */ + private int _id; + + /** + * keeps track of state for field: _id + */ + private boolean _has_id; + + /** + * Field _featuresList. + */ + private java.util.Vector _featuresList; + + /** + * Field _pdbidsList. + */ + private java.util.Vector _pdbidsList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public JSeq() + { + super(); + this._featuresList = new java.util.Vector(); + this._pdbidsList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vFeatures + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addFeatures(final jalview.binding.Features vFeatures) + throws java.lang.IndexOutOfBoundsException + { + this._featuresList.addElement(vFeatures); + } + + /** + * + * + * @param index + * @param vFeatures + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addFeatures(final int index, + final jalview.binding.Features vFeatures) + throws java.lang.IndexOutOfBoundsException + { + this._featuresList.add(index, vFeatures); + } + + /** + * + * + * @param vPdbids + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addPdbids(final jalview.binding.Pdbids vPdbids) + throws java.lang.IndexOutOfBoundsException + { + this._pdbidsList.addElement(vPdbids); + } + + /** + * + * + * @param index + * @param vPdbids + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addPdbids(final int index, + final jalview.binding.Pdbids vPdbids) + throws java.lang.IndexOutOfBoundsException + { + this._pdbidsList.add(index, vPdbids); + } + + /** + */ + public void deleteColour() + { + this._has_colour = false; + } + + /** + */ + public void deleteEnd() + { + this._has_end = false; + } + + /** + */ + public void deleteId() + { + this._has_id = false; + } + + /** + */ + public void deleteStart() + { + this._has_start = false; + } + + /** + * Method enumerateFeatures. + * + * @return an Enumeration over all jalview.binding.Features elements + */ + public java.util.Enumeration enumerateFeatures() + { + return this._featuresList.elements(); + } + + /** + * Method enumeratePdbids. + * + * @return an Enumeration over all jalview.binding.Pdbids elements + */ + public java.util.Enumeration enumeratePdbids() + { + return this._pdbidsList.elements(); + } + + /** + * Returns the value of field 'colour'. + * + * @return the value of field 'Colour'. + */ + public int getColour() + { + return this._colour; + } + + /** + * Returns the value of field 'end'. + * + * @return the value of field 'End'. + */ + public int getEnd() + { + return this._end; + } + + /** + * Method getFeatures. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.binding.Features at the given index + */ + public jalview.binding.Features getFeatures(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._featuresList.size()) + { + throw new IndexOutOfBoundsException("getFeatures: Index value '" + + index + "' not in range [0.." + + (this._featuresList.size() - 1) + "]"); + } + + return (jalview.binding.Features) _featuresList.get(index); + } + + /** + * Method getFeatures.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 jalview.binding.Features[] getFeatures() + { + jalview.binding.Features[] array = new jalview.binding.Features[0]; + return (jalview.binding.Features[]) this._featuresList.toArray(array); + } + + /** + * Method getFeaturesCount. + * + * @return the size of this collection + */ + public int getFeaturesCount() + { + return this._featuresList.size(); + } + + /** + * Returns the value of field 'id'. + * + * @return the value of field 'Id'. + */ + public int getId() + { + return this._id; + } + + /** + * Method getPdbids. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.binding.Pdbids at the given index + */ + public jalview.binding.Pdbids getPdbids(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._pdbidsList.size()) + { + throw new IndexOutOfBoundsException("getPdbids: Index value '" + + index + "' not in range [0.." + + (this._pdbidsList.size() - 1) + "]"); + } + + return (jalview.binding.Pdbids) _pdbidsList.get(index); + } + + /** + * Method getPdbids.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 jalview.binding.Pdbids[] getPdbids() + { + jalview.binding.Pdbids[] array = new jalview.binding.Pdbids[0]; + return (jalview.binding.Pdbids[]) this._pdbidsList.toArray(array); + } + + /** + * Method getPdbidsCount. + * + * @return the size of this collection + */ + public int getPdbidsCount() + { + return this._pdbidsList.size(); + } + + /** + * Returns the value of field 'start'. + * + * @return the value of field 'Start'. + */ + public int getStart() + { + return this._start; + } + + /** + * Method hasColour. + * + * @return true if at least one Colour has been added + */ + public boolean hasColour() + { + return this._has_colour; + } + + /** + * Method hasEnd. + * + * @return true if at least one End has been added + */ + public boolean hasEnd() + { + return this._has_end; + } + + /** + * Method hasId. + * + * @return true if at least one Id has been added + */ + public boolean hasId() + { + return this._has_id; + } + + /** + * Method hasStart. + * + * @return true if at least one Start has been added + */ + public boolean hasStart() + { + return this._has_start; + } + + /** + * 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 removeAllFeatures() + { + this._featuresList.clear(); + } + + /** + */ + public void removeAllPdbids() + { + this._pdbidsList.clear(); + } + + /** + * Method removeFeatures. + * + * @param vFeatures + * @return true if the object was removed from the collection. + */ + public boolean removeFeatures(final jalview.binding.Features vFeatures) + { + boolean removed = _featuresList.remove(vFeatures); + return removed; + } + + /** + * Method removeFeaturesAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.binding.Features removeFeaturesAt(final int index) + { + java.lang.Object obj = this._featuresList.remove(index); + return (jalview.binding.Features) obj; + } + + /** + * Method removePdbids. + * + * @param vPdbids + * @return true if the object was removed from the collection. + */ + public boolean removePdbids(final jalview.binding.Pdbids vPdbids) + { + boolean removed = _pdbidsList.remove(vPdbids); + return removed; + } + + /** + * Method removePdbidsAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.binding.Pdbids removePdbidsAt(final int index) + { + java.lang.Object obj = this._pdbidsList.remove(index); + return (jalview.binding.Pdbids) obj; + } + + /** + * Sets the value of field 'colour'. + * + * @param colour + * the value of field 'colour'. + */ + public void setColour(final int colour) + { + this._colour = colour; + this._has_colour = true; + } + + /** + * Sets the value of field 'end'. + * + * @param end + * the value of field 'end'. + */ + public void setEnd(final int end) + { + this._end = end; + this._has_end = true; + } + + /** + * + * + * @param index + * @param vFeatures + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setFeatures(final int index, + final jalview.binding.Features vFeatures) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._featuresList.size()) + { + throw new IndexOutOfBoundsException("setFeatures: Index value '" + + index + "' not in range [0.." + + (this._featuresList.size() - 1) + "]"); + } + + this._featuresList.set(index, vFeatures); + } + + /** + * + * + * @param vFeaturesArray + */ + public void setFeatures(final jalview.binding.Features[] vFeaturesArray) + { + // -- copy array + _featuresList.clear(); + + for (int i = 0; i < vFeaturesArray.length; i++) + { + this._featuresList.add(vFeaturesArray[i]); + } + } + + /** + * Sets the value of field 'id'. + * + * @param id + * the value of field 'id'. + */ + public void setId(final int id) + { + this._id = id; + this._has_id = true; + } + + /** + * + * + * @param index + * @param vPdbids + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setPdbids(final int index, + final jalview.binding.Pdbids vPdbids) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._pdbidsList.size()) + { + throw new IndexOutOfBoundsException("setPdbids: Index value '" + + index + "' not in range [0.." + + (this._pdbidsList.size() - 1) + "]"); + } + + this._pdbidsList.set(index, vPdbids); + } + + /** + * + * + * @param vPdbidsArray + */ + public void setPdbids(final jalview.binding.Pdbids[] vPdbidsArray) + { + // -- copy array + _pdbidsList.clear(); + + for (int i = 0; i < vPdbidsArray.length; i++) + { + this._pdbidsList.add(vPdbidsArray[i]); + } + } + + /** + * Sets the value of field 'start'. + * + * @param start + * the value of field 'start'. + */ + public void setStart(final int start) + { + this._start = start; + this._has_start = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.binding.JSeq + */ + public static jalview.binding.JSeq unmarshal(final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.JSeq) Unmarshaller.unmarshal( + jalview.binding.JSeq.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/binding/JalviewModel.java b/src/jalview/binding/JalviewModel.java index 21f8be9..7141b27 100644 --- a/src/jalview/binding/JalviewModel.java +++ b/src/jalview/binding/JalviewModel.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,202 +19,215 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class JalviewModel implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _creationDate. - */ - private java.util.Date _creationDate; - - /** - * Field _version. - */ - private java.lang.String _version; - - /** - * Field _vamsasModel. - */ - private jalview.binding.VamsasModel _vamsasModel; - - /** - * Field _jalviewModelSequence. - */ - private jalview.binding.JalviewModelSequence _jalviewModelSequence; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public JalviewModel() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Returns the value of field 'creationDate'. - * - * @return the value of field 'CreationDate'. - */ - public java.util.Date getCreationDate( - ) { - return this._creationDate; - } - - /** - * Returns the value of field 'jalviewModelSequence'. - * - * @return the value of field 'JalviewModelSequence'. - */ - public jalview.binding.JalviewModelSequence getJalviewModelSequence( - ) { - return this._jalviewModelSequence; - } - - /** - * Returns the value of field 'vamsasModel'. - * - * @return the value of field 'VamsasModel'. - */ - public jalview.binding.VamsasModel getVamsasModel( - ) { - return this._vamsasModel; - } - - /** - * Returns the value of field 'version'. - * - * @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; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'creationDate'. - * - * @param creationDate the value of field 'creationDate'. - */ - public void setCreationDate( - final java.util.Date creationDate) { - this._creationDate = creationDate; - } - - /** - * Sets the value of field 'jalviewModelSequence'. - * - * @param jalviewModelSequence the value of field - * 'jalviewModelSequence'. - */ - public void setJalviewModelSequence( - final jalview.binding.JalviewModelSequence jalviewModelSequence) { - this._jalviewModelSequence = jalviewModelSequence; - } - - /** - * Sets the value of field 'vamsasModel'. - * - * @param vamsasModel the value of field 'vamsasModel'. - */ - public void setVamsasModel( - final jalview.binding.VamsasModel vamsasModel) { - this._vamsasModel = vamsasModel; - } - - /** - * Sets the value of field 'version'. - * - * @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.binding.JalviewModel - */ - public static jalview.binding.JalviewModel unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.JalviewModel) Unmarshaller.unmarshal(jalview.binding.JalviewModel.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); +public class JalviewModel implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _creationDate. + */ + private java.util.Date _creationDate; + + /** + * Field _version. + */ + private java.lang.String _version; + + /** + * Field _vamsasModel. + */ + private jalview.binding.VamsasModel _vamsasModel; + + /** + * Field _jalviewModelSequence. + */ + private jalview.binding.JalviewModelSequence _jalviewModelSequence; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public JalviewModel() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Returns the value of field 'creationDate'. + * + * @return the value of field 'CreationDate'. + */ + public java.util.Date getCreationDate() + { + return this._creationDate; + } + + /** + * Returns the value of field 'jalviewModelSequence'. + * + * @return the value of field 'JalviewModelSequence'. + */ + public jalview.binding.JalviewModelSequence getJalviewModelSequence() + { + return this._jalviewModelSequence; + } + + /** + * Returns the value of field 'vamsasModel'. + * + * @return the value of field 'VamsasModel'. + */ + public jalview.binding.VamsasModel getVamsasModel() + { + return this._vamsasModel; + } + + /** + * Returns the value of field 'version'. + * + * @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; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'creationDate'. + * + * @param creationDate + * the value of field 'creationDate'. + */ + public void setCreationDate(final java.util.Date creationDate) + { + this._creationDate = creationDate; + } + + /** + * Sets the value of field 'jalviewModelSequence'. + * + * @param jalviewModelSequence + * the value of field 'jalviewModelSequence'. + */ + public void setJalviewModelSequence( + final jalview.binding.JalviewModelSequence jalviewModelSequence) + { + this._jalviewModelSequence = jalviewModelSequence; + } + + /** + * Sets the value of field 'vamsasModel'. + * + * @param vamsasModel + * the value of field 'vamsasModel'. + */ + public void setVamsasModel(final jalview.binding.VamsasModel vamsasModel) + { + this._vamsasModel = vamsasModel; + } + + /** + * Sets the value of field 'version'. + * + * @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.binding.JalviewModel + */ + public static jalview.binding.JalviewModel unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.JalviewModel) Unmarshaller.unmarshal( + jalview.binding.JalviewModel.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/binding/JalviewModelSequence.java b/src/jalview/binding/JalviewModelSequence.java index 5ebcee6..eb0716d 100644 --- a/src/jalview/binding/JalviewModelSequence.java +++ b/src/jalview/binding/JalviewModelSequence.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,904 +19,937 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class JalviewModelSequence implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _JSeqList. - */ - private java.util.Vector _JSeqList; - - /** - * Field _JGroupList. - */ - private java.util.Vector _JGroupList; - - /** - * Field _viewportList. - */ - private java.util.Vector _viewportList; - - /** - * Field _userColoursList. - */ - private java.util.Vector _userColoursList; - - /** - * Field _treeList. - */ - private java.util.Vector _treeList; - - /** - * Field _featureSettings. - */ - private jalview.binding.FeatureSettings _featureSettings; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public JalviewModelSequence() { - super(); - this._JSeqList = new java.util.Vector(); - this._JGroupList = new java.util.Vector(); - this._viewportList = new java.util.Vector(); - this._userColoursList = new java.util.Vector(); - this._treeList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vJGroup - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addJGroup( - final jalview.binding.JGroup vJGroup) - throws java.lang.IndexOutOfBoundsException { - this._JGroupList.addElement(vJGroup); - } - - /** - * - * - * @param index - * @param vJGroup - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addJGroup( - final int index, - final jalview.binding.JGroup vJGroup) - throws java.lang.IndexOutOfBoundsException { - this._JGroupList.add(index, vJGroup); - } - - /** - * - * - * @param vJSeq - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addJSeq( - final jalview.binding.JSeq vJSeq) - throws java.lang.IndexOutOfBoundsException { - this._JSeqList.addElement(vJSeq); - } - - /** - * - * - * @param index - * @param vJSeq - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addJSeq( - final int index, - final jalview.binding.JSeq vJSeq) - throws java.lang.IndexOutOfBoundsException { - this._JSeqList.add(index, vJSeq); - } - - /** - * - * - * @param vTree - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addTree( - final jalview.binding.Tree vTree) - throws java.lang.IndexOutOfBoundsException { - this._treeList.addElement(vTree); - } - - /** - * - * - * @param index - * @param vTree - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addTree( - final int index, - final jalview.binding.Tree vTree) - throws java.lang.IndexOutOfBoundsException { - this._treeList.add(index, vTree); - } - - /** - * - * - * @param vUserColours - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addUserColours( - final jalview.binding.UserColours vUserColours) - throws java.lang.IndexOutOfBoundsException { - this._userColoursList.addElement(vUserColours); - } - - /** - * - * - * @param index - * @param vUserColours - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addUserColours( - final int index, - final jalview.binding.UserColours vUserColours) - throws java.lang.IndexOutOfBoundsException { - this._userColoursList.add(index, vUserColours); - } - - /** - * - * - * @param vViewport - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addViewport( - final jalview.binding.Viewport vViewport) - throws java.lang.IndexOutOfBoundsException { - this._viewportList.addElement(vViewport); - } - - /** - * - * - * @param index - * @param vViewport - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addViewport( - final int index, - final jalview.binding.Viewport vViewport) - throws java.lang.IndexOutOfBoundsException { - this._viewportList.add(index, vViewport); - } - - /** - * Method enumerateJGroup. - * - * @return an Enumeration over all jalview.binding.JGroup - * elements - */ - public java.util.Enumeration enumerateJGroup( - ) { - return this._JGroupList.elements(); - } - - /** - * Method enumerateJSeq. - * - * @return an Enumeration over all jalview.binding.JSeq elements - */ - public java.util.Enumeration enumerateJSeq( - ) { - return this._JSeqList.elements(); - } - - /** - * Method enumerateTree. - * - * @return an Enumeration over all jalview.binding.Tree elements - */ - public java.util.Enumeration enumerateTree( - ) { - return this._treeList.elements(); - } - - /** - * Method enumerateUserColours. - * - * @return an Enumeration over all jalview.binding.UserColours - * elements - */ - public java.util.Enumeration enumerateUserColours( - ) { - return this._userColoursList.elements(); - } - - /** - * Method enumerateViewport. - * - * @return an Enumeration over all jalview.binding.Viewport - * elements - */ - public java.util.Enumeration enumerateViewport( - ) { - return this._viewportList.elements(); - } - - /** - * Returns the value of field 'featureSettings'. - * - * @return the value of field 'FeatureSettings'. - */ - public jalview.binding.FeatureSettings getFeatureSettings( - ) { - return this._featureSettings; - } - - /** - * Method getJGroup. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the jalview.binding.JGroup at the given - * index - */ - public jalview.binding.JGroup getJGroup( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._JGroupList.size()) { - throw new IndexOutOfBoundsException("getJGroup: Index value '" + index + "' not in range [0.." + (this._JGroupList.size() - 1) + "]"); - } - - return (jalview.binding.JGroup) _JGroupList.get(index); - } - - /** - * Method getJGroup.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 jalview.binding.JGroup[] getJGroup( - ) { - jalview.binding.JGroup[] array = new jalview.binding.JGroup[0]; - return (jalview.binding.JGroup[]) this._JGroupList.toArray(array); - } - - /** - * Method getJGroupCount. - * - * @return the size of this collection - */ - public int getJGroupCount( - ) { - return this._JGroupList.size(); - } - - /** - * Method getJSeq. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the jalview.binding.JSeq at the given - * index - */ - public jalview.binding.JSeq getJSeq( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._JSeqList.size()) { - throw new IndexOutOfBoundsException("getJSeq: Index value '" + index + "' not in range [0.." + (this._JSeqList.size() - 1) + "]"); - } - - return (jalview.binding.JSeq) _JSeqList.get(index); - } - - /** - * Method getJSeq.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 jalview.binding.JSeq[] getJSeq( - ) { - jalview.binding.JSeq[] array = new jalview.binding.JSeq[0]; - return (jalview.binding.JSeq[]) this._JSeqList.toArray(array); - } - - /** - * Method getJSeqCount. - * - * @return the size of this collection - */ - public int getJSeqCount( - ) { - return this._JSeqList.size(); - } - - /** - * Method getTree. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the jalview.binding.Tree at the given - * index - */ - public jalview.binding.Tree getTree( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._treeList.size()) { - throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]"); - } - - return (jalview.binding.Tree) _treeList.get(index); - } - - /** - * Method getTree.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 jalview.binding.Tree[] getTree( - ) { - jalview.binding.Tree[] array = new jalview.binding.Tree[0]; - return (jalview.binding.Tree[]) this._treeList.toArray(array); - } - - /** - * Method getTreeCount. - * - * @return the size of this collection - */ - public int getTreeCount( - ) { - return this._treeList.size(); - } - - /** - * Method getUserColours. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the jalview.binding.UserColours at the - * given index - */ - public jalview.binding.UserColours getUserColours( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._userColoursList.size()) { - throw new IndexOutOfBoundsException("getUserColours: Index value '" + index + "' not in range [0.." + (this._userColoursList.size() - 1) + "]"); - } - - return (jalview.binding.UserColours) _userColoursList.get(index); - } - - /** - * Method getUserColours.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 jalview.binding.UserColours[] getUserColours( - ) { - jalview.binding.UserColours[] array = new jalview.binding.UserColours[0]; - return (jalview.binding.UserColours[]) this._userColoursList.toArray(array); - } - - /** - * Method getUserColoursCount. - * - * @return the size of this collection - */ - public int getUserColoursCount( - ) { - return this._userColoursList.size(); - } - - /** - * Method getViewport. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the jalview.binding.Viewport at the - * given index - */ - public jalview.binding.Viewport getViewport( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._viewportList.size()) { - throw new IndexOutOfBoundsException("getViewport: Index value '" + index + "' not in range [0.." + (this._viewportList.size() - 1) + "]"); - } - - return (jalview.binding.Viewport) _viewportList.get(index); - } - - /** - * Method getViewport.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 jalview.binding.Viewport[] getViewport( - ) { - jalview.binding.Viewport[] array = new jalview.binding.Viewport[0]; - return (jalview.binding.Viewport[]) this._viewportList.toArray(array); - } - - /** - * Method getViewportCount. - * - * @return the size of this collection - */ - public int getViewportCount( - ) { - return this._viewportList.size(); - } - - /** - * 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 removeAllJGroup( - ) { - this._JGroupList.clear(); - } - - /** - */ - public void removeAllJSeq( - ) { - this._JSeqList.clear(); - } - - /** - */ - public void removeAllTree( - ) { - this._treeList.clear(); - } - - /** - */ - public void removeAllUserColours( - ) { - this._userColoursList.clear(); - } - - /** - */ - public void removeAllViewport( - ) { - this._viewportList.clear(); - } - - /** - * Method removeJGroup. - * - * @param vJGroup - * @return true if the object was removed from the collection. - */ - public boolean removeJGroup( - final jalview.binding.JGroup vJGroup) { - boolean removed = _JGroupList.remove(vJGroup); - return removed; - } - - /** - * Method removeJGroupAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.binding.JGroup removeJGroupAt( - final int index) { - java.lang.Object obj = this._JGroupList.remove(index); - return (jalview.binding.JGroup) obj; - } - - /** - * Method removeJSeq. - * - * @param vJSeq - * @return true if the object was removed from the collection. - */ - public boolean removeJSeq( - final jalview.binding.JSeq vJSeq) { - boolean removed = _JSeqList.remove(vJSeq); - return removed; - } - - /** - * Method removeJSeqAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.binding.JSeq removeJSeqAt( - final int index) { - java.lang.Object obj = this._JSeqList.remove(index); - return (jalview.binding.JSeq) obj; - } - - /** - * Method removeTree. - * - * @param vTree - * @return true if the object was removed from the collection. - */ - public boolean removeTree( - final jalview.binding.Tree vTree) { - boolean removed = _treeList.remove(vTree); - return removed; - } - - /** - * Method removeTreeAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.binding.Tree removeTreeAt( - final int index) { - java.lang.Object obj = this._treeList.remove(index); - return (jalview.binding.Tree) obj; - } - - /** - * Method removeUserColours. - * - * @param vUserColours - * @return true if the object was removed from the collection. - */ - public boolean removeUserColours( - final jalview.binding.UserColours vUserColours) { - boolean removed = _userColoursList.remove(vUserColours); - return removed; - } - - /** - * Method removeUserColoursAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.binding.UserColours removeUserColoursAt( - final int index) { - java.lang.Object obj = this._userColoursList.remove(index); - return (jalview.binding.UserColours) obj; - } - - /** - * Method removeViewport. - * - * @param vViewport - * @return true if the object was removed from the collection. - */ - public boolean removeViewport( - final jalview.binding.Viewport vViewport) { - boolean removed = _viewportList.remove(vViewport); - return removed; - } - - /** - * Method removeViewportAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.binding.Viewport removeViewportAt( - final int index) { - java.lang.Object obj = this._viewportList.remove(index); - return (jalview.binding.Viewport) obj; - } - - /** - * Sets the value of field 'featureSettings'. - * - * @param featureSettings the value of field 'featureSettings'. - */ - public void setFeatureSettings( - final jalview.binding.FeatureSettings featureSettings) { - this._featureSettings = featureSettings; - } - - /** - * - * - * @param index - * @param vJGroup - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setJGroup( - final int index, - final jalview.binding.JGroup vJGroup) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._JGroupList.size()) { - throw new IndexOutOfBoundsException("setJGroup: Index value '" + index + "' not in range [0.." + (this._JGroupList.size() - 1) + "]"); - } - - this._JGroupList.set(index, vJGroup); - } - - /** - * - * - * @param vJGroupArray - */ - public void setJGroup( - final jalview.binding.JGroup[] vJGroupArray) { - //-- copy array - _JGroupList.clear(); - - for (int i = 0; i < vJGroupArray.length; i++) { - this._JGroupList.add(vJGroupArray[i]); - } - } - - /** - * - * - * @param index - * @param vJSeq - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setJSeq( - final int index, - final jalview.binding.JSeq vJSeq) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._JSeqList.size()) { - throw new IndexOutOfBoundsException("setJSeq: Index value '" + index + "' not in range [0.." + (this._JSeqList.size() - 1) + "]"); - } - - this._JSeqList.set(index, vJSeq); - } - - /** - * - * - * @param vJSeqArray - */ - public void setJSeq( - final jalview.binding.JSeq[] vJSeqArray) { - //-- copy array - _JSeqList.clear(); - - for (int i = 0; i < vJSeqArray.length; i++) { - this._JSeqList.add(vJSeqArray[i]); - } - } - - /** - * - * - * @param index - * @param vTree - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setTree( - final int index, - final jalview.binding.Tree vTree) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._treeList.size()) { - throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]"); - } - - this._treeList.set(index, vTree); - } - - /** - * - * - * @param vTreeArray - */ - public void setTree( - final jalview.binding.Tree[] vTreeArray) { - //-- copy array - _treeList.clear(); - - for (int i = 0; i < vTreeArray.length; i++) { - this._treeList.add(vTreeArray[i]); - } - } - - /** - * - * - * @param index - * @param vUserColours - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setUserColours( - final int index, - final jalview.binding.UserColours vUserColours) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._userColoursList.size()) { - throw new IndexOutOfBoundsException("setUserColours: Index value '" + index + "' not in range [0.." + (this._userColoursList.size() - 1) + "]"); - } - - this._userColoursList.set(index, vUserColours); - } - - /** - * - * - * @param vUserColoursArray - */ - public void setUserColours( - final jalview.binding.UserColours[] vUserColoursArray) { - //-- copy array - _userColoursList.clear(); - - for (int i = 0; i < vUserColoursArray.length; i++) { - this._userColoursList.add(vUserColoursArray[i]); - } - } - - /** - * - * - * @param index - * @param vViewport - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setViewport( - final int index, - final jalview.binding.Viewport vViewport) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._viewportList.size()) { - throw new IndexOutOfBoundsException("setViewport: Index value '" + index + "' not in range [0.." + (this._viewportList.size() - 1) + "]"); - } - - this._viewportList.set(index, vViewport); - } - - /** - * - * - * @param vViewportArray - */ - public void setViewport( - final jalview.binding.Viewport[] vViewportArray) { - //-- copy array - _viewportList.clear(); - - for (int i = 0; i < vViewportArray.length; i++) { - this._viewportList.add(vViewportArray[i]); - } - } - - /** - * 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.binding.JalviewModelSequence - */ - public static jalview.binding.JalviewModelSequence unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.JalviewModelSequence) Unmarshaller.unmarshal(jalview.binding.JalviewModelSequence.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class JalviewModelSequence implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _JSeqList. + */ + private java.util.Vector _JSeqList; + + /** + * Field _JGroupList. + */ + private java.util.Vector _JGroupList; + + /** + * Field _viewportList. + */ + private java.util.Vector _viewportList; + + /** + * Field _userColoursList. + */ + private java.util.Vector _userColoursList; + + /** + * Field _treeList. + */ + private java.util.Vector _treeList; + + /** + * Field _featureSettings. + */ + private jalview.binding.FeatureSettings _featureSettings; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public JalviewModelSequence() + { + super(); + this._JSeqList = new java.util.Vector(); + this._JGroupList = new java.util.Vector(); + this._viewportList = new java.util.Vector(); + this._userColoursList = new java.util.Vector(); + this._treeList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vJGroup + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addJGroup(final jalview.binding.JGroup vJGroup) + throws java.lang.IndexOutOfBoundsException + { + this._JGroupList.addElement(vJGroup); + } + + /** + * + * + * @param index + * @param vJGroup + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addJGroup(final int index, + final jalview.binding.JGroup vJGroup) + throws java.lang.IndexOutOfBoundsException + { + this._JGroupList.add(index, vJGroup); + } + + /** + * + * + * @param vJSeq + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addJSeq(final jalview.binding.JSeq vJSeq) + throws java.lang.IndexOutOfBoundsException + { + this._JSeqList.addElement(vJSeq); + } + + /** + * + * + * @param index + * @param vJSeq + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addJSeq(final int index, final jalview.binding.JSeq vJSeq) + throws java.lang.IndexOutOfBoundsException + { + this._JSeqList.add(index, vJSeq); + } + + /** + * + * + * @param vTree + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addTree(final jalview.binding.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + this._treeList.addElement(vTree); + } + + /** + * + * + * @param index + * @param vTree + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addTree(final int index, final jalview.binding.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + this._treeList.add(index, vTree); + } + + /** + * + * + * @param vUserColours + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addUserColours(final jalview.binding.UserColours vUserColours) + throws java.lang.IndexOutOfBoundsException + { + this._userColoursList.addElement(vUserColours); + } + + /** + * + * + * @param index + * @param vUserColours + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addUserColours(final int index, + final jalview.binding.UserColours vUserColours) + throws java.lang.IndexOutOfBoundsException + { + this._userColoursList.add(index, vUserColours); + } + + /** + * + * + * @param vViewport + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addViewport(final jalview.binding.Viewport vViewport) + throws java.lang.IndexOutOfBoundsException + { + this._viewportList.addElement(vViewport); + } + + /** + * + * + * @param index + * @param vViewport + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addViewport(final int index, + final jalview.binding.Viewport vViewport) + throws java.lang.IndexOutOfBoundsException + { + this._viewportList.add(index, vViewport); + } + + /** + * Method enumerateJGroup. + * + * @return an Enumeration over all jalview.binding.JGroup elements + */ + public java.util.Enumeration enumerateJGroup() + { + return this._JGroupList.elements(); + } + + /** + * Method enumerateJSeq. + * + * @return an Enumeration over all jalview.binding.JSeq elements + */ + public java.util.Enumeration enumerateJSeq() + { + return this._JSeqList.elements(); + } + + /** + * Method enumerateTree. + * + * @return an Enumeration over all jalview.binding.Tree elements + */ + public java.util.Enumeration enumerateTree() + { + return this._treeList.elements(); + } + + /** + * Method enumerateUserColours. + * + * @return an Enumeration over all jalview.binding.UserColours elements + */ + public java.util.Enumeration enumerateUserColours() + { + return this._userColoursList.elements(); + } + + /** + * Method enumerateViewport. + * + * @return an Enumeration over all jalview.binding.Viewport elements + */ + public java.util.Enumeration enumerateViewport() + { + return this._viewportList.elements(); + } + + /** + * Returns the value of field 'featureSettings'. + * + * @return the value of field 'FeatureSettings'. + */ + public jalview.binding.FeatureSettings getFeatureSettings() + { + return this._featureSettings; + } + + /** + * Method getJGroup. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.binding.JGroup at the given index + */ + public jalview.binding.JGroup getJGroup(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._JGroupList.size()) + { + throw new IndexOutOfBoundsException("getJGroup: Index value '" + + index + "' not in range [0.." + + (this._JGroupList.size() - 1) + "]"); + } + + return (jalview.binding.JGroup) _JGroupList.get(index); + } + + /** + * Method getJGroup.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 jalview.binding.JGroup[] getJGroup() + { + jalview.binding.JGroup[] array = new jalview.binding.JGroup[0]; + return (jalview.binding.JGroup[]) this._JGroupList.toArray(array); + } + + /** + * Method getJGroupCount. + * + * @return the size of this collection + */ + public int getJGroupCount() + { + return this._JGroupList.size(); + } + + /** + * Method getJSeq. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.binding.JSeq at the given index + */ + public jalview.binding.JSeq getJSeq(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._JSeqList.size()) + { + throw new IndexOutOfBoundsException("getJSeq: Index value '" + index + + "' not in range [0.." + (this._JSeqList.size() - 1) + "]"); + } + + return (jalview.binding.JSeq) _JSeqList.get(index); + } + + /** + * Method getJSeq.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 jalview.binding.JSeq[] getJSeq() + { + jalview.binding.JSeq[] array = new jalview.binding.JSeq[0]; + return (jalview.binding.JSeq[]) this._JSeqList.toArray(array); + } + + /** + * Method getJSeqCount. + * + * @return the size of this collection + */ + public int getJSeqCount() + { + return this._JSeqList.size(); + } + + /** + * Method getTree. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.binding.Tree at the given index + */ + public jalview.binding.Tree getTree(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._treeList.size()) + { + throw new IndexOutOfBoundsException("getTree: Index value '" + index + + "' not in range [0.." + (this._treeList.size() - 1) + "]"); + } + + return (jalview.binding.Tree) _treeList.get(index); + } + + /** + * Method getTree.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 jalview.binding.Tree[] getTree() + { + jalview.binding.Tree[] array = new jalview.binding.Tree[0]; + return (jalview.binding.Tree[]) this._treeList.toArray(array); + } + + /** + * Method getTreeCount. + * + * @return the size of this collection + */ + public int getTreeCount() + { + return this._treeList.size(); + } + + /** + * Method getUserColours. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.binding.UserColours at the given index + */ + public jalview.binding.UserColours getUserColours(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._userColoursList.size()) + { + throw new IndexOutOfBoundsException("getUserColours: Index value '" + + index + "' not in range [0.." + + (this._userColoursList.size() - 1) + "]"); + } + + return (jalview.binding.UserColours) _userColoursList.get(index); + } + + /** + * Method getUserColours.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 jalview.binding.UserColours[] getUserColours() + { + jalview.binding.UserColours[] array = new jalview.binding.UserColours[0]; + return (jalview.binding.UserColours[]) this._userColoursList + .toArray(array); + } + + /** + * Method getUserColoursCount. + * + * @return the size of this collection + */ + public int getUserColoursCount() + { + return this._userColoursList.size(); + } + + /** + * Method getViewport. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.binding.Viewport at the given index + */ + public jalview.binding.Viewport getViewport(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._viewportList.size()) + { + throw new IndexOutOfBoundsException("getViewport: Index value '" + + index + "' not in range [0.." + + (this._viewportList.size() - 1) + "]"); + } + + return (jalview.binding.Viewport) _viewportList.get(index); + } + + /** + * Method getViewport.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 jalview.binding.Viewport[] getViewport() + { + jalview.binding.Viewport[] array = new jalview.binding.Viewport[0]; + return (jalview.binding.Viewport[]) this._viewportList.toArray(array); + } + + /** + * Method getViewportCount. + * + * @return the size of this collection + */ + public int getViewportCount() + { + return this._viewportList.size(); + } + + /** + * 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 removeAllJGroup() + { + this._JGroupList.clear(); + } + + /** + */ + public void removeAllJSeq() + { + this._JSeqList.clear(); + } + + /** + */ + public void removeAllTree() + { + this._treeList.clear(); + } + + /** + */ + public void removeAllUserColours() + { + this._userColoursList.clear(); + } + + /** + */ + public void removeAllViewport() + { + this._viewportList.clear(); + } + + /** + * Method removeJGroup. + * + * @param vJGroup + * @return true if the object was removed from the collection. + */ + public boolean removeJGroup(final jalview.binding.JGroup vJGroup) + { + boolean removed = _JGroupList.remove(vJGroup); + return removed; + } + + /** + * Method removeJGroupAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.binding.JGroup removeJGroupAt(final int index) + { + java.lang.Object obj = this._JGroupList.remove(index); + return (jalview.binding.JGroup) obj; + } + + /** + * Method removeJSeq. + * + * @param vJSeq + * @return true if the object was removed from the collection. + */ + public boolean removeJSeq(final jalview.binding.JSeq vJSeq) + { + boolean removed = _JSeqList.remove(vJSeq); + return removed; + } + + /** + * Method removeJSeqAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.binding.JSeq removeJSeqAt(final int index) + { + java.lang.Object obj = this._JSeqList.remove(index); + return (jalview.binding.JSeq) obj; + } + + /** + * Method removeTree. + * + * @param vTree + * @return true if the object was removed from the collection. + */ + public boolean removeTree(final jalview.binding.Tree vTree) + { + boolean removed = _treeList.remove(vTree); + return removed; + } + + /** + * Method removeTreeAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.binding.Tree removeTreeAt(final int index) + { + java.lang.Object obj = this._treeList.remove(index); + return (jalview.binding.Tree) obj; + } + + /** + * Method removeUserColours. + * + * @param vUserColours + * @return true if the object was removed from the collection. + */ + public boolean removeUserColours( + final jalview.binding.UserColours vUserColours) + { + boolean removed = _userColoursList.remove(vUserColours); + return removed; + } + + /** + * Method removeUserColoursAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.binding.UserColours removeUserColoursAt(final int index) + { + java.lang.Object obj = this._userColoursList.remove(index); + return (jalview.binding.UserColours) obj; + } + + /** + * Method removeViewport. + * + * @param vViewport + * @return true if the object was removed from the collection. + */ + public boolean removeViewport(final jalview.binding.Viewport vViewport) + { + boolean removed = _viewportList.remove(vViewport); + return removed; + } + + /** + * Method removeViewportAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.binding.Viewport removeViewportAt(final int index) + { + java.lang.Object obj = this._viewportList.remove(index); + return (jalview.binding.Viewport) obj; + } + + /** + * Sets the value of field 'featureSettings'. + * + * @param featureSettings + * the value of field 'featureSettings'. + */ + public void setFeatureSettings( + final jalview.binding.FeatureSettings featureSettings) + { + this._featureSettings = featureSettings; + } + + /** + * + * + * @param index + * @param vJGroup + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setJGroup(final int index, + final jalview.binding.JGroup vJGroup) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._JGroupList.size()) + { + throw new IndexOutOfBoundsException("setJGroup: Index value '" + + index + "' not in range [0.." + + (this._JGroupList.size() - 1) + "]"); + } + + this._JGroupList.set(index, vJGroup); + } + + /** + * + * + * @param vJGroupArray + */ + public void setJGroup(final jalview.binding.JGroup[] vJGroupArray) + { + // -- copy array + _JGroupList.clear(); + + for (int i = 0; i < vJGroupArray.length; i++) + { + this._JGroupList.add(vJGroupArray[i]); + } + } + + /** + * + * + * @param index + * @param vJSeq + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setJSeq(final int index, final jalview.binding.JSeq vJSeq) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._JSeqList.size()) + { + throw new IndexOutOfBoundsException("setJSeq: Index value '" + index + + "' not in range [0.." + (this._JSeqList.size() - 1) + "]"); + } + + this._JSeqList.set(index, vJSeq); + } + + /** + * + * + * @param vJSeqArray + */ + public void setJSeq(final jalview.binding.JSeq[] vJSeqArray) + { + // -- copy array + _JSeqList.clear(); + + for (int i = 0; i < vJSeqArray.length; i++) + { + this._JSeqList.add(vJSeqArray[i]); + } + } + + /** + * + * + * @param index + * @param vTree + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setTree(final int index, final jalview.binding.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._treeList.size()) + { + throw new IndexOutOfBoundsException("setTree: Index value '" + index + + "' not in range [0.." + (this._treeList.size() - 1) + "]"); + } + + this._treeList.set(index, vTree); + } + + /** + * + * + * @param vTreeArray + */ + public void setTree(final jalview.binding.Tree[] vTreeArray) + { + // -- copy array + _treeList.clear(); + + for (int i = 0; i < vTreeArray.length; i++) + { + this._treeList.add(vTreeArray[i]); + } + } + + /** + * + * + * @param index + * @param vUserColours + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setUserColours(final int index, + final jalview.binding.UserColours vUserColours) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._userColoursList.size()) + { + throw new IndexOutOfBoundsException("setUserColours: Index value '" + + index + "' not in range [0.." + + (this._userColoursList.size() - 1) + "]"); + } + + this._userColoursList.set(index, vUserColours); + } + + /** + * + * + * @param vUserColoursArray + */ + public void setUserColours( + final jalview.binding.UserColours[] vUserColoursArray) + { + // -- copy array + _userColoursList.clear(); + + for (int i = 0; i < vUserColoursArray.length; i++) + { + this._userColoursList.add(vUserColoursArray[i]); + } + } + + /** + * + * + * @param index + * @param vViewport + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setViewport(final int index, + final jalview.binding.Viewport vViewport) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._viewportList.size()) + { + throw new IndexOutOfBoundsException("setViewport: Index value '" + + index + "' not in range [0.." + + (this._viewportList.size() - 1) + "]"); + } + + this._viewportList.set(index, vViewport); + } + + /** + * + * + * @param vViewportArray + */ + public void setViewport(final jalview.binding.Viewport[] vViewportArray) + { + // -- copy array + _viewportList.clear(); + + for (int i = 0; i < vViewportArray.length; i++) + { + this._viewportList.add(vViewportArray[i]); + } + } + + /** + * 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.binding.JalviewModelSequence + */ + public static jalview.binding.JalviewModelSequence unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.JalviewModelSequence) Unmarshaller.unmarshal( + jalview.binding.JalviewModelSequence.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/binding/JalviewUserColours.java b/src/jalview/binding/JalviewUserColours.java index 9a6465b..02bb12e 100644 --- a/src/jalview/binding/JalviewUserColours.java +++ b/src/jalview/binding/JalviewUserColours.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,312 +19,326 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class JalviewUserColours implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _schemeName. - */ - private java.lang.String _schemeName; - - /** - * Jalview colour scheme document version. - * - */ - private java.lang.String _version; - - /** - * Field _colourList. - */ - private java.util.Vector _colourList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public JalviewUserColours() { - super(); - this._colourList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vColour - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addColour( - final Colour vColour) - throws java.lang.IndexOutOfBoundsException { - this._colourList.addElement(vColour); - } - - /** - * - * - * @param index - * @param vColour - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addColour( - final int index, - final Colour vColour) - throws java.lang.IndexOutOfBoundsException { - this._colourList.add(index, vColour); - } - - /** - * Method enumerateColour. - * - * @return an Enumeration over all Colour elements - */ - public java.util.Enumeration enumerateColour( - ) { - return this._colourList.elements(); - } - - /** - * Method getColour. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the Colour at the given index - */ - public Colour getColour( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._colourList.size()) { - throw new IndexOutOfBoundsException("getColour: Index value '" + index + "' not in range [0.." + (this._colourList.size() - 1) + "]"); - } - - return (Colour) _colourList.get(index); - } - - /** - * Method getColour.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 Colour[] getColour( - ) { - Colour[] array = new Colour[0]; - return (Colour[]) this._colourList.toArray(array); - } - - /** - * Method getColourCount. - * - * @return the size of this collection - */ - public int getColourCount( - ) { - return this._colourList.size(); - } - - /** - * Returns the value of field 'schemeName'. - * - * @return the value of field 'SchemeName'. - */ - public java.lang.String getSchemeName( - ) { - return this._schemeName; - } - - /** - * Returns the value of field 'version'. The field 'version' - * has the following description: Jalview colour scheme - * document version. - * - * - * @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; - } - 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 removeAllColour( - ) { - this._colourList.clear(); - } - - /** - * Method removeColour. - * - * @param vColour - * @return true if the object was removed from the collection. - */ - public boolean removeColour( - final Colour vColour) { - boolean removed = _colourList.remove(vColour); - return removed; +public class JalviewUserColours implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _schemeName. + */ + private java.lang.String _schemeName; + + /** + * Jalview colour scheme document version. + * + */ + private java.lang.String _version; + + /** + * Field _colourList. + */ + private java.util.Vector _colourList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public JalviewUserColours() + { + super(); + this._colourList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vColour + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addColour(final Colour vColour) + throws java.lang.IndexOutOfBoundsException + { + this._colourList.addElement(vColour); + } + + /** + * + * + * @param index + * @param vColour + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addColour(final int index, final Colour vColour) + throws java.lang.IndexOutOfBoundsException + { + this._colourList.add(index, vColour); + } + + /** + * Method enumerateColour. + * + * @return an Enumeration over all Colour elements + */ + public java.util.Enumeration enumerateColour() + { + return this._colourList.elements(); + } + + /** + * Method getColour. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the Colour at the given index + */ + public Colour getColour(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._colourList.size()) + { + throw new IndexOutOfBoundsException("getColour: Index value '" + + index + "' not in range [0.." + + (this._colourList.size() - 1) + "]"); } - /** - * Method removeColourAt. - * - * @param index - * @return the element removed from the collection - */ - public Colour removeColourAt( - final int index) { - java.lang.Object obj = this._colourList.remove(index); - return (Colour) obj; + return (Colour) _colourList.get(index); + } + + /** + * Method getColour.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 Colour[] getColour() + { + Colour[] array = new Colour[0]; + return (Colour[]) this._colourList.toArray(array); + } + + /** + * Method getColourCount. + * + * @return the size of this collection + */ + public int getColourCount() + { + return this._colourList.size(); + } + + /** + * Returns the value of field 'schemeName'. + * + * @return the value of field 'SchemeName'. + */ + public java.lang.String getSchemeName() + { + return this._schemeName; + } + + /** + * Returns the value of field 'version'. The field 'version' has the following + * description: Jalview colour scheme document version. + * + * + * @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; } - - /** - * - * - * @param index - * @param vColour - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection + 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 setColour( - final int index, - final Colour vColour) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._colourList.size()) { - throw new IndexOutOfBoundsException("setColour: Index value '" + index + "' not in range [0.." + (this._colourList.size() - 1) + "]"); - } - - this._colourList.set(index, vColour); + public void removeAllColour() + { + this._colourList.clear(); + } + + /** + * Method removeColour. + * + * @param vColour + * @return true if the object was removed from the collection. + */ + public boolean removeColour(final Colour vColour) + { + boolean removed = _colourList.remove(vColour); + return removed; + } + + /** + * Method removeColourAt. + * + * @param index + * @return the element removed from the collection + */ + public Colour removeColourAt(final int index) + { + java.lang.Object obj = this._colourList.remove(index); + return (Colour) obj; + } + + /** + * + * + * @param index + * @param vColour + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setColour(final int index, final Colour vColour) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._colourList.size()) + { + throw new IndexOutOfBoundsException("setColour: Index value '" + + index + "' not in range [0.." + + (this._colourList.size() - 1) + "]"); } - /** - * - * - * @param vColourArray - */ - public void setColour( - final Colour[] vColourArray) { - //-- copy array - _colourList.clear(); - - for (int i = 0; i < vColourArray.length; i++) { - this._colourList.add(vColourArray[i]); - } - } - - /** - * Sets the value of field 'schemeName'. - * - * @param schemeName the value of field 'schemeName'. - */ - public void setSchemeName( - final java.lang.String schemeName) { - this._schemeName = schemeName; - } - - /** - * Sets the value of field 'version'. The field 'version' has - * the following description: Jalview colour scheme document - * version. - * - * - * @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.binding.JalviewUserColours - */ - public static jalview.binding.JalviewUserColours unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.JalviewUserColours) Unmarshaller.unmarshal(jalview.binding.JalviewUserColours.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._colourList.set(index, vColour); + } + + /** + * + * + * @param vColourArray + */ + public void setColour(final Colour[] vColourArray) + { + // -- copy array + _colourList.clear(); + + for (int i = 0; i < vColourArray.length; i++) + { + this._colourList.add(vColourArray[i]); } + } + + /** + * Sets the value of field 'schemeName'. + * + * @param schemeName + * the value of field 'schemeName'. + */ + public void setSchemeName(final java.lang.String schemeName) + { + this._schemeName = schemeName; + } + + /** + * Sets the value of field 'version'. The field 'version' has the following + * description: Jalview colour scheme document version. + * + * + * @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.binding.JalviewUserColours + */ + public static jalview.binding.JalviewUserColours unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.JalviewUserColours) Unmarshaller.unmarshal( + jalview.binding.JalviewUserColours.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/binding/Pdbentry.java b/src/jalview/binding/Pdbentry.java index cac4cf6..6c0e745 100644 --- a/src/jalview/binding/Pdbentry.java +++ b/src/jalview/binding/Pdbentry.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,308 +19,326 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Pdbentry implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _id. - */ - private java.lang.String _id; - - /** - * Field _type. - */ - private java.lang.String _type; - - /** - * Field _items. - */ - private java.util.Vector _items; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Pdbentry() { - super(); - this._items = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vPdbentryItem - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addPdbentryItem( - final jalview.binding.PdbentryItem vPdbentryItem) - throws java.lang.IndexOutOfBoundsException { - this._items.addElement(vPdbentryItem); - } - - /** - * - * - * @param index - * @param vPdbentryItem - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addPdbentryItem( - final int index, - final jalview.binding.PdbentryItem vPdbentryItem) - throws java.lang.IndexOutOfBoundsException { - this._items.add(index, vPdbentryItem); - } - - /** - * Method enumeratePdbentryItem. - * - * @return an Enumeration over all jalview.binding.PdbentryItem - * elements - */ - public java.util.Enumeration enumeratePdbentryItem( - ) { - return this._items.elements(); - } - - /** - * Returns the value of field 'id'. - * - * @return the value of field 'Id'. - */ - public java.lang.String getId( - ) { - return this._id; - } - - /** - * Method getPdbentryItem. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the jalview.binding.PdbentryItem at the - * given index - */ - public jalview.binding.PdbentryItem getPdbentryItem( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._items.size()) { - throw new IndexOutOfBoundsException("getPdbentryItem: Index value '" + index + "' not in range [0.." + (this._items.size() - 1) + "]"); - } - - return (jalview.binding.PdbentryItem) _items.get(index); - } - - /** - * Method getPdbentryItem.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 jalview.binding.PdbentryItem[] getPdbentryItem( - ) { - jalview.binding.PdbentryItem[] array = new jalview.binding.PdbentryItem[0]; - return (jalview.binding.PdbentryItem[]) this._items.toArray(array); - } - - /** - * Method getPdbentryItemCount. - * - * @return the size of this collection - */ - public int getPdbentryItemCount( - ) { - return this._items.size(); - } - - /** - * Returns the value of field 'type'. - * - * @return the value of field 'Type'. - */ - public java.lang.String getType( - ) { - return this._type; - } - - /** - * 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 removeAllPdbentryItem( - ) { - this._items.clear(); - } - - /** - * Method removePdbentryItem. - * - * @param vPdbentryItem - * @return true if the object was removed from the collection. - */ - public boolean removePdbentryItem( - final jalview.binding.PdbentryItem vPdbentryItem) { - boolean removed = _items.remove(vPdbentryItem); - return removed; +public class Pdbentry implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _id. + */ + private java.lang.String _id; + + /** + * Field _type. + */ + private java.lang.String _type; + + /** + * Field _items. + */ + private java.util.Vector _items; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Pdbentry() + { + super(); + this._items = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vPdbentryItem + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addPdbentryItem( + final jalview.binding.PdbentryItem vPdbentryItem) + throws java.lang.IndexOutOfBoundsException + { + this._items.addElement(vPdbentryItem); + } + + /** + * + * + * @param index + * @param vPdbentryItem + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addPdbentryItem(final int index, + final jalview.binding.PdbentryItem vPdbentryItem) + throws java.lang.IndexOutOfBoundsException + { + this._items.add(index, vPdbentryItem); + } + + /** + * Method enumeratePdbentryItem. + * + * @return an Enumeration over all jalview.binding.PdbentryItem elements + */ + public java.util.Enumeration enumeratePdbentryItem() + { + return this._items.elements(); + } + + /** + * Returns the value of field 'id'. + * + * @return the value of field 'Id'. + */ + public java.lang.String getId() + { + return this._id; + } + + /** + * Method getPdbentryItem. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.binding.PdbentryItem at the given index + */ + public jalview.binding.PdbentryItem getPdbentryItem(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._items.size()) + { + throw new IndexOutOfBoundsException("getPdbentryItem: Index value '" + + index + "' not in range [0.." + (this._items.size() - 1) + + "]"); } - /** - * Method removePdbentryItemAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.binding.PdbentryItem removePdbentryItemAt( - final int index) { - java.lang.Object obj = this._items.remove(index); - return (jalview.binding.PdbentryItem) obj; + return (jalview.binding.PdbentryItem) _items.get(index); + } + + /** + * Method getPdbentryItem.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 jalview.binding.PdbentryItem[] getPdbentryItem() + { + jalview.binding.PdbentryItem[] array = new jalview.binding.PdbentryItem[0]; + return (jalview.binding.PdbentryItem[]) this._items.toArray(array); + } + + /** + * Method getPdbentryItemCount. + * + * @return the size of this collection + */ + public int getPdbentryItemCount() + { + return this._items.size(); + } + + /** + * Returns the value of field 'type'. + * + * @return the value of field 'Type'. + */ + public java.lang.String getType() + { + return this._type; + } + + /** + * 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; } - - /** - * Sets the value of field 'id'. - * - * @param id the value of field 'id'. + 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 setId( - final java.lang.String id) { - this._id = id; + public void removeAllPdbentryItem() + { + this._items.clear(); + } + + /** + * Method removePdbentryItem. + * + * @param vPdbentryItem + * @return true if the object was removed from the collection. + */ + public boolean removePdbentryItem( + final jalview.binding.PdbentryItem vPdbentryItem) + { + boolean removed = _items.remove(vPdbentryItem); + return removed; + } + + /** + * Method removePdbentryItemAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.binding.PdbentryItem removePdbentryItemAt(final int index) + { + java.lang.Object obj = this._items.remove(index); + return (jalview.binding.PdbentryItem) obj; + } + + /** + * Sets the value of field 'id'. + * + * @param id + * the value of field 'id'. + */ + public void setId(final java.lang.String id) + { + this._id = id; + } + + /** + * + * + * @param index + * @param vPdbentryItem + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setPdbentryItem(final int index, + final jalview.binding.PdbentryItem vPdbentryItem) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._items.size()) + { + throw new IndexOutOfBoundsException("setPdbentryItem: Index value '" + + index + "' not in range [0.." + (this._items.size() - 1) + + "]"); } - /** - * - * - * @param index - * @param vPdbentryItem - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setPdbentryItem( - final int index, - final jalview.binding.PdbentryItem vPdbentryItem) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._items.size()) { - throw new IndexOutOfBoundsException("setPdbentryItem: Index value '" + index + "' not in range [0.." + (this._items.size() - 1) + "]"); - } - - this._items.set(index, vPdbentryItem); - } - - /** - * - * - * @param vPdbentryItemArray - */ - public void setPdbentryItem( - final jalview.binding.PdbentryItem[] vPdbentryItemArray) { - //-- copy array - _items.clear(); - - for (int i = 0; i < vPdbentryItemArray.length; i++) { - this._items.add(vPdbentryItemArray[i]); - } - } - - /** - * Sets the value of field 'type'. - * - * @param type the value of field 'type'. - */ - public void setType( - final java.lang.String type) { - this._type = type; - } - - /** - * 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.binding.Pdbentry - */ - public static jalview.binding.Pdbentry unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.Pdbentry) Unmarshaller.unmarshal(jalview.binding.Pdbentry.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._items.set(index, vPdbentryItem); + } + + /** + * + * + * @param vPdbentryItemArray + */ + public void setPdbentryItem( + final jalview.binding.PdbentryItem[] vPdbentryItemArray) + { + // -- copy array + _items.clear(); + + for (int i = 0; i < vPdbentryItemArray.length; i++) + { + this._items.add(vPdbentryItemArray[i]); } + } + + /** + * Sets the value of field 'type'. + * + * @param type + * the value of field 'type'. + */ + public void setType(final java.lang.String type) + { + this._type = type; + } + + /** + * 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.binding.Pdbentry + */ + public static jalview.binding.Pdbentry unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.Pdbentry) Unmarshaller.unmarshal( + jalview.binding.Pdbentry.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/binding/PdbentryItem.java b/src/jalview/binding/PdbentryItem.java index 83bc40a..93c46e0 100644 --- a/src/jalview/binding/PdbentryItem.java +++ b/src/jalview/binding/PdbentryItem.java @@ -12,181 +12,185 @@ package jalview.binding; * * @version $Revision$ $Date$ */ -public class PdbentryItem implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _propertyList. - */ - private java.util.Vector _propertyList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public PdbentryItem() { - super(); - this._propertyList = new java.util.Vector(); +public class PdbentryItem implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _propertyList. + */ + private java.util.Vector _propertyList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public PdbentryItem() + { + super(); + this._propertyList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vProperty + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addProperty(final jalview.binding.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + this._propertyList.addElement(vProperty); + } + + /** + * + * + * @param index + * @param vProperty + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addProperty(final int index, + final jalview.binding.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + this._propertyList.add(index, vProperty); + } + + /** + * Method enumerateProperty. + * + * @return an Enumeration over all jalview.binding.Property elements + */ + public java.util.Enumeration enumerateProperty() + { + return this._propertyList.elements(); + } + + /** + * Method getProperty. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.binding.Property at the given index + */ + public jalview.binding.Property getProperty(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) + { + throw new IndexOutOfBoundsException("getProperty: Index value '" + + index + "' not in range [0.." + + (this._propertyList.size() - 1) + "]"); } - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vProperty - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection + return (jalview.binding.Property) _propertyList.get(index); + } + + /** + * Method getProperty.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 jalview.binding.Property[] getProperty() + { + jalview.binding.Property[] array = new jalview.binding.Property[0]; + return (jalview.binding.Property[]) this._propertyList.toArray(array); + } + + /** + * Method getPropertyCount. + * + * @return the size of this collection + */ + public int getPropertyCount() + { + return this._propertyList.size(); + } + + /** */ - public void addProperty( - final jalview.binding.Property vProperty) - throws java.lang.IndexOutOfBoundsException { - this._propertyList.addElement(vProperty); + public void removeAllProperty() + { + this._propertyList.clear(); + } + + /** + * Method removeProperty. + * + * @param vProperty + * @return true if the object was removed from the collection. + */ + public boolean removeProperty(final jalview.binding.Property vProperty) + { + boolean removed = _propertyList.remove(vProperty); + return removed; + } + + /** + * Method removePropertyAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.binding.Property removePropertyAt(final int index) + { + java.lang.Object obj = this._propertyList.remove(index); + return (jalview.binding.Property) obj; + } + + /** + * + * + * @param index + * @param vProperty + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setProperty(final int index, + final jalview.binding.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) + { + throw new IndexOutOfBoundsException("setProperty: Index value '" + + index + "' not in range [0.." + + (this._propertyList.size() - 1) + "]"); } - /** - * - * - * @param index - * @param vProperty - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addProperty( - final int index, - final jalview.binding.Property vProperty) - throws java.lang.IndexOutOfBoundsException { - this._propertyList.add(index, vProperty); - } - - /** - * Method enumerateProperty. - * - * @return an Enumeration over all jalview.binding.Property - * elements - */ - public java.util.Enumeration enumerateProperty( - ) { - return this._propertyList.elements(); - } - - /** - * Method getProperty. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the jalview.binding.Property at the - * given index - */ - public jalview.binding.Property getProperty( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._propertyList.size()) { - throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); - } - - return (jalview.binding.Property) _propertyList.get(index); - } - - /** - * Method getProperty.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 jalview.binding.Property[] getProperty( - ) { - jalview.binding.Property[] array = new jalview.binding.Property[0]; - return (jalview.binding.Property[]) this._propertyList.toArray(array); - } - - /** - * Method getPropertyCount. - * - * @return the size of this collection - */ - public int getPropertyCount( - ) { - return this._propertyList.size(); - } - - /** - */ - public void removeAllProperty( - ) { - this._propertyList.clear(); - } - - /** - * Method removeProperty. - * - * @param vProperty - * @return true if the object was removed from the collection. - */ - public boolean removeProperty( - final jalview.binding.Property vProperty) { - boolean removed = _propertyList.remove(vProperty); - return removed; - } - - /** - * Method removePropertyAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.binding.Property removePropertyAt( - final int index) { - java.lang.Object obj = this._propertyList.remove(index); - return (jalview.binding.Property) obj; - } - - /** - * - * - * @param index - * @param vProperty - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setProperty( - final int index, - final jalview.binding.Property vProperty) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._propertyList.size()) { - throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); - } - - this._propertyList.set(index, vProperty); - } - - /** - * - * - * @param vPropertyArray - */ - public void setProperty( - final jalview.binding.Property[] vPropertyArray) { - //-- copy array - _propertyList.clear(); - - for (int i = 0; i < vPropertyArray.length; i++) { - this._propertyList.add(vPropertyArray[i]); - } + this._propertyList.set(index, vProperty); + } + + /** + * + * + * @param vPropertyArray + */ + public void setProperty(final jalview.binding.Property[] vPropertyArray) + { + // -- copy array + _propertyList.clear(); + + for (int i = 0; i < vPropertyArray.length; i++) + { + this._propertyList.add(vPropertyArray[i]); } + } } diff --git a/src/jalview/binding/Pdbids.java b/src/jalview/binding/Pdbids.java index b4745a2..d821a6a 100644 --- a/src/jalview/binding/Pdbids.java +++ b/src/jalview/binding/Pdbids.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,98 +19,106 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Pdbids extends Pdbentry -implements java.io.Serializable +public class Pdbids extends Pdbentry implements java.io.Serializable { + // ----------------/ + // - Constructors -/ + // ----------------/ - //----------------/ - //- Constructors -/ - //----------------/ - - public Pdbids() { - super(); - } - + public Pdbids() + { + super(); + } - //-----------/ - //- Methods -/ - //-----------/ + // -----------/ + // - Methods -/ + // -----------/ - /** - * 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; + /** + * 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 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); - } + /** + * + * + * @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); + } - /** - * 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.binding.Pdbentry - */ - public static jalview.binding.Pdbentry unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.Pdbentry) Unmarshaller.unmarshal(jalview.binding.Pdbids.class, reader); - } + /** + * 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.binding.Pdbentry + */ + public static jalview.binding.Pdbentry unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.Pdbentry) Unmarshaller.unmarshal( + jalview.binding.Pdbids.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); - } + /** + * + * + * @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/binding/Property.java b/src/jalview/binding/Property.java index f1114f7..df3decf 100644 --- a/src/jalview/binding/Property.java +++ b/src/jalview/binding/Property.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,151 +19,162 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Property implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _name. - */ - private java.lang.String _name; - - /** - * Field _value. - */ - private java.lang.String _value; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Property() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Returns the value of field 'name'. - * - * @return the value of field 'Name'. - */ - public java.lang.String getName( - ) { - return this._name; - } - - /** - * Returns the value of field 'value'. - * - * @return the value of field 'Value'. - */ - public java.lang.String getValue( - ) { - return this._value; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'name'. - * - * @param name the value of field 'name'. - */ - public void setName( - final java.lang.String name) { - this._name = name; - } - - /** - * Sets the value of field 'value'. - * - * @param value the value of field 'value'. - */ - public void setValue( - final java.lang.String value) { - this._value = value; - } - - /** - * 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.binding.Property - */ - public static jalview.binding.Property unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.Property) Unmarshaller.unmarshal(jalview.binding.Property.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); +public class Property implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _name. + */ + private java.lang.String _name; + + /** + * Field _value. + */ + private java.lang.String _value; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Property() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Returns the value of field 'name'. + * + * @return the value of field 'Name'. + */ + public java.lang.String getName() + { + return this._name; + } + + /** + * Returns the value of field 'value'. + * + * @return the value of field 'Value'. + */ + public java.lang.String getValue() + { + return this._value; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'name'. + * + * @param name + * the value of field 'name'. + */ + public void setName(final java.lang.String name) + { + this._name = name; + } + + /** + * Sets the value of field 'value'. + * + * @param value + * the value of field 'value'. + */ + public void setValue(final java.lang.String value) + { + this._value = value; + } + + /** + * 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.binding.Property + */ + public static jalview.binding.Property unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.Property) Unmarshaller.unmarshal( + jalview.binding.Property.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/binding/Sequence.java b/src/jalview/binding/Sequence.java index 9c8cbc2..5ab8a37 100644 --- a/src/jalview/binding/Sequence.java +++ b/src/jalview/binding/Sequence.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,98 +19,106 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Sequence extends SequenceType -implements java.io.Serializable +public class Sequence extends SequenceType implements java.io.Serializable { + // ----------------/ + // - Constructors -/ + // ----------------/ - //----------------/ - //- Constructors -/ - //----------------/ - - public Sequence() { - super(); - } - + public Sequence() + { + super(); + } - //-----------/ - //- Methods -/ - //-----------/ + // -----------/ + // - Methods -/ + // -----------/ - /** - * 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; + /** + * 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 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); - } + /** + * + * + * @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); + } - /** - * 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.binding.SequenceType - */ - public static jalview.binding.SequenceType unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.SequenceType) Unmarshaller.unmarshal(jalview.binding.Sequence.class, reader); - } + /** + * 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.binding.SequenceType + */ + public static jalview.binding.SequenceType unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.SequenceType) Unmarshaller.unmarshal( + jalview.binding.Sequence.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); - } + /** + * + * + * @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/binding/SequenceSet.java b/src/jalview/binding/SequenceSet.java index 13a9020..c12934d 100644 --- a/src/jalview/binding/SequenceSet.java +++ b/src/jalview/binding/SequenceSet.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,496 +19,520 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class SequenceSet implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _gapChar. - */ - private java.lang.String _gapChar; - - /** - * Field _aligned. - */ - private boolean _aligned; - - /** - * keeps track of state for field: _aligned - */ - private boolean _has_aligned; - - /** - * Field _sequenceList. - */ - private java.util.Vector _sequenceList; - - /** - * Field _annotationList. - */ - private java.util.Vector _annotationList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public SequenceSet() { - super(); - this._sequenceList = new java.util.Vector(); - this._annotationList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vAnnotation - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addAnnotation( - final jalview.binding.Annotation vAnnotation) - throws java.lang.IndexOutOfBoundsException { - this._annotationList.addElement(vAnnotation); - } - - /** - * - * - * @param index - * @param vAnnotation - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addAnnotation( - final int index, - final jalview.binding.Annotation vAnnotation) - throws java.lang.IndexOutOfBoundsException { - this._annotationList.add(index, vAnnotation); - } - - /** - * - * - * @param vSequence - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSequence( - final jalview.binding.Sequence vSequence) - throws java.lang.IndexOutOfBoundsException { - this._sequenceList.addElement(vSequence); - } - - /** - * - * - * @param index - * @param vSequence - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSequence( - final int index, - final jalview.binding.Sequence vSequence) - throws java.lang.IndexOutOfBoundsException { - this._sequenceList.add(index, vSequence); - } - - /** - */ - public void deleteAligned( - ) { - this._has_aligned= false; - } - - /** - * Method enumerateAnnotation. - * - * @return an Enumeration over all jalview.binding.Annotation - * elements - */ - public java.util.Enumeration enumerateAnnotation( - ) { - return this._annotationList.elements(); - } - - /** - * Method enumerateSequence. - * - * @return an Enumeration over all jalview.binding.Sequence - * elements - */ - public java.util.Enumeration enumerateSequence( - ) { - return this._sequenceList.elements(); - } - - /** - * Returns the value of field 'aligned'. - * - * @return the value of field 'Aligned'. - */ - public boolean getAligned( - ) { - return this._aligned; - } - - /** - * Method getAnnotation. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the jalview.binding.Annotation at the - * given index - */ - public jalview.binding.Annotation getAnnotation( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._annotationList.size()) { - throw new IndexOutOfBoundsException("getAnnotation: Index value '" + index + "' not in range [0.." + (this._annotationList.size() - 1) + "]"); - } - - return (jalview.binding.Annotation) _annotationList.get(index); - } - - /** - * Method getAnnotation.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 jalview.binding.Annotation[] getAnnotation( - ) { - jalview.binding.Annotation[] array = new jalview.binding.Annotation[0]; - return (jalview.binding.Annotation[]) this._annotationList.toArray(array); - } - - /** - * Method getAnnotationCount. - * - * @return the size of this collection - */ - public int getAnnotationCount( - ) { - return this._annotationList.size(); - } - - /** - * Returns the value of field 'gapChar'. - * - * @return the value of field 'GapChar'. - */ - public java.lang.String getGapChar( - ) { - return this._gapChar; - } - - /** - * Method getSequence. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the jalview.binding.Sequence at the - * given index - */ - public jalview.binding.Sequence getSequence( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._sequenceList.size()) { - throw new IndexOutOfBoundsException("getSequence: Index value '" + index + "' not in range [0.." + (this._sequenceList.size() - 1) + "]"); - } - - return (jalview.binding.Sequence) _sequenceList.get(index); - } - - /** - * Method getSequence.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 jalview.binding.Sequence[] getSequence( - ) { - jalview.binding.Sequence[] array = new jalview.binding.Sequence[0]; - return (jalview.binding.Sequence[]) this._sequenceList.toArray(array); - } - - /** - * Method getSequenceCount. - * - * @return the size of this collection - */ - public int getSequenceCount( - ) { - return this._sequenceList.size(); - } - - /** - * Method hasAligned. - * - * @return true if at least one Aligned has been added - */ - public boolean hasAligned( - ) { - return this._has_aligned; - } - - /** - * Returns the value of field 'aligned'. - * - * @return the value of field 'Aligned'. - */ - public boolean isAligned( - ) { - return this._aligned; - } - - /** - * 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 removeAllAnnotation( - ) { - this._annotationList.clear(); - } - - /** - */ - public void removeAllSequence( - ) { - this._sequenceList.clear(); - } - - /** - * Method removeAnnotation. - * - * @param vAnnotation - * @return true if the object was removed from the collection. - */ - public boolean removeAnnotation( - final jalview.binding.Annotation vAnnotation) { - boolean removed = _annotationList.remove(vAnnotation); - return removed; - } - - /** - * Method removeAnnotationAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.binding.Annotation removeAnnotationAt( - final int index) { - java.lang.Object obj = this._annotationList.remove(index); - return (jalview.binding.Annotation) obj; - } - - /** - * Method removeSequence. - * - * @param vSequence - * @return true if the object was removed from the collection. - */ - public boolean removeSequence( - final jalview.binding.Sequence vSequence) { - boolean removed = _sequenceList.remove(vSequence); - return removed; - } - - /** - * Method removeSequenceAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.binding.Sequence removeSequenceAt( - final int index) { - java.lang.Object obj = this._sequenceList.remove(index); - return (jalview.binding.Sequence) obj; - } - - /** - * Sets the value of field 'aligned'. - * - * @param aligned the value of field 'aligned'. - */ - public void setAligned( - final boolean aligned) { - this._aligned = aligned; - this._has_aligned = true; - } - - /** - * - * - * @param index - * @param vAnnotation - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setAnnotation( - final int index, - final jalview.binding.Annotation vAnnotation) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._annotationList.size()) { - throw new IndexOutOfBoundsException("setAnnotation: Index value '" + index + "' not in range [0.." + (this._annotationList.size() - 1) + "]"); - } - - this._annotationList.set(index, vAnnotation); - } - - /** - * - * - * @param vAnnotationArray - */ - public void setAnnotation( - final jalview.binding.Annotation[] vAnnotationArray) { - //-- copy array - _annotationList.clear(); - - for (int i = 0; i < vAnnotationArray.length; i++) { - this._annotationList.add(vAnnotationArray[i]); - } - } - - /** - * Sets the value of field 'gapChar'. - * - * @param gapChar the value of field 'gapChar'. - */ - public void setGapChar( - final java.lang.String gapChar) { - this._gapChar = gapChar; - } - - /** - * - * - * @param index - * @param vSequence - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setSequence( - final int index, - final jalview.binding.Sequence vSequence) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._sequenceList.size()) { - throw new IndexOutOfBoundsException("setSequence: Index value '" + index + "' not in range [0.." + (this._sequenceList.size() - 1) + "]"); - } - - this._sequenceList.set(index, vSequence); - } - - /** - * - * - * @param vSequenceArray - */ - public void setSequence( - final jalview.binding.Sequence[] vSequenceArray) { - //-- copy array - _sequenceList.clear(); - - for (int i = 0; i < vSequenceArray.length; i++) { - this._sequenceList.add(vSequenceArray[i]); - } - } - - /** - * 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.binding.SequenceSet - */ - public static jalview.binding.SequenceSet unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.SequenceSet) Unmarshaller.unmarshal(jalview.binding.SequenceSet.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class SequenceSet implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _gapChar. + */ + private java.lang.String _gapChar; + + /** + * Field _aligned. + */ + private boolean _aligned; + + /** + * keeps track of state for field: _aligned + */ + private boolean _has_aligned; + + /** + * Field _sequenceList. + */ + private java.util.Vector _sequenceList; + + /** + * Field _annotationList. + */ + private java.util.Vector _annotationList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public SequenceSet() + { + super(); + this._sequenceList = new java.util.Vector(); + this._annotationList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vAnnotation + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addAnnotation(final jalview.binding.Annotation vAnnotation) + throws java.lang.IndexOutOfBoundsException + { + this._annotationList.addElement(vAnnotation); + } + + /** + * + * + * @param index + * @param vAnnotation + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addAnnotation(final int index, + final jalview.binding.Annotation vAnnotation) + throws java.lang.IndexOutOfBoundsException + { + this._annotationList.add(index, vAnnotation); + } + + /** + * + * + * @param vSequence + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSequence(final jalview.binding.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException + { + this._sequenceList.addElement(vSequence); + } + + /** + * + * + * @param index + * @param vSequence + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSequence(final int index, + final jalview.binding.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException + { + this._sequenceList.add(index, vSequence); + } + + /** + */ + public void deleteAligned() + { + this._has_aligned = false; + } + + /** + * Method enumerateAnnotation. + * + * @return an Enumeration over all jalview.binding.Annotation elements + */ + public java.util.Enumeration enumerateAnnotation() + { + return this._annotationList.elements(); + } + + /** + * Method enumerateSequence. + * + * @return an Enumeration over all jalview.binding.Sequence elements + */ + public java.util.Enumeration enumerateSequence() + { + return this._sequenceList.elements(); + } + + /** + * Returns the value of field 'aligned'. + * + * @return the value of field 'Aligned'. + */ + public boolean getAligned() + { + return this._aligned; + } + + /** + * Method getAnnotation. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.binding.Annotation at the given index + */ + public jalview.binding.Annotation getAnnotation(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._annotationList.size()) + { + throw new IndexOutOfBoundsException("getAnnotation: Index value '" + + index + "' not in range [0.." + + (this._annotationList.size() - 1) + "]"); + } + + return (jalview.binding.Annotation) _annotationList.get(index); + } + + /** + * Method getAnnotation.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 jalview.binding.Annotation[] getAnnotation() + { + jalview.binding.Annotation[] array = new jalview.binding.Annotation[0]; + return (jalview.binding.Annotation[]) this._annotationList + .toArray(array); + } + + /** + * Method getAnnotationCount. + * + * @return the size of this collection + */ + public int getAnnotationCount() + { + return this._annotationList.size(); + } + + /** + * Returns the value of field 'gapChar'. + * + * @return the value of field 'GapChar'. + */ + public java.lang.String getGapChar() + { + return this._gapChar; + } + + /** + * Method getSequence. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.binding.Sequence at the given index + */ + public jalview.binding.Sequence getSequence(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._sequenceList.size()) + { + throw new IndexOutOfBoundsException("getSequence: Index value '" + + index + "' not in range [0.." + + (this._sequenceList.size() - 1) + "]"); + } + + return (jalview.binding.Sequence) _sequenceList.get(index); + } + + /** + * Method getSequence.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 jalview.binding.Sequence[] getSequence() + { + jalview.binding.Sequence[] array = new jalview.binding.Sequence[0]; + return (jalview.binding.Sequence[]) this._sequenceList.toArray(array); + } + + /** + * Method getSequenceCount. + * + * @return the size of this collection + */ + public int getSequenceCount() + { + return this._sequenceList.size(); + } + + /** + * Method hasAligned. + * + * @return true if at least one Aligned has been added + */ + public boolean hasAligned() + { + return this._has_aligned; + } + + /** + * Returns the value of field 'aligned'. + * + * @return the value of field 'Aligned'. + */ + public boolean isAligned() + { + return this._aligned; + } + + /** + * 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 removeAllAnnotation() + { + this._annotationList.clear(); + } + + /** + */ + public void removeAllSequence() + { + this._sequenceList.clear(); + } + + /** + * Method removeAnnotation. + * + * @param vAnnotation + * @return true if the object was removed from the collection. + */ + public boolean removeAnnotation( + final jalview.binding.Annotation vAnnotation) + { + boolean removed = _annotationList.remove(vAnnotation); + return removed; + } + + /** + * Method removeAnnotationAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.binding.Annotation removeAnnotationAt(final int index) + { + java.lang.Object obj = this._annotationList.remove(index); + return (jalview.binding.Annotation) obj; + } + + /** + * Method removeSequence. + * + * @param vSequence + * @return true if the object was removed from the collection. + */ + public boolean removeSequence(final jalview.binding.Sequence vSequence) + { + boolean removed = _sequenceList.remove(vSequence); + return removed; + } + + /** + * Method removeSequenceAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.binding.Sequence removeSequenceAt(final int index) + { + java.lang.Object obj = this._sequenceList.remove(index); + return (jalview.binding.Sequence) obj; + } + + /** + * Sets the value of field 'aligned'. + * + * @param aligned + * the value of field 'aligned'. + */ + public void setAligned(final boolean aligned) + { + this._aligned = aligned; + this._has_aligned = true; + } + + /** + * + * + * @param index + * @param vAnnotation + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setAnnotation(final int index, + final jalview.binding.Annotation vAnnotation) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._annotationList.size()) + { + throw new IndexOutOfBoundsException("setAnnotation: Index value '" + + index + "' not in range [0.." + + (this._annotationList.size() - 1) + "]"); + } + + this._annotationList.set(index, vAnnotation); + } + + /** + * + * + * @param vAnnotationArray + */ + public void setAnnotation( + final jalview.binding.Annotation[] vAnnotationArray) + { + // -- copy array + _annotationList.clear(); + + for (int i = 0; i < vAnnotationArray.length; i++) + { + this._annotationList.add(vAnnotationArray[i]); + } + } + + /** + * Sets the value of field 'gapChar'. + * + * @param gapChar + * the value of field 'gapChar'. + */ + public void setGapChar(final java.lang.String gapChar) + { + this._gapChar = gapChar; + } + + /** + * + * + * @param index + * @param vSequence + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setSequence(final int index, + final jalview.binding.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._sequenceList.size()) + { + throw new IndexOutOfBoundsException("setSequence: Index value '" + + index + "' not in range [0.." + + (this._sequenceList.size() - 1) + "]"); + } + + this._sequenceList.set(index, vSequence); + } + + /** + * + * + * @param vSequenceArray + */ + public void setSequence(final jalview.binding.Sequence[] vSequenceArray) + { + // -- copy array + _sequenceList.clear(); + + for (int i = 0; i < vSequenceArray.length; i++) + { + this._sequenceList.add(vSequenceArray[i]); + } + } + + /** + * 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.binding.SequenceSet + */ + public static jalview.binding.SequenceSet unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.SequenceSet) Unmarshaller.unmarshal( + jalview.binding.SequenceSet.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/binding/SequenceType.java b/src/jalview/binding/SequenceType.java index 1bb2a62..d725405 100644 --- a/src/jalview/binding/SequenceType.java +++ b/src/jalview/binding/SequenceType.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,176 +19,188 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class SequenceType implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _id. - */ - private java.lang.String _id; - - /** - * Field _sequence. - */ - private java.lang.String _sequence; - - /** - * Field _name. - */ - private java.lang.String _name; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public SequenceType() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Returns the value of field 'id'. - * - * @return the value of field 'Id'. - */ - public java.lang.String getId( - ) { - return this._id; - } - - /** - * Returns the value of field 'name'. - * - * @return the value of field 'Name'. - */ - public java.lang.String getName( - ) { - return this._name; - } - - /** - * Returns the value of field 'sequence'. - * - * @return the value of field 'Sequence'. - */ - public java.lang.String getSequence( - ) { - return this._sequence; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'id'. - * - * @param id the value of field 'id'. - */ - public void setId( - final java.lang.String id) { - this._id = id; - } - - /** - * Sets the value of field 'name'. - * - * @param name the value of field 'name'. - */ - public void setName( - final java.lang.String name) { - this._name = name; - } - - /** - * Sets the value of field 'sequence'. - * - * @param sequence the value of field 'sequence'. - */ - public void setSequence( - final java.lang.String sequence) { - this._sequence = sequence; - } - - /** - * 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.binding.SequenceType - */ - public static jalview.binding.SequenceType unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.SequenceType) Unmarshaller.unmarshal(jalview.binding.SequenceType.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); +public class SequenceType implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _id. + */ + private java.lang.String _id; + + /** + * Field _sequence. + */ + private java.lang.String _sequence; + + /** + * Field _name. + */ + private java.lang.String _name; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public SequenceType() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Returns the value of field 'id'. + * + * @return the value of field 'Id'. + */ + public java.lang.String getId() + { + return this._id; + } + + /** + * Returns the value of field 'name'. + * + * @return the value of field 'Name'. + */ + public java.lang.String getName() + { + return this._name; + } + + /** + * Returns the value of field 'sequence'. + * + * @return the value of field 'Sequence'. + */ + public java.lang.String getSequence() + { + return this._sequence; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'id'. + * + * @param id + * the value of field 'id'. + */ + public void setId(final java.lang.String id) + { + this._id = id; + } + + /** + * Sets the value of field 'name'. + * + * @param name + * the value of field 'name'. + */ + public void setName(final java.lang.String name) + { + this._name = name; + } + + /** + * Sets the value of field 'sequence'. + * + * @param sequence + * the value of field 'sequence'. + */ + public void setSequence(final java.lang.String sequence) + { + this._sequence = sequence; + } + + /** + * 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.binding.SequenceType + */ + public static jalview.binding.SequenceType unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.SequenceType) Unmarshaller.unmarshal( + jalview.binding.SequenceType.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/binding/Setting.java b/src/jalview/binding/Setting.java index 9cd84b4..6641429 100644 --- a/src/jalview/binding/Setting.java +++ b/src/jalview/binding/Setting.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,232 +19,244 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Setting implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _type. - */ - private java.lang.String _type; - - /** - * Field _colour. - */ - private int _colour; - - /** - * keeps track of state for field: _colour - */ - private boolean _has_colour; - - /** - * Field _display. - */ - private boolean _display; - - /** - * keeps track of state for field: _display - */ - private boolean _has_display; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Setting() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deleteColour( - ) { - this._has_colour= false; - } - - /** - */ - public void deleteDisplay( - ) { - this._has_display= false; - } - - /** - * Returns the value of field 'colour'. - * - * @return the value of field 'Colour'. - */ - public int getColour( - ) { - return this._colour; - } - - /** - * Returns the value of field 'display'. - * - * @return the value of field 'Display'. - */ - public boolean getDisplay( - ) { - return this._display; - } - - /** - * Returns the value of field 'type'. - * - * @return the value of field 'Type'. +public class Setting implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _type. + */ + private java.lang.String _type; + + /** + * Field _colour. + */ + private int _colour; + + /** + * keeps track of state for field: _colour + */ + private boolean _has_colour; + + /** + * Field _display. + */ + private boolean _display; + + /** + * keeps track of state for field: _display + */ + private boolean _has_display; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Setting() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** */ - public java.lang.String getType( - ) { - return this._type; - } - - /** - * Method hasColour. - * - * @return true if at least one Colour has been added - */ - public boolean hasColour( - ) { - return this._has_colour; - } - - /** - * Method hasDisplay. - * - * @return true if at least one Display has been added - */ - public boolean hasDisplay( - ) { - return this._has_display; - } - - /** - * Returns the value of field 'display'. - * - * @return the value of field 'Display'. - */ - public boolean isDisplay( - ) { - return this._display; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'colour'. - * - * @param colour the value of field 'colour'. - */ - public void setColour( - final int colour) { - this._colour = colour; - this._has_colour = true; - } - - /** - * Sets the value of field 'display'. - * - * @param display the value of field 'display'. - */ - public void setDisplay( - final boolean display) { - this._display = display; - this._has_display = true; - } - - /** - * Sets the value of field 'type'. - * - * @param type the value of field 'type'. - */ - public void setType( - final java.lang.String type) { - this._type = type; - } - - /** - * 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.binding.Setting - */ - public static jalview.binding.Setting unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.Setting) Unmarshaller.unmarshal(jalview.binding.Setting.class, reader); - } + public void deleteColour() + { + this._has_colour = false; + } - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema + /** */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); + public void deleteDisplay() + { + this._has_display = false; + } + + /** + * Returns the value of field 'colour'. + * + * @return the value of field 'Colour'. + */ + public int getColour() + { + return this._colour; + } + + /** + * Returns the value of field 'display'. + * + * @return the value of field 'Display'. + */ + public boolean getDisplay() + { + return this._display; + } + + /** + * Returns the value of field 'type'. + * + * @return the value of field 'Type'. + */ + public java.lang.String getType() + { + return this._type; + } + + /** + * Method hasColour. + * + * @return true if at least one Colour has been added + */ + public boolean hasColour() + { + return this._has_colour; + } + + /** + * Method hasDisplay. + * + * @return true if at least one Display has been added + */ + public boolean hasDisplay() + { + return this._has_display; + } + + /** + * Returns the value of field 'display'. + * + * @return the value of field 'Display'. + */ + public boolean isDisplay() + { + return this._display; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'colour'. + * + * @param colour + * the value of field 'colour'. + */ + public void setColour(final int colour) + { + this._colour = colour; + this._has_colour = true; + } + + /** + * Sets the value of field 'display'. + * + * @param display + * the value of field 'display'. + */ + public void setDisplay(final boolean display) + { + this._display = display; + this._has_display = true; + } + + /** + * Sets the value of field 'type'. + * + * @param type + * the value of field 'type'. + */ + public void setType(final java.lang.String type) + { + this._type = type; + } + + /** + * 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.binding.Setting + */ + public static jalview.binding.Setting unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.Setting) Unmarshaller.unmarshal( + jalview.binding.Setting.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/binding/Tree.java b/src/jalview/binding/Tree.java index 5f138d0..04ea0a4 100644 --- a/src/jalview/binding/Tree.java +++ b/src/jalview/binding/Tree.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,802 +19,825 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Tree implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _width. - */ - private int _width; - - /** - * keeps track of state for field: _width - */ - private boolean _has_width; - - /** - * Field _height. - */ - private int _height; - - /** - * keeps track of state for field: _height - */ - private boolean _has_height; - - /** - * Field _xpos. - */ - private int _xpos; - - /** - * keeps track of state for field: _xpos - */ - private boolean _has_xpos; - - /** - * Field _ypos. - */ - private int _ypos; - - /** - * keeps track of state for field: _ypos - */ - private boolean _has_ypos; - - /** - * Field _fontName. - */ - private java.lang.String _fontName; - - /** - * Field _fontSize. - */ - private int _fontSize; - - /** - * keeps track of state for field: _fontSize - */ - private boolean _has_fontSize; - - /** - * Field _fontStyle. - */ - private int _fontStyle; - - /** - * keeps track of state for field: _fontStyle - */ - private boolean _has_fontStyle; - - /** - * Field _threshold. - */ - private float _threshold; - - /** - * keeps track of state for field: _threshold - */ - private boolean _has_threshold; - - /** - * Field _showBootstrap. - */ - private boolean _showBootstrap; - - /** - * keeps track of state for field: _showBootstrap - */ - private boolean _has_showBootstrap; - - /** - * Field _showDistances. - */ - private boolean _showDistances; - - /** - * keeps track of state for field: _showDistances - */ - private boolean _has_showDistances; - - /** - * Field _markUnlinked. - */ - private boolean _markUnlinked; - - /** - * keeps track of state for field: _markUnlinked - */ - private boolean _has_markUnlinked; - - /** - * Field _fitToWindow. - */ - private boolean _fitToWindow; - - /** - * keeps track of state for field: _fitToWindow - */ - private boolean _has_fitToWindow; - - /** - * Field _currentTree. - */ - private boolean _currentTree; - - /** - * keeps track of state for field: _currentTree - */ - private boolean _has_currentTree; - - /** - * Field _title. - */ - private java.lang.String _title; - - /** - * Field _newick. - */ - private java.lang.String _newick; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Tree() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deleteCurrentTree( - ) { - this._has_currentTree= false; - } - - /** - */ - public void deleteFitToWindow( - ) { - this._has_fitToWindow= false; - } - - /** - */ - public void deleteFontSize( - ) { - this._has_fontSize= false; - } - - /** - */ - public void deleteFontStyle( - ) { - this._has_fontStyle= false; - } - - /** - */ - public void deleteHeight( - ) { - this._has_height= false; - } - - /** - */ - public void deleteMarkUnlinked( - ) { - this._has_markUnlinked= false; - } - - /** - */ - public void deleteShowBootstrap( - ) { - this._has_showBootstrap= false; - } - - /** - */ - public void deleteShowDistances( - ) { - this._has_showDistances= false; - } - - /** - */ - public void deleteThreshold( - ) { - this._has_threshold= false; - } - - /** - */ - public void deleteWidth( - ) { - this._has_width= false; - } - - /** - */ - public void deleteXpos( - ) { - this._has_xpos= false; - } - - /** - */ - public void deleteYpos( - ) { - this._has_ypos= false; - } - - /** - * Returns the value of field 'currentTree'. - * - * @return the value of field 'CurrentTree'. - */ - public boolean getCurrentTree( - ) { - return this._currentTree; - } - - /** - * Returns the value of field 'fitToWindow'. - * - * @return the value of field 'FitToWindow'. - */ - public boolean getFitToWindow( - ) { - return this._fitToWindow; - } - - /** - * Returns the value of field 'fontName'. - * - * @return the value of field 'FontName'. - */ - public java.lang.String getFontName( - ) { - return this._fontName; - } - - /** - * Returns the value of field 'fontSize'. - * - * @return the value of field 'FontSize'. - */ - public int getFontSize( - ) { - return this._fontSize; - } - - /** - * Returns the value of field 'fontStyle'. - * - * @return the value of field 'FontStyle'. - */ - public int getFontStyle( - ) { - return this._fontStyle; - } - - /** - * Returns the value of field 'height'. - * - * @return the value of field 'Height'. - */ - public int getHeight( - ) { - return this._height; - } - - /** - * Returns the value of field 'markUnlinked'. - * - * @return the value of field 'MarkUnlinked'. - */ - public boolean getMarkUnlinked( - ) { - return this._markUnlinked; - } - - /** - * Returns the value of field 'newick'. - * - * @return the value of field 'Newick'. - */ - public java.lang.String getNewick( - ) { - return this._newick; - } - - /** - * Returns the value of field 'showBootstrap'. - * - * @return the value of field 'ShowBootstrap'. - */ - public boolean getShowBootstrap( - ) { - return this._showBootstrap; - } - - /** - * Returns the value of field 'showDistances'. - * - * @return the value of field 'ShowDistances'. - */ - public boolean getShowDistances( - ) { - return this._showDistances; - } - - /** - * Returns the value of field 'threshold'. - * - * @return the value of field 'Threshold'. - */ - public float getThreshold( - ) { - return this._threshold; - } - - /** - * Returns the value of field 'title'. - * - * @return the value of field 'Title'. - */ - public java.lang.String getTitle( - ) { - return this._title; - } - - /** - * Returns the value of field 'width'. - * - * @return the value of field 'Width'. - */ - public int getWidth( - ) { - return this._width; - } - - /** - * Returns the value of field 'xpos'. - * - * @return the value of field 'Xpos'. - */ - public int getXpos( - ) { - return this._xpos; - } - - /** - * Returns the value of field 'ypos'. - * - * @return the value of field 'Ypos'. - */ - public int getYpos( - ) { - return this._ypos; - } - - /** - * Method hasCurrentTree. - * - * @return true if at least one CurrentTree has been added - */ - public boolean hasCurrentTree( - ) { - return this._has_currentTree; - } - - /** - * Method hasFitToWindow. - * - * @return true if at least one FitToWindow has been added - */ - public boolean hasFitToWindow( - ) { - return this._has_fitToWindow; - } - - /** - * Method hasFontSize. - * - * @return true if at least one FontSize has been added - */ - public boolean hasFontSize( - ) { - return this._has_fontSize; - } - - /** - * Method hasFontStyle. - * - * @return true if at least one FontStyle has been added - */ - public boolean hasFontStyle( - ) { - return this._has_fontStyle; - } - - /** - * Method hasHeight. - * - * @return true if at least one Height has been added - */ - public boolean hasHeight( - ) { - return this._has_height; - } - - /** - * Method hasMarkUnlinked. - * - * @return true if at least one MarkUnlinked has been added - */ - public boolean hasMarkUnlinked( - ) { - return this._has_markUnlinked; - } - - /** - * Method hasShowBootstrap. - * - * @return true if at least one ShowBootstrap has been added - */ - public boolean hasShowBootstrap( - ) { - return this._has_showBootstrap; - } - - /** - * Method hasShowDistances. - * - * @return true if at least one ShowDistances has been added - */ - public boolean hasShowDistances( - ) { - return this._has_showDistances; - } - - /** - * Method hasThreshold. - * - * @return true if at least one Threshold has been added - */ - public boolean hasThreshold( - ) { - return this._has_threshold; - } - - /** - * Method hasWidth. - * - * @return true if at least one Width has been added - */ - public boolean hasWidth( - ) { - return this._has_width; - } - - /** - * Method hasXpos. - * - * @return true if at least one Xpos has been added - */ - public boolean hasXpos( - ) { - return this._has_xpos; - } - - /** - * Method hasYpos. - * - * @return true if at least one Ypos has been added - */ - public boolean hasYpos( - ) { - return this._has_ypos; - } - - /** - * Returns the value of field 'currentTree'. - * - * @return the value of field 'CurrentTree'. - */ - public boolean isCurrentTree( - ) { - return this._currentTree; - } - - /** - * Returns the value of field 'fitToWindow'. - * - * @return the value of field 'FitToWindow'. - */ - public boolean isFitToWindow( - ) { - return this._fitToWindow; - } - - /** - * Returns the value of field 'markUnlinked'. - * - * @return the value of field 'MarkUnlinked'. - */ - public boolean isMarkUnlinked( - ) { - return this._markUnlinked; - } - - /** - * Returns the value of field 'showBootstrap'. - * - * @return the value of field 'ShowBootstrap'. - */ - public boolean isShowBootstrap( - ) { - return this._showBootstrap; - } - - /** - * Returns the value of field 'showDistances'. - * - * @return the value of field 'ShowDistances'. - */ - public boolean isShowDistances( - ) { - return this._showDistances; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'currentTree'. - * - * @param currentTree the value of field 'currentTree'. - */ - public void setCurrentTree( - final boolean currentTree) { - this._currentTree = currentTree; - this._has_currentTree = true; - } - - /** - * Sets the value of field 'fitToWindow'. - * - * @param fitToWindow the value of field 'fitToWindow'. - */ - public void setFitToWindow( - final boolean fitToWindow) { - this._fitToWindow = fitToWindow; - this._has_fitToWindow = true; - } - - /** - * Sets the value of field 'fontName'. - * - * @param fontName the value of field 'fontName'. - */ - public void setFontName( - final java.lang.String fontName) { - this._fontName = fontName; - } - - /** - * Sets the value of field 'fontSize'. - * - * @param fontSize the value of field 'fontSize'. - */ - public void setFontSize( - final int fontSize) { - this._fontSize = fontSize; - this._has_fontSize = true; - } - - /** - * Sets the value of field 'fontStyle'. - * - * @param fontStyle the value of field 'fontStyle'. - */ - public void setFontStyle( - final int fontStyle) { - this._fontStyle = fontStyle; - this._has_fontStyle = true; - } - - /** - * Sets the value of field 'height'. - * - * @param height the value of field 'height'. - */ - public void setHeight( - final int height) { - this._height = height; - this._has_height = true; - } - - /** - * Sets the value of field 'markUnlinked'. - * - * @param markUnlinked the value of field 'markUnlinked'. - */ - public void setMarkUnlinked( - final boolean markUnlinked) { - this._markUnlinked = markUnlinked; - this._has_markUnlinked = true; - } - - /** - * Sets the value of field 'newick'. - * - * @param newick the value of field 'newick'. - */ - public void setNewick( - final java.lang.String newick) { - this._newick = newick; - } - - /** - * Sets the value of field 'showBootstrap'. - * - * @param showBootstrap the value of field 'showBootstrap'. - */ - public void setShowBootstrap( - final boolean showBootstrap) { - this._showBootstrap = showBootstrap; - this._has_showBootstrap = true; - } - - /** - * Sets the value of field 'showDistances'. - * - * @param showDistances the value of field 'showDistances'. - */ - public void setShowDistances( - final boolean showDistances) { - this._showDistances = showDistances; - this._has_showDistances = true; - } - - /** - * Sets the value of field 'threshold'. - * - * @param threshold the value of field 'threshold'. - */ - public void setThreshold( - final float threshold) { - this._threshold = threshold; - this._has_threshold = true; - } - - /** - * Sets the value of field 'title'. - * - * @param title the value of field 'title'. - */ - public void setTitle( - final java.lang.String title) { - this._title = title; - } - - /** - * Sets the value of field 'width'. - * - * @param width the value of field 'width'. - */ - public void setWidth( - final int width) { - this._width = width; - this._has_width = true; - } - - /** - * Sets the value of field 'xpos'. - * - * @param xpos the value of field 'xpos'. - */ - public void setXpos( - final int xpos) { - this._xpos = xpos; - this._has_xpos = true; - } - - /** - * Sets the value of field 'ypos'. - * - * @param ypos the value of field 'ypos'. - */ - public void setYpos( - final int ypos) { - this._ypos = ypos; - this._has_ypos = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled jalview.binding.Tree - */ - public static jalview.binding.Tree unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.Tree) Unmarshaller.unmarshal(jalview.binding.Tree.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class Tree implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _width. + */ + private int _width; + + /** + * keeps track of state for field: _width + */ + private boolean _has_width; + + /** + * Field _height. + */ + private int _height; + + /** + * keeps track of state for field: _height + */ + private boolean _has_height; + + /** + * Field _xpos. + */ + private int _xpos; + + /** + * keeps track of state for field: _xpos + */ + private boolean _has_xpos; + + /** + * Field _ypos. + */ + private int _ypos; + + /** + * keeps track of state for field: _ypos + */ + private boolean _has_ypos; + + /** + * Field _fontName. + */ + private java.lang.String _fontName; + + /** + * Field _fontSize. + */ + private int _fontSize; + + /** + * keeps track of state for field: _fontSize + */ + private boolean _has_fontSize; + + /** + * Field _fontStyle. + */ + private int _fontStyle; + + /** + * keeps track of state for field: _fontStyle + */ + private boolean _has_fontStyle; + + /** + * Field _threshold. + */ + private float _threshold; + + /** + * keeps track of state for field: _threshold + */ + private boolean _has_threshold; + + /** + * Field _showBootstrap. + */ + private boolean _showBootstrap; + + /** + * keeps track of state for field: _showBootstrap + */ + private boolean _has_showBootstrap; + + /** + * Field _showDistances. + */ + private boolean _showDistances; + + /** + * keeps track of state for field: _showDistances + */ + private boolean _has_showDistances; + + /** + * Field _markUnlinked. + */ + private boolean _markUnlinked; + + /** + * keeps track of state for field: _markUnlinked + */ + private boolean _has_markUnlinked; + + /** + * Field _fitToWindow. + */ + private boolean _fitToWindow; + + /** + * keeps track of state for field: _fitToWindow + */ + private boolean _has_fitToWindow; + + /** + * Field _currentTree. + */ + private boolean _currentTree; + + /** + * keeps track of state for field: _currentTree + */ + private boolean _has_currentTree; + + /** + * Field _title. + */ + private java.lang.String _title; + + /** + * Field _newick. + */ + private java.lang.String _newick; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Tree() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + */ + public void deleteCurrentTree() + { + this._has_currentTree = false; + } + + /** + */ + public void deleteFitToWindow() + { + this._has_fitToWindow = false; + } + + /** + */ + public void deleteFontSize() + { + this._has_fontSize = false; + } + + /** + */ + public void deleteFontStyle() + { + this._has_fontStyle = false; + } + + /** + */ + public void deleteHeight() + { + this._has_height = false; + } + + /** + */ + public void deleteMarkUnlinked() + { + this._has_markUnlinked = false; + } + + /** + */ + public void deleteShowBootstrap() + { + this._has_showBootstrap = false; + } + + /** + */ + public void deleteShowDistances() + { + this._has_showDistances = false; + } + + /** + */ + public void deleteThreshold() + { + this._has_threshold = false; + } + + /** + */ + public void deleteWidth() + { + this._has_width = false; + } + + /** + */ + public void deleteXpos() + { + this._has_xpos = false; + } + + /** + */ + public void deleteYpos() + { + this._has_ypos = false; + } + + /** + * Returns the value of field 'currentTree'. + * + * @return the value of field 'CurrentTree'. + */ + public boolean getCurrentTree() + { + return this._currentTree; + } + + /** + * Returns the value of field 'fitToWindow'. + * + * @return the value of field 'FitToWindow'. + */ + public boolean getFitToWindow() + { + return this._fitToWindow; + } + + /** + * Returns the value of field 'fontName'. + * + * @return the value of field 'FontName'. + */ + public java.lang.String getFontName() + { + return this._fontName; + } + + /** + * Returns the value of field 'fontSize'. + * + * @return the value of field 'FontSize'. + */ + public int getFontSize() + { + return this._fontSize; + } + + /** + * Returns the value of field 'fontStyle'. + * + * @return the value of field 'FontStyle'. + */ + public int getFontStyle() + { + return this._fontStyle; + } + + /** + * Returns the value of field 'height'. + * + * @return the value of field 'Height'. + */ + public int getHeight() + { + return this._height; + } + + /** + * Returns the value of field 'markUnlinked'. + * + * @return the value of field 'MarkUnlinked'. + */ + public boolean getMarkUnlinked() + { + return this._markUnlinked; + } + + /** + * Returns the value of field 'newick'. + * + * @return the value of field 'Newick'. + */ + public java.lang.String getNewick() + { + return this._newick; + } + + /** + * Returns the value of field 'showBootstrap'. + * + * @return the value of field 'ShowBootstrap'. + */ + public boolean getShowBootstrap() + { + return this._showBootstrap; + } + + /** + * Returns the value of field 'showDistances'. + * + * @return the value of field 'ShowDistances'. + */ + public boolean getShowDistances() + { + return this._showDistances; + } + + /** + * Returns the value of field 'threshold'. + * + * @return the value of field 'Threshold'. + */ + public float getThreshold() + { + return this._threshold; + } + + /** + * Returns the value of field 'title'. + * + * @return the value of field 'Title'. + */ + public java.lang.String getTitle() + { + return this._title; + } + + /** + * Returns the value of field 'width'. + * + * @return the value of field 'Width'. + */ + public int getWidth() + { + return this._width; + } + + /** + * Returns the value of field 'xpos'. + * + * @return the value of field 'Xpos'. + */ + public int getXpos() + { + return this._xpos; + } + + /** + * Returns the value of field 'ypos'. + * + * @return the value of field 'Ypos'. + */ + public int getYpos() + { + return this._ypos; + } + + /** + * Method hasCurrentTree. + * + * @return true if at least one CurrentTree has been added + */ + public boolean hasCurrentTree() + { + return this._has_currentTree; + } + + /** + * Method hasFitToWindow. + * + * @return true if at least one FitToWindow has been added + */ + public boolean hasFitToWindow() + { + return this._has_fitToWindow; + } + + /** + * Method hasFontSize. + * + * @return true if at least one FontSize has been added + */ + public boolean hasFontSize() + { + return this._has_fontSize; + } + + /** + * Method hasFontStyle. + * + * @return true if at least one FontStyle has been added + */ + public boolean hasFontStyle() + { + return this._has_fontStyle; + } + + /** + * Method hasHeight. + * + * @return true if at least one Height has been added + */ + public boolean hasHeight() + { + return this._has_height; + } + + /** + * Method hasMarkUnlinked. + * + * @return true if at least one MarkUnlinked has been added + */ + public boolean hasMarkUnlinked() + { + return this._has_markUnlinked; + } + + /** + * Method hasShowBootstrap. + * + * @return true if at least one ShowBootstrap has been added + */ + public boolean hasShowBootstrap() + { + return this._has_showBootstrap; + } + + /** + * Method hasShowDistances. + * + * @return true if at least one ShowDistances has been added + */ + public boolean hasShowDistances() + { + return this._has_showDistances; + } + + /** + * Method hasThreshold. + * + * @return true if at least one Threshold has been added + */ + public boolean hasThreshold() + { + return this._has_threshold; + } + + /** + * Method hasWidth. + * + * @return true if at least one Width has been added + */ + public boolean hasWidth() + { + return this._has_width; + } + + /** + * Method hasXpos. + * + * @return true if at least one Xpos has been added + */ + public boolean hasXpos() + { + return this._has_xpos; + } + + /** + * Method hasYpos. + * + * @return true if at least one Ypos has been added + */ + public boolean hasYpos() + { + return this._has_ypos; + } + + /** + * Returns the value of field 'currentTree'. + * + * @return the value of field 'CurrentTree'. + */ + public boolean isCurrentTree() + { + return this._currentTree; + } + + /** + * Returns the value of field 'fitToWindow'. + * + * @return the value of field 'FitToWindow'. + */ + public boolean isFitToWindow() + { + return this._fitToWindow; + } + + /** + * Returns the value of field 'markUnlinked'. + * + * @return the value of field 'MarkUnlinked'. + */ + public boolean isMarkUnlinked() + { + return this._markUnlinked; + } + + /** + * Returns the value of field 'showBootstrap'. + * + * @return the value of field 'ShowBootstrap'. + */ + public boolean isShowBootstrap() + { + return this._showBootstrap; + } + + /** + * Returns the value of field 'showDistances'. + * + * @return the value of field 'ShowDistances'. + */ + public boolean isShowDistances() + { + return this._showDistances; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; + } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'currentTree'. + * + * @param currentTree + * the value of field 'currentTree'. + */ + public void setCurrentTree(final boolean currentTree) + { + this._currentTree = currentTree; + this._has_currentTree = true; + } + + /** + * Sets the value of field 'fitToWindow'. + * + * @param fitToWindow + * the value of field 'fitToWindow'. + */ + public void setFitToWindow(final boolean fitToWindow) + { + this._fitToWindow = fitToWindow; + this._has_fitToWindow = true; + } + + /** + * Sets the value of field 'fontName'. + * + * @param fontName + * the value of field 'fontName'. + */ + public void setFontName(final java.lang.String fontName) + { + this._fontName = fontName; + } + + /** + * Sets the value of field 'fontSize'. + * + * @param fontSize + * the value of field 'fontSize'. + */ + public void setFontSize(final int fontSize) + { + this._fontSize = fontSize; + this._has_fontSize = true; + } + + /** + * Sets the value of field 'fontStyle'. + * + * @param fontStyle + * the value of field 'fontStyle'. + */ + public void setFontStyle(final int fontStyle) + { + this._fontStyle = fontStyle; + this._has_fontStyle = true; + } + + /** + * Sets the value of field 'height'. + * + * @param height + * the value of field 'height'. + */ + public void setHeight(final int height) + { + this._height = height; + this._has_height = true; + } + + /** + * Sets the value of field 'markUnlinked'. + * + * @param markUnlinked + * the value of field 'markUnlinked'. + */ + public void setMarkUnlinked(final boolean markUnlinked) + { + this._markUnlinked = markUnlinked; + this._has_markUnlinked = true; + } + + /** + * Sets the value of field 'newick'. + * + * @param newick + * the value of field 'newick'. + */ + public void setNewick(final java.lang.String newick) + { + this._newick = newick; + } + + /** + * Sets the value of field 'showBootstrap'. + * + * @param showBootstrap + * the value of field 'showBootstrap'. + */ + public void setShowBootstrap(final boolean showBootstrap) + { + this._showBootstrap = showBootstrap; + this._has_showBootstrap = true; + } + + /** + * Sets the value of field 'showDistances'. + * + * @param showDistances + * the value of field 'showDistances'. + */ + public void setShowDistances(final boolean showDistances) + { + this._showDistances = showDistances; + this._has_showDistances = true; + } + + /** + * Sets the value of field 'threshold'. + * + * @param threshold + * the value of field 'threshold'. + */ + public void setThreshold(final float threshold) + { + this._threshold = threshold; + this._has_threshold = true; + } + + /** + * Sets the value of field 'title'. + * + * @param title + * the value of field 'title'. + */ + public void setTitle(final java.lang.String title) + { + this._title = title; + } + + /** + * Sets the value of field 'width'. + * + * @param width + * the value of field 'width'. + */ + public void setWidth(final int width) + { + this._width = width; + this._has_width = true; + } + + /** + * Sets the value of field 'xpos'. + * + * @param xpos + * the value of field 'xpos'. + */ + public void setXpos(final int xpos) + { + this._xpos = xpos; + this._has_xpos = true; + } + + /** + * Sets the value of field 'ypos'. + * + * @param ypos + * the value of field 'ypos'. + */ + public void setYpos(final int ypos) + { + this._ypos = ypos; + this._has_ypos = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.binding.Tree + */ + public static jalview.binding.Tree unmarshal(final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.Tree) Unmarshaller.unmarshal( + jalview.binding.Tree.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/binding/UserColourScheme.java b/src/jalview/binding/UserColourScheme.java index 24c97ff..555693c 100644 --- a/src/jalview/binding/UserColourScheme.java +++ b/src/jalview/binding/UserColourScheme.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,98 +19,107 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class UserColourScheme extends JalviewUserColours -implements java.io.Serializable +public class UserColourScheme extends JalviewUserColours implements + java.io.Serializable { + // ----------------/ + // - Constructors -/ + // ----------------/ - //----------------/ - //- Constructors -/ - //----------------/ - - public UserColourScheme() { - super(); - } - + public UserColourScheme() + { + super(); + } - //-----------/ - //- Methods -/ - //-----------/ + // -----------/ + // - Methods -/ + // -----------/ - /** - * 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; + /** + * 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 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); - } + /** + * + * + * @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); + } - /** - * 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.binding.JalviewUserColours - */ - public static jalview.binding.JalviewUserColours unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.JalviewUserColours) Unmarshaller.unmarshal(jalview.binding.UserColourScheme.class, reader); - } + /** + * 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.binding.JalviewUserColours + */ + public static jalview.binding.JalviewUserColours unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.JalviewUserColours) Unmarshaller.unmarshal( + jalview.binding.UserColourScheme.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); - } + /** + * + * + * @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/binding/UserColours.java b/src/jalview/binding/UserColours.java index bdefe05..6a8d73c 100644 --- a/src/jalview/binding/UserColours.java +++ b/src/jalview/binding/UserColours.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,151 +19,163 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class UserColours implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _id. - */ - private java.lang.String _id; - - /** - * Field _userColourScheme. - */ - private jalview.binding.UserColourScheme _userColourScheme; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public UserColours() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Returns the value of field 'id'. - * - * @return the value of field 'Id'. - */ - public java.lang.String getId( - ) { - return this._id; - } - - /** - * Returns the value of field 'userColourScheme'. - * - * @return the value of field 'UserColourScheme'. - */ - public jalview.binding.UserColourScheme getUserColourScheme( - ) { - return this._userColourScheme; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'id'. - * - * @param id the value of field 'id'. - */ - public void setId( - final java.lang.String id) { - this._id = id; - } - - /** - * Sets the value of field 'userColourScheme'. - * - * @param userColourScheme the value of field 'userColourScheme' - */ - public void setUserColourScheme( - final jalview.binding.UserColourScheme userColourScheme) { - this._userColourScheme = userColourScheme; - } - - /** - * 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.binding.UserColours - */ - public static jalview.binding.UserColours unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.UserColours) Unmarshaller.unmarshal(jalview.binding.UserColours.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); +public class UserColours implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _id. + */ + private java.lang.String _id; + + /** + * Field _userColourScheme. + */ + private jalview.binding.UserColourScheme _userColourScheme; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public UserColours() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Returns the value of field 'id'. + * + * @return the value of field 'Id'. + */ + public java.lang.String getId() + { + return this._id; + } + + /** + * Returns the value of field 'userColourScheme'. + * + * @return the value of field 'UserColourScheme'. + */ + public jalview.binding.UserColourScheme getUserColourScheme() + { + return this._userColourScheme; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'id'. + * + * @param id + * the value of field 'id'. + */ + public void setId(final java.lang.String id) + { + this._id = id; + } + + /** + * Sets the value of field 'userColourScheme'. + * + * @param userColourScheme + * the value of field 'userColourScheme' + */ + public void setUserColourScheme( + final jalview.binding.UserColourScheme userColourScheme) + { + this._userColourScheme = userColourScheme; + } + + /** + * 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.binding.UserColours + */ + public static jalview.binding.UserColours unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.UserColours) Unmarshaller.unmarshal( + jalview.binding.UserColours.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/binding/VAMSAS.java b/src/jalview/binding/VAMSAS.java index 1c92bd3..c06de29 100644 --- a/src/jalview/binding/VAMSAS.java +++ b/src/jalview/binding/VAMSAS.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,563 +19,584 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class VAMSAS implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _alignmentList. - */ - private java.util.Vector _alignmentList; - - /** - * Field _treeList. - */ - private java.util.Vector _treeList; - - /** - * Field _sequenceSetList. - */ - private java.util.Vector _sequenceSetList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public VAMSAS() { - super(); - this._alignmentList = new java.util.Vector(); - this._treeList = new java.util.Vector(); - this._sequenceSetList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vAlignment - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addAlignment( - final Alignment vAlignment) - throws java.lang.IndexOutOfBoundsException { - this._alignmentList.addElement(vAlignment); - } - - /** - * - * - * @param index - * @param vAlignment - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addAlignment( - final int index, - final Alignment vAlignment) - throws java.lang.IndexOutOfBoundsException { - this._alignmentList.add(index, vAlignment); - } - - /** - * - * - * @param vSequenceSet - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSequenceSet( - final SequenceSet vSequenceSet) - throws java.lang.IndexOutOfBoundsException { - this._sequenceSetList.addElement(vSequenceSet); - } - - /** - * - * - * @param index - * @param vSequenceSet - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSequenceSet( - final int index, - final SequenceSet vSequenceSet) - throws java.lang.IndexOutOfBoundsException { - this._sequenceSetList.add(index, vSequenceSet); - } - - /** - * - * - * @param vTree - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addTree( - final java.lang.String vTree) - throws java.lang.IndexOutOfBoundsException { - this._treeList.addElement(vTree); - } - - /** - * - * - * @param index - * @param vTree - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addTree( - final int index, - final java.lang.String vTree) - throws java.lang.IndexOutOfBoundsException { - this._treeList.add(index, vTree); - } - - /** - * Method enumerateAlignment. - * - * @return an Enumeration over all Alignment elements - */ - public java.util.Enumeration enumerateAlignment( - ) { - return this._alignmentList.elements(); - } - - /** - * Method enumerateSequenceSet. - * - * @return an Enumeration over all SequenceSet elements - */ - public java.util.Enumeration enumerateSequenceSet( - ) { - return this._sequenceSetList.elements(); - } - - /** - * Method enumerateTree. - * - * @return an Enumeration over all java.lang.String elements - */ - public java.util.Enumeration enumerateTree( - ) { - return this._treeList.elements(); - } - - /** - * Method getAlignment. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the Alignment at the given index - */ - public Alignment getAlignment( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._alignmentList.size()) { - throw new IndexOutOfBoundsException("getAlignment: Index value '" + index + "' not in range [0.." + (this._alignmentList.size() - 1) + "]"); - } - - return (Alignment) _alignmentList.get(index); - } - - /** - * Method getAlignment.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 Alignment[] getAlignment( - ) { - Alignment[] array = new Alignment[0]; - return (Alignment[]) this._alignmentList.toArray(array); - } - - /** - * Method getAlignmentCount. - * - * @return the size of this collection - */ - public int getAlignmentCount( - ) { - return this._alignmentList.size(); - } - - /** - * Method getSequenceSet. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the SequenceSet at the given index - */ - public SequenceSet getSequenceSet( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._sequenceSetList.size()) { - throw new IndexOutOfBoundsException("getSequenceSet: Index value '" + index + "' not in range [0.." + (this._sequenceSetList.size() - 1) + "]"); - } - - return (SequenceSet) _sequenceSetList.get(index); - } - - /** - * Method getSequenceSet.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 SequenceSet[] getSequenceSet( - ) { - SequenceSet[] array = new SequenceSet[0]; - return (SequenceSet[]) this._sequenceSetList.toArray(array); - } - - /** - * Method getSequenceSetCount. - * - * @return the size of this collection - */ - public int getSequenceSetCount( - ) { - return this._sequenceSetList.size(); - } - - /** - * Method getTree. - * - * @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 getTree( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._treeList.size()) { - throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]"); - } - - return (java.lang.String) _treeList.get(index); - } - - /** - * Method getTree.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[] getTree( - ) { - java.lang.String[] array = new java.lang.String[0]; - return (java.lang.String[]) this._treeList.toArray(array); - } - - /** - * Method getTreeCount. - * - * @return the size of this collection - */ - public int getTreeCount( - ) { - return this._treeList.size(); - } - - /** - * 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); - } - - /** - * Method removeAlignment. - * - * @param vAlignment - * @return true if the object was removed from the collection. - */ - public boolean removeAlignment( - final Alignment vAlignment) { - boolean removed = _alignmentList.remove(vAlignment); - return removed; - } - - /** - * Method removeAlignmentAt. - * - * @param index - * @return the element removed from the collection - */ - public Alignment removeAlignmentAt( - final int index) { - java.lang.Object obj = this._alignmentList.remove(index); - return (Alignment) obj; - } - - /** - */ - public void removeAllAlignment( - ) { - this._alignmentList.clear(); - } - - /** - */ - public void removeAllSequenceSet( - ) { - this._sequenceSetList.clear(); - } - - /** - */ - public void removeAllTree( - ) { - this._treeList.clear(); - } - - /** - * Method removeSequenceSet. - * - * @param vSequenceSet - * @return true if the object was removed from the collection. - */ - public boolean removeSequenceSet( - final SequenceSet vSequenceSet) { - boolean removed = _sequenceSetList.remove(vSequenceSet); - return removed; - } - - /** - * Method removeSequenceSetAt. - * - * @param index - * @return the element removed from the collection - */ - public SequenceSet removeSequenceSetAt( - final int index) { - java.lang.Object obj = this._sequenceSetList.remove(index); - return (SequenceSet) obj; - } - - /** - * Method removeTree. - * - * @param vTree - * @return true if the object was removed from the collection. - */ - public boolean removeTree( - final java.lang.String vTree) { - boolean removed = _treeList.remove(vTree); - return removed; - } - - /** - * Method removeTreeAt. - * - * @param index - * @return the element removed from the collection - */ - public java.lang.String removeTreeAt( - final int index) { - java.lang.Object obj = this._treeList.remove(index); - return (java.lang.String) obj; - } - - /** - * - * - * @param index - * @param vAlignment - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setAlignment( - final int index, - final Alignment vAlignment) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._alignmentList.size()) { - throw new IndexOutOfBoundsException("setAlignment: Index value '" + index + "' not in range [0.." + (this._alignmentList.size() - 1) + "]"); - } - - this._alignmentList.set(index, vAlignment); - } - - /** - * - * - * @param vAlignmentArray - */ - public void setAlignment( - final Alignment[] vAlignmentArray) { - //-- copy array - _alignmentList.clear(); - - for (int i = 0; i < vAlignmentArray.length; i++) { - this._alignmentList.add(vAlignmentArray[i]); - } - } - - /** - * - * - * @param index - * @param vSequenceSet - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setSequenceSet( - final int index, - final SequenceSet vSequenceSet) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._sequenceSetList.size()) { - throw new IndexOutOfBoundsException("setSequenceSet: Index value '" + index + "' not in range [0.." + (this._sequenceSetList.size() - 1) + "]"); - } - - this._sequenceSetList.set(index, vSequenceSet); - } - - /** - * - * - * @param vSequenceSetArray - */ - public void setSequenceSet( - final SequenceSet[] vSequenceSetArray) { - //-- copy array - _sequenceSetList.clear(); - - for (int i = 0; i < vSequenceSetArray.length; i++) { - this._sequenceSetList.add(vSequenceSetArray[i]); - } - } - - /** - * - * - * @param index - * @param vTree - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setTree( - final int index, - final java.lang.String vTree) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._treeList.size()) { - throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]"); - } - - this._treeList.set(index, vTree); - } - - /** - * - * - * @param vTreeArray - */ - public void setTree( - final java.lang.String[] vTreeArray) { - //-- copy array - _treeList.clear(); - - for (int i = 0; i < vTreeArray.length; i++) { - this._treeList.add(vTreeArray[i]); - } - } - - /** - * 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.binding.VAMSAS - */ - public static jalview.binding.VAMSAS unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.VAMSAS) Unmarshaller.unmarshal(jalview.binding.VAMSAS.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class VAMSAS implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _alignmentList. + */ + private java.util.Vector _alignmentList; + + /** + * Field _treeList. + */ + private java.util.Vector _treeList; + + /** + * Field _sequenceSetList. + */ + private java.util.Vector _sequenceSetList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public VAMSAS() + { + super(); + this._alignmentList = new java.util.Vector(); + this._treeList = new java.util.Vector(); + this._sequenceSetList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vAlignment + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addAlignment(final Alignment vAlignment) + throws java.lang.IndexOutOfBoundsException + { + this._alignmentList.addElement(vAlignment); + } + + /** + * + * + * @param index + * @param vAlignment + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addAlignment(final int index, final Alignment vAlignment) + throws java.lang.IndexOutOfBoundsException + { + this._alignmentList.add(index, vAlignment); + } + + /** + * + * + * @param vSequenceSet + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSequenceSet(final SequenceSet vSequenceSet) + throws java.lang.IndexOutOfBoundsException + { + this._sequenceSetList.addElement(vSequenceSet); + } + + /** + * + * + * @param index + * @param vSequenceSet + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSequenceSet(final int index, final SequenceSet vSequenceSet) + throws java.lang.IndexOutOfBoundsException + { + this._sequenceSetList.add(index, vSequenceSet); + } + + /** + * + * + * @param vTree + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addTree(final java.lang.String vTree) + throws java.lang.IndexOutOfBoundsException + { + this._treeList.addElement(vTree); + } + + /** + * + * + * @param index + * @param vTree + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addTree(final int index, final java.lang.String vTree) + throws java.lang.IndexOutOfBoundsException + { + this._treeList.add(index, vTree); + } + + /** + * Method enumerateAlignment. + * + * @return an Enumeration over all Alignment elements + */ + public java.util.Enumeration enumerateAlignment() + { + return this._alignmentList.elements(); + } + + /** + * Method enumerateSequenceSet. + * + * @return an Enumeration over all SequenceSet elements + */ + public java.util.Enumeration enumerateSequenceSet() + { + return this._sequenceSetList.elements(); + } + + /** + * Method enumerateTree. + * + * @return an Enumeration over all java.lang.String elements + */ + public java.util.Enumeration enumerateTree() + { + return this._treeList.elements(); + } + + /** + * Method getAlignment. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the Alignment at the given index + */ + public Alignment getAlignment(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._alignmentList.size()) + { + throw new IndexOutOfBoundsException("getAlignment: Index value '" + + index + "' not in range [0.." + + (this._alignmentList.size() - 1) + "]"); + } + + return (Alignment) _alignmentList.get(index); + } + + /** + * Method getAlignment.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 Alignment[] getAlignment() + { + Alignment[] array = new Alignment[0]; + return (Alignment[]) this._alignmentList.toArray(array); + } + + /** + * Method getAlignmentCount. + * + * @return the size of this collection + */ + public int getAlignmentCount() + { + return this._alignmentList.size(); + } + + /** + * Method getSequenceSet. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the SequenceSet at the given index + */ + public SequenceSet getSequenceSet(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._sequenceSetList.size()) + { + throw new IndexOutOfBoundsException("getSequenceSet: Index value '" + + index + "' not in range [0.." + + (this._sequenceSetList.size() - 1) + "]"); + } + + return (SequenceSet) _sequenceSetList.get(index); + } + + /** + * Method getSequenceSet.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 SequenceSet[] getSequenceSet() + { + SequenceSet[] array = new SequenceSet[0]; + return (SequenceSet[]) this._sequenceSetList.toArray(array); + } + + /** + * Method getSequenceSetCount. + * + * @return the size of this collection + */ + public int getSequenceSetCount() + { + return this._sequenceSetList.size(); + } + + /** + * Method getTree. + * + * @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 getTree(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._treeList.size()) + { + throw new IndexOutOfBoundsException("getTree: Index value '" + index + + "' not in range [0.." + (this._treeList.size() - 1) + "]"); + } + + return (java.lang.String) _treeList.get(index); + } + + /** + * Method getTree.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[] getTree() + { + java.lang.String[] array = new java.lang.String[0]; + return (java.lang.String[]) this._treeList.toArray(array); + } + + /** + * Method getTreeCount. + * + * @return the size of this collection + */ + public int getTreeCount() + { + return this._treeList.size(); + } + + /** + * 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); + } + + /** + * Method removeAlignment. + * + * @param vAlignment + * @return true if the object was removed from the collection. + */ + public boolean removeAlignment(final Alignment vAlignment) + { + boolean removed = _alignmentList.remove(vAlignment); + return removed; + } + + /** + * Method removeAlignmentAt. + * + * @param index + * @return the element removed from the collection + */ + public Alignment removeAlignmentAt(final int index) + { + java.lang.Object obj = this._alignmentList.remove(index); + return (Alignment) obj; + } + + /** + */ + public void removeAllAlignment() + { + this._alignmentList.clear(); + } + + /** + */ + public void removeAllSequenceSet() + { + this._sequenceSetList.clear(); + } + + /** + */ + public void removeAllTree() + { + this._treeList.clear(); + } + + /** + * Method removeSequenceSet. + * + * @param vSequenceSet + * @return true if the object was removed from the collection. + */ + public boolean removeSequenceSet(final SequenceSet vSequenceSet) + { + boolean removed = _sequenceSetList.remove(vSequenceSet); + return removed; + } + + /** + * Method removeSequenceSetAt. + * + * @param index + * @return the element removed from the collection + */ + public SequenceSet removeSequenceSetAt(final int index) + { + java.lang.Object obj = this._sequenceSetList.remove(index); + return (SequenceSet) obj; + } + + /** + * Method removeTree. + * + * @param vTree + * @return true if the object was removed from the collection. + */ + public boolean removeTree(final java.lang.String vTree) + { + boolean removed = _treeList.remove(vTree); + return removed; + } + + /** + * Method removeTreeAt. + * + * @param index + * @return the element removed from the collection + */ + public java.lang.String removeTreeAt(final int index) + { + java.lang.Object obj = this._treeList.remove(index); + return (java.lang.String) obj; + } + + /** + * + * + * @param index + * @param vAlignment + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setAlignment(final int index, final Alignment vAlignment) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._alignmentList.size()) + { + throw new IndexOutOfBoundsException("setAlignment: Index value '" + + index + "' not in range [0.." + + (this._alignmentList.size() - 1) + "]"); + } + + this._alignmentList.set(index, vAlignment); + } + + /** + * + * + * @param vAlignmentArray + */ + public void setAlignment(final Alignment[] vAlignmentArray) + { + // -- copy array + _alignmentList.clear(); + + for (int i = 0; i < vAlignmentArray.length; i++) + { + this._alignmentList.add(vAlignmentArray[i]); + } + } + + /** + * + * + * @param index + * @param vSequenceSet + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setSequenceSet(final int index, final SequenceSet vSequenceSet) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._sequenceSetList.size()) + { + throw new IndexOutOfBoundsException("setSequenceSet: Index value '" + + index + "' not in range [0.." + + (this._sequenceSetList.size() - 1) + "]"); + } + + this._sequenceSetList.set(index, vSequenceSet); + } + + /** + * + * + * @param vSequenceSetArray + */ + public void setSequenceSet(final SequenceSet[] vSequenceSetArray) + { + // -- copy array + _sequenceSetList.clear(); + + for (int i = 0; i < vSequenceSetArray.length; i++) + { + this._sequenceSetList.add(vSequenceSetArray[i]); + } + } + + /** + * + * + * @param index + * @param vTree + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setTree(final int index, final java.lang.String vTree) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._treeList.size()) + { + throw new IndexOutOfBoundsException("setTree: Index value '" + index + + "' not in range [0.." + (this._treeList.size() - 1) + "]"); + } + + this._treeList.set(index, vTree); + } + + /** + * + * + * @param vTreeArray + */ + public void setTree(final java.lang.String[] vTreeArray) + { + // -- copy array + _treeList.clear(); + + for (int i = 0; i < vTreeArray.length; i++) + { + this._treeList.add(vTreeArray[i]); + } + } + + /** + * 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.binding.VAMSAS + */ + public static jalview.binding.VAMSAS unmarshal(final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.VAMSAS) Unmarshaller.unmarshal( + jalview.binding.VAMSAS.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/binding/VamsasModel.java b/src/jalview/binding/VamsasModel.java index 5fda35e..e4c5e0d 100644 --- a/src/jalview/binding/VamsasModel.java +++ b/src/jalview/binding/VamsasModel.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,98 +19,105 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class VamsasModel extends VAMSAS -implements java.io.Serializable +public class VamsasModel extends VAMSAS implements java.io.Serializable { + // ----------------/ + // - Constructors -/ + // ----------------/ - //----------------/ - //- Constructors -/ - //----------------/ - - public VamsasModel() { - super(); - } - + public VamsasModel() + { + super(); + } - //-----------/ - //- Methods -/ - //-----------/ + // -----------/ + // - Methods -/ + // -----------/ - /** - * 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; + /** + * 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 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); - } + /** + * + * + * @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); + } - /** - * 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.binding.VAMSAS - */ - public static jalview.binding.VAMSAS unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.VAMSAS) Unmarshaller.unmarshal(jalview.binding.VamsasModel.class, reader); - } + /** + * 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.binding.VAMSAS + */ + public static jalview.binding.VAMSAS unmarshal(final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.VAMSAS) Unmarshaller.unmarshal( + jalview.binding.VamsasModel.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); - } + /** + * + * + * @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/binding/Viewport.java b/src/jalview/binding/Viewport.java index 643c323..d144378 100644 --- a/src/jalview/binding/Viewport.java +++ b/src/jalview/binding/Viewport.java @@ -7,8 +7,8 @@ package jalview.binding; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,1414 +19,1445 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Viewport implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _conservationSelected. - */ - private boolean _conservationSelected; - - /** - * keeps track of state for field: _conservationSelected - */ - private boolean _has_conservationSelected; - - /** - * Field _pidSelected. - */ - private boolean _pidSelected; - - /** - * keeps track of state for field: _pidSelected - */ - private boolean _has_pidSelected; - - /** - * Field _bgColour. - */ - private java.lang.String _bgColour; - - /** - * Field _consThreshold. - */ - private int _consThreshold; - - /** - * keeps track of state for field: _consThreshold - */ - private boolean _has_consThreshold; - - /** - * Field _pidThreshold. - */ - private int _pidThreshold; - - /** - * keeps track of state for field: _pidThreshold - */ - private boolean _has_pidThreshold; - - /** - * Field _title. - */ - private java.lang.String _title; - - /** - * Field _showFullId. - */ - private boolean _showFullId; - - /** - * keeps track of state for field: _showFullId - */ - private boolean _has_showFullId; +public class Viewport implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _conservationSelected. + */ + private boolean _conservationSelected; + + /** + * keeps track of state for field: _conservationSelected + */ + private boolean _has_conservationSelected; + + /** + * Field _pidSelected. + */ + private boolean _pidSelected; + + /** + * keeps track of state for field: _pidSelected + */ + private boolean _has_pidSelected; + + /** + * Field _bgColour. + */ + private java.lang.String _bgColour; + + /** + * Field _consThreshold. + */ + private int _consThreshold; + + /** + * keeps track of state for field: _consThreshold + */ + private boolean _has_consThreshold; + + /** + * Field _pidThreshold. + */ + private int _pidThreshold; + + /** + * keeps track of state for field: _pidThreshold + */ + private boolean _has_pidThreshold; + + /** + * Field _title. + */ + private java.lang.String _title; + + /** + * Field _showFullId. + */ + private boolean _showFullId; + + /** + * keeps track of state for field: _showFullId + */ + private boolean _has_showFullId; + + /** + * Field _showText. + */ + private boolean _showText; + + /** + * keeps track of state for field: _showText + */ + private boolean _has_showText; + + /** + * Field _showColourText. + */ + private boolean _showColourText; + + /** + * keeps track of state for field: _showColourText + */ + private boolean _has_showColourText; + + /** + * Field _showBoxes. + */ + private boolean _showBoxes; + + /** + * keeps track of state for field: _showBoxes + */ + private boolean _has_showBoxes; + + /** + * Field _wrapAlignment. + */ + private boolean _wrapAlignment; + + /** + * keeps track of state for field: _wrapAlignment + */ + private boolean _has_wrapAlignment; + + /** + * Field _renderGaps. + */ + private boolean _renderGaps; + + /** + * keeps track of state for field: _renderGaps + */ + private boolean _has_renderGaps; + + /** + * Field _showSequenceFeatures. + */ + private boolean _showSequenceFeatures; + + /** + * keeps track of state for field: _showSequenceFeatures + */ + private boolean _has_showSequenceFeatures; + + /** + * Field _showAnnotation. + */ + private boolean _showAnnotation; + + /** + * keeps track of state for field: _showAnnotation + */ + private boolean _has_showAnnotation; + + /** + * Field _showConservation. + */ + private boolean _showConservation; + + /** + * keeps track of state for field: _showConservation + */ + private boolean _has_showConservation; + + /** + * Field _showQuality. + */ + private boolean _showQuality; + + /** + * keeps track of state for field: _showQuality + */ + private boolean _has_showQuality; + + /** + * Field _showIdentity. + */ + private boolean _showIdentity; + + /** + * keeps track of state for field: _showIdentity + */ + private boolean _has_showIdentity; + + /** + * Field _xpos. + */ + private int _xpos; + + /** + * keeps track of state for field: _xpos + */ + private boolean _has_xpos; + + /** + * Field _ypos. + */ + private int _ypos; + + /** + * keeps track of state for field: _ypos + */ + private boolean _has_ypos; + + /** + * Field _width. + */ + private int _width; + + /** + * keeps track of state for field: _width + */ + private boolean _has_width; + + /** + * Field _height. + */ + private int _height; + + /** + * keeps track of state for field: _height + */ + private boolean _has_height; + + /** + * Field _startRes. + */ + private int _startRes; + + /** + * keeps track of state for field: _startRes + */ + private boolean _has_startRes; + + /** + * Field _startSeq. + */ + private int _startSeq; + + /** + * keeps track of state for field: _startSeq + */ + private boolean _has_startSeq; + + /** + * Field _fontName. + */ + private java.lang.String _fontName; + + /** + * Field _fontSize. + */ + private int _fontSize; + + /** + * keeps track of state for field: _fontSize + */ + private boolean _has_fontSize; + + /** + * Field _fontStyle. + */ + private int _fontStyle; + + /** + * keeps track of state for field: _fontStyle + */ + private boolean _has_fontStyle; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Viewport() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ - /** - * Field _showText. + /** */ - private boolean _showText; + public void deleteConsThreshold() + { + this._has_consThreshold = false; + } - /** - * keeps track of state for field: _showText + /** */ - private boolean _has_showText; + public void deleteConservationSelected() + { + this._has_conservationSelected = false; + } - /** - * Field _showColourText. + /** */ - private boolean _showColourText; + public void deleteFontSize() + { + this._has_fontSize = false; + } - /** - * keeps track of state for field: _showColourText + /** */ - private boolean _has_showColourText; + public void deleteFontStyle() + { + this._has_fontStyle = false; + } - /** - * Field _showBoxes. + /** */ - private boolean _showBoxes; + public void deleteHeight() + { + this._has_height = false; + } - /** - * keeps track of state for field: _showBoxes + /** */ - private boolean _has_showBoxes; + public void deletePidSelected() + { + this._has_pidSelected = false; + } - /** - * Field _wrapAlignment. + /** */ - private boolean _wrapAlignment; + public void deletePidThreshold() + { + this._has_pidThreshold = false; + } - /** - * keeps track of state for field: _wrapAlignment + /** */ - private boolean _has_wrapAlignment; + public void deleteRenderGaps() + { + this._has_renderGaps = false; + } - /** - * Field _renderGaps. + /** */ - private boolean _renderGaps; + public void deleteShowAnnotation() + { + this._has_showAnnotation = false; + } - /** - * keeps track of state for field: _renderGaps + /** */ - private boolean _has_renderGaps; + public void deleteShowBoxes() + { + this._has_showBoxes = false; + } - /** - * Field _showSequenceFeatures. + /** */ - private boolean _showSequenceFeatures; + public void deleteShowColourText() + { + this._has_showColourText = false; + } - /** - * keeps track of state for field: _showSequenceFeatures + /** */ - private boolean _has_showSequenceFeatures; + public void deleteShowConservation() + { + this._has_showConservation = false; + } - /** - * Field _showAnnotation. + /** */ - private boolean _showAnnotation; + public void deleteShowFullId() + { + this._has_showFullId = false; + } - /** - * keeps track of state for field: _showAnnotation + /** */ - private boolean _has_showAnnotation; + public void deleteShowIdentity() + { + this._has_showIdentity = false; + } - /** - * Field _showConservation. + /** */ - private boolean _showConservation; - - /** - * keeps track of state for field: _showConservation - */ - private boolean _has_showConservation; - - /** - * Field _showQuality. - */ - private boolean _showQuality; - - /** - * keeps track of state for field: _showQuality - */ - private boolean _has_showQuality; - - /** - * Field _showIdentity. - */ - private boolean _showIdentity; - - /** - * keeps track of state for field: _showIdentity - */ - private boolean _has_showIdentity; - - /** - * Field _xpos. - */ - private int _xpos; - - /** - * keeps track of state for field: _xpos - */ - private boolean _has_xpos; - - /** - * Field _ypos. - */ - private int _ypos; - - /** - * keeps track of state for field: _ypos - */ - private boolean _has_ypos; - - /** - * Field _width. - */ - private int _width; - - /** - * keeps track of state for field: _width - */ - private boolean _has_width; - - /** - * Field _height. - */ - private int _height; - - /** - * keeps track of state for field: _height - */ - private boolean _has_height; - - /** - * Field _startRes. - */ - private int _startRes; - - /** - * keeps track of state for field: _startRes - */ - private boolean _has_startRes; - - /** - * Field _startSeq. - */ - private int _startSeq; - - /** - * keeps track of state for field: _startSeq - */ - private boolean _has_startSeq; - - /** - * Field _fontName. - */ - private java.lang.String _fontName; - - /** - * Field _fontSize. - */ - private int _fontSize; - - /** - * keeps track of state for field: _fontSize - */ - private boolean _has_fontSize; - - /** - * Field _fontStyle. - */ - private int _fontStyle; - - /** - * keeps track of state for field: _fontStyle - */ - private boolean _has_fontStyle; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Viewport() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deleteConsThreshold( - ) { - this._has_consThreshold= false; - } - - /** - */ - public void deleteConservationSelected( - ) { - this._has_conservationSelected= false; - } - - /** - */ - public void deleteFontSize( - ) { - this._has_fontSize= false; - } - - /** - */ - public void deleteFontStyle( - ) { - this._has_fontStyle= false; - } - - /** - */ - public void deleteHeight( - ) { - this._has_height= false; - } - - /** - */ - public void deletePidSelected( - ) { - this._has_pidSelected= false; - } - - /** - */ - public void deletePidThreshold( - ) { - this._has_pidThreshold= false; - } - - /** - */ - public void deleteRenderGaps( - ) { - this._has_renderGaps= false; - } - - /** - */ - public void deleteShowAnnotation( - ) { - this._has_showAnnotation= false; - } - - /** - */ - public void deleteShowBoxes( - ) { - this._has_showBoxes= false; - } - - /** - */ - public void deleteShowColourText( - ) { - this._has_showColourText= false; - } - - /** - */ - public void deleteShowConservation( - ) { - this._has_showConservation= false; - } - - /** - */ - public void deleteShowFullId( - ) { - this._has_showFullId= false; - } - - /** - */ - public void deleteShowIdentity( - ) { - this._has_showIdentity= false; - } - - /** - */ - public void deleteShowQuality( - ) { - this._has_showQuality= false; - } - - /** - */ - public void deleteShowSequenceFeatures( - ) { - this._has_showSequenceFeatures= false; - } - - /** - */ - public void deleteShowText( - ) { - this._has_showText= false; - } - - /** - */ - public void deleteStartRes( - ) { - this._has_startRes= false; - } - - /** - */ - public void deleteStartSeq( - ) { - this._has_startSeq= false; - } - - /** - */ - public void deleteWidth( - ) { - this._has_width= false; - } - - /** - */ - public void deleteWrapAlignment( - ) { - this._has_wrapAlignment= false; - } - - /** - */ - public void deleteXpos( - ) { - this._has_xpos= false; - } - - /** - */ - public void deleteYpos( - ) { - this._has_ypos= false; - } - - /** - * Returns the value of field 'bgColour'. - * - * @return the value of field 'BgColour'. - */ - public java.lang.String getBgColour( - ) { - return this._bgColour; - } - - /** - * Returns the value of field 'consThreshold'. - * - * @return the value of field 'ConsThreshold'. - */ - public int getConsThreshold( - ) { - return this._consThreshold; - } - - /** - * Returns the value of field 'conservationSelected'. - * - * @return the value of field 'ConservationSelected'. - */ - public boolean getConservationSelected( - ) { - return this._conservationSelected; - } - - /** - * Returns the value of field 'fontName'. - * - * @return the value of field 'FontName'. - */ - public java.lang.String getFontName( - ) { - return this._fontName; - } - - /** - * Returns the value of field 'fontSize'. - * - * @return the value of field 'FontSize'. - */ - public int getFontSize( - ) { - return this._fontSize; - } - - /** - * Returns the value of field 'fontStyle'. - * - * @return the value of field 'FontStyle'. - */ - public int getFontStyle( - ) { - return this._fontStyle; - } - - /** - * Returns the value of field 'height'. - * - * @return the value of field 'Height'. - */ - public int getHeight( - ) { - return this._height; - } - - /** - * Returns the value of field 'pidSelected'. - * - * @return the value of field 'PidSelected'. - */ - public boolean getPidSelected( - ) { - return this._pidSelected; - } - - /** - * Returns the value of field 'pidThreshold'. - * - * @return the value of field 'PidThreshold'. - */ - public int getPidThreshold( - ) { - return this._pidThreshold; - } - - /** - * Returns the value of field 'renderGaps'. - * - * @return the value of field 'RenderGaps'. - */ - public boolean getRenderGaps( - ) { - return this._renderGaps; - } - - /** - * Returns the value of field 'showAnnotation'. - * - * @return the value of field 'ShowAnnotation'. - */ - public boolean getShowAnnotation( - ) { - return this._showAnnotation; - } - - /** - * Returns the value of field 'showBoxes'. - * - * @return the value of field 'ShowBoxes'. - */ - public boolean getShowBoxes( - ) { - return this._showBoxes; - } - - /** - * Returns the value of field 'showColourText'. - * - * @return the value of field 'ShowColourText'. - */ - public boolean getShowColourText( - ) { - return this._showColourText; - } - - /** - * Returns the value of field 'showConservation'. - * - * @return the value of field 'ShowConservation'. - */ - public boolean getShowConservation( - ) { - return this._showConservation; - } - - /** - * Returns the value of field 'showFullId'. - * - * @return the value of field 'ShowFullId'. - */ - public boolean getShowFullId( - ) { - return this._showFullId; - } - - /** - * Returns the value of field 'showIdentity'. - * - * @return the value of field 'ShowIdentity'. - */ - public boolean getShowIdentity( - ) { - return this._showIdentity; - } - - /** - * Returns the value of field 'showQuality'. - * - * @return the value of field 'ShowQuality'. - */ - public boolean getShowQuality( - ) { - return this._showQuality; - } - - /** - * Returns the value of field 'showSequenceFeatures'. - * - * @return the value of field 'ShowSequenceFeatures'. - */ - public boolean getShowSequenceFeatures( - ) { - return this._showSequenceFeatures; - } - - /** - * Returns the value of field 'showText'. - * - * @return the value of field 'ShowText'. - */ - public boolean getShowText( - ) { - return this._showText; - } - - /** - * Returns the value of field 'startRes'. - * - * @return the value of field 'StartRes'. - */ - public int getStartRes( - ) { - return this._startRes; - } - - /** - * Returns the value of field 'startSeq'. - * - * @return the value of field 'StartSeq'. - */ - public int getStartSeq( - ) { - return this._startSeq; - } - - /** - * Returns the value of field 'title'. - * - * @return the value of field 'Title'. - */ - public java.lang.String getTitle( - ) { - return this._title; - } - - /** - * Returns the value of field 'width'. - * - * @return the value of field 'Width'. - */ - public int getWidth( - ) { - return this._width; - } - - /** - * Returns the value of field 'wrapAlignment'. - * - * @return the value of field 'WrapAlignment'. - */ - public boolean getWrapAlignment( - ) { - return this._wrapAlignment; - } - - /** - * Returns the value of field 'xpos'. - * - * @return the value of field 'Xpos'. - */ - public int getXpos( - ) { - return this._xpos; - } - - /** - * Returns the value of field 'ypos'. - * - * @return the value of field 'Ypos'. - */ - public int getYpos( - ) { - return this._ypos; - } - - /** - * Method hasConsThreshold. - * - * @return true if at least one ConsThreshold has been added - */ - public boolean hasConsThreshold( - ) { - return this._has_consThreshold; - } - - /** - * Method hasConservationSelected. - * - * @return true if at least one ConservationSelected has been - * added - */ - public boolean hasConservationSelected( - ) { - return this._has_conservationSelected; - } - - /** - * Method hasFontSize. - * - * @return true if at least one FontSize has been added - */ - public boolean hasFontSize( - ) { - return this._has_fontSize; - } - - /** - * Method hasFontStyle. - * - * @return true if at least one FontStyle has been added - */ - public boolean hasFontStyle( - ) { - return this._has_fontStyle; - } - - /** - * Method hasHeight. - * - * @return true if at least one Height has been added - */ - public boolean hasHeight( - ) { - return this._has_height; - } - - /** - * Method hasPidSelected. - * - * @return true if at least one PidSelected has been added - */ - public boolean hasPidSelected( - ) { - return this._has_pidSelected; - } - - /** - * Method hasPidThreshold. - * - * @return true if at least one PidThreshold has been added - */ - public boolean hasPidThreshold( - ) { - return this._has_pidThreshold; - } - - /** - * Method hasRenderGaps. - * - * @return true if at least one RenderGaps has been added - */ - public boolean hasRenderGaps( - ) { - return this._has_renderGaps; - } - - /** - * Method hasShowAnnotation. - * - * @return true if at least one ShowAnnotation has been added - */ - public boolean hasShowAnnotation( - ) { - return this._has_showAnnotation; - } - - /** - * Method hasShowBoxes. - * - * @return true if at least one ShowBoxes has been added - */ - public boolean hasShowBoxes( - ) { - return this._has_showBoxes; - } - - /** - * Method hasShowColourText. - * - * @return true if at least one ShowColourText has been added - */ - public boolean hasShowColourText( - ) { - return this._has_showColourText; - } - - /** - * Method hasShowConservation. - * - * @return true if at least one ShowConservation has been added - */ - public boolean hasShowConservation( - ) { - return this._has_showConservation; - } - - /** - * Method hasShowFullId. - * - * @return true if at least one ShowFullId has been added - */ - public boolean hasShowFullId( - ) { - return this._has_showFullId; - } - - /** - * Method hasShowIdentity. - * - * @return true if at least one ShowIdentity has been added - */ - public boolean hasShowIdentity( - ) { - return this._has_showIdentity; - } - - /** - * Method hasShowQuality. - * - * @return true if at least one ShowQuality has been added - */ - public boolean hasShowQuality( - ) { - return this._has_showQuality; - } - - /** - * Method hasShowSequenceFeatures. - * - * @return true if at least one ShowSequenceFeatures has been - * added - */ - public boolean hasShowSequenceFeatures( - ) { - return this._has_showSequenceFeatures; - } - - /** - * Method hasShowText. - * - * @return true if at least one ShowText has been added - */ - public boolean hasShowText( - ) { - return this._has_showText; - } - - /** - * Method hasStartRes. - * - * @return true if at least one StartRes has been added - */ - public boolean hasStartRes( - ) { - return this._has_startRes; - } - - /** - * Method hasStartSeq. - * - * @return true if at least one StartSeq has been added - */ - public boolean hasStartSeq( - ) { - return this._has_startSeq; - } - - /** - * Method hasWidth. - * - * @return true if at least one Width has been added - */ - public boolean hasWidth( - ) { - return this._has_width; - } - - /** - * Method hasWrapAlignment. - * - * @return true if at least one WrapAlignment has been added - */ - public boolean hasWrapAlignment( - ) { - return this._has_wrapAlignment; - } - - /** - * Method hasXpos. - * - * @return true if at least one Xpos has been added - */ - public boolean hasXpos( - ) { - return this._has_xpos; - } - - /** - * Method hasYpos. - * - * @return true if at least one Ypos has been added - */ - public boolean hasYpos( - ) { - return this._has_ypos; - } - - /** - * Returns the value of field 'conservationSelected'. - * - * @return the value of field 'ConservationSelected'. - */ - public boolean isConservationSelected( - ) { - return this._conservationSelected; - } - - /** - * Returns the value of field 'pidSelected'. - * - * @return the value of field 'PidSelected'. - */ - public boolean isPidSelected( - ) { - return this._pidSelected; - } - - /** - * Returns the value of field 'renderGaps'. - * - * @return the value of field 'RenderGaps'. - */ - public boolean isRenderGaps( - ) { - return this._renderGaps; - } - - /** - * Returns the value of field 'showAnnotation'. - * - * @return the value of field 'ShowAnnotation'. - */ - public boolean isShowAnnotation( - ) { - return this._showAnnotation; - } - - /** - * Returns the value of field 'showBoxes'. - * - * @return the value of field 'ShowBoxes'. - */ - public boolean isShowBoxes( - ) { - return this._showBoxes; - } - - /** - * Returns the value of field 'showColourText'. - * - * @return the value of field 'ShowColourText'. - */ - public boolean isShowColourText( - ) { - return this._showColourText; - } - - /** - * Returns the value of field 'showConservation'. - * - * @return the value of field 'ShowConservation'. - */ - public boolean isShowConservation( - ) { - return this._showConservation; - } - - /** - * Returns the value of field 'showFullId'. - * - * @return the value of field 'ShowFullId'. - */ - public boolean isShowFullId( - ) { - return this._showFullId; - } - - /** - * Returns the value of field 'showIdentity'. - * - * @return the value of field 'ShowIdentity'. - */ - public boolean isShowIdentity( - ) { - return this._showIdentity; - } - - /** - * Returns the value of field 'showQuality'. - * - * @return the value of field 'ShowQuality'. - */ - public boolean isShowQuality( - ) { - return this._showQuality; - } - - /** - * Returns the value of field 'showSequenceFeatures'. - * - * @return the value of field 'ShowSequenceFeatures'. - */ - public boolean isShowSequenceFeatures( - ) { - return this._showSequenceFeatures; - } - - /** - * Returns the value of field 'showText'. - * - * @return the value of field 'ShowText'. - */ - public boolean isShowText( - ) { - return this._showText; - } - - /** - * 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; - } - - /** - * Returns the value of field 'wrapAlignment'. - * - * @return the value of field 'WrapAlignment'. - */ - public boolean isWrapAlignment( - ) { - return this._wrapAlignment; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'bgColour'. - * - * @param bgColour the value of field 'bgColour'. - */ - public void setBgColour( - final java.lang.String bgColour) { - this._bgColour = bgColour; - } - - /** - * Sets the value of field 'consThreshold'. - * - * @param consThreshold the value of field 'consThreshold'. - */ - public void setConsThreshold( - final int consThreshold) { - this._consThreshold = consThreshold; - this._has_consThreshold = true; - } - - /** - * Sets the value of field 'conservationSelected'. - * - * @param conservationSelected the value of field - * 'conservationSelected'. - */ - public void setConservationSelected( - final boolean conservationSelected) { - this._conservationSelected = conservationSelected; - this._has_conservationSelected = true; - } - - /** - * Sets the value of field 'fontName'. - * - * @param fontName the value of field 'fontName'. - */ - public void setFontName( - final java.lang.String fontName) { - this._fontName = fontName; - } - - /** - * Sets the value of field 'fontSize'. - * - * @param fontSize the value of field 'fontSize'. - */ - public void setFontSize( - final int fontSize) { - this._fontSize = fontSize; - this._has_fontSize = true; - } - - /** - * Sets the value of field 'fontStyle'. - * - * @param fontStyle the value of field 'fontStyle'. - */ - public void setFontStyle( - final int fontStyle) { - this._fontStyle = fontStyle; - this._has_fontStyle = true; - } - - /** - * Sets the value of field 'height'. - * - * @param height the value of field 'height'. - */ - public void setHeight( - final int height) { - this._height = height; - this._has_height = true; - } - - /** - * Sets the value of field 'pidSelected'. - * - * @param pidSelected the value of field 'pidSelected'. - */ - public void setPidSelected( - final boolean pidSelected) { - this._pidSelected = pidSelected; - this._has_pidSelected = true; - } - - /** - * Sets the value of field 'pidThreshold'. - * - * @param pidThreshold the value of field 'pidThreshold'. - */ - public void setPidThreshold( - final int pidThreshold) { - this._pidThreshold = pidThreshold; - this._has_pidThreshold = true; - } - - /** - * Sets the value of field 'renderGaps'. - * - * @param renderGaps the value of field 'renderGaps'. - */ - public void setRenderGaps( - final boolean renderGaps) { - this._renderGaps = renderGaps; - this._has_renderGaps = true; - } - - /** - * Sets the value of field 'showAnnotation'. - * - * @param showAnnotation the value of field 'showAnnotation'. - */ - public void setShowAnnotation( - final boolean showAnnotation) { - this._showAnnotation = showAnnotation; - this._has_showAnnotation = true; - } - - /** - * Sets the value of field 'showBoxes'. - * - * @param showBoxes the value of field 'showBoxes'. - */ - public void setShowBoxes( - final boolean showBoxes) { - this._showBoxes = showBoxes; - this._has_showBoxes = true; - } - - /** - * Sets the value of field 'showColourText'. - * - * @param showColourText the value of field 'showColourText'. - */ - public void setShowColourText( - final boolean showColourText) { - this._showColourText = showColourText; - this._has_showColourText = true; - } - - /** - * Sets the value of field 'showConservation'. - * - * @param showConservation the value of field 'showConservation' - */ - public void setShowConservation( - final boolean showConservation) { - this._showConservation = showConservation; - this._has_showConservation = true; - } - - /** - * Sets the value of field 'showFullId'. - * - * @param showFullId the value of field 'showFullId'. - */ - public void setShowFullId( - final boolean showFullId) { - this._showFullId = showFullId; - this._has_showFullId = true; - } - - /** - * Sets the value of field 'showIdentity'. - * - * @param showIdentity the value of field 'showIdentity'. - */ - public void setShowIdentity( - final boolean showIdentity) { - this._showIdentity = showIdentity; - this._has_showIdentity = true; - } - - /** - * Sets the value of field 'showQuality'. - * - * @param showQuality the value of field 'showQuality'. - */ - public void setShowQuality( - final boolean showQuality) { - this._showQuality = showQuality; - this._has_showQuality = true; - } - - /** - * Sets the value of field 'showSequenceFeatures'. - * - * @param showSequenceFeatures the value of field - * 'showSequenceFeatures'. - */ - public void setShowSequenceFeatures( - final boolean showSequenceFeatures) { - this._showSequenceFeatures = showSequenceFeatures; - this._has_showSequenceFeatures = true; - } - - /** - * Sets the value of field 'showText'. - * - * @param showText the value of field 'showText'. - */ - public void setShowText( - final boolean showText) { - this._showText = showText; - this._has_showText = true; - } - - /** - * Sets the value of field 'startRes'. - * - * @param startRes the value of field 'startRes'. - */ - public void setStartRes( - final int startRes) { - this._startRes = startRes; - this._has_startRes = true; - } - - /** - * Sets the value of field 'startSeq'. - * - * @param startSeq the value of field 'startSeq'. - */ - public void setStartSeq( - final int startSeq) { - this._startSeq = startSeq; - this._has_startSeq = true; - } - - /** - * Sets the value of field 'title'. - * - * @param title the value of field 'title'. - */ - public void setTitle( - final java.lang.String title) { - this._title = title; - } - - /** - * Sets the value of field 'width'. - * - * @param width the value of field 'width'. - */ - public void setWidth( - final int width) { - this._width = width; - this._has_width = true; - } - - /** - * Sets the value of field 'wrapAlignment'. - * - * @param wrapAlignment the value of field 'wrapAlignment'. - */ - public void setWrapAlignment( - final boolean wrapAlignment) { - this._wrapAlignment = wrapAlignment; - this._has_wrapAlignment = true; - } - - /** - * Sets the value of field 'xpos'. - * - * @param xpos the value of field 'xpos'. - */ - public void setXpos( - final int xpos) { - this._xpos = xpos; - this._has_xpos = true; - } - - /** - * Sets the value of field 'ypos'. - * - * @param ypos the value of field 'ypos'. - */ - public void setYpos( - final int ypos) { - this._ypos = ypos; - this._has_ypos = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled jalview.binding.Viewport - */ - public static jalview.binding.Viewport unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.binding.Viewport) Unmarshaller.unmarshal(jalview.binding.Viewport.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } + public void deleteShowQuality() + { + this._has_showQuality = false; + } + + /** + */ + public void deleteShowSequenceFeatures() + { + this._has_showSequenceFeatures = false; + } + + /** + */ + public void deleteShowText() + { + this._has_showText = false; + } + + /** + */ + public void deleteStartRes() + { + this._has_startRes = false; + } + + /** + */ + public void deleteStartSeq() + { + this._has_startSeq = false; + } + + /** + */ + public void deleteWidth() + { + this._has_width = false; + } + + /** + */ + public void deleteWrapAlignment() + { + this._has_wrapAlignment = false; + } + + /** + */ + public void deleteXpos() + { + this._has_xpos = false; + } + + /** + */ + public void deleteYpos() + { + this._has_ypos = false; + } + + /** + * Returns the value of field 'bgColour'. + * + * @return the value of field 'BgColour'. + */ + public java.lang.String getBgColour() + { + return this._bgColour; + } + + /** + * Returns the value of field 'consThreshold'. + * + * @return the value of field 'ConsThreshold'. + */ + public int getConsThreshold() + { + return this._consThreshold; + } + + /** + * Returns the value of field 'conservationSelected'. + * + * @return the value of field 'ConservationSelected'. + */ + public boolean getConservationSelected() + { + return this._conservationSelected; + } + + /** + * Returns the value of field 'fontName'. + * + * @return the value of field 'FontName'. + */ + public java.lang.String getFontName() + { + return this._fontName; + } + + /** + * Returns the value of field 'fontSize'. + * + * @return the value of field 'FontSize'. + */ + public int getFontSize() + { + return this._fontSize; + } + + /** + * Returns the value of field 'fontStyle'. + * + * @return the value of field 'FontStyle'. + */ + public int getFontStyle() + { + return this._fontStyle; + } + + /** + * Returns the value of field 'height'. + * + * @return the value of field 'Height'. + */ + public int getHeight() + { + return this._height; + } + + /** + * Returns the value of field 'pidSelected'. + * + * @return the value of field 'PidSelected'. + */ + public boolean getPidSelected() + { + return this._pidSelected; + } + + /** + * Returns the value of field 'pidThreshold'. + * + * @return the value of field 'PidThreshold'. + */ + public int getPidThreshold() + { + return this._pidThreshold; + } + + /** + * Returns the value of field 'renderGaps'. + * + * @return the value of field 'RenderGaps'. + */ + public boolean getRenderGaps() + { + return this._renderGaps; + } + + /** + * Returns the value of field 'showAnnotation'. + * + * @return the value of field 'ShowAnnotation'. + */ + public boolean getShowAnnotation() + { + return this._showAnnotation; + } + + /** + * Returns the value of field 'showBoxes'. + * + * @return the value of field 'ShowBoxes'. + */ + public boolean getShowBoxes() + { + return this._showBoxes; + } + + /** + * Returns the value of field 'showColourText'. + * + * @return the value of field 'ShowColourText'. + */ + public boolean getShowColourText() + { + return this._showColourText; + } + + /** + * Returns the value of field 'showConservation'. + * + * @return the value of field 'ShowConservation'. + */ + public boolean getShowConservation() + { + return this._showConservation; + } + + /** + * Returns the value of field 'showFullId'. + * + * @return the value of field 'ShowFullId'. + */ + public boolean getShowFullId() + { + return this._showFullId; + } + + /** + * Returns the value of field 'showIdentity'. + * + * @return the value of field 'ShowIdentity'. + */ + public boolean getShowIdentity() + { + return this._showIdentity; + } + + /** + * Returns the value of field 'showQuality'. + * + * @return the value of field 'ShowQuality'. + */ + public boolean getShowQuality() + { + return this._showQuality; + } + + /** + * Returns the value of field 'showSequenceFeatures'. + * + * @return the value of field 'ShowSequenceFeatures'. + */ + public boolean getShowSequenceFeatures() + { + return this._showSequenceFeatures; + } + + /** + * Returns the value of field 'showText'. + * + * @return the value of field 'ShowText'. + */ + public boolean getShowText() + { + return this._showText; + } + + /** + * Returns the value of field 'startRes'. + * + * @return the value of field 'StartRes'. + */ + public int getStartRes() + { + return this._startRes; + } + + /** + * Returns the value of field 'startSeq'. + * + * @return the value of field 'StartSeq'. + */ + public int getStartSeq() + { + return this._startSeq; + } + + /** + * Returns the value of field 'title'. + * + * @return the value of field 'Title'. + */ + public java.lang.String getTitle() + { + return this._title; + } + + /** + * Returns the value of field 'width'. + * + * @return the value of field 'Width'. + */ + public int getWidth() + { + return this._width; + } + + /** + * Returns the value of field 'wrapAlignment'. + * + * @return the value of field 'WrapAlignment'. + */ + public boolean getWrapAlignment() + { + return this._wrapAlignment; + } + + /** + * Returns the value of field 'xpos'. + * + * @return the value of field 'Xpos'. + */ + public int getXpos() + { + return this._xpos; + } + + /** + * Returns the value of field 'ypos'. + * + * @return the value of field 'Ypos'. + */ + public int getYpos() + { + return this._ypos; + } + + /** + * Method hasConsThreshold. + * + * @return true if at least one ConsThreshold has been added + */ + public boolean hasConsThreshold() + { + return this._has_consThreshold; + } + + /** + * Method hasConservationSelected. + * + * @return true if at least one ConservationSelected has been added + */ + public boolean hasConservationSelected() + { + return this._has_conservationSelected; + } + + /** + * Method hasFontSize. + * + * @return true if at least one FontSize has been added + */ + public boolean hasFontSize() + { + return this._has_fontSize; + } + + /** + * Method hasFontStyle. + * + * @return true if at least one FontStyle has been added + */ + public boolean hasFontStyle() + { + return this._has_fontStyle; + } + + /** + * Method hasHeight. + * + * @return true if at least one Height has been added + */ + public boolean hasHeight() + { + return this._has_height; + } + + /** + * Method hasPidSelected. + * + * @return true if at least one PidSelected has been added + */ + public boolean hasPidSelected() + { + return this._has_pidSelected; + } + + /** + * Method hasPidThreshold. + * + * @return true if at least one PidThreshold has been added + */ + public boolean hasPidThreshold() + { + return this._has_pidThreshold; + } + + /** + * Method hasRenderGaps. + * + * @return true if at least one RenderGaps has been added + */ + public boolean hasRenderGaps() + { + return this._has_renderGaps; + } + + /** + * Method hasShowAnnotation. + * + * @return true if at least one ShowAnnotation has been added + */ + public boolean hasShowAnnotation() + { + return this._has_showAnnotation; + } + + /** + * Method hasShowBoxes. + * + * @return true if at least one ShowBoxes has been added + */ + public boolean hasShowBoxes() + { + return this._has_showBoxes; + } + + /** + * Method hasShowColourText. + * + * @return true if at least one ShowColourText has been added + */ + public boolean hasShowColourText() + { + return this._has_showColourText; + } + + /** + * Method hasShowConservation. + * + * @return true if at least one ShowConservation has been added + */ + public boolean hasShowConservation() + { + return this._has_showConservation; + } + + /** + * Method hasShowFullId. + * + * @return true if at least one ShowFullId has been added + */ + public boolean hasShowFullId() + { + return this._has_showFullId; + } + + /** + * Method hasShowIdentity. + * + * @return true if at least one ShowIdentity has been added + */ + public boolean hasShowIdentity() + { + return this._has_showIdentity; + } + + /** + * Method hasShowQuality. + * + * @return true if at least one ShowQuality has been added + */ + public boolean hasShowQuality() + { + return this._has_showQuality; + } + + /** + * Method hasShowSequenceFeatures. + * + * @return true if at least one ShowSequenceFeatures has been added + */ + public boolean hasShowSequenceFeatures() + { + return this._has_showSequenceFeatures; + } + + /** + * Method hasShowText. + * + * @return true if at least one ShowText has been added + */ + public boolean hasShowText() + { + return this._has_showText; + } + + /** + * Method hasStartRes. + * + * @return true if at least one StartRes has been added + */ + public boolean hasStartRes() + { + return this._has_startRes; + } + + /** + * Method hasStartSeq. + * + * @return true if at least one StartSeq has been added + */ + public boolean hasStartSeq() + { + return this._has_startSeq; + } + + /** + * Method hasWidth. + * + * @return true if at least one Width has been added + */ + public boolean hasWidth() + { + return this._has_width; + } + + /** + * Method hasWrapAlignment. + * + * @return true if at least one WrapAlignment has been added + */ + public boolean hasWrapAlignment() + { + return this._has_wrapAlignment; + } + + /** + * Method hasXpos. + * + * @return true if at least one Xpos has been added + */ + public boolean hasXpos() + { + return this._has_xpos; + } + + /** + * Method hasYpos. + * + * @return true if at least one Ypos has been added + */ + public boolean hasYpos() + { + return this._has_ypos; + } + + /** + * Returns the value of field 'conservationSelected'. + * + * @return the value of field 'ConservationSelected'. + */ + public boolean isConservationSelected() + { + return this._conservationSelected; + } + + /** + * Returns the value of field 'pidSelected'. + * + * @return the value of field 'PidSelected'. + */ + public boolean isPidSelected() + { + return this._pidSelected; + } + + /** + * Returns the value of field 'renderGaps'. + * + * @return the value of field 'RenderGaps'. + */ + public boolean isRenderGaps() + { + return this._renderGaps; + } + + /** + * Returns the value of field 'showAnnotation'. + * + * @return the value of field 'ShowAnnotation'. + */ + public boolean isShowAnnotation() + { + return this._showAnnotation; + } + + /** + * Returns the value of field 'showBoxes'. + * + * @return the value of field 'ShowBoxes'. + */ + public boolean isShowBoxes() + { + return this._showBoxes; + } + + /** + * Returns the value of field 'showColourText'. + * + * @return the value of field 'ShowColourText'. + */ + public boolean isShowColourText() + { + return this._showColourText; + } + + /** + * Returns the value of field 'showConservation'. + * + * @return the value of field 'ShowConservation'. + */ + public boolean isShowConservation() + { + return this._showConservation; + } + + /** + * Returns the value of field 'showFullId'. + * + * @return the value of field 'ShowFullId'. + */ + public boolean isShowFullId() + { + return this._showFullId; + } + + /** + * Returns the value of field 'showIdentity'. + * + * @return the value of field 'ShowIdentity'. + */ + public boolean isShowIdentity() + { + return this._showIdentity; + } + + /** + * Returns the value of field 'showQuality'. + * + * @return the value of field 'ShowQuality'. + */ + public boolean isShowQuality() + { + return this._showQuality; + } + + /** + * Returns the value of field 'showSequenceFeatures'. + * + * @return the value of field 'ShowSequenceFeatures'. + */ + public boolean isShowSequenceFeatures() + { + return this._showSequenceFeatures; + } + + /** + * Returns the value of field 'showText'. + * + * @return the value of field 'ShowText'. + */ + public boolean isShowText() + { + return this._showText; + } + + /** + * 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; + } + + /** + * Returns the value of field 'wrapAlignment'. + * + * @return the value of field 'WrapAlignment'. + */ + public boolean isWrapAlignment() + { + return this._wrapAlignment; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'bgColour'. + * + * @param bgColour + * the value of field 'bgColour'. + */ + public void setBgColour(final java.lang.String bgColour) + { + this._bgColour = bgColour; + } + + /** + * Sets the value of field 'consThreshold'. + * + * @param consThreshold + * the value of field 'consThreshold'. + */ + public void setConsThreshold(final int consThreshold) + { + this._consThreshold = consThreshold; + this._has_consThreshold = true; + } + + /** + * Sets the value of field 'conservationSelected'. + * + * @param conservationSelected + * the value of field 'conservationSelected'. + */ + public void setConservationSelected(final boolean conservationSelected) + { + this._conservationSelected = conservationSelected; + this._has_conservationSelected = true; + } + + /** + * Sets the value of field 'fontName'. + * + * @param fontName + * the value of field 'fontName'. + */ + public void setFontName(final java.lang.String fontName) + { + this._fontName = fontName; + } + + /** + * Sets the value of field 'fontSize'. + * + * @param fontSize + * the value of field 'fontSize'. + */ + public void setFontSize(final int fontSize) + { + this._fontSize = fontSize; + this._has_fontSize = true; + } + + /** + * Sets the value of field 'fontStyle'. + * + * @param fontStyle + * the value of field 'fontStyle'. + */ + public void setFontStyle(final int fontStyle) + { + this._fontStyle = fontStyle; + this._has_fontStyle = true; + } + + /** + * Sets the value of field 'height'. + * + * @param height + * the value of field 'height'. + */ + public void setHeight(final int height) + { + this._height = height; + this._has_height = true; + } + + /** + * Sets the value of field 'pidSelected'. + * + * @param pidSelected + * the value of field 'pidSelected'. + */ + public void setPidSelected(final boolean pidSelected) + { + this._pidSelected = pidSelected; + this._has_pidSelected = true; + } + + /** + * Sets the value of field 'pidThreshold'. + * + * @param pidThreshold + * the value of field 'pidThreshold'. + */ + public void setPidThreshold(final int pidThreshold) + { + this._pidThreshold = pidThreshold; + this._has_pidThreshold = true; + } + + /** + * Sets the value of field 'renderGaps'. + * + * @param renderGaps + * the value of field 'renderGaps'. + */ + public void setRenderGaps(final boolean renderGaps) + { + this._renderGaps = renderGaps; + this._has_renderGaps = true; + } + + /** + * Sets the value of field 'showAnnotation'. + * + * @param showAnnotation + * the value of field 'showAnnotation'. + */ + public void setShowAnnotation(final boolean showAnnotation) + { + this._showAnnotation = showAnnotation; + this._has_showAnnotation = true; + } + + /** + * Sets the value of field 'showBoxes'. + * + * @param showBoxes + * the value of field 'showBoxes'. + */ + public void setShowBoxes(final boolean showBoxes) + { + this._showBoxes = showBoxes; + this._has_showBoxes = true; + } + + /** + * Sets the value of field 'showColourText'. + * + * @param showColourText + * the value of field 'showColourText'. + */ + public void setShowColourText(final boolean showColourText) + { + this._showColourText = showColourText; + this._has_showColourText = true; + } + + /** + * Sets the value of field 'showConservation'. + * + * @param showConservation + * the value of field 'showConservation' + */ + public void setShowConservation(final boolean showConservation) + { + this._showConservation = showConservation; + this._has_showConservation = true; + } + + /** + * Sets the value of field 'showFullId'. + * + * @param showFullId + * the value of field 'showFullId'. + */ + public void setShowFullId(final boolean showFullId) + { + this._showFullId = showFullId; + this._has_showFullId = true; + } + + /** + * Sets the value of field 'showIdentity'. + * + * @param showIdentity + * the value of field 'showIdentity'. + */ + public void setShowIdentity(final boolean showIdentity) + { + this._showIdentity = showIdentity; + this._has_showIdentity = true; + } + + /** + * Sets the value of field 'showQuality'. + * + * @param showQuality + * the value of field 'showQuality'. + */ + public void setShowQuality(final boolean showQuality) + { + this._showQuality = showQuality; + this._has_showQuality = true; + } + + /** + * Sets the value of field 'showSequenceFeatures'. + * + * @param showSequenceFeatures + * the value of field 'showSequenceFeatures'. + */ + public void setShowSequenceFeatures(final boolean showSequenceFeatures) + { + this._showSequenceFeatures = showSequenceFeatures; + this._has_showSequenceFeatures = true; + } + + /** + * Sets the value of field 'showText'. + * + * @param showText + * the value of field 'showText'. + */ + public void setShowText(final boolean showText) + { + this._showText = showText; + this._has_showText = true; + } + + /** + * Sets the value of field 'startRes'. + * + * @param startRes + * the value of field 'startRes'. + */ + public void setStartRes(final int startRes) + { + this._startRes = startRes; + this._has_startRes = true; + } + + /** + * Sets the value of field 'startSeq'. + * + * @param startSeq + * the value of field 'startSeq'. + */ + public void setStartSeq(final int startSeq) + { + this._startSeq = startSeq; + this._has_startSeq = true; + } + + /** + * Sets the value of field 'title'. + * + * @param title + * the value of field 'title'. + */ + public void setTitle(final java.lang.String title) + { + this._title = title; + } + + /** + * Sets the value of field 'width'. + * + * @param width + * the value of field 'width'. + */ + public void setWidth(final int width) + { + this._width = width; + this._has_width = true; + } + + /** + * Sets the value of field 'wrapAlignment'. + * + * @param wrapAlignment + * the value of field 'wrapAlignment'. + */ + public void setWrapAlignment(final boolean wrapAlignment) + { + this._wrapAlignment = wrapAlignment; + this._has_wrapAlignment = true; + } + + /** + * Sets the value of field 'xpos'. + * + * @param xpos + * the value of field 'xpos'. + */ + public void setXpos(final int xpos) + { + this._xpos = xpos; + this._has_xpos = true; + } + + /** + * Sets the value of field 'ypos'. + * + * @param ypos + * the value of field 'ypos'. + */ + public void setYpos(final int ypos) + { + this._ypos = ypos; + this._has_ypos = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.binding.Viewport + */ + public static jalview.binding.Viewport unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.binding.Viewport) Unmarshaller.unmarshal( + jalview.binding.Viewport.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/commands/EditCommand.java b/src/jalview/commands/EditCommand.java index 2d3a8d8..4b21137 100644 --- a/src/jalview/commands/EditCommand.java +++ b/src/jalview/commands/EditCommand.java @@ -307,8 +307,7 @@ public class EditCommand implements CommandI * @param performEdit */ final public void appendEdit(Action command, SequenceI[] seqs, - int position, - int number, AlignmentI al, boolean performEdit) + int position, int number, AlignmentI al, boolean performEdit) { appendEdit(command, seqs, position, number, al, performEdit, null); } @@ -326,8 +325,8 @@ public class EditCommand implements CommandI * @param views */ final public void appendEdit(Action command, SequenceI[] seqs, - int position, - int number, AlignmentI al, boolean performEdit, AlignmentI[] views) + int position, int number, AlignmentI al, boolean performEdit, + AlignmentI[] views) { Edit edit = new Edit(command, seqs, position, number, al.getGapCharacter()); @@ -432,7 +431,7 @@ public class EditCommand implements CommandI */ @Override final public void undoCommand(AlignmentI[] views) - { + { ListIterator iterator = edits.listIterator(edits.size()); while (iterator.hasPrevious()) { @@ -474,8 +473,8 @@ public class EditCommand implements CommandI for (int s = 0; s < command.seqs.length; s++) { - command.seqs[s].insertCharAt(command.position, - command.number, command.gapChar); + command.seqs[s].insertCharAt(command.position, command.number, + command.gapChar); // System.out.println("pos: "+command.position+" number: "+command.number); } @@ -560,8 +559,8 @@ public class EditCommand implements CommandI command, i, sequence.findPosition(command.position), - sequence.findPosition(command.position - + command.number), false); + sequence.findPosition(command.position + command.number), + false); } } } @@ -1045,7 +1044,7 @@ public class EditCommand implements CommandI int copylen = Math.min(command.position, annotations[a].annotations.length); if (copylen > 0) - { + { System.arraycopy(annotations[a].annotations, 0, temp, 0, copylen); // command.position); } @@ -1117,8 +1116,7 @@ public class EditCommand implements CommandI if (command.editedFeatures != null && command.editedFeatures.containsKey(seq)) { - sequence.setSequenceFeatures(command.editedFeatures - .get(seq)); + sequence.setSequenceFeatures(command.editedFeatures.get(seq)); } return; @@ -1265,8 +1263,7 @@ public class EditCommand implements CommandI if (action == Action.DELETE_GAP) { preEdit.setSequence(new String(StringUtils.insertCharAt( - preEdit.getSequence(), position, - number, gap))); + preEdit.getSequence(), position, number, gap))); } else if (action == Action.INSERT_GAP) { diff --git a/src/jalview/commands/RemoveGapColCommand.java b/src/jalview/commands/RemoveGapColCommand.java index 490dc4a..3266874 100644 --- a/src/jalview/commands/RemoveGapColCommand.java +++ b/src/jalview/commands/RemoveGapColCommand.java @@ -88,8 +88,7 @@ public class RemoveGapColCommand extends EditCommand if (!delete && startCol > -1) { this.appendEdit(Action.DELETE_GAP, seqs, startCol - columnsDeleted, - endCol - - startCol, al, false, null); + endCol - startCol, al, false, null); columnsDeleted += (endCol - startCol); startCol = -1; @@ -103,8 +102,7 @@ public class RemoveGapColCommand extends EditCommand // end of the alignment this.appendEdit(Action.DELETE_GAP, seqs, startCol - columnsDeleted, - end - - startCol + 1, al, false, null); + end - startCol + 1, al, false, null); columnsDeleted += (end - startCol + 1); } diff --git a/src/jalview/commands/RemoveGapsCommand.java b/src/jalview/commands/RemoveGapsCommand.java index db1725b..c8dadfa 100644 --- a/src/jalview/commands/RemoveGapsCommand.java +++ b/src/jalview/commands/RemoveGapsCommand.java @@ -109,9 +109,9 @@ public class RemoveGapsCommand extends EditCommand if (!delete && startCol > -1) { - this.appendEdit(Action.DELETE_GAP, new SequenceI[] - { seqs[s] }, start + startCol - deletedCols, endCol - startCol, - al, false, null); + this.appendEdit(Action.DELETE_GAP, new SequenceI[] { seqs[s] }, + start + startCol - deletedCols, endCol - startCol, al, + false, null); deletedCols += (endCol - startCol); startCol = -1; @@ -120,8 +120,8 @@ public class RemoveGapsCommand extends EditCommand } if (delete && startCol > -1) { - this.appendEdit(Action.DELETE_GAP, new SequenceI[] - { seqs[s] }, start + startCol - deletedCols, jSize - startCol, al, + this.appendEdit(Action.DELETE_GAP, new SequenceI[] { seqs[s] }, + start + startCol - deletedCols, jSize - startCol, al, false, null); } diff --git a/src/jalview/controller/AlignViewController.java b/src/jalview/controller/AlignViewController.java index 3be32bb..a39dc80 100644 --- a/src/jalview/controller/AlignViewController.java +++ b/src/jalview/controller/AlignViewController.java @@ -86,20 +86,23 @@ public class AlignViewController implements AlignViewControllerI if (sg != null && (cs == null || cs.getSelected() == null || cs.size() == 0)) { - gps = jalview.analysis.Grouping.makeGroupsFrom( - viewport.getSequenceSelection(), - viewport.getAlignmentView(true).getSequenceStrings( - viewport.getGapCharacter()), viewport.getAlignment() - .getGroups()); - } else { - if (cs!=null) { + gps = jalview.analysis.Grouping.makeGroupsFrom(viewport + .getSequenceSelection(), viewport.getAlignmentView(true) + .getSequenceStrings(viewport.getGapCharacter()), viewport + .getAlignment().getGroups()); + } + else + { + if (cs != null) + { gps = jalview.analysis.Grouping.makeGroupsFromCols( (sg == null) ? viewport.getAlignment().getSequencesArray() : sg.getSequences().toArray(new SequenceI[0]), cs, viewport.getAlignment().getGroups()); } } - if (gps!=null) { + if (gps != null) + { viewport.getAlignment().deleteAllGroups(); viewport.clearSequenceColours(); viewport.setSelectionGroup(null); @@ -289,17 +292,22 @@ public class AlignViewController implements AlignViewControllerI } viewport.setColumnSelection(cs); alignPanel.paintAlignment(true); - avcg.setStatus(MessageManager.formatMessage("label.view_controller_toggled_marked", - new String[]{ - (toggle ? MessageManager.getString("label.toggled") : MessageManager.getString("label.marked")), - (invert ? (Integer.valueOf((alw - alStart) - bs.cardinality()).toString()):(Integer.valueOf(bs.cardinality()).toString())), - featureType, Integer.valueOf(nseq).toString() - })); + avcg.setStatus(MessageManager.formatMessage( + "label.view_controller_toggled_marked", + new String[] { + (toggle ? MessageManager.getString("label.toggled") + : MessageManager.getString("label.marked")), + (invert ? (Integer.valueOf((alw - alStart) + - bs.cardinality()).toString()) : (Integer + .valueOf(bs.cardinality()).toString())), + featureType, Integer.valueOf(nseq).toString() })); return true; } else { - avcg.setStatus(MessageManager.formatMessage("label.no_feature_of_type_found", new String[]{featureType})); + avcg.setStatus(MessageManager.formatMessage( + "label.no_feature_of_type_found", + new String[] { featureType })); if (!extendCurrent && cs != null) { cs.clear(); @@ -309,8 +317,6 @@ public class AlignViewController implements AlignViewControllerI } } - - @Override public void sortAlignmentByFeatureDensity(String[] typ) { @@ -322,10 +328,10 @@ public class AlignViewController implements AlignViewControllerI FeatureRenderer fr = alignPanel.getFeatureRenderer(); if (typ == null) { - typ = fr==null ? null : fr.getDisplayedFeatureTypes(); + typ = fr == null ? null : fr.getDisplayedFeatureTypes(); } String gps[] = null; - gps = fr==null ? null : fr.getDisplayedFeatureGroups(); + gps = fr == null ? null : fr.getDisplayedFeatureGroups(); if (typ != null) { ArrayList types = new ArrayList(); diff --git a/src/jalview/controller/FeatureSettingsController.java b/src/jalview/controller/FeatureSettingsController.java index 7dd1399..68d717b 100644 --- a/src/jalview/controller/FeatureSettingsController.java +++ b/src/jalview/controller/FeatureSettingsController.java @@ -4,10 +4,12 @@ import jalview.api.FeatureRenderer; import jalview.api.FeatureSettingsModelI; public class FeatureSettingsController // implements - // jalview.api.FeatureSettingsControllerI +// jalview.api.FeatureSettingsControllerI { FeatureSettingsControllerGuiI settingUI; + FeatureRenderer fr; + FeatureSettingsModelI fsettings; - + } diff --git a/src/jalview/datamodel/AlignedCodonFrame.java b/src/jalview/datamodel/AlignedCodonFrame.java index eb977bc..627f0a6 100644 --- a/src/jalview/datamodel/AlignedCodonFrame.java +++ b/src/jalview/datamodel/AlignedCodonFrame.java @@ -20,12 +20,12 @@ */ package jalview.datamodel; -import java.util.ArrayList; -import java.util.List; - import jalview.util.MapList; import jalview.util.MappingUtils; +import java.util.ArrayList; +import java.util.List; + /** * Stores mapping between the columns of a protein alignment and a DNA alignment * and a list of individual codon to amino acid mappings between sequences. @@ -373,7 +373,8 @@ public class AlignedCodonFrame if (dnaSeqs[mi] == targetDs && dnaToProt[mi].to == sourceDs) { int[] codon = dnaToProt[mi].map.locateInFrom(pos, pos); - if (codon != null) { + if (codon != null) + { return codon; } } @@ -422,8 +423,7 @@ public class AlignedCodonFrame * Read off the mapped nucleotides (converting to position base 0) */ codonPos = MappingUtils.flattenRanges(codonPos); - return new char[] - { dnaSeq[codonPos[0] - 1], dnaSeq[codonPos[1] - 1], + return new char[] { dnaSeq[codonPos[0] - 1], dnaSeq[codonPos[1] - 1], dnaSeq[codonPos[2] - 1] }; } @@ -444,7 +444,7 @@ public class AlignedCodonFrame List related = new ArrayList(); SequenceI seqDs = seq.getDatasetSequence(); seqDs = seqDs != null ? seqDs : seq; - + for (int ds = 0; ds < dnaSeqs.length; ds++) { final Mapping mapping = dnaToProt[ds]; diff --git a/src/jalview/datamodel/Alignment.java b/src/jalview/datamodel/Alignment.java index 5d1fc60..7ea9985 100755 --- a/src/jalview/datamodel/Alignment.java +++ b/src/jalview/datamodel/Alignment.java @@ -147,7 +147,9 @@ public class Alignment implements AlignmentI */ public static AlignmentI createAlignment(CigarArray compactAlignment) { - throw new Error(MessageManager.getString("error.alignment_cigararray_not_implemented")); + throw new Error( + MessageManager + .getString("error.alignment_cigararray_not_implemented")); // this(compactAlignment.refCigars); } @@ -236,8 +238,7 @@ public class Alignment implements AlignmentI } if (sequences == null) { - initAlignment(new SequenceI[] - { snew }); + initAlignment(new SequenceI[] { snew }); } else { @@ -1588,38 +1589,37 @@ public class Alignment implements AlignmentI } } + private SequenceI seqrep = null; - private SequenceI seqrep=null; - - /** - * - * @return the representative sequence for this group - */ - public SequenceI getSeqrep() - { - return seqrep; - } + /** + * + * @return the representative sequence for this group + */ + public SequenceI getSeqrep() + { + return seqrep; + } - /** - * set the representative sequence for this group. Note - this affects the - * interpretation of the Hidereps attribute. - * - * @param seqrep - * the seqrep to set (null means no sequence representative) - */ - public void setSeqrep(SequenceI seqrep) - { - this.seqrep = seqrep; - } + /** + * set the representative sequence for this group. Note - this affects the + * interpretation of the Hidereps attribute. + * + * @param seqrep + * the seqrep to set (null means no sequence representative) + */ + public void setSeqrep(SequenceI seqrep) + { + this.seqrep = seqrep; + } - /** - * - * @return true if group has a sequence representative - */ - public boolean hasSeqrep() - { - return seqrep != null; - } + /** + * + * @return true if group has a sequence representative + */ + public boolean hasSeqrep() + { + return seqrep != null; + } @Override public int getEndRes() @@ -1678,7 +1678,7 @@ public class Alignment implements AlignmentI * @param preserveUnmappedGaps * if true, gaps within and between unmapped codons are preserved */ -// @Override + // @Override public int alignAs(AlignmentI al, boolean preserveMappedGaps, boolean preserveUnmappedGaps) { @@ -1693,9 +1693,8 @@ public class Alignment implements AlignmentI char thisGapChar = this.getGapCharacter(); String gap = thisIsNucleotide && thatIsProtein ? String - .valueOf(new char[] - { thisGapChar, thisGapChar, thisGapChar }) : String - .valueOf(thisGapChar); + .valueOf(new char[] { thisGapChar, thisGapChar, thisGapChar }) + : String.valueOf(thisGapChar); // TODO handle intron regions? Needs a 'holistic' alignment of dna, // not just sequence by sequence. But how to 'gap' intron regions? @@ -1705,8 +1704,8 @@ public class Alignment implements AlignmentI */ for (SequenceI alignTo : getSequences()) { - count += AlignmentUtils.alignSequenceAs(alignTo, al, gap, preserveMappedGaps, - preserveUnmappedGaps) ? 1 : 0; + count += AlignmentUtils.alignSequenceAs(alignTo, al, gap, + preserveMappedGaps, preserveUnmappedGaps) ? 1 : 0; } return count; } diff --git a/src/jalview/datamodel/AlignmentAnnotation.java b/src/jalview/datamodel/AlignmentAnnotation.java index 322fd54..bb45b67 100755 --- a/src/jalview/datamodel/AlignmentAnnotation.java +++ b/src/jalview/datamodel/AlignmentAnnotation.java @@ -20,6 +20,10 @@ */ package jalview.datamodel; +import jalview.analysis.Rna; +import jalview.analysis.SecStrConsensus.SimpleBP; +import jalview.analysis.WUSSParseException; + import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -28,10 +32,6 @@ import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; -import jalview.analysis.Rna; -import jalview.analysis.SecStrConsensus.SimpleBP; -import jalview.analysis.WUSSParseException; - /** * DOCUMENT ME! * @@ -164,6 +164,7 @@ public class AlignmentAnnotation } setScore(mxval); } + /** * map of positions in the associated annotation */ @@ -692,10 +693,10 @@ public class AlignmentAnnotation this.scaleColLabel = annotation.scaleColLabel; this.showAllColLabels = annotation.showAllColLabels; this.calcId = annotation.calcId; - if (annotation.properties!=null) + if (annotation.properties != null) { - properties = new HashMap(); - for (Map.Entry val:annotation.properties.entrySet()) + properties = new HashMap(); + for (Map.Entry val : annotation.properties.entrySet()) { properties.put(val.getKey(), val.getValue()); } @@ -1042,7 +1043,8 @@ public class AlignmentAnnotation { if (sequenceRef != null) { - boolean rIsDs=sequenceRef.getDatasetSequence()==null,tIsDs=sequenceI.getDatasetSequence()==null; + boolean rIsDs = sequenceRef.getDatasetSequence() == null, tIsDs = sequenceI + .getDatasetSequence() == null; if (sequenceRef != sequenceI && (rIsDs && !tIsDs && sequenceRef != sequenceI .getDatasetSequence()) @@ -1238,8 +1240,10 @@ public class AlignmentAnnotation { if (sp2sq.getMappedWidth() != sp2sq.getWidth()) { - // TODO: employ getWord/MappedWord to transfer annotation between cDNA and Protein reference frames - throw new Error("liftOver currently not implemented for transfer of annotation between different types of seqeunce"); + // TODO: employ getWord/MappedWord to transfer annotation between cDNA and + // Protein reference frames + throw new Error( + "liftOver currently not implemented for transfer of annotation between different types of seqeunce"); } boolean mapIsTo = (sp2sq != null) ? (sp2sq.getTo() == sq || sp2sq .getTo() == sq.getDatasetSequence()) : false; @@ -1354,9 +1358,9 @@ public class AlignmentAnnotation public void setProperty(String property, String value) { - if (properties==null) + if (properties == null) { - properties = new HashMap(); + properties = new HashMap(); } properties.put(property, value); } diff --git a/src/jalview/datamodel/AlignmentExportData.java b/src/jalview/datamodel/AlignmentExportData.java index ff550ea..35a8c61 100644 --- a/src/jalview/datamodel/AlignmentExportData.java +++ b/src/jalview/datamodel/AlignmentExportData.java @@ -2,7 +2,6 @@ package jalview.datamodel; import jalview.api.AlignExportSettingI; - public class AlignmentExportData { private AlignmentI alignment; diff --git a/src/jalview/datamodel/AlignmentI.java b/src/jalview/datamodel/AlignmentI.java index 8194bf0..de79488 100755 --- a/src/jalview/datamodel/AlignmentI.java +++ b/src/jalview/datamodel/AlignmentI.java @@ -473,9 +473,8 @@ public interface AlignmentI extends AnnotatedCollectionI * * @return existing annotation matching the given attributes */ - AlignmentAnnotation findOrCreateAnnotation(String name, - String calcId, boolean autoCalc, SequenceI seqRef, - SequenceGroup groupRef); + AlignmentAnnotation findOrCreateAnnotation(String name, String calcId, + boolean autoCalc, SequenceI seqRef, SequenceGroup groupRef); /** * move the given group up or down in the alignment by the given number of diff --git a/src/jalview/datamodel/AlignmentView.java b/src/jalview/datamodel/AlignmentView.java index e089a11..756a116 100644 --- a/src/jalview/datamodel/AlignmentView.java +++ b/src/jalview/datamodel/AlignmentView.java @@ -47,7 +47,7 @@ public class AlignmentView * one or more ScGroup objects, which are referenced by each seqCigar's group * membership */ - private List scGroups=null; + private List scGroups = null; private boolean isNa = false; @@ -133,7 +133,7 @@ public class AlignmentView selseqs = alignment.getSequencesArray(); } - List> seqsets=new ArrayList>(); + List> seqsets = new ArrayList>(); // get the alignment's group list and make a copy List grps = new ArrayList(); List gg = alignment.getGroups(); @@ -241,7 +241,9 @@ public class AlignmentView { if (!seqcigararray.isSeqCigarArray()) { - throw new Error(MessageManager.getString("error.implementation_error_can_only_make_alignmnet_from_cigararray")); + throw new Error( + MessageManager + .getString("error.implementation_error_can_only_make_alignmnet_from_cigararray")); } // contigs = seqcigararray.applyDeletions(); contigs = seqcigararray.getDeletedRegions(); @@ -298,8 +300,7 @@ public class AlignmentView { ColumnSelection colsel = new ColumnSelection(); - return new Object[] - { + return new Object[] { SeqCigar.createAlignmentSequences(sequences, gapCharacter, colsel, contigs), colsel }; } @@ -663,7 +664,9 @@ public class AlignmentView { if (sequences == null || width <= 0) { - throw new Error(MessageManager.getString("error.empty_view_cannot_be_updated")); + throw new Error( + MessageManager + .getString("error.empty_view_cannot_be_updated")); } if (nvismsa == null) { @@ -693,7 +696,17 @@ public class AlignmentView j++; if (mseq.length != sequences.length) { - throw new Error(MessageManager.formatMessage("error.mismatch_between_number_of_sequences_in_block", new String[]{Integer.valueOf(j).toString(),Integer.valueOf(mseq.length).toString(),Integer.valueOf(sequences.length).toString() })); + throw new Error( + MessageManager + .formatMessage( + "error.mismatch_between_number_of_sequences_in_block", + new String[] { + Integer.valueOf(j).toString(), + Integer.valueOf(mseq.length) + .toString(), + Integer.valueOf( + sequences.length) + .toString() })); } swidth = mseq[0].getLength(); // JBPNote: could ensure padded // here. @@ -846,25 +859,30 @@ public class AlignmentView else { // place gaps. - throw new Error(MessageManager.getString("error.padding_not_yet_implemented")); + throw new Error( + MessageManager + .getString("error.padding_not_yet_implemented")); } } } } } - return new Object[] - { alignment, columnselection }; + return new Object[] { alignment, columnselection }; } else { if (nvismsa.length != 1) { - throw new Error(MessageManager.formatMessage("error.mismatch_between_visible_blocks_to_update_and_number_of_contigs_in_view", new String[]{Integer.valueOf(nvismsa.length).toString()})); + throw new Error( + MessageManager + .formatMessage( + "error.mismatch_between_visible_blocks_to_update_and_number_of_contigs_in_view", + new String[] { Integer.valueOf( + nvismsa.length).toString() })); } if (nvismsa[0] != null) { - return new Object[] - { nvismsa[0], new ColumnSelection() }; + return new Object[] { nvismsa[0], new ColumnSelection() }; } else { @@ -925,8 +943,7 @@ public class AlignmentView } else { - return new int[] - { 0, width }; + return new int[] { 0, width }; } } diff --git a/src/jalview/datamodel/BinarySequence.java b/src/jalview/datamodel/BinarySequence.java index baec986..ed57dce 100755 --- a/src/jalview/datamodel/BinarySequence.java +++ b/src/jalview/datamodel/BinarySequence.java @@ -20,7 +20,8 @@ */ package jalview.datamodel; -import jalview.schemes.*; +import jalview.schemes.ResidueProperties; +import jalview.schemes.ScoreMatrix; /** * Encode a sequence as a numeric vector using either classic residue binary diff --git a/src/jalview/datamodel/CigarArray.java b/src/jalview/datamodel/CigarArray.java index ebc7cd1..f6e5862 100644 --- a/src/jalview/datamodel/CigarArray.java +++ b/src/jalview/datamodel/CigarArray.java @@ -97,8 +97,7 @@ public class CigarArray extends CigarBase private static int[] _calcStartEndBounds(AlignmentI alignment, SequenceGroup selectionGroup) { - int[] startend = new int[] - { 0, 0, 0 }; + int[] startend = new int[] { 0, 0, 0 }; if (selectionGroup != null) { startend[0] = selectionGroup.getSize(); @@ -343,8 +342,11 @@ public class CigarArray extends CigarBase delpos = new java.util.Vector(); } int delstart = cursor, delend = cursor + range[i] - 1; // inclusive - delpos.addElement(new int[] - { vcursor + offset, range[i] }); // index of right hand column after + delpos.addElement(new int[] { vcursor + offset, range[i] }); // index of + // right + // hand + // column + // after // hidden region boundary offset += range[i] - 1; // shift in visible column coordinates System.arraycopy(operation, i + 1, operation, i, length - i); diff --git a/src/jalview/datamodel/CigarBase.java b/src/jalview/datamodel/CigarBase.java index 1506cee..bcf8596 100644 --- a/src/jalview/datamodel/CigarBase.java +++ b/src/jalview/datamodel/CigarBase.java @@ -22,7 +22,7 @@ package jalview.datamodel; import jalview.util.MessageManager; -import java.util.*; +import java.util.Vector; public abstract class CigarBase { @@ -101,8 +101,7 @@ public abstract class CigarBase case D: if (!consecutive_del) { - deletions[++delcount] = new int[] - { cursor, 0, alcursor }; + deletions[++delcount] = new int[] { cursor, 0, alcursor }; } cursor += range[i]; deletions[delcount][1] = cursor - 1; @@ -146,7 +145,9 @@ public abstract class CigarBase endpos = alcursor; break; default: - throw new Error(MessageManager.formatMessage("error.unknown_seq_cigar_operation", new String[]{new StringBuffer(operation[i]).toString()})); + throw new Error(MessageManager.formatMessage( + "error.unknown_seq_cigar_operation", + new String[] { new StringBuffer(operation[i]).toString() })); } } if (++delcount > 0) @@ -155,9 +156,8 @@ public abstract class CigarBase System.arraycopy(deletions, 0, trunc_deletions, 0, delcount); } deletions = null; - return new Object[] - { ((reference != null) ? sq.toString() : null), new int[] - { start, startpos, end, endpos }, trunc_deletions }; + return new Object[] { ((reference != null) ? sq.toString() : null), + new int[] { start, startpos, end, endpos }, trunc_deletions }; } protected void compact_operations() @@ -225,7 +225,9 @@ public abstract class CigarBase } while (c >= '0' && c <= '9' && j < l); if (j >= l && c >= '0' && c <= '9') { - throw new Exception(MessageManager.getString("exception.unterminated_cigar_string")); + throw new Exception( + MessageManager + .getString("exception.unterminated_cigar_string")); } try { @@ -234,7 +236,9 @@ public abstract class CigarBase i = j; } catch (Exception e) { - throw new Error(MessageManager.getString("error.implementation_bug_parse_cigar_string")); + throw new Error( + MessageManager + .getString("error.implementation_bug_parse_cigar_string")); } if (c >= 'a' && c <= 'z') { @@ -246,15 +250,13 @@ public abstract class CigarBase } else { - throw new Exception(MessageManager.formatMessage("exception.unexpected_operation_cigar_string_pos", new String[]{ - new StringBuffer(c).toString(), - Integer.valueOf(i).toString(), - cigarString - })); + throw new Exception(MessageManager.formatMessage( + "exception.unexpected_operation_cigar_string_pos", + new String[] { new StringBuffer(c).toString(), + Integer.valueOf(i).toString(), cigarString })); } } - return new Object[] - { operation, range }; + return new Object[] { operation, range }; } /** @@ -273,7 +275,9 @@ public abstract class CigarBase } if (op != M && op != D && op != I) { - throw new Error(MessageManager.getString("error.implementation_error_invalid_operation_string")); + throw new Error( + MessageManager + .getString("error.implementation_error_invalid_operation_string")); } if (range == 0) { @@ -281,7 +285,8 @@ public abstract class CigarBase } if (range < 0) { - throw new Error(MessageManager.getString("error.invalid_range_string")); + throw new Error( + MessageManager.getString("error.invalid_range_string")); } int lngth = 0; if (operation == null) @@ -393,7 +398,9 @@ public abstract class CigarBase } if (start < 0 || start > end) { - throw new Error(MessageManager.getString("error.implementation_error_delete_range_out_of_bounds")); + throw new Error( + MessageManager + .getString("error.implementation_error_delete_range_out_of_bounds")); } // find beginning int cursor = 0; // mark the position for the current operation being edited. @@ -465,9 +472,13 @@ public abstract class CigarBase } break; case D: - throw new Error(MessageManager.getString("error.implementation_error")); // do nothing; + throw new Error( + MessageManager.getString("error.implementation_error")); // do + // nothing; default: - throw new Error(MessageManager.formatMessage("error.implementation_error_unknown_operation", new String[]{new StringBuffer(oldops[o]).toString()})); + throw new Error(MessageManager.formatMessage( + "error.implementation_error_unknown_operation", + new String[] { new StringBuffer(oldops[o]).toString() })); } rlength -= remain; remain = oldrange[++o]; // number of op characters left to edit @@ -526,8 +537,7 @@ public abstract class CigarBase vcursor += range[i]; break; case D: - dr.addElement(new int[] - { vcursor, cursor, range[i] }); + dr.addElement(new int[] { vcursor, cursor, range[i] }); cursor += range[i]; } } diff --git a/src/jalview/datamodel/ColumnSelection.java b/src/jalview/datamodel/ColumnSelection.java index 3916b7d..57db830 100644 --- a/src/jalview/datamodel/ColumnSelection.java +++ b/src/jalview/datamodel/ColumnSelection.java @@ -486,6 +486,7 @@ public class ColumnSelection /** * This Method is used to return all the HiddenColumn regions + * * @return empty list or List of hidden column intervals */ public List getHiddenColumns() @@ -666,8 +667,7 @@ public class ColumnSelection } else if (end < region[0] && start < region[0]) { - hiddenColumns.insertElementAt(new int[] - { start, end }, i); + hiddenColumns.insertElementAt(new int[] { start, end }, i); added = true; break; } @@ -679,8 +679,7 @@ public class ColumnSelection } else if (!added) { - hiddenColumns.addElement(new int[] - { start, end }); + hiddenColumns.addElement(new int[] { start, end }); } } @@ -909,16 +908,14 @@ public class ColumnSelection } if (hideStart > vstart) { - visiblecontigs.add(new int[] - { vstart, hideStart - 1 }); + visiblecontigs.add(new int[] { vstart, hideStart - 1 }); } vstart = hideEnd + 1; } if (vstart < end) { - visiblecontigs.add(new int[] - { vstart, end - 1 }); + visiblecontigs.add(new int[] { vstart, end - 1 }); } int[] vcontigs = new int[visiblecontigs.size() * 2]; for (int i = 0, j = visiblecontigs.size(); i < j; i++) @@ -933,8 +930,7 @@ public class ColumnSelection } else { - return new int[] - { start, end - 1 }; + return new int[] { start, end - 1 }; } } @@ -975,7 +971,7 @@ public class ColumnSelection if (hiddenColumns != null && hiddenColumns.size() > 0) { // then mangle the alignmentAnnotation annotation array - Vector annels = new Vector(); + Vector annels = new Vector(); Annotation[] els = null; List regions = getHiddenColumns(); int blockStart = start, blockEnd = end; @@ -1035,7 +1031,7 @@ public class ColumnSelection alignmentAnnotation.annotations = new Annotation[w]; w = 0; - for (Annotation [] chnk : annels) + for (Annotation[] chnk : annels) { System.arraycopy(chnk, 0, alignmentAnnotation.annotations, w, chnk.length); @@ -1284,7 +1280,7 @@ public class ColumnSelection { return hiddenColumns != null && hiddenColumns.size() > 0; } - + /** * * @return true if there are more than one set of columns hidden @@ -1308,7 +1304,7 @@ public class ColumnSelection hideColumns(r[0], r[1]); } } - + public boolean filterAnnotations(Annotation[] annotations, AnnotationFilterParameter filterParams) { diff --git a/src/jalview/datamodel/DBRefSource.java b/src/jalview/datamodel/DBRefSource.java index 6982594..6a676cf 100755 --- a/src/jalview/datamodel/DBRefSource.java +++ b/src/jalview/datamodel/DBRefSource.java @@ -44,7 +44,7 @@ public class DBRefSource * Uniprot Knowledgebase/TrEMBL as served from EMBL protein products. */ public static final String UNIPROTKB = "UniProtKB/TrEMBL".toUpperCase(); - + public static final String EMBLCDSProduct = "EMBLCDSProtein" .toUpperCase(); @@ -81,23 +81,19 @@ public class DBRefSource /** * List of databases whose sequences might have coding regions annotated */ - public static final String[] DNACODINGDBS = - { EMBL, EMBLCDS, GENEDB }; + public static final String[] DNACODINGDBS = { EMBL, EMBLCDS, GENEDB }; - public static final String[] CODINGDBS = - { EMBLCDS, GENEDB }; + public static final String[] CODINGDBS = { EMBLCDS, GENEDB }; - public static final String[] PROTEINDBS = - { UNIPROT, PDB, UNIPROTKB, EMBLCDSProduct }; + public static final String[] PROTEINDBS = { UNIPROT, PDB, UNIPROTKB, + EMBLCDSProduct }; - public static final String[] PROTEINSEQ = - { UNIPROT, UNIPROTKB, EMBLCDSProduct }; + public static final String[] PROTEINSEQ = { UNIPROT, UNIPROTKB, + EMBLCDSProduct }; - public static final String[] PROTEINSTR = - { PDB }; + public static final String[] PROTEINSTR = { PDB }; - public static final String[] DOMAINDBS = - { PFAM, RFAM }; + public static final String[] DOMAINDBS = { PFAM, RFAM }; /** * set of unique DBRefSource property constants. These could be used to diff --git a/src/jalview/datamodel/Mapping.java b/src/jalview/datamodel/Mapping.java index d7b7eb9..1272538 100644 --- a/src/jalview/datamodel/Mapping.java +++ b/src/jalview/datamodel/Mapping.java @@ -20,12 +20,12 @@ */ package jalview.datamodel; +import jalview.util.MapList; + import java.util.Iterator; import java.util.NoSuchElementException; import java.util.Vector; -import jalview.util.MapList; - public class Mapping { /** @@ -163,7 +163,8 @@ public class Mapping { // TODO should ideally handle toRatio other than 1 as well... // i.e. code like getNextCodon() - if (toPosition <= currentToRange[1]) { + if (toPosition <= currentToRange[1]) + { char pep = Mapping.this.to.getSequence()[toPosition - 1]; toPosition++; return String.valueOf(pep); @@ -466,8 +467,7 @@ public class Mapping int[] mp = map.shiftFrom(pos); if (mp != null) { - return new int[] - { mp[0], mp[0] + mp[2] * (map.getToRatio() - 1) }; + return new int[] { mp[0], mp[0] + mp[2] * (map.getToRatio() - 1) }; } } return null; @@ -528,8 +528,7 @@ public class Mapping } } // give up and just return the feature. - return new SequenceFeature[] - { f }; + return new SequenceFeature[] { f }; } /** @@ -565,8 +564,7 @@ public class Mapping } return map.locateInFrom(from, to); } - return new int[] - { from, to }; + return new int[] { from, to }; } /** @@ -602,8 +600,7 @@ public class Mapping } return map.locateInTo(from, to); } - return new int[] - { from, to }; + return new int[] { from, to }; } /** @@ -631,13 +628,11 @@ public class Mapping { for (int m = 0; m < mpr.length; m += 2) { - toRange.addElement(new int[] - { mpr[m], mpr[m + 1] }); + toRange.addElement(new int[] { mpr[m], mpr[m + 1] }); int[] xpos = locateRange(mpr[m], mpr[m + 1]); for (int x = 0; x < xpos.length; x += 2) { - fromRange.addElement(new int[] - { xpos[x], xpos[x + 1] }); + fromRange.addElement(new int[] { xpos[x], xpos[x + 1] }); } } } diff --git a/src/jalview/datamodel/PDBEntry.java b/src/jalview/datamodel/PDBEntry.java index d0cef5d..589bc7b 100755 --- a/src/jalview/datamodel/PDBEntry.java +++ b/src/jalview/datamodel/PDBEntry.java @@ -36,6 +36,7 @@ public class PDBEntry { PDB, FILE } + Hashtable properties; /* @@ -55,9 +56,8 @@ public class PDBEntry return true; } PDBEntry o = (PDBEntry) obj; - return - (type == o.type || (type != null && o.type != null && o.type - .equals(type))) + return (type == o.type || (type != null && o.type != null && o.type + .equals(type))) && (id == o.id || (id != null && o.id != null && o.id .equalsIgnoreCase(id))) && (chainCode == o.chainCode || (chainCode != null @@ -66,7 +66,7 @@ public class PDBEntry && (properties == o.properties || (properties != null && o.properties != null && properties .equals(o.properties))); - + } /** @@ -86,7 +86,7 @@ public class PDBEntry // this.file = filePath; // this.id = pdbId; // } - + public PDBEntry(String pdbId, String chain, PDBEntry.Type type, String filePath) { @@ -127,6 +127,7 @@ public class PDBEntry { this.type = t; } + public void setType(PDBEntry.Type type) { this.type = type == null ? null : type.toString(); diff --git a/src/jalview/datamodel/Provenance.java b/src/jalview/datamodel/Provenance.java index 54842d0..a1a821e 100755 --- a/src/jalview/datamodel/Provenance.java +++ b/src/jalview/datamodel/Provenance.java @@ -20,7 +20,7 @@ */ package jalview.datamodel; -import java.util.*; +import java.util.Vector; public class Provenance { diff --git a/src/jalview/datamodel/RnaViewerModel.java b/src/jalview/datamodel/RnaViewerModel.java index 33783ec..e6ec786 100644 --- a/src/jalview/datamodel/RnaViewerModel.java +++ b/src/jalview/datamodel/RnaViewerModel.java @@ -1,6 +1,5 @@ package jalview.datamodel; - /** * A data bean class to hold properties of an RNA viewer */ @@ -32,8 +31,7 @@ public class RnaViewerModel * @param dividerLocation */ public RnaViewerModel(String viewId, String title, int xpos, int ypos, - int width, - int height, int dividerLocation) + int width, int height, int dividerLocation) { this.viewId = viewId; this.title = title; diff --git a/src/jalview/datamodel/SearchResults.java b/src/jalview/datamodel/SearchResults.java index 3329431..ad0e472 100755 --- a/src/jalview/datamodel/SearchResults.java +++ b/src/jalview/datamodel/SearchResults.java @@ -232,8 +232,7 @@ public class SearchResults if (result == null) { - result = new int[] - { matchStart, matchEnd }; + result = new int[] { matchStart, matchEnd }; } else { diff --git a/src/jalview/datamodel/SeqCigar.java b/src/jalview/datamodel/SeqCigar.java index 09b2e89..d279a26 100644 --- a/src/jalview/datamodel/SeqCigar.java +++ b/src/jalview/datamodel/SeqCigar.java @@ -20,14 +20,14 @@ */ package jalview.datamodel; -import java.util.Enumeration; -import java.util.Hashtable; - import jalview.analysis.AlignSeq; import jalview.analysis.SeqsetUtils; import jalview.util.MessageManager; import jalview.util.ShiftList; +import java.util.Enumeration; +import java.util.Hashtable; + public class SeqCigar extends CigarSimple { /** @@ -95,7 +95,9 @@ public class SeqCigar extends CigarSimple refseq.getSequenceAsString(start, end), GapChar); if (edit_result == null) { - throw new Error(MessageManager.getString("error.implementation_error_unexpected_null_from_get_sequence_and_deletions")); + throw new Error( + MessageManager + .getString("error.implementation_error_unexpected_null_from_get_sequence_and_deletions")); } int bounds[] = (int[]) edit_result[1]; seq = new Sequence(refseq.getName(), (String) edit_result[0], @@ -143,11 +145,15 @@ public class SeqCigar extends CigarSimple boolean hasgaps = false; if (seq == null) { - throw new Error(MessageManager.getString("error.implementation_error_set_seq_null")); + throw new Error( + MessageManager + .getString("error.implementation_error_set_seq_null")); } if (_s < 0) { - throw new Error(MessageManager.formatMessage("error.implementation_error_s", new String[]{Integer.valueOf(_s).toString()})); + throw new Error(MessageManager.formatMessage( + "error.implementation_error_s", new String[] { Integer + .valueOf(_s).toString() })); } String seq_string = seq.getSequenceAsString(); if (_e == 0 || _e < _s || _e > seq_string.length()) @@ -213,7 +219,9 @@ public class SeqCigar extends CigarSimple // Check offsets if (end > ds.getLength()) { - throw new Error(MessageManager.getString("error.implementation_error_seqcigar_possible")); + throw new Error( + MessageManager + .getString("error.implementation_error_seqcigar_possible")); // end = ds.getLength(); } @@ -237,11 +245,14 @@ public class SeqCigar extends CigarSimple super(); if (seq == null) { - throw new Error(MessageManager.getString("error.implmentation_bug_seq_null")); + throw new Error( + MessageManager.getString("error.implmentation_bug_seq_null")); } if (operation.length != range.length) { - throw new Error(MessageManager.getString("error.implementation_bug_cigar_operation_list_range_list")); + throw new Error( + MessageManager + .getString("error.implementation_bug_cigar_operation_list_range_list")); } if (operation != null) @@ -251,14 +262,22 @@ public class SeqCigar extends CigarSimple if (_setSeq(seq, false, 0, 0)) { - throw new Error(MessageManager.getString("error.not_yet_implemented_cigar_object_from_cigar_string")); + throw new Error( + MessageManager + .getString("error.not_yet_implemented_cigar_object_from_cigar_string")); } for (int i = this.length, j = 0; j < operation.length; i++, j++) { char op = operation[j]; if (op != M && op != I && op != D) { - throw new Error(MessageManager.formatMessage("error.implementation_bug_cigar_operation", new String[]{Integer.valueOf(j).toString(),Integer.valueOf(op).toString(),Integer.valueOf(M).toString(),Integer.valueOf(I).toString(),Integer.valueOf(D).toString()})); + throw new Error(MessageManager.formatMessage( + "error.implementation_bug_cigar_operation", new String[] { + Integer.valueOf(j).toString(), + Integer.valueOf(op).toString(), + Integer.valueOf(M).toString(), + Integer.valueOf(I).toString(), + Integer.valueOf(D).toString() })); } this.operation[i] = op; this.range[i] = range[j]; @@ -272,7 +291,9 @@ public class SeqCigar extends CigarSimple this.length = 0; if (_setSeq(seq, false, 0, 0)) { - throw new Error(MessageManager.getString("error.not_yet_implemented_cigar_object_from_cigar_string")); + throw new Error( + MessageManager + .getString("error.not_yet_implemented_cigar_object_from_cigar_string")); } } } @@ -379,7 +400,9 @@ public class SeqCigar extends CigarSimple super(); if (seq == null) { - throw new Error(MessageManager.getString("error.implementation_error_for_new_cigar")); + throw new Error( + MessageManager + .getString("error.implementation_error_for_new_cigar")); } _setSeq(seq, false, 0, 0); // there is still work to do @@ -401,7 +424,9 @@ public class SeqCigar extends CigarSimple super(); if (seq == null) { - throw new Error(MessageManager.getString("error.implementation_error_for_new_cigar")); + throw new Error( + MessageManager + .getString("error.implementation_error_for_new_cigar")); } _setSeq(seq, false, start, end + 1); // there is still work to do @@ -456,7 +481,9 @@ public class SeqCigar extends CigarSimple // endcol}, hidden regions {{start, end, col}}) if (gs_regions[i] == null) { - throw new Error(MessageManager.formatMessage("error.implementation_error_cigar_seq_no_operations", new String[]{Integer.valueOf(i).toString()})); + throw new Error(MessageManager.formatMessage( + "error.implementation_error_cigar_seq_no_operations", + new String[] { Integer.valueOf(i).toString() })); } g_seqs[i] = new StringBuffer((String) ((Object[]) gs_regions[i])[0]); // the // visible diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index 19ad30f..c7581d8 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -59,7 +59,6 @@ public class Sequence extends ASequence implements SequenceI RNA rna; - /** * This annotation is displayed below the alignment but the positions are tied * to the residues of this sequence @@ -748,8 +747,7 @@ public class Sequence extends ASequence implements SequenceI { if (lastj != -1) { - map.add(new int[] - { lastj, j - 1 }); + map.add(new int[] { lastj, j - 1 }); lastj = -1; } } @@ -757,8 +755,7 @@ public class Sequence extends ASequence implements SequenceI } if (lastj != -1) { - map.add(new int[] - { lastj, j - 1 }); + map.add(new int[] { lastj, j - 1 }); lastj = -1; } return map; @@ -956,7 +953,6 @@ public class Sequence extends ASequence implements SequenceI .toArray(new AlignmentAnnotation[annotation.size()]); } - @Override public boolean hasAnnotation(AlignmentAnnotation ann) { @@ -1208,8 +1204,7 @@ public class Sequence extends ASequence implements SequenceI for (int si = 0; si < sfs.length; si++) { SequenceFeature sf[] = (mp != null) ? mp.locateFeature(sfs[si]) - : new SequenceFeature[] - { new SequenceFeature(sfs[si]) }; + : new SequenceFeature[] { new SequenceFeature(sfs[si]) }; if (sf != null && sf.length > 0) { for (int sfi = 0; sfi < sf.length; sfi++) diff --git a/src/jalview/datamodel/SequenceCollectionI.java b/src/jalview/datamodel/SequenceCollectionI.java index 7777dce..aca79c8 100644 --- a/src/jalview/datamodel/SequenceCollectionI.java +++ b/src/jalview/datamodel/SequenceCollectionI.java @@ -29,20 +29,26 @@ public interface SequenceCollectionI List getSequences( Map hiddenReps); + int getWidth(); + /** * * @return true if getSeqrep doesn't return null */ boolean hasSeqrep(); + /** * get the reference or representative sequence within this collection + * * @return null or the current reference sequence */ SequenceI getSeqrep(); + /** - * set the reference or representative sequence for this collection. - * Reference is assumed to be present within the collection. + * set the reference or representative sequence for this collection. Reference + * is assumed to be present within the collection. + * * @return */ void setSeqrep(SequenceI refseq); diff --git a/src/jalview/datamodel/SequenceDummy.java b/src/jalview/datamodel/SequenceDummy.java index 4a8c3ee..f472a71 100644 --- a/src/jalview/datamodel/SequenceDummy.java +++ b/src/jalview/datamodel/SequenceDummy.java @@ -8,6 +8,7 @@ public class SequenceDummy extends Sequence implements SequenceI } private boolean dummy = true; + /** * become a proxy for mseq, merging any existing annotation on this sequence * @@ -16,7 +17,7 @@ public class SequenceDummy extends Sequence implements SequenceI public void become(SequenceI mseq) { initSeqFrom(mseq, null); - dummy=false; + dummy = false; } /** diff --git a/src/jalview/datamodel/SequenceGroup.java b/src/jalview/datamodel/SequenceGroup.java index 3439248..cc70e25 100755 --- a/src/jalview/datamodel/SequenceGroup.java +++ b/src/jalview/datamodel/SequenceGroup.java @@ -20,6 +20,11 @@ */ package jalview.datamodel; +import jalview.analysis.AAFrequency; +import jalview.analysis.Conservation; +import jalview.schemes.ColourSchemeI; +import jalview.schemes.ResidueProperties; + import java.awt.Color; import java.util.ArrayList; import java.util.Hashtable; @@ -27,11 +32,6 @@ import java.util.List; import java.util.Map; import java.util.Vector; -import jalview.analysis.AAFrequency; -import jalview.analysis.Conservation; -import jalview.schemes.ColourSchemeI; -import jalview.schemes.ResidueProperties; - /** * Collects a set contiguous ranges on a set of sequences * @@ -613,13 +613,13 @@ public class SequenceGroup implements AnnotatedCollectionI { synchronized (sequences) { - if (sequences.contains(s)) - { - deleteSequence(s, recalc); - } - else - { - addSequence(s, recalc); + if (sequences.contains(s)) + { + deleteSequence(s, recalc); + } + else + { + addSequence(s, recalc); } } } @@ -775,8 +775,9 @@ public class SequenceGroup implements AnnotatedCollectionI synchronized (sequences) { // MC This needs to get reset when characters are inserted and deleted - boolean first=true; - for (SequenceI seq:sequences) { + boolean first = true; + for (SequenceI seq : sequences) + { if (first || seq.getLength() > width) { width = seq.getLength(); diff --git a/src/jalview/datamodel/SequenceI.java b/src/jalview/datamodel/SequenceI.java index 2ff619b..0e649c0 100755 --- a/src/jalview/datamodel/SequenceI.java +++ b/src/jalview/datamodel/SequenceI.java @@ -239,6 +239,7 @@ public interface SequenceI extends ASequenceI /** * DOCUMENT ME! + * * @param position * DOCUMENT ME! * @param ch @@ -382,8 +383,8 @@ public interface SequenceI extends ASequenceI /** * Transfer any database references or annotation from entry under a sequence * mapping.
- * Note: DOES NOT transfer sequence associated alignment - * annotation
+ * Note: DOES NOT transfer sequence associated alignment annotation + *
* * @param entry * @param mp diff --git a/src/jalview/datamodel/SequenceNode.java b/src/jalview/datamodel/SequenceNode.java index 6f6aeb7..b2f054c 100755 --- a/src/jalview/datamodel/SequenceNode.java +++ b/src/jalview/datamodel/SequenceNode.java @@ -20,7 +20,7 @@ */ package jalview.datamodel; -import java.awt.*; +import java.awt.Color; /** * DOCUMENT ME! diff --git a/src/jalview/datamodel/StructureViewerModel.java b/src/jalview/datamodel/StructureViewerModel.java index 8bc745a..affaa84 100644 --- a/src/jalview/datamodel/StructureViewerModel.java +++ b/src/jalview/datamodel/StructureViewerModel.java @@ -41,6 +41,7 @@ public class StructureViewerModel private String pdbId; private List seqList; + // TODO and possibly a list of chains? /** diff --git a/src/jalview/datamodel/xdb/embl/EmblEntry.java b/src/jalview/datamodel/xdb/embl/EmblEntry.java index 9c9447e..87e2789 100644 --- a/src/jalview/datamodel/xdb/embl/EmblEntry.java +++ b/src/jalview/datamodel/xdb/embl/EmblEntry.java @@ -408,9 +408,9 @@ public class EmblEntry dna.addDBRef(retrievedref); // add map to indicate the sequence is a valid coordinate frame for the // dbref - retrievedref.setMap(new Mapping(null, new int[] - { 1, dna.getLength() }, new int[] - { 1, dna.getLength() }, 1, 1)); + retrievedref.setMap(new Mapping(null, + new int[] { 1, dna.getLength() }, new int[] { 1, + dna.getLength() }, 1, 1)); // TODO: transform EMBL Database refs to canonical form if (dbRefs != null) { @@ -422,7 +422,7 @@ public class EmblEntry } try { - for (EmblFeature feature: features) + for (EmblFeature feature : features) { if (!noNa) { @@ -599,19 +599,18 @@ public class EmblEntry .println("Not allowing for additional stop codon at end of cDNA fragment... !"); // this might occur for CDS sequences where no features are // marked. - exon = new int[] - { dna.getStart() + (prstart - 1), dna.getEnd() }; - map = new jalview.datamodel.Mapping(product, exon, new int[] - { 1, prseq.length() }, 3, 1); + exon = new int[] { dna.getStart() + (prstart - 1), dna.getEnd() }; + map = new jalview.datamodel.Mapping(product, exon, new int[] { 1, + prseq.length() }, 3, 1); } if ((prseq.length() + 1) * 3 == (1 - prstart + dna.getSequence().length)) { System.err .println("Allowing for additional stop codon at end of cDNA fragment... will probably cause an error in VAMSAs!"); - exon = new int[] - { dna.getStart() + (prstart - 1), dna.getEnd() - 3 }; - map = new jalview.datamodel.Mapping(product, exon, new int[] - { 1, prseq.length() }, 3, 1); + exon = new int[] { dna.getStart() + (prstart - 1), + dna.getEnd() - 3 }; + map = new jalview.datamodel.Mapping(product, exon, new int[] { 1, + prseq.length() }, 3, 1); } } else @@ -632,8 +631,8 @@ public class EmblEntry // final product length trunctation check map = new jalview.datamodel.Mapping(product, - adjustForProteinLength(prseq.length(), exon), new int[] - { 1, prseq.length() }, 3, 1); + adjustForProteinLength(prseq.length(), exon), new int[] { + 1, prseq.length() }, 3, 1); // reconstruct the EMBLCDS entry // TODO: this is only necessary when there codon annotation is // complete (I think JBPNote) @@ -641,9 +640,9 @@ public class EmblEntry pcdnaref.setAccessionId(prid); pcdnaref.setSource(DBRefSource.EMBLCDS); pcdnaref.setVersion(getVersion()); // same as parent EMBL version. - jalview.util.MapList mp = new jalview.util.MapList(new int[] - { 1, prseq.length() }, new int[] - { 1 + (prstart - 1), (prstart - 1) + 3 * prseq.length() }, 1, 3); + jalview.util.MapList mp = new jalview.util.MapList(new int[] { 1, + prseq.length() }, new int[] { 1 + (prstart - 1), + (prstart - 1) + 3 * prseq.length() }, 1, 3); // { 1 + (prstart - 1) * 3, // 1 + (prstart - 1) * 3 + prseq.length() * 3 - 1 }, new int[] // { 1prstart, prstart + prseq.length() - 1 }, 3, 1); diff --git a/src/jalview/datamodel/xdb/embl/EmblFeature.java b/src/jalview/datamodel/xdb/embl/EmblFeature.java index 7f53eb3..7e503c9 100644 --- a/src/jalview/datamodel/xdb/embl/EmblFeature.java +++ b/src/jalview/datamodel/xdb/embl/EmblFeature.java @@ -20,10 +20,10 @@ */ package jalview.datamodel.xdb.embl; -import java.util.Vector; - import jalview.datamodel.DBRefEntry; +import java.util.Vector; + /** * Data model for a <feature> element returned from an EMBL query reply * diff --git a/src/jalview/datamodel/xdb/embl/EmblFile.java b/src/jalview/datamodel/xdb/embl/EmblFile.java index 2129054..e0b5ede 100644 --- a/src/jalview/datamodel/xdb/embl/EmblFile.java +++ b/src/jalview/datamodel/xdb/embl/EmblFile.java @@ -116,9 +116,8 @@ public class EmblFile try { // uncomment to DEBUG EMBLFile reading - if (jalview.bin.Cache.getDefault( - jalview.bin.Cache.CASTORLOGLEVEL, "debug") - .equalsIgnoreCase("DEBUG")) + if (jalview.bin.Cache.getDefault(jalview.bin.Cache.CASTORLOGLEVEL, + "debug").equalsIgnoreCase("DEBUG")) { unmar.setDebug(jalview.bin.Cache.log.isDebugEnabled()); } diff --git a/src/jalview/ext/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index 729780c..b464c94 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -231,10 +231,9 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel public void superposeStructures(AlignmentI alignment, int refStructure, ColumnSelection hiddenCols) { - superposeStructures(new AlignmentI[] - { alignment }, new int[] - { refStructure }, new ColumnSelection[] - { hiddenCols }); + superposeStructures(new AlignmentI[] { alignment }, + new int[] { refStructure }, + new ColumnSelection[] { hiddenCols }); } /** @@ -458,8 +457,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel + selectioncom.toString() + "); cartoons; "); // selcom.append("; ribbons; "); String cmdString = command.toString(); - System.out -.println("Superimpose command(s):\n" + cmdString); + System.out.println("Superimpose command(s):\n" + cmdString); evalStateCommand(cmdString); } @@ -516,7 +514,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } AlignmentI alignment = alignmentv.getAlignment(); - for (jalview.structure.StructureMappingcommandSet cpdbbyseq : getColourBySequenceCommands(files, sr, fr, alignment)) + for (jalview.structure.StructureMappingcommandSet cpdbbyseq : getColourBySequenceCommands( + files, sr, fr, alignment)) { for (String cbyseq : cpdbbyseq.commands) { @@ -536,10 +535,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel String[] files, SequenceRenderer sr, FeatureRenderer fr, AlignmentI alignment) { - return JmolCommands - .getColourBySequenceCommand(getSsm(), files, getSequence(), sr, - fr, - alignment); + return JmolCommands.getColourBySequenceCommand(getSsm(), files, + getSequence(), sr, fr, alignment); } /** @@ -592,8 +589,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } // TODO: verify atomIndex is selecting correct model. // return new Color(viewer.getAtomArgb(atomIndex)); Jmol 12.2.4 - int colour = viewer.ms.at[atomIndex] - .atomPropertyInt(T.color); + int colour = viewer.ms.at[atomIndex].atomPropertyInt(T.color); return new Color(colour); } @@ -891,8 +887,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel pdbfilename = modelFileNames[_mp]; if (pdbfilename == null) { - pdbfilename = new File( - viewer.ms.getModelFileName(mnumber)) + pdbfilename = new File(viewer.ms.getModelFileName(mnumber)) .getAbsolutePath(); } @@ -1135,8 +1130,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel pdbfile = viewer.getData("" + (1 + _modelFileNameMap[modelnum]) + ".0", "PDB"); } - // search pdbentries and sequences to find correct pdbentry for this - // model + // search pdbentries and sequences to find correct pdbentry for this + // model for (int pe = 0; pe < getPdbCount(); pe++) { boolean matches = false; @@ -1460,4 +1455,3 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel showConsole(false); } } - diff --git a/src/jalview/ext/jmol/PDBFileWithJmol.java b/src/jalview/ext/jmol/PDBFileWithJmol.java index ddfa1b0..8d76afc 100644 --- a/src/jalview/ext/jmol/PDBFileWithJmol.java +++ b/src/jalview/ext/jmol/PDBFileWithJmol.java @@ -86,8 +86,9 @@ public class PDBFileWithJmol extends AlignFile implements null, "-x -o -n", this); } catch (ClassCastException x) { - throw new Error(MessageManager.formatMessage("error.jmol_version_not_compatible_with_jalview_version", new String[]{JmolViewer.getJmolVersion()}), - x); + throw new Error(MessageManager.formatMessage( + "error.jmol_version_not_compatible_with_jalview_version", + new String[] { JmolViewer.getJmolVersion() }), x); } } return viewer; @@ -236,7 +237,8 @@ public class PDBFileWithJmol extends AlignFile implements * equivalent (e.g. MSE with MET->M) to maximise sequence matching */ String threeLetterCode = group.getGroup3(); - String canonical = ResidueProperties.getCanonicalAminoAcid(threeLetterCode); + String canonical = ResidueProperties + .getCanonicalAminoAcid(threeLetterCode); if (canonical != null && !canonical.equalsIgnoreCase(threeLetterCode)) { diff --git a/src/jalview/ext/paradise/Annotate3D.java b/src/jalview/ext/paradise/Annotate3D.java index 55c3c1d..85c84ab 100644 --- a/src/jalview/ext/paradise/Annotate3D.java +++ b/src/jalview/ext/paradise/Annotate3D.java @@ -137,7 +137,8 @@ public class Annotate3D // return processJsonResponseFor(HttpClientUtils.doHttpUrlPost(twoDtoolsURL, // vals)); ArrayList readers = new ArrayList(); - final BufferedReader postResponse = HttpClientUtils.doHttpUrlPost(twoDtoolsURL, vals, 0, 0); + final BufferedReader postResponse = HttpClientUtils.doHttpUrlPost( + twoDtoolsURL, vals, 0, 0); readers.add(postResponse); return readers.iterator(); @@ -190,14 +191,16 @@ public class Annotate3D @Override public void remove() { - throw new Error(MessageManager.getString("error.not_implemented_remove")); + throw new Error( + MessageManager.getString("error.not_implemented_remove")); } @Override protected Object clone() throws CloneNotSupportedException { - throw new CloneNotSupportedException(MessageManager.getString("error.not_implemented_clone")); + throw new CloneNotSupportedException( + MessageManager.getString("error.not_implemented_clone")); } @Override @@ -218,7 +221,10 @@ public class Annotate3D }; } catch (Exception foo) { - throw new Exception(MessageManager.getString("exception.couldnt_parse_responde_from_annotated3d_server"), foo); + throw new Exception( + MessageManager + .getString("exception.couldnt_parse_responde_from_annotated3d_server"), + foo); } } diff --git a/src/jalview/ext/rbvi/chimera/ChimeraCommands.java b/src/jalview/ext/rbvi/chimera/ChimeraCommands.java index 148f252..5342dc8 100644 --- a/src/jalview/ext/rbvi/chimera/ChimeraCommands.java +++ b/src/jalview/ext/rbvi/chimera/ChimeraCommands.java @@ -20,13 +20,6 @@ */ package jalview.ext.rbvi.chimera; -import java.awt.Color; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; - import jalview.api.FeatureRenderer; import jalview.api.SequenceRenderer; import jalview.datamodel.AlignmentI; @@ -37,6 +30,13 @@ import jalview.structure.StructureSelectionManager; import jalview.util.ColorUtils; import jalview.util.Comparison; +import java.awt.Color; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; + /** * Routines for generating Chimera commands for Jalview/Chimera binding * @@ -67,8 +67,7 @@ public class ChimeraCommands ChimeraCommands.class, null, colourCommands.toArray(new String[0])); - return new StructureMappingcommandSet[] - { cs }; + return new StructureMappingcommandSet[] { cs }; } /** @@ -79,7 +78,7 @@ public class ChimeraCommands *

color colorname #modelnumber:range.chain e.g. color #00ff00 * #0:2.B,4.B,9-12.B|#1:1.A,2-6.A,... * - * @see http + * @see http * ://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/midas/frameatom_spec * .html * @@ -107,7 +106,8 @@ public class ChimeraCommands sb.append("color ").append(colourCode).append(" "); firstColour = false; boolean firstModelForColour = true; - final Map>> colourData = colourMap.get(colour); + final Map>> colourData = colourMap + .get(colour); for (Integer model : colourData.keySet()) { boolean firstPositionForModel = true; @@ -287,8 +287,7 @@ public class ChimeraCommands /* * Add the start/end positions */ - chainData.add(new int[] - { startPos, endPos }); + chainData.add(new int[] { startPos, endPos }); } } diff --git a/src/jalview/ext/rbvi/chimera/ChimeraListener.java b/src/jalview/ext/rbvi/chimera/ChimeraListener.java index 2882cb5..ead51b3 100644 --- a/src/jalview/ext/rbvi/chimera/ChimeraListener.java +++ b/src/jalview/ext/rbvi/chimera/ChimeraListener.java @@ -1,13 +1,13 @@ package jalview.ext.rbvi.chimera; +import jalview.httpserver.AbstractRequestHandler; +import jalview.structure.SelectionSource; + import java.net.BindException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import jalview.httpserver.AbstractRequestHandler; -import jalview.structure.SelectionSource; - /** * This is a simple Http handler that can listen for selections in Chimera. *

diff --git a/src/jalview/gui/AlignExportSettings.java b/src/jalview/gui/AlignExportSettings.java index 0856365..41dc101 100644 --- a/src/jalview/gui/AlignExportSettings.java +++ b/src/jalview/gui/AlignExportSettings.java @@ -28,8 +28,7 @@ public class AlignExportSettings extends GAlignExportSettings implements { JOptionPane pane = new JOptionPane(null, JOptionPane.DEFAULT_OPTION, - JOptionPane.DEFAULT_OPTION, null, new Object[] - { this }); + JOptionPane.DEFAULT_OPTION, null, new Object[] { this }); dialog = pane.createDialog(Desktop.desktop, MessageManager.getString("label.export_settings")); dialog.addWindowListener(new WindowAdapter() @@ -47,7 +46,6 @@ public class AlignExportSettings extends GAlignExportSettings implements } } - public void ok_actionPerformed(ActionEvent e) { cancelled = false; diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index fbcecbe..500dfdb 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -241,7 +241,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, this(al, hiddenColumns, width, height, null); } - /** * Create alignment frame for al with hiddenColumns, a specific width and * height, and specific sequenceId @@ -286,7 +285,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, alignPanel = new AlignmentPanel(this, viewport); - addAlignmentPanel(alignPanel, true); init(); } @@ -312,7 +310,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, init(); } - /** * Make a new AlignFrame from existing alignmentPanels * @@ -374,7 +371,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, setMenusFromViewport(viewport); buildSortByAnnotationScoresMenu(); buildTreeMenu(); - + if (viewport.getWrapAlignment()) { wrapMenuItem_actionPerformed(null); @@ -558,8 +555,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, case KeyEvent.VK_SPACE: if (viewport.cursorMode) { - alignPanel.getSeqPanel().insertGapAtCursor(evt.isControlDown() - || evt.isShiftDown() || evt.isAltDown()); + alignPanel.getSeqPanel().insertGapAtCursor( + evt.isControlDown() || evt.isShiftDown() + || evt.isAltDown()); } break; @@ -582,8 +580,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } else { - alignPanel.getSeqPanel().deleteGapAtCursor(evt.isControlDown() - || evt.isShiftDown() || evt.isAltDown()); + alignPanel.getSeqPanel().deleteGapAtCursor( + evt.isControlDown() || evt.isShiftDown() + || evt.isAltDown()); } break; @@ -631,8 +630,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, case KeyEvent.VK_F2: viewport.cursorMode = !viewport.cursorMode; statusBar.setText(MessageManager.formatMessage( - "label.keyboard_editing_mode", new String[] - { (viewport.cursorMode ? "on" : "off") })); + "label.keyboard_editing_mode", + new String[] { (viewport.cursorMode ? "on" : "off") })); if (viewport.cursorMode) { alignPanel.getSeqPanel().seqCanvas.cursorX = viewport.startRes; @@ -1077,7 +1076,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, currentFileFormat, false); chooser.setFileView(new JalviewFileView()); - chooser.setDialogTitle(MessageManager.getString("label.save_alignment_to_file")); + chooser.setDialogTitle(MessageManager + .getString("label.save_alignment_to_file")); chooser.setToolTipText(MessageManager.getString("action.save")); int value = chooser.showSaveDialog(this); @@ -1135,8 +1135,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, success = new Jalview2XML().saveAlignment(this, file, shortName); statusBar.setText(MessageManager.formatMessage( - "label.successfully_saved_to_file_in_format", new Object[] - { fileName, format })); + "label.successfully_saved_to_file_in_format", new Object[] { + fileName, format })); } else @@ -1160,7 +1160,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } FormatAdapter f = new FormatAdapter(alignPanel, exportData.getSettings()); - String output = f.formatSequences(format, + String output = f.formatSequences( + format, exportData.getAlignment(), // class cast exceptions will // occur in the distant future exportData.getOmitHidden(), exportData.getStartEndPostions(), @@ -1183,8 +1184,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, this.setTitle(file); statusBar.setText(MessageManager.formatMessage( "label.successfully_saved_to_file_in_format", - new Object[] - { fileName, format })); + new Object[] { fileName, format })); } catch (Exception ex) { success = false; @@ -1196,8 +1196,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, if (!success) { JOptionPane.showInternalMessageDialog(this, MessageManager - .formatMessage("label.couldnt_save_file", new Object[] - { fileName }), MessageManager + .formatMessage("label.couldnt_save_file", + new Object[] { fileName }), MessageManager .getString("label.error_saving_file"), JOptionPane.WARNING_MESSAGE); } @@ -1205,7 +1205,6 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, return success; } - private void warningMessage(String warning, String title) { if (new jalview.util.Platform().isHeadless()) @@ -1242,14 +1241,14 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, try { cap.setText(new FormatAdapter(alignPanel, exportData.getSettings()) - .formatSequences( - e.getActionCommand(), - exportData.getAlignment(), - exportData.getOmitHidden(), exportData.getStartEndPostions(), - viewport.getColumnSelection())); + .formatSequences(e.getActionCommand(), + exportData.getAlignment(), + exportData.getOmitHidden(), + exportData.getStartEndPostions(), + viewport.getColumnSelection())); Desktop.addInternalFrame(cap, MessageManager.formatMessage( - "label.alignment_output_command", new Object[] - { e.getActionCommand() }), 600, 500); + "label.alignment_output_command", + new Object[] { e.getActionCommand() }), 600, 500); } catch (OutOfMemoryError oom) { new OOMWarning("Outputting alignment as " + e.getActionCommand(), oom); @@ -1258,8 +1257,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } - public static AlignmentExportData getAlignmentForExport(String exportFormat, - AlignViewportI viewport, + public static AlignmentExportData getAlignmentForExport( + String exportFormat, AlignViewportI viewport, AlignExportSettingI exportSettings) { AlignmentI alignmentToExport = null; @@ -1270,16 +1269,14 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, HiddenSequences hiddenSeqs = viewport.getAlignment() .getHiddenSequences(); - alignmentToExport = viewport.getAlignment(); - alignmentStartEnd = new int[] - { 0, alignmentToExport.getWidth() - 1 }; + alignmentStartEnd = new int[] { 0, alignmentToExport.getWidth() - 1 }; boolean hasHiddenSeqs = hiddenSeqs.getSize() > 0; if (settings == null) { settings = new AlignExportSettings(hasHiddenSeqs, - viewport.hasHiddenColumns(), exportFormat); + viewport.hasHiddenColumns(), exportFormat); } // settings.isExportAnnotations(); @@ -1298,8 +1295,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, alignmentStartEnd = getStartEnd(alignmentStartEnd, viewport .getColumnSelection().getHiddenColumns()); } - AlignmentExportData ed = new AlignmentExportData(alignmentToExport, omitHidden, alignmentStartEnd, - settings); + AlignmentExportData ed = new AlignmentExportData(alignmentToExport, + omitHidden, alignmentStartEnd, settings); return ed; } @@ -1340,26 +1337,19 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } // System.out.println("Export range : " + minPos + " - " + maxPos); - return new int[] - { startPos, endPos }; + return new int[] { startPos, endPos }; } public static void main(String[] args) { ArrayList hiddenCols = new ArrayList(); - hiddenCols.add(new int[] - { 0, 4 }); - hiddenCols.add(new int[] - { 6, 9 }); - hiddenCols.add(new int[] - { 11, 12 }); - hiddenCols.add(new int[] - { 33, 33 }); - hiddenCols.add(new int[] - { 45, 50 }); - - int[] x = getStartEnd(new int[] - { 0, 50 }, hiddenCols); + hiddenCols.add(new int[] { 0, 4 }); + hiddenCols.add(new int[] { 6, 9 }); + hiddenCols.add(new int[] { 11, 12 }); + hiddenCols.add(new int[] { 33, 33 }); + hiddenCols.add(new int[] { 45, 50 }); + + int[] x = getStartEnd(new int[] { 0, 50 }, hiddenCols); // System.out.println("Export range : " + x[0] + " - " + x[1]); } @@ -1381,6 +1371,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, BioJsHTMLOutput bjs = new BioJsHTMLOutput(alignPanel); bjs.exportJalviewAlignmentAsBioJsHtmlFile(); } + public void createImageMap(File file, String image) { alignPanel.makePNGImageMap(file, image); @@ -1414,6 +1405,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { alignPanel.makeSVG(f); } + @Override public void pageSetup_actionPerformed(ActionEvent e) { @@ -1557,8 +1549,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, undoMenuItem.setEnabled(true); CommandI command = viewport.getHistoryList().peek(); undoMenuItem.setText(MessageManager.formatMessage( - "label.undo_command", new Object[] - { command.getDescription() })); + "label.undo_command", + new Object[] { command.getDescription() })); } else { @@ -1572,8 +1564,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, CommandI command = viewport.getRedoList().peek(); redoMenuItem.setText(MessageManager.formatMessage( - "label.redo_command", new Object[] - { command.getDescription() })); + "label.redo_command", + new Object[] { command.getDescription() })); } else { @@ -1615,8 +1607,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } if (viewport != null) { - return new AlignmentI[] - { viewport.getAlignment() }; + return new AlignmentI[] { viewport.getAlignment() }; } return null; } @@ -1850,8 +1841,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, boolean appendHistoryItem = false; Deque historyList = viewport.getHistoryList(); boolean inSplitFrame = getSplitViewContainer() != null; - if (!inSplitFrame && historyList != null - && historyList.size() > 0 + if (!inSplitFrame && historyList != null && historyList.size() > 0 && historyList.peek() instanceof SlideSequencesCommand) { appendHistoryItem = ssc @@ -1922,17 +1912,17 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { if (region[0] >= hiddenOffset && region[1] <= hiddenCutoff) { - hiddenColumns.add(new int[] - { region[0] - hiddenOffset, region[1] - hiddenOffset }); + hiddenColumns.add(new int[] { region[0] - hiddenOffset, + region[1] - hiddenOffset }); } } } - Desktop.jalviewClipboard = new Object[] - { seqs, viewport.getAlignment().getDataset(), hiddenColumns }; + Desktop.jalviewClipboard = new Object[] { seqs, + viewport.getAlignment().getDataset(), hiddenColumns }; statusBar.setText(MessageManager.formatMessage( - "label.copied_sequences_to_clipboard", new Object[] - { Integer.valueOf(seqs.length).toString() })); + "label.copied_sequences_to_clipboard", new Object[] { Integer + .valueOf(seqs.length).toString() })); } /** @@ -2141,8 +2131,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, // addHistoryItem(new EditCommand( MessageManager.getString("label.add_sequences"), - Action.PASTE, - sequences, 0, alignment.getWidth(), alignment)); + Action.PASTE, sequences, 0, alignment.getWidth(), alignment)); } // Add any annotations attached to sequences for (int i = 0; i < sequences.length; i++) @@ -2260,7 +2249,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, // found!!<<< af.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer() .transferSettings( - alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer()); + alignPanel.getSeqPanel().seqCanvas + .getFeatureRenderer()); // TODO: maintain provenance of an alignment, rather than just make the // title a concatenation of operations. @@ -2319,7 +2309,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, // found!!<<< af.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer() .transferSettings( - alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer()); + alignPanel.getSeqPanel().seqCanvas + .getFeatureRenderer()); // TODO: maintain provenance of an alignment, rather than just make the // title a concatenation of operations. @@ -2589,8 +2580,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } statusBar.setText(MessageManager.formatMessage( - "label.removed_columns", new String[] - { Integer.valueOf(trimRegion.getSize()).toString() })); + "label.removed_columns", + new String[] { Integer.valueOf(trimRegion.getSize()) + .toString() })); addHistoryItem(trimRegion); @@ -2639,8 +2631,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, addHistoryItem(removeGapCols); statusBar.setText(MessageManager.formatMessage( - "label.removed_empty_columns", new Object[] - { Integer.valueOf(removeGapCols.getSize()).toString() })); + "label.removed_empty_columns", + new Object[] { Integer.valueOf(removeGapCols.getSize()) + .toString() })); // This is to maintain viewport position on first residue // of first sequence @@ -2890,8 +2883,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { viewport.setShowJVSuffix(seqLimits.isSelected()); - alignPanel.getIdPanel().getIdCanvas().setPreferredSize(alignPanel - .calculateIdWidth()); + alignPanel.getIdPanel().getIdCanvas() + .setPreferredSize(alignPanel.calculateIdWidth()); alignPanel.paintAlignment(true); } @@ -2976,7 +2969,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, public void hideSelSequences_actionPerformed(ActionEvent e) { viewport.hideAllSelectedSeqs(); -// alignPanel.paintAlignment(true); + // alignPanel.paintAlignment(true); } /** @@ -3281,14 +3274,13 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, StringBuffer contents = new AlignmentProperties(viewport.getAlignment()) .formatAsHtml(); editPane.setText(MessageManager.formatMessage("label.html_content", - new Object[] - { contents.toString() })); + new Object[] { contents.toString() })); JInternalFrame frame = new JInternalFrame(); frame.getContentPane().add(new JScrollPane(editPane)); Desktop.addInternalFrame(frame, MessageManager.formatMessage( - "label.alignment_properties", new Object[] - { getTitle() }), 500, 400); + "label.alignment_properties", new Object[] { getTitle() }), + 500, 400); } /** @@ -3309,8 +3301,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, OverviewPanel overview = new OverviewPanel(alignPanel); frame.setContentPane(overview); Desktop.addInternalFrame(frame, MessageManager.formatMessage( - "label.overview_params", new Object[] - { this.getTitle() }), frame.getWidth(), frame.getHeight()); + "label.overview_params", new Object[] { this.getTitle() }), + frame.getWidth(), frame.getHeight()); frame.pack(); frame.setLayer(JLayeredPane.PALETTE_LAYER); frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() @@ -4030,7 +4022,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, public void addSortByOrderMenuItem(String title, final AlignmentOrder order) { - final JMenuItem item = new JMenuItem(MessageManager.formatMessage("action.by_title_param", new Object[]{title})); + final JMenuItem item = new JMenuItem(MessageManager.formatMessage( + "action.by_title_param", new Object[] { title })); sort.add(item); item.addActionListener(new java.awt.event.ActionListener() { @@ -4149,8 +4142,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, calculateTree.removeAll(); // build the calculate menu - for (final String type : new String[] - { "NJ", "AV" }) + for (final String type : new String[] { "NJ", "AV" }) { String treecalcnm = MessageManager.getString("label.tree_calc_" + type.toLowerCase()); @@ -4299,8 +4291,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, // selection may well be aligned - we preserve 2.0.8 behaviour for moment. if (!viewport.getAlignment().isAligned(false)) { - seqs.setSequences(new SeqCigar[] - { seqs.getSequences()[0] }); + seqs.setSequences(new SeqCigar[] { seqs.getSequences()[0] }); // TODO: if seqs.getSequences().length>1 then should really have warned // user! @@ -4747,8 +4738,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { final long sttime = System.currentTimeMillis(); AlignFrame.this.setProgressBar(MessageManager.formatMessage( - "status.searching_for_sequences_from", new Object[] - { source }), sttime); + "status.searching_for_sequences_from", + new Object[] { source }), sttime); try { // update our local dataset reference @@ -4855,9 +4846,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } AlignFrame.this.setProgressBar(MessageManager.formatMessage( "status.finished_searching_for_sequences_from", - new Object[] - { source }), - sttime); + new Object[] { source }), sttime); } }; @@ -4922,8 +4911,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, AlignFrame af = new AlignFrame(al, DEFAULT_WIDTH, DEFAULT_HEIGHT); af.setFileFormat(this.currentFileFormat); final String newTitle = MessageManager.formatMessage( - "label.translation_of_params", new Object[] - { this.getTitle() }); + "label.translation_of_params", + new Object[] { this.getTitle() }); af.setTitle(newTitle); if (Cache.getDefault(Preferences.ENABLE_SPLIT_FRAME, true)) { @@ -4961,7 +4950,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { return avc.parseFeaturesFile(file, type, jalview.bin.Cache.getDefault("RELAXEDSEQIDMATCHING", false)); - + } @Override @@ -4976,8 +4965,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, showSeqFeatures.setSelected(true); } - } + @Override public void dragEnter(DropTargetDragEvent evt) { @@ -5108,8 +5097,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, { if (type.equalsIgnoreCase("PDB")) { - filesmatched.add(new Object[] - { file, protocol, mtch }); + filesmatched.add(new Object[] { file, protocol, mtch }); continue; } } @@ -5128,10 +5116,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, MessageManager .formatMessage( "label.automatically_associate_pdb_files_with_sequences_same_name", - new Object[] - { Integer.valueOf( - filesmatched - .size()) + new Object[] { Integer + .valueOf( + filesmatched + .size()) .toString() }), MessageManager .getString("label.automatically_associate_pdb_files_by_name"), @@ -5168,14 +5156,16 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, "AUTOASSOCIATE_PDBANDSEQS_IGNOREOTHERS", false) || JOptionPane .showConfirmDialog( this, - ""+MessageManager - .formatMessage( - "label.ignore_unmatched_dropped_files_info", - new Object[] - { Integer.valueOf( - filesnotmatched - .size()) - .toString() })+"", + "" + + MessageManager + .formatMessage( + "label.ignore_unmatched_dropped_files_info", + new Object[] { Integer + .valueOf( + filesnotmatched + .size()) + .toString() }) + + "", MessageManager .getString("label.ignore_unmatched_dropped_files"), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION)) @@ -5218,8 +5208,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, // try to parse as annotation. boolean isAnnotation = (format == null || format .equalsIgnoreCase("PFAM")) ? new AnnotationFile() - .annotateAlignmentView(viewport, file, protocol) - : false; + .annotateAlignmentView(viewport, file, protocol) : false; if (!isAnnotation) { @@ -5612,7 +5601,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } }); - fetchr.setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.formatMessage("label.fetch_retrieve_from", new Object[]{src.getDbName()}))); + fetchr.setToolTipText(JvSwingUtils.wrapTooltip(true, + MessageManager.formatMessage( + "label.fetch_retrieve_from", + new Object[] { src.getDbName() }))); dfetch.add(fetchr); comp++; } @@ -5623,8 +5615,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, // fetch all entry DbSourceProxy src = otherdb.get(0); fetchr = new JMenuItem(MessageManager.formatMessage( - "label.fetch_all_param", new Object[] - { src.getDbSource() })); + "label.fetch_all_param", + new Object[] { src.getDbSource() })); fetchr.addActionListener(new ActionListener() { @Override @@ -5645,11 +5637,19 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, } }); - fetchr.setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.formatMessage("label.fetch_retrieve_from_all_sources", new Object[]{Integer.valueOf(otherdb.size()).toString(), src.getDbSource(), src.getDbName()}))); + fetchr.setToolTipText(JvSwingUtils.wrapTooltip(true, + MessageManager.formatMessage( + "label.fetch_retrieve_from_all_sources", + new Object[] { + Integer.valueOf(otherdb.size()) + .toString(), src.getDbSource(), + src.getDbName() }))); dfetch.add(fetchr); comp++; // and then build the rest of the individual menus - ifetch = new JMenu(MessageManager.formatMessage("label.source_from_db_source", new Object[]{src.getDbSource()})); + ifetch = new JMenu(MessageManager.formatMessage( + "label.source_from_db_source", + new Object[] { src.getDbSource() })); icomp = 0; String imname = null; int i = 0; @@ -5662,11 +5662,11 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, 0, 10) + "..." : dbname; if (imname == null) { - imname = MessageManager.formatMessage("label.from_msname", new Object[]{sname}); + imname = MessageManager.formatMessage( + "label.from_msname", new Object[] { sname }); } fetchr = new JMenuItem(msname); - final DbSourceProxy[] dassrc = - { sproxy }; + final DbSourceProxy[] dassrc = { sproxy }; fetchr.addActionListener(new ActionListener() { @@ -5689,7 +5689,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, }); fetchr.setToolTipText("" - + MessageManager.formatMessage("label.fetch_retrieve_from", new Object[]{dbname})); + + MessageManager.formatMessage( + "label.fetch_retrieve_from", new Object[] + { dbname })); ifetch.add(fetchr); ++i; if (++icomp >= mcomp || i == (otherdb.size())) @@ -5853,10 +5855,12 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, alignPanel.paintAlignment(true); } } + public void clearAlignmentSeqRep() { // TODO refactor alignmentseqrep to controller - if (viewport.getAlignment().hasSeqrep()) { + if (viewport.getAlignment().hasSeqrep()) + { viewport.getAlignment().setSeqrep(null); PaintRefresher.Refresh(this, viewport.getSequenceSetId()); alignPanel.updateAnnotation(); @@ -5892,7 +5896,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, if (!viewport.getSequenceSetId().equals( alignmentPanel.av.getSequenceSetId())) { - throw new Error(MessageManager.getString("error.implementation_error_cannot_show_view_alignment_frame")); + throw new Error( + MessageManager + .getString("error.implementation_error_cannot_show_view_alignment_frame")); } if (tabbedPane != null && tabbedPane.getTabCount() > 0 @@ -5955,8 +5961,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, */ public List getAlignPanels() { - return alignPanels == null ? Arrays.asList(alignPanel) - : alignPanels; + return alignPanels == null ? Arrays.asList(alignPanel) : alignPanels; } /** @@ -5973,8 +5978,10 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, return; } List cdnaSeqs = new ArrayList(); - for (SequenceI aaSeq : alignment.getSequences()) { - for (AlignedCodonFrame acf : mappings) { + for (SequenceI aaSeq : alignment.getSequences()) + { + for (AlignedCodonFrame acf : mappings) + { SequenceI dnaSeq = acf.getDnaForAaSeq(aaSeq.getDatasetSequence()); if (dnaSeq != null) { @@ -6002,8 +6009,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, String newtitle = "cDNA " + MessageManager.getString("label.for") + " " + this.title; Desktop.addInternalFrame(alignFrame, newtitle, - AlignFrame.DEFAULT_WIDTH, - AlignFrame.DEFAULT_HEIGHT); + AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); } /** @@ -6016,7 +6022,8 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, protected void showComplement_actionPerformed(boolean show) { SplitContainerI sf = getSplitViewContainer(); - if (sf != null) { + if (sf != null) + { sf.setComplementVisible(this, show); } } diff --git a/src/jalview/gui/AlignViewport.java b/src/jalview/gui/AlignViewport.java index 579b476..8378f30 100644 --- a/src/jalview/gui/AlignViewport.java +++ b/src/jalview/gui/AlignViewport.java @@ -109,6 +109,7 @@ public class AlignViewport extends AlignmentViewport implements private boolean gatherViewsHere = false; private AnnotationColumnChooser annotationColumnSelectionState; + /** * Creates a new AlignViewport object. * @@ -399,6 +400,7 @@ public class AlignViewport extends AlignmentViewport implements viewStyle.getFontSize()), false); } + /** * DOCUMENT ME! * @@ -565,11 +567,9 @@ public class AlignViewport extends AlignmentViewport implements // TODO: JAL-1126 if (historyList == null || redoList == null) { - return new long[] - { -1, -1 }; + return new long[] { -1, -1 }; } - return new long[] - { historyList.hashCode(), this.redoList.hashCode() }; + return new long[] { historyList.hashCode(), this.redoList.hashCode() }; } /** @@ -714,8 +714,7 @@ public class AlignViewport extends AlignmentViewport implements List seqs = new ArrayList(); for (SequenceI sq : alignment.getSequences()) { - Vector pdbs = sq - .getDatasetSequence().getAllPDBEntries(); + Vector pdbs = sq.getDatasetSequence().getAllPDBEntries(); if (pdbs == null) { continue; @@ -893,8 +892,8 @@ public class AlignViewport extends AlignmentViewport implements */ protected boolean openLinkedAlignment(AlignmentI al, String title) { - String[] options = new String[] - { MessageManager.getString("action.no"), + String[] options = new String[] { + MessageManager.getString("action.no"), MessageManager.getString("label.split_window"), MessageManager.getString("label.new_window"), }; final String question = JvSwingUtils.wrapTooltip(true, @@ -937,8 +936,7 @@ public class AlignViewport extends AlignmentViewport implements AlignFrame.DEFAULT_HEIGHT); newAlignFrame.setTitle(title); newAlignFrame.statusBar.setText(MessageManager.formatMessage( - "label.successfully_loaded_file", new Object[] - { title })); + "label.successfully_loaded_file", new Object[] { title })); // TODO if we want this (e.g. to enable reload of the alignment from file), // we will need to add parameters to the stack. @@ -950,15 +948,13 @@ public class AlignViewport extends AlignmentViewport implements if (openInNewWindow) { Desktop.addInternalFrame(newAlignFrame, title, - AlignFrame.DEFAULT_WIDTH, - AlignFrame.DEFAULT_HEIGHT); + AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); } try { newAlignFrame.setMaximum(jalview.bin.Cache.getDefault( - "SHOW_FULLSCREEN", - false)); + "SHOW_FULLSCREEN", false)); } catch (java.beans.PropertyVetoException ex) { } @@ -987,7 +983,8 @@ public class AlignViewport extends AlignmentViewport implements { /* * Make a new frame with a copy of the alignment we are adding to. If this - * is protein, the mappings to cDNA will be registered with StructureSelectionManager as a side-effect. + * is protein, the mappings to cDNA will be registered with + * StructureSelectionManager as a side-effect. */ AlignFrame copyMe = new AlignFrame(complement, AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); @@ -996,8 +993,7 @@ public class AlignViewport extends AlignmentViewport implements AlignmentI al = newAlignFrame.viewport.getAlignment(); final AlignFrame proteinFrame = al.isNucleotide() ? copyMe : newAlignFrame; - final AlignFrame cdnaFrame = al.isNucleotide() ? newAlignFrame - : copyMe; + final AlignFrame cdnaFrame = al.isNucleotide() ? newAlignFrame : copyMe; cdnaFrame.setVisible(true); proteinFrame.setVisible(true); String linkedTitle = MessageManager @@ -1074,7 +1070,8 @@ public class AlignViewport extends AlignmentViewport implements if (!sr.isEmpty()) { // TODO would like next line without cast but needs more refactoring... - final AlignmentPanel complementPanel = ((AlignViewport) getCodingComplement()).getAlignPanel(); + final AlignmentPanel complementPanel = ((AlignViewport) getCodingComplement()) + .getAlignPanel(); complementPanel.setFollowingComplementScroll(true); complementPanel.scrollToCentre(sr, verticalOffset); } diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 1b93f10..ec83a5d 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -76,6 +76,7 @@ public class AlignmentPanel extends GAlignmentPanel implements private IdPanel idPanel; private boolean headless; + IdwidthAdjuster idwidthAdjuster; /** DOCUMENT ME!! */ @@ -155,6 +156,7 @@ public class AlignmentPanel extends GAlignmentPanel implements { return av; } + public void alignmentChanged() { av.alignmentChanged(this); @@ -177,8 +179,7 @@ public class AlignmentPanel extends GAlignmentPanel implements scalePanelHolder.setPreferredSize(new Dimension(10, av.getCharHeight() + fm.getDescent())); idSpaceFillerPanel1.setPreferredSize(new Dimension(10, av - .getCharHeight() - + fm.getDescent())); + .getCharHeight() + fm.getDescent())); getIdPanel().getIdCanvas().gg = null; getSeqPanel().seqCanvas.img = null; @@ -317,7 +318,8 @@ public class AlignmentPanel extends GAlignmentPanel implements * @param redrawOverview * @return */ - public boolean scrollToPosition(SearchResults searchResults, boolean redrawOverview) + public boolean scrollToPosition(SearchResults searchResults, + boolean redrawOverview) { return scrollToPosition(searchResults, 0, redrawOverview, false); } @@ -337,8 +339,7 @@ public class AlignmentPanel extends GAlignmentPanel implements * @return false if results were not found */ public boolean scrollToPosition(SearchResults results, - int verticalOffset, - boolean redrawOverview, boolean centre) + int verticalOffset, boolean redrawOverview, boolean centre) { int startv, endv, starts, ends; // TODO: properly locate search results in view when large numbers of hidden @@ -363,8 +364,8 @@ public class AlignmentPanel extends GAlignmentPanel implements int start = r[0]; int end = r[1]; // DEBUG -// System.err.println(this.av.viewName + " Seq : " + seqIndex -// + " Scroll to " + start + "," + end); + // System.err.println(this.av.viewName + " Seq : " + seqIndex + // + " Scroll to " + start + "," + end); /* * To centre results, scroll to positions half the visible width @@ -747,7 +748,8 @@ public class AlignmentPanel extends GAlignmentPanel implements { int x = hscroll.getValue(); av.setStartRes(x); - av.setEndRes((x + (getSeqPanel().seqCanvas.getWidth() / av.getCharWidth())) - 1); + av.setEndRes((x + (getSeqPanel().seqCanvas.getWidth() / av + .getCharWidth())) - 1); } if (evt.getSource() == vscroll) @@ -844,8 +846,7 @@ public class AlignmentPanel extends GAlignmentPanel implements { final AnnotationSorter sorter = new AnnotationSorter(getAlignment(), av.isShowAutocalculatedAbove()); - sorter.sort(getAlignment() - .getAlignmentAnnotation(), + sorter.sort(getAlignment().getAlignmentAnnotation(), av.getSortAnnotationsBy()); repaint(); @@ -1063,9 +1064,7 @@ public class AlignmentPanel extends GAlignmentPanel implements - 4; } - pg.drawString( - seq.getDisplayId(av.getShowJVSuffix()), - xPos, + pg.drawString(seq.getDisplayId(av.getShowJVSuffix()), xPos, (((i - startSeq) * av.getCharHeight()) + av.getCharHeight()) - (av.getCharHeight() / 5)); } @@ -1074,7 +1073,8 @@ public class AlignmentPanel extends GAlignmentPanel implements // draw main sequence panel pg.translate(idWidth, 0); - getSeqPanel().seqCanvas.drawPanel(pg, startRes, endRes, startSeq, endSeq, 0); + getSeqPanel().seqCanvas.drawPanel(pg, startRes, endRes, startSeq, + endSeq, 0); if (av.isShowAnnotation() && (endSeq == av.getAlignment().getHeight())) { @@ -1176,12 +1176,14 @@ public class AlignmentPanel extends GAlignmentPanel implements } if (labels != null) { - pg.translate(-3, ypos - + (av.getAlignment().getHeight() * av.getCharHeight())); + pg.translate(-3, + ypos + (av.getAlignment().getHeight() * av.getCharHeight())); pg.setFont(av.getFont()); labels.drawComponent(pg, idWidth); - pg.translate(+3, -ypos + pg.translate( + +3, + -ypos - (av.getAlignment().getHeight() * av .getCharHeight())); } @@ -1191,8 +1193,8 @@ public class AlignmentPanel extends GAlignmentPanel implements pg.translate(idWidth, 0); - getSeqPanel().seqCanvas.drawWrappedPanel(pg, pwidth - idWidth, totalHeight, - 0); + getSeqPanel().seqCanvas.drawWrappedPanel(pg, pwidth - idWidth, + totalHeight, 0); if ((pi * pheight) < totalHeight) { @@ -1250,8 +1252,8 @@ public class AlignmentPanel extends GAlignmentPanel implements if (alignFrame != null && !headless) { alignFrame.setProgressBar(MessageManager.formatMessage( - "status.saving_file", new Object[] - { type.getLabel() }), progress); + "status.saving_file", new Object[] { type.getLabel() }), + progress); } try { @@ -1312,7 +1314,9 @@ public class AlignmentPanel extends GAlignmentPanel implements { if (alignFrame != null && !headless) { - alignFrame.setProgressBar(MessageManager.getString("status.export_complete"), progress); + alignFrame.setProgressBar( + MessageManager.getString("status.export_complete"), + progress); } } } @@ -1377,6 +1381,7 @@ public class AlignmentPanel extends GAlignmentPanel implements { makeAlignmentImage(jalview.util.ImageMaker.TYPE.SVG, svgFile); } + public void makePNGImageMap(File imgMapFile, String imageName) { // /////ONLY WORKS WITH NONE WRAPPED ALIGNMENTS @@ -1414,8 +1419,7 @@ public class AlignmentPanel extends GAlignmentPanel implements if (av.getAlignment().isNucleotide()) { triplet = ResidueProperties.nucleotideName.get(seq - .getCharAt(res) - + ""); + .getCharAt(res) + ""); } else { @@ -1437,8 +1441,7 @@ public class AlignmentPanel extends GAlignmentPanel implements text.append(" selectedTypes = new HashMap(); - + /** * Constructor. * @@ -388,7 +388,7 @@ public class AnnotationChooser extends JPanel final boolean wholeAlignment = this.sg == null; JPanel applyToOptions = new JPanel(new FlowLayout(FlowLayout.LEFT)); CheckboxGroup actingOn = new CheckboxGroup(); - + String forAll = MessageManager.getString("label.all_sequences"); final Checkbox allSequences = new Checkbox(forAll, actingOn, wholeAlignment); @@ -397,7 +397,8 @@ public class AnnotationChooser extends JPanel @Override public void itemStateChanged(ItemEvent evt) { - if (evt.getStateChange() == ItemEvent.SELECTED) { + if (evt.getStateChange() == ItemEvent.SELECTED) + { AnnotationChooser.this.setApplyToSelectedSequences(true); AnnotationChooser.this.setApplyToUnselectedSequences(true); AnnotationChooser.this.changeApplyTo_actionPerformed(); @@ -405,7 +406,7 @@ public class AnnotationChooser extends JPanel } }); applyToOptions.add(allSequences); - + String forSelected = MessageManager .getString("label.selected_sequences"); final Checkbox selectedSequences = new Checkbox(forSelected, actingOn, @@ -425,10 +426,11 @@ public class AnnotationChooser extends JPanel } }); applyToOptions.add(selectedSequences); - + String exceptSelected = MessageManager .getString("label.except_selected_sequences"); - final Checkbox unselectedSequences = new Checkbox(exceptSelected, actingOn, false); + final Checkbox unselectedSequences = new Checkbox(exceptSelected, + actingOn, false); unselectedSequences.setEnabled(!wholeAlignment); unselectedSequences.addItemListener(new ItemListener() { @@ -444,7 +446,7 @@ public class AnnotationChooser extends JPanel } }); applyToOptions.add(unselectedSequences); - + // set member variables to match the initial selection state this.applyToSelectedSequences = selectedSequences.getState() || allSequences.getState(); @@ -476,7 +478,8 @@ public class AnnotationChooser extends JPanel @Override public void itemStateChanged(ItemEvent evt) { - if (evt.getStateChange() == ItemEvent.SELECTED) { + if (evt.getStateChange() == ItemEvent.SELECTED) + { AnnotationChooser.this.setShowSelected(true); AnnotationChooser.this.changeShowHide_actionPerformed(); } @@ -521,7 +524,7 @@ public class AnnotationChooser extends JPanel { JPanel jp = new JPanel(); final Font labelFont = JvSwingUtils.getLabelFont(); - + JButton ok = new JButton(MessageManager.getString("action.ok")); ok.setFont(labelFont); ok.addActionListener(new ActionListener() @@ -533,7 +536,7 @@ public class AnnotationChooser extends JPanel } }); jp.add(ok); - + JButton cancel = new JButton(MessageManager.getString("action.cancel")); cancel.setFont(labelFont); cancel.addActionListener(new ActionListener() diff --git a/src/jalview/gui/AnnotationColourChooser.java b/src/jalview/gui/AnnotationColourChooser.java index c8dd889..19eed27 100644 --- a/src/jalview/gui/AnnotationColourChooser.java +++ b/src/jalview/gui/AnnotationColourChooser.java @@ -63,7 +63,6 @@ public class AnnotationColourChooser extends AnnotationRowFilter JButton defColours = new JButton(); - JPanel jPanel1 = new JPanel(); JPanel jPanel2 = new JPanel(); @@ -140,7 +139,9 @@ public class AnnotationColourChooser extends AnnotationRowFilter getThreshold().setSelectedIndex(2); break; default: - throw new Error(MessageManager.getString("error.implementation_error_dont_know_about_thereshold_setting")); + throw new Error( + MessageManager + .getString("error.implementation_error_dont_know_about_thereshold_setting")); } thresholdIsMin.setSelected(acg.thresholdIsMinMax); thresholdValue.setText("" + acg.getAnnotationThreshold()); @@ -348,7 +349,8 @@ public class AnnotationColourChooser extends AnnotationRowFilter public void minColour_actionPerformed() { Color col = JColorChooser.showDialog(this, - MessageManager.getString("label.select_colour_minimum_value"), minColour.getBackground()); + MessageManager.getString("label.select_colour_minimum_value"), + minColour.getBackground()); if (col != null) { minColour.setBackground(col); @@ -360,7 +362,8 @@ public class AnnotationColourChooser extends AnnotationRowFilter public void maxColour_actionPerformed() { Color col = JColorChooser.showDialog(this, - MessageManager.getString("label.select_colour_maximum_value"), maxColour.getBackground()); + MessageManager.getString("label.select_colour_maximum_value"), + maxColour.getBackground()); if (col != null) { maxColour.setBackground(col); @@ -449,9 +452,10 @@ public class AnnotationColourChooser extends AnnotationRowFilter && getCurrentAnnotation().threshold == null) { getCurrentAnnotation() - .setThreshold(new jalview.datamodel.GraphLine( - (getCurrentAnnotation().graphMax - getCurrentAnnotation().graphMin) / 2f, - "Threshold", Color.black)); + .setThreshold( + new jalview.datamodel.GraphLine( + (getCurrentAnnotation().graphMax - getCurrentAnnotation().graphMin) / 2f, + "Threshold", Color.black)); } if (selectedThresholdItem != AnnotationColourGradient.NO_THRESHOLD) diff --git a/src/jalview/gui/AnnotationColumnChooser.java b/src/jalview/gui/AnnotationColumnChooser.java index e87be35..c0d7084 100644 --- a/src/jalview/gui/AnnotationColumnChooser.java +++ b/src/jalview/gui/AnnotationColumnChooser.java @@ -66,6 +66,7 @@ public class AnnotationColumnChooser extends AnnotationRowFilter implements private CardLayout switchableViewsLayout = (CardLayout) (switchableViewsPanel .getLayout()); + private JPanel noGraphFilterView = new JPanel(); private JPanel graphFilterView = new JPanel(); @@ -294,6 +295,7 @@ public class AnnotationColumnChooser extends AnnotationRowFilter implements slider.setToolTipText(defaultTtip); } } + public void reset() { if (this.getOldColumnSelection() != null) @@ -585,7 +587,6 @@ public class AnnotationColumnChooser extends AnnotationRowFilter implements updateView(); } - public class FurtherActionPanel extends JPanel { private AnnotationColumnChooser aColChooser; @@ -646,8 +647,7 @@ public class AnnotationColumnChooser extends AnnotationRowFilter implements { if (aColChooser.getActionOption() == AnnotationColumnChooser.ACTION_OPTION_HIDE) { - this.optionsGroup.setSelected(this.hideOption.getModel(), - true); + this.optionsGroup.setSelected(this.hideOption.getModel(), true); } else { @@ -816,27 +816,26 @@ public class AnnotationColumnChooser extends AnnotationRowFilter implements JvSwingUtils.jvInitComponent(searchBox); searchBox.setToolTipText(MessageManager .getString("info.enter_search_text_here")); - searchBox.getDocument().addDocumentListener( - new DocumentListener() - { - @Override - public void insertUpdate(DocumentEvent e) - { - searchStringAction(); - } - - @Override - public void removeUpdate(DocumentEvent e) - { - searchStringAction(); - } - - @Override - public void changedUpdate(DocumentEvent e) - { - searchStringAction(); - } - }); + searchBox.getDocument().addDocumentListener(new DocumentListener() + { + @Override + public void insertUpdate(DocumentEvent e) + { + searchStringAction(); + } + + @Override + public void removeUpdate(DocumentEvent e) + { + searchStringAction(); + } + + @Override + public void changedUpdate(DocumentEvent e) + { + searchStringAction(); + } + }); JvSwingUtils.jvInitComponent(displayName, "label.label"); displayName.setEnabled(false); @@ -905,15 +904,14 @@ public class AnnotationColumnChooser extends AnnotationRowFilter implements { String defaultTtip = MessageManager .getString("info.enter_search_text_to_enable"); - String labelTtip = MessageManager -.formatMessage( + String labelTtip = MessageManager.formatMessage( "info.search_in_annotation_label", annotations .getSelectedItem().toString()); - String descTtip = MessageManager -.formatMessage( + String descTtip = MessageManager.formatMessage( "info.search_in_annotation_description", annotations .getSelectedItem().toString()); - displayName.setToolTipText(displayName.isEnabled() ? labelTtip : defaultTtip); + displayName.setToolTipText(displayName.isEnabled() ? labelTtip + : defaultTtip); description.setToolTipText(description.isEnabled() ? descTtip : defaultTtip); } diff --git a/src/jalview/gui/AnnotationExporter.java b/src/jalview/gui/AnnotationExporter.java index 9b25388..643d8a0 100644 --- a/src/jalview/gui/AnnotationExporter.java +++ b/src/jalview/gui/AnnotationExporter.java @@ -120,8 +120,9 @@ public class AnnotationExporter extends JPanel jalview.bin.Cache.getProperty("LAST_DIRECTORY")); chooser.setFileView(new JalviewFileView()); - chooser.setDialogTitle(features ? MessageManager.getString("label.save_features_to_file") - : MessageManager.getString("label.save_annotation_to_file")); + chooser.setDialogTitle(features ? MessageManager + .getString("label.save_features_to_file") : MessageManager + .getString("label.save_annotation_to_file")); chooser.setToolTipText(MessageManager.getString("action.save")); int value = chooser.showSaveDialog(this); @@ -186,6 +187,7 @@ public class AnnotationExporter extends JPanel } return text; } + public void toTextbox_actionPerformed(ActionEvent e) { CutAndPasteTransfer cap = new CutAndPasteTransfer(); @@ -197,23 +199,26 @@ public class AnnotationExporter extends JPanel Desktop.addInternalFrame( cap, (features ? MessageManager.formatMessage( - "label.features_for_params", new String[] - { ap.alignFrame.getTitle() }) : MessageManager - .formatMessage("label.annotations_for_params", - new String[] - { ap.alignFrame.getTitle() })), 600, 500); + "label.features_for_params", + new String[] { ap.alignFrame.getTitle() }) + : MessageManager.formatMessage( + "label.annotations_for_params", + new String[] { ap.alignFrame.getTitle() })), + 600, 500); } catch (OutOfMemoryError oom) { new OOMWarning((features ? MessageManager.formatMessage( - "label.generating_features_for_params", new String[] - { ap.alignFrame.getTitle() }) : MessageManager.formatMessage( - "label.generating_annotations_for_params", new String[] - { ap.alignFrame.getTitle() })), oom); + "label.generating_features_for_params", + new String[] { ap.alignFrame.getTitle() }) + : MessageManager.formatMessage( + "label.generating_annotations_for_params", + new String[] { ap.alignFrame.getTitle() })), oom); cap.dispose(); } close_actionPerformed(null); } + public void close_actionPerformed(ActionEvent e) { try diff --git a/src/jalview/gui/AnnotationLabels.java b/src/jalview/gui/AnnotationLabels.java index 4e625e1..d4300e4 100755 --- a/src/jalview/gui/AnnotationLabels.java +++ b/src/jalview/gui/AnnotationLabels.java @@ -70,13 +70,16 @@ import javax.swing.ToolTipManager; public class AnnotationLabels extends JPanel implements MouseListener, MouseMotionListener, ActionListener { - private static final Pattern LEFT_ANGLE_BRACKET_PATTERN = Pattern.compile("<"); + private static final Pattern LEFT_ANGLE_BRACKET_PATTERN = Pattern + .compile("<"); - String TOGGLE_LABELSCALE = MessageManager.getString("label.scale_label_to_column"); + String TOGGLE_LABELSCALE = MessageManager + .getString("label.scale_label_to_column"); String ADDNEW = MessageManager.getString("label.add_new_row"); - String EDITNAME = MessageManager.getString("label.edit_label_description"); + String EDITNAME = MessageManager + .getString("label.edit_label_description"); String HIDE = MessageManager.getString("label.hide_row"); @@ -86,7 +89,8 @@ public class AnnotationLabels extends JPanel implements MouseListener, String OUTPUT_TEXT = MessageManager.getString("label.export_annotation"); - String COPYCONS_SEQ = MessageManager.getString("label.copy_consensus_sequence"); + String COPYCONS_SEQ = MessageManager + .getString("label.copy_consensus_sequence"); boolean resizePanel = false; @@ -253,8 +257,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, else if (evt.getActionCommand().equals(OUTPUT_TEXT)) { new AnnotationExporter().exportAnnotations(ap, - new AlignmentAnnotation[] - { aa[selectedRow] }); + new AlignmentAnnotation[] { aa[selectedRow] }); } else if (evt.getActionCommand().equals(COPYCONS_SEQ)) { @@ -547,9 +550,8 @@ public class AnnotationLabels extends JPanel implements MouseListener, } else { - ap.getSeqPanel().ap.getIdPanel() - .highlightSearchResults(aa[selectedRow].groupRef - .getSequences(null)); + ap.getSeqPanel().ap.getIdPanel().highlightSearchResults( + aa[selectedRow].groupRef.getSequences(null)); } return; } @@ -557,36 +559,45 @@ public class AnnotationLabels extends JPanel implements MouseListener, { if (evt.getClickCount() == 1) { - ap.getSeqPanel().ap.getIdPanel().highlightSearchResults(Arrays - .asList(new SequenceI[] - { aa[selectedRow].sequenceRef })); + ap.getSeqPanel().ap + .getIdPanel() + .highlightSearchResults( + Arrays.asList(new SequenceI[] { aa[selectedRow].sequenceRef })); } else if (evt.getClickCount() >= 2) { ap.getSeqPanel().ap.getIdPanel().highlightSearchResults(null); SequenceGroup sg = ap.av.getSelectionGroup(); - if (sg!=null) + if (sg != null) { - // we make a copy rather than edit the current selection if no modifiers pressed + // we make a copy rather than edit the current selection if no + // modifiers pressed // see Enhancement JAL-1557 if (!(evt.isControlDown() || evt.isShiftDown())) { sg = new SequenceGroup(sg); sg.clear(); sg.addSequence(aa[selectedRow].sequenceRef, false); - } else { + } + else + { if (evt.isControlDown()) { sg.addOrRemove(aa[selectedRow].sequenceRef, true); - } else { - // notionally, we should also add intermediate sequences from last added sequence ? + } + else + { + // notionally, we should also add intermediate sequences from + // last added sequence ? sg.addSequence(aa[selectedRow].sequenceRef, true); } } - } else { + } + else + { sg = new SequenceGroup(); sg.setStartRes(0); - sg.setEndRes(ap.av.getAlignment().getWidth()-1); + sg.setEndRes(ap.av.getAlignment().getWidth() - 1); sg.addSequence(aa[selectedRow].sequenceRef, false); } ap.av.setSelectionGroup(sg); @@ -632,7 +643,8 @@ public class AnnotationLabels extends JPanel implements MouseListener, { final String label = aa[selectedRow].label; JMenuItem hideType = new JMenuItem(); - String text = MessageManager.getString("label.hide_all") + " " + label; + String text = MessageManager.getString("label.hide_all") + " " + + label; hideType.setText(text); hideType.addActionListener(new ActionListener() { @@ -692,7 +704,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, pop.addSeparator(); // av and sequencegroup need to implement same interface for final JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem( - MessageManager.getString("label.ignore_gaps_consensus"), + MessageManager.getString("label.ignore_gaps_consensus"), (aa[selectedRow].groupRef != null) ? aa[selectedRow].groupRef .getIgnoreGapsConsensus() : ap.av .isIgnoreGapsConsensus()); @@ -705,7 +717,8 @@ public class AnnotationLabels extends JPanel implements MouseListener, { // TODO: pass on reference to ap so the view can be updated. aaa.groupRef.setIgnoreGapsConsensus(cbmi.getState()); - ap.getAnnotationPanel().paint(ap.getAnnotationPanel().getGraphics()); + ap.getAnnotationPanel().paint( + ap.getAnnotationPanel().getGraphics()); } else { @@ -718,7 +731,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, if (aaa.groupRef != null) { final JCheckBoxMenuItem chist = new JCheckBoxMenuItem( - MessageManager.getString("label.show_group_histogram"), + MessageManager.getString("label.show_group_histogram"), aa[selectedRow].groupRef.isShowConsensusHistogram()); chist.addActionListener(new ActionListener() { @@ -737,7 +750,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, }); pop.add(chist); final JCheckBoxMenuItem cprofl = new JCheckBoxMenuItem( - MessageManager.getString("label.show_group_logo"), + MessageManager.getString("label.show_group_logo"), aa[selectedRow].groupRef.isShowSequenceLogo()); cprofl.addActionListener(new ActionListener() { @@ -756,7 +769,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, }); pop.add(cprofl); final JCheckBoxMenuItem cproflnorm = new JCheckBoxMenuItem( - MessageManager.getString("label.normalise_group_logo"), + MessageManager.getString("label.normalise_group_logo"), aa[selectedRow].groupRef.isNormaliseSequenceLogo()); cproflnorm.addActionListener(new ActionListener() { @@ -781,7 +794,8 @@ public class AnnotationLabels extends JPanel implements MouseListener, else { final JCheckBoxMenuItem chist = new JCheckBoxMenuItem( - MessageManager.getString("label.show_histogram"), av.isShowConsensusHistogram()); + MessageManager.getString("label.show_histogram"), + av.isShowConsensusHistogram()); chist.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -800,7 +814,8 @@ public class AnnotationLabels extends JPanel implements MouseListener, }); pop.add(chist); final JCheckBoxMenuItem cprof = new JCheckBoxMenuItem( - MessageManager.getString("label.show_logo"), av.isShowSequenceLogo()); + MessageManager.getString("label.show_logo"), + av.isShowSequenceLogo()); cprof.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -819,7 +834,8 @@ public class AnnotationLabels extends JPanel implements MouseListener, }); pop.add(cprof); final JCheckBoxMenuItem cprofnorm = new JCheckBoxMenuItem( - MessageManager.getString("label.normalise_logo"), av.isNormaliseSequenceLogo()); + MessageManager.getString("label.normalise_logo"), + av.isNormaliseSequenceLogo()); cprofnorm.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -855,11 +871,9 @@ public class AnnotationLabels extends JPanel implements MouseListener, */ protected void copy_annotseqtoclipboard(SequenceI sq) { - SequenceI[] seqs = new SequenceI[] - { sq }; + SequenceI[] seqs = new SequenceI[] { sq }; String[] omitHidden = null; - SequenceI[] dseqs = new SequenceI[] - { sq.getDatasetSequence() }; + SequenceI[] dseqs = new SequenceI[] { sq.getDatasetSequence() }; if (dseqs[0] == null) { dseqs[0] = new Sequence(sq); @@ -875,8 +889,7 @@ public class AnnotationLabels extends JPanel implements MouseListener, sq.getLength(), seqs); } - int[] alignmentStartEnd = new int[] - { 0, ds.getWidth() - 1 }; + int[] alignmentStartEnd = new int[] { 0, ds.getWidth() - 1 }; List hiddenCols = av.getColumnSelection().getHiddenColumns(); if (hiddenCols != null) { @@ -895,13 +908,14 @@ public class AnnotationLabels extends JPanel implements MouseListener, hiddenColumns = new ArrayList(); for (int[] region : av.getColumnSelection().getHiddenColumns()) { - hiddenColumns.add(new int[] - { region[0], region[1] }); + hiddenColumns.add(new int[] { region[0], region[1] }); } } - Desktop.jalviewClipboard = new Object[] - { seqs, ds, // what is the dataset of a consensus sequence ? need to flag + Desktop.jalviewClipboard = new Object[] { seqs, ds, // what is the dataset + // of a consensus + // sequence ? need to + // flag // sequence as special. hiddenColumns }; } @@ -990,8 +1004,8 @@ public class AnnotationLabels extends JPanel implements MouseListener, int ofontH = fontHeight; int sOffset = 0; int visHeight = 0; - int[] visr = (ap != null && ap.getAnnotationPanel() != null) ? ap.getAnnotationPanel() - .getVisibleVRange() : null; + int[] visr = (ap != null && ap.getAnnotationPanel() != null) ? ap + .getAnnotationPanel().getVisibleVRange() : null; if (clip && visr != null) { sOffset = visr[0]; diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 97752f2..77d6b51 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -335,7 +335,8 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, else if (evt.getActionCommand().equals(COLOUR)) { Color col = JColorChooser.showDialog(this, - MessageManager.getString("label.select_foreground_colour"), Color.black); + MessageManager.getString("label.select_foreground_colour"), + Color.black); for (int i = 0; i < av.getColumnSelection().size(); i++) { @@ -412,7 +413,6 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, anot[index] = new Annotation(label, "", type, 0); } - anot[index].secondaryStructure = type != 'S' ? type : label .length() == 0 ? ' ' : label.charAt(0); anot[index].displayCharacter = label; @@ -709,8 +709,8 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, && aa[row].annotations[res].description != null && aa[row].annotations[res].description.length() > 0) { - this.setToolTipText(JvSwingUtils - .wrapTooltip(true, aa[row].annotations[res].description)); + this.setToolTipText(JvSwingUtils.wrapTooltip(true, + aa[row].annotations[res].description)); } else { @@ -809,8 +809,8 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, { try { - image = new BufferedImage(imgWidth, ap.getAnnotationPanel().getHeight(), - BufferedImage.TYPE_INT_RGB); + image = new BufferedImage(imgWidth, ap.getAnnotationPanel() + .getHeight(), BufferedImage.TYPE_INT_RGB); } catch (OutOfMemoryError oom) { try diff --git a/src/jalview/gui/AnnotationRowFilter.java b/src/jalview/gui/AnnotationRowFilter.java index ac767cf..7b2fb36 100644 --- a/src/jalview/gui/AnnotationRowFilter.java +++ b/src/jalview/gui/AnnotationRowFilter.java @@ -111,7 +111,6 @@ public abstract class AnnotationRowFilter extends JPanel }); } - public AnnotationRowFilter(AlignViewport av, final AlignmentPanel ap) { this.av = av; @@ -363,7 +362,6 @@ public abstract class AnnotationRowFilter extends JPanel return false; } - public jalview.datamodel.AlignmentAnnotation getCurrentAnnotation() { return currentAnnotation; diff --git a/src/jalview/gui/AppJmol.java b/src/jalview/gui/AppJmol.java index fdc47fc..d876755 100644 --- a/src/jalview/gui/AppJmol.java +++ b/src/jalview/gui/AppJmol.java @@ -174,7 +174,8 @@ public class AppJmol extends StructureViewerBase _alignwith = new Vector(); } - seqColourBy = new ViewSelectionMenu(MessageManager.getString("label.colour_by"), this, _colourwith, + seqColourBy = new ViewSelectionMenu( + MessageManager.getString("label.colour_by"), this, _colourwith, new ItemListener() { @@ -194,7 +195,8 @@ public class AppJmol extends StructureViewerBase }); viewMenu.add(seqColourBy); final ItemListener handler; - JMenu alpanels = new ViewSelectionMenu(MessageManager.getString("label.superpose_with"), this, + JMenu alpanels = new ViewSelectionMenu( + MessageManager.getString("label.superpose_with"), this, _alignwith, handler = new ItemListener() { @@ -205,8 +207,8 @@ public class AppJmol extends StructureViewerBase alignStructs.setToolTipText(MessageManager .formatMessage( "label.align_structures_using_linked_alignment_views", - new String[] - { new Integer(_alignwith.size()).toString() })); + new String[] { new Integer(_alignwith + .size()).toString() })); } }); handler.itemStateChanged(null); @@ -488,7 +490,8 @@ public class AppJmol extends StructureViewerBase long hdl = pdbid.hashCode() - System.currentTimeMillis(); if (progressBar != null) { - progressBar.setProgressBar(MessageManager.formatMessage("status.fetching_pdb", new String[]{pdbid}), hdl); + progressBar.setProgressBar(MessageManager.formatMessage( + "status.fetching_pdb", new String[] { pdbid }), hdl); } try { @@ -503,7 +506,8 @@ public class AppJmol extends StructureViewerBase } if (progressBar != null) { - progressBar.setProgressBar(MessageManager.getString("label.state_completed"), hdl); + progressBar.setProgressBar( + MessageManager.getString("label.state_completed"), hdl); } if (pdbseq != null) { @@ -554,9 +558,8 @@ public class AppJmol extends StructureViewerBase JOptionPane.showInternalMessageDialog(Desktop.desktop, MessageManager .formatMessage("label.pdb_entries_couldnt_be_retrieved", - new String[] - { errormsgs.toString() }), MessageManager - .getString("label.couldnt_load_file"), + new String[] { errormsgs.toString() }), + MessageManager.getString("label.couldnt_load_file"), JOptionPane.ERROR_MESSAGE); } @@ -674,8 +677,7 @@ public class AppJmol extends StructureViewerBase try { // TODO: cope with multiple PDB files in view - in = new BufferedReader(new FileReader( - jmb.getPdbFile()[0])); + in = new BufferedReader(new FileReader(jmb.getPdbFile()[0])); File outFile = chooser.getSelectedFile(); PrintWriter out = new PrintWriter(new FileOutputStream(outFile)); @@ -749,15 +751,14 @@ public class AppJmol extends StructureViewerBase if (type == jalview.util.ImageMaker.TYPE.PNG) { im = new jalview.util.ImageMaker(this, - jalview.util.ImageMaker.TYPE.PNG, - "Make PNG image from view", width, height, null, null); + jalview.util.ImageMaker.TYPE.PNG, "Make PNG image from view", + width, height, null, null); } else if (type == jalview.util.ImageMaker.TYPE.EPS) { im = new jalview.util.ImageMaker(this, - jalview.util.ImageMaker.TYPE.EPS, - "Make EPS file from view", width, height, null, - this.getTitle()); + jalview.util.ImageMaker.TYPE.EPS, "Make EPS file from view", + width, height, null, this.getTitle()); } else { @@ -889,8 +890,9 @@ public class AppJmol extends StructureViewerBase @Override public void backGround_actionPerformed(ActionEvent actionEvent) { - java.awt.Color col = JColorChooser.showDialog(this, - MessageManager.getString("label.select_backgroud_colour"), null); + java.awt.Color col = JColorChooser + .showDialog(this, MessageManager + .getString("label.select_backgroud_colour"), null); if (col != null) { jmb.setBackgroundColour(col); diff --git a/src/jalview/gui/AppJmolBinding.java b/src/jalview/gui/AppJmolBinding.java index 5c4346e..1c54a5e 100644 --- a/src/jalview/gui/AppJmolBinding.java +++ b/src/jalview/gui/AppJmolBinding.java @@ -49,11 +49,10 @@ public class AppJmolBinding extends JalviewJmolBinding } @Override - public FeatureRenderer getFeatureRenderer( - AlignmentViewPanel alignment) + public FeatureRenderer getFeatureRenderer(AlignmentViewPanel alignment) { - AlignmentPanel ap = (alignment == null) ? appJmolWindow.getAlignmentPanel() - : (AlignmentPanel) alignment; + AlignmentPanel ap = (alignment == null) ? appJmolWindow + .getAlignmentPanel() : (AlignmentPanel) alignment; if (ap.av.isShowSequenceFeatures()) { if (fr == null) @@ -70,8 +69,7 @@ public class AppJmolBinding extends JalviewJmolBinding } @Override - public SequenceRenderer getSequenceRenderer( - AlignmentViewPanel alignment) + public SequenceRenderer getSequenceRenderer(AlignmentViewPanel alignment) { return new SequenceRenderer(((AlignmentPanel) alignment).av); } diff --git a/src/jalview/gui/AppVarna.java b/src/jalview/gui/AppVarna.java index 99bcff4..f4a4f4d 100644 --- a/src/jalview/gui/AppVarna.java +++ b/src/jalview/gui/AppVarna.java @@ -64,8 +64,8 @@ public class AppVarna extends JInternalFrame implements SelectionListener, SecondaryStructureListener, InterfaceVARNASelectionListener, VamsasSource { - private static final byte[] PAIRS = new byte[] - { '(', ')', '[', ']', '{', '}', '<', '>' }; + private static final byte[] PAIRS = new byte[] { '(', ')', '[', ']', '{', + '}', '<', '>' }; private AppVarnaBinding vab; @@ -181,8 +181,7 @@ public class AppVarna extends JInternalFrame implements SelectionListener, String theTitle = sname + (aa.sequenceRef == null ? " trimmed to " + seq.getName() : ""); theTitle = MessageManager.formatMessage("label.varna_params", - new String[] - { theTitle }); + new String[] { theTitle }); setTitle(theTitle); String gappedTitle = sname + " (with gaps)"; @@ -195,7 +194,6 @@ public class AppVarna extends JInternalFrame implements SelectionListener, vab.setSelectedIndex(0); } - /** * Constructor that links the viewer to a parent panel (but has no structures * yet - use addModel to add them) @@ -677,7 +675,6 @@ public class AppVarna extends JInternalFrame implements SelectionListener, vab.setSelectedIndex(selectedIndex); } - /** * Add a model with associated Varna session file * @@ -716,7 +713,6 @@ public class AppVarna extends JInternalFrame implements SelectionListener, } } - /** * Replace everything except RNA secondary structure characters with a period * diff --git a/src/jalview/gui/AppVarnaBinding.java b/src/jalview/gui/AppVarnaBinding.java index 25af7d1..521bb3e 100644 --- a/src/jalview/gui/AppVarnaBinding.java +++ b/src/jalview/gui/AppVarnaBinding.java @@ -113,7 +113,8 @@ public class AppVarnaBinding extends JalviewVarnaBinding _sideList.addMouseListener(new MouseAdapter() { @Override - public void mouseClicked(MouseEvent e) { + public void mouseClicked(MouseEvent e) + { AppVarnaBinding.this.mouseClicked(e); } }); @@ -150,7 +151,8 @@ public class AppVarnaBinding extends JalviewVarnaBinding _listPanel.add(j, BorderLayout.NORTH); _listPanel.add(listScroller, BorderLayout.CENTER); - new DropTarget(vp, new DropTargetAdapter() { + new DropTarget(vp, new DropTargetAdapter() + { @Override public void drop(DropTargetDropEvent dtde) { @@ -198,8 +200,7 @@ public class AppVarnaBinding extends JalviewVarnaBinding public String[][] getParameterInfo() { - String[][] info = - { + String[][] info = { // Parameter Name Kind of Value Description, { "sequenceDBN", "String", "A raw RNA sequence" }, { "structureDBN", "String", @@ -287,7 +288,8 @@ public class AppVarnaBinding extends JalviewVarnaBinding { name += " (Model " + mn++ + ")"; } - _rnaList.add(varnaPanel.getConfig().clone(), r, name, true); + _rnaList.add(varnaPanel.getConfig().clone(), r, name, + true); } } } @@ -482,7 +484,7 @@ public class AppVarnaBinding extends JalviewVarnaBinding * restore the previous display */ vp.showRNA(sel.rna, sel.config); - + return filePath; } catch (IOException e) { @@ -500,7 +502,8 @@ public class AppVarnaBinding extends JalviewVarnaBinding * * @param evt */ - protected void changeSelectedStructure_actionPerformed(ListSelectionEvent evt) + protected void changeSelectedStructure_actionPerformed( + ListSelectionEvent evt) { if (!evt.getValueIsAdjusting()) { diff --git a/src/jalview/gui/AssociatePdbFileWithSeq.java b/src/jalview/gui/AssociatePdbFileWithSeq.java index 7e646e2..861fe56 100644 --- a/src/jalview/gui/AssociatePdbFileWithSeq.java +++ b/src/jalview/gui/AssociatePdbFileWithSeq.java @@ -50,8 +50,8 @@ public class AssociatePdbFileWithSeq PDBEntry entry = new PDBEntry(); MCview.PDBfile pdbfile = null; pdbfile = StructureSelectionManager.getStructureSelectionManager(ssmp) - .setMapping(false, new SequenceI[] - { sequence }, null, choice, protocol); + .setMapping(false, new SequenceI[] { sequence }, null, choice, + protocol); if (pdbfile == null) { // stacktrace already thrown so just return diff --git a/src/jalview/gui/BlogReader.java b/src/jalview/gui/BlogReader.java index a3e695a..2e72e17 100644 --- a/src/jalview/gui/BlogReader.java +++ b/src/jalview/gui/BlogReader.java @@ -331,7 +331,8 @@ public class BlogReader extends JPanel { createDialog(); bounds = new Rectangle(5, 5, 550, 350); - jd.initDialogFrame(me, false, false, MessageManager.getString("label.news_from_jalview"), + jd.initDialogFrame(me, false, false, + MessageManager.getString("label.news_from_jalview"), bounds.width, bounds.height); jd.frame.setModalExclusionType(ModalExclusionType.NO_EXCLUDE); Cache.log.debug("Displaying news."); @@ -440,7 +441,9 @@ public class BlogReader extends JPanel topBottomSplitPane.setBottomComponent(bottomPanel); JScrollPane spTextDescription = new JScrollPane(textDescription); textDescription.setText(""); - statusBar.setText(new StringBuffer("[").append(MessageManager.getString("label.status")).append("]").toString()); + statusBar.setText(new StringBuffer("[") + .append(MessageManager.getString("label.status")).append("]") + .toString()); buttonRefresh.addActionListener(new ActionListener() { @@ -819,8 +822,7 @@ class ChannelsRenderer extends DefaultListCellRenderer component .setText(MessageManager.formatMessage( "label.channel_title_item_count", - new String[] - { + new String[] { channel.getTitle(), Integer.valueOf(channel.getUnreadItemCount()) .toString() })); @@ -848,8 +850,7 @@ class ItemsRenderer extends DefaultListCellRenderer { component.setText(MessageManager.formatMessage( "label.blog_item_published_on_date", - new String[] - { + new String[] { DateFormat .getDateInstance(DateFormat.LONG, MessageManager.getLocale()) diff --git a/src/jalview/gui/ChimeraViewFrame.java b/src/jalview/gui/ChimeraViewFrame.java index 967d93f..09451dc 100644 --- a/src/jalview/gui/ChimeraViewFrame.java +++ b/src/jalview/gui/ChimeraViewFrame.java @@ -156,8 +156,8 @@ public class ChimeraViewFrame extends StructureViewerBase alignStructs.setToolTipText(MessageManager .formatMessage( "label.align_structures_using_linked_alignment_views", - new Object[] - { new Integer(_alignwith.size()).toString() })); + new Object[] { new Integer(_alignwith + .size()).toString() })); } }); handler.itemStateChanged(null); @@ -298,7 +298,8 @@ public class ChimeraViewFrame extends StructureViewerBase String chain = null; if (seq.getDatasetSequence() != null) { - Vector pdbrefs = seq.getDatasetSequence().getAllPDBEntries(); + Vector pdbrefs = seq.getDatasetSequence() + .getAllPDBEntries(); if (pdbrefs != null && pdbrefs.size() > 0) { chain = pdbrefs.get(0).getChainCode(); @@ -323,8 +324,7 @@ public class ChimeraViewFrame extends StructureViewerBase * @param newViewId */ public ChimeraViewFrame(String chimeraSessionFile, - AlignmentPanel alignPanel, - PDBEntry[] pdbArray, + AlignmentPanel alignPanel, PDBEntry[] pdbArray, SequenceI[][] seqsArray, boolean colourByChimera, boolean colourBySequence, String newViewId) { @@ -414,14 +414,13 @@ public class ChimeraViewFrame extends StructureViewerBase void initChimera() { jmb.setFinishedInit(false); - jalview.gui.Desktop.addInternalFrame(this, jmb.getViewerTitle("Chimera", true), - getBounds().width, getBounds().height); + jalview.gui.Desktop.addInternalFrame(this, + jmb.getViewerTitle("Chimera", true), getBounds().width, + getBounds().height); if (!jmb.launchChimera()) { - JOptionPane - .showMessageDialog( - Desktop.desktop, + JOptionPane.showMessageDialog(Desktop.desktop, MessageManager.getString("label.chimera_failed"), MessageManager.getString("label.error_loading_file"), JOptionPane.ERROR_MESSAGE); @@ -531,8 +530,8 @@ public class ChimeraViewFrame extends StructureViewerBase if (!closeChimera) { String prompt = MessageManager.formatMessage( - "label.confirm_close_chimera", new Object[] - { jmb.getViewerTitle("Chimera", false) }); + "label.confirm_close_chimera", + new Object[] { jmb.getViewerTitle("Chimera", false) }); prompt = JvSwingUtils.wrapTooltip(true, prompt); int confirm = JOptionPane.showConfirmDialog(this, prompt, MessageManager.getString("label.close_viewer"), @@ -625,9 +624,8 @@ public class ChimeraViewFrame extends StructureViewerBase JOptionPane.showInternalMessageDialog(Desktop.desktop, MessageManager .formatMessage("label.pdb_entries_couldnt_be_retrieved", - new Object[] - { errormsgs.toString() }), MessageManager - .getString("label.couldnt_load_file"), + new Object[] { errormsgs.toString() }), + MessageManager.getString("label.couldnt_load_file"), JOptionPane.ERROR_MESSAGE); } @@ -672,9 +670,7 @@ public class ChimeraViewFrame extends StructureViewerBase } // Explicitly map to the filename used by Chimera ; jmb.getSsm().setMapping(jmb.getSequence()[pos], - jmb.getChains()[pos], - pe.getFile(), - protocol); + jmb.getChains()[pos], pe.getFile(), protocol); } catch (OutOfMemoryError oomerror) { new OOMWarning( @@ -737,8 +733,7 @@ public class ChimeraViewFrame extends StructureViewerBase * Write 'fetching PDB' progress on AlignFrame as we are not yet visible */ String msg = MessageManager.formatMessage("status.fetching_pdb", - new Object[] - { pdbid }); + new Object[] { pdbid }); getAlignmentPanel().alignFrame.setProgressBar(msg, handle); // long hdl = startProgressBar(MessageManager.formatMessage( // "status.fetching_pdb", new Object[] @@ -751,8 +746,7 @@ public class ChimeraViewFrame extends StructureViewerBase new OOMWarning("Retrieving PDB id " + pdbid, oomerror); } finally { - msg = pdbid + " " - + MessageManager.getString("label.state_completed"); + msg = pdbid + " " + MessageManager.getString("label.state_completed"); getAlignmentPanel().alignFrame.setProgressBar(msg, handle); // stopProgressBar(msg, hdl); } diff --git a/src/jalview/gui/Console.java b/src/jalview/gui/Console.java index 4ab7586..280b4c0 100644 --- a/src/jalview/gui/Console.java +++ b/src/jalview/gui/Console.java @@ -22,10 +22,25 @@ package jalview.gui; import jalview.util.MessageManager; -import java.io.*; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.GraphicsEnvironment; +import java.awt.Rectangle; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.event.WindowListener; +import java.io.IOException; +import java.io.PipedInputStream; +import java.io.PipedOutputStream; +import java.io.PrintStream; + +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; import org.apache.log4j.SimpleLayout; @@ -501,7 +516,8 @@ public class Console extends WindowAdapter implements WindowListener, } catch (InterruptedException ie) { } - throw new NullPointerException(MessageManager.getString("exception.application_test_npe")); + throw new NullPointerException( + MessageManager.getString("exception.application_test_npe")); } } diff --git a/src/jalview/gui/CutAndPasteHtmlTransfer.java b/src/jalview/gui/CutAndPasteHtmlTransfer.java index ea5c75e..7d5d8d7 100644 --- a/src/jalview/gui/CutAndPasteHtmlTransfer.java +++ b/src/jalview/gui/CutAndPasteHtmlTransfer.java @@ -20,20 +20,28 @@ */ package jalview.gui; -import java.awt.*; -import java.awt.datatransfer.*; -import java.awt.event.*; +import jalview.io.JalviewFileChooser; +import jalview.io.JalviewFileView; +import jalview.jbgui.GCutAndPasteHtmlTransfer; +import jalview.util.MessageManager; +import jalview.viewmodel.AlignmentViewport; + +import java.awt.Toolkit; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.StringSelection; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.awt.event.MouseEvent; import java.io.StringWriter; -import javax.swing.*; +import javax.swing.JMenuItem; +import javax.swing.JPopupMenu; +import javax.swing.SwingUtilities; import javax.swing.event.HyperlinkEvent; -import javax.swing.event.HyperlinkListener; import javax.swing.event.HyperlinkEvent.EventType; - -import jalview.io.*; -import jalview.jbgui.*; -import jalview.util.MessageManager; -import jalview.viewmodel.AlignmentViewport; +import javax.swing.event.HyperlinkListener; /** * Cut'n'paste files into the desktop See JAL-1105 @@ -142,7 +150,8 @@ public class CutAndPasteHtmlTransfer extends GCutAndPasteHtmlTransfer chooser.setAcceptAllFileFilterUsed(false); chooser.setFileView(new JalviewFileView()); - chooser.setDialogTitle(MessageManager.getString("label.save_text_to_file")); + chooser.setDialogTitle(MessageManager + .getString("label.save_text_to_file")); chooser.setToolTipText(MessageManager.getString("action.save")); int value = chooser.showSaveDialog(this); diff --git a/src/jalview/gui/CutAndPasteTransfer.java b/src/jalview/gui/CutAndPasteTransfer.java index cd5c792..f5a8e1c 100644 --- a/src/jalview/gui/CutAndPasteTransfer.java +++ b/src/jalview/gui/CutAndPasteTransfer.java @@ -66,6 +66,7 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer AlignViewportI viewport; FileParse source = null; + public CutAndPasteTransfer() { SwingUtilities.invokeLater(new Runnable() @@ -129,7 +130,8 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer chooser.setAcceptAllFileFilterUsed(false); chooser.setFileView(new JalviewFileView()); - chooser.setDialogTitle(MessageManager.getString("label.save_text_to_file")); + chooser.setDialogTitle(MessageManager + .getString("label.save_text_to_file")); chooser.setToolTipText(MessageManager.getString("action.save")); int value = chooser.showSaveDialog(this); @@ -233,8 +235,8 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer { JOptionPane.showInternalMessageDialog(Desktop.desktop, MessageManager.formatMessage( - "label.couldnt_read_pasted_text", new String[] - { ex.toString() }), MessageManager + "label.couldnt_read_pasted_text", + new String[] { ex.toString() }), MessageManager .getString("label.error_parsing_text"), JOptionPane.WARNING_MESSAGE); } @@ -243,8 +245,7 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer if (al != null && al.hasValidSequence()) { String title = MessageManager.formatMessage( - "label.input_cut_paste_params", new String[] - { format }); + "label.input_cut_paste_params", new String[] { format }); if (viewport != null) { ((AlignViewport) viewport).addAlignment(al, title); @@ -265,8 +266,7 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer FeaturesDisplayedI fd = ((ComplexAlignFile) source) .getDisplayedFeatures(); af = new AlignFrame(al, hiddenSeqs, colSel, - AlignFrame.DEFAULT_WIDTH, - AlignFrame.DEFAULT_HEIGHT); + AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); af.getViewport().setShowSequenceFeatures(showSeqFeatures); af.getViewport().setFeaturesDisplayed(fd); af.changeColour(cs); @@ -306,7 +306,6 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer } } - /** * DOCUMENT ME! * diff --git a/src/jalview/gui/DasSourceBrowser.java b/src/jalview/gui/DasSourceBrowser.java index fab4cb3..53e3c8d 100644 --- a/src/jalview/gui/DasSourceBrowser.java +++ b/src/jalview/gui/DasSourceBrowser.java @@ -20,6 +20,12 @@ */ package jalview.gui; +import jalview.jbgui.GDasSourceBrowser; +import jalview.util.MessageManager; +import jalview.util.TableSorter; +import jalview.ws.dbsources.das.api.DasSourceRegistryI; +import jalview.ws.dbsources.das.api.jalviewSourceI; + import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.MouseAdapter; @@ -46,12 +52,6 @@ import org.biodas.jdas.schema.sources.COORDINATES; import org.biodas.jdas.schema.sources.PROP; import org.biodas.jdas.schema.sources.VERSION; -import jalview.jbgui.GDasSourceBrowser; -import jalview.util.MessageManager; -import jalview.util.TableSorter; -import jalview.ws.dbsources.das.api.DasSourceRegistryI; -import jalview.ws.dbsources.das.api.jalviewSourceI; - public class DasSourceBrowser extends GDasSourceBrowser implements Runnable, ListSelectionListener { @@ -535,8 +535,7 @@ public class DasSourceBrowser extends GDasSourceBrowser implements return; } - Object[] options = - { "Edit", "Remove", "Cancel" }; + Object[] options = { "Edit", "Remove", "Cancel" }; int choice = JOptionPane.showInternalOptionDialog(Desktop.desktop, "Do you want to edit or remove " + nickname + "?", "Edit / Remove Local DAS Source", @@ -601,8 +600,7 @@ public class DasSourceBrowser extends GDasSourceBrowser implements // The features filter is not visible, but we must still // filter the das source list here. // July 2006 - only 6 sources fo not serve features - Object[] dummyFeatureList = new Object[] - { "features" }; + Object[] dummyFeatureList = new Object[] { "features" }; List srcs = sourceRegistry.getSources(); for (jalviewSourceI ds : srcs) { @@ -632,8 +630,8 @@ public class DasSourceBrowser extends GDasSourceBrowser implements for (int j = 0; j < coords.size(); j++) { - if (selectedInList(filter1.getSelectedValues(), new String[] - { coords.get(j).getAuthority() }) + if (selectedInList(filter1.getSelectedValues(), + new String[] { coords.get(j).getAuthority() }) && selectedInList(filter2.getSelectedValues(), new String[] { coords.get(j).getSource() })) { @@ -739,8 +737,9 @@ public class DasSourceBrowser extends GDasSourceBrowser implements this.data = data; } - private String[] columnNames = new String[] - { MessageManager.getString("label.nickname"), MessageManager.getString("label.use_source") }; + private String[] columnNames = new String[] { + MessageManager.getString("label.nickname"), + MessageManager.getString("label.use_source") }; private Object[][] data; diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 2a360cc..270805a 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -1106,8 +1106,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements { JOptionPane.showInternalMessageDialog(Desktop.desktop, MessageManager.formatMessage("label.couldnt_locate", - new Object[] - { url }), MessageManager + new Object[] { url }), MessageManager .getString("label.url_not_found"), JOptionPane.WARNING_MESSAGE); @@ -1495,9 +1494,9 @@ 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[] - { "jvp" }, new String[] - { "Jalview Project" }, "Jalview Project"); + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), + new String[] { "jvp" }, new String[] { "Jalview Project" }, + "Jalview Project"); chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle(MessageManager.getString("label.save_state")); @@ -1516,8 +1515,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements { // TODO: refactor to Jalview desktop session controller action. setProgressBar(MessageManager.formatMessage( - "label.saving_jalview_project", new Object[] - { choice.getName() }), choice.hashCode()); + "label.saving_jalview_project", + new Object[] { choice.getName() }), choice.hashCode()); jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice.getParent()); // TODO catch and handle errors for savestate @@ -1536,8 +1535,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements ex); JOptionPane.showMessageDialog(me, MessageManager.formatMessage( "label.error_whilst_saving_current_state_to", - new Object[] - { choice.getName() }), MessageManager + new Object[] { choice.getName() }), MessageManager .getString("label.couldnt_save_project"), JOptionPane.WARNING_MESSAGE); } @@ -1567,10 +1565,9 @@ 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[] - { "jvp", "jar" }, new String[] - { "Jalview Project", "Jalview Project (old)" }, - "Jalview Project"); + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] { + "jvp", "jar" }, new String[] { "Jalview Project", + "Jalview Project (old)" }, "Jalview Project"); chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle(MessageManager.getString("label.restore_state")); @@ -1587,9 +1584,10 @@ public class Desktop extends jalview.jbgui.GDesktop implements { public void run() { - setProgressBar(MessageManager.formatMessage( - "label.loading_jalview_project", new Object[] - { choice }), choice.hashCode()); + setProgressBar( + MessageManager.formatMessage( + "label.loading_jalview_project", + new Object[] { choice }), choice.hashCode()); try { new Jalview2XML().loadJalviewAlign(choice); @@ -1603,8 +1601,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements JOptionPane.showMessageDialog(Desktop.desktop, MessageManager .formatMessage( "label.error_whilst_loading_project_from", - new Object[] - { choice }), MessageManager + new Object[] { choice }), MessageManager .getString("label.couldnt_load_project"), JOptionPane.WARNING_MESSAGE); } @@ -1629,8 +1626,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements if (fileLoadingCount == 0) { fileLoadingPanels.add(addProgressPanel(MessageManager.formatMessage( - "label.loading_file", new Object[] - { fileName }))); + "label.loading_file", new Object[] { fileName }))); } fileLoadingCount++; } @@ -1724,7 +1720,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements { for (AlignmentPanel ap : af.alignPanels) { - if (alignmentId==null || alignmentId.equals(ap.av.getSequenceSetId())) + if (alignmentId == null + || alignmentId.equals(ap.av.getSequenceSetId())) { aps.add(ap); } @@ -1755,7 +1752,9 @@ public class Desktop extends jalview.jbgui.GDesktop implements for (AlignFrame afr : frames) { - if (sequenceSetId==null || afr.getViewport().getSequenceSetId().equals(sequenceSetId)) + if (sequenceSetId == null + || afr.getViewport().getSequenceSetId() + .equals(sequenceSetId)) { if (afr.alignPanels != null) { @@ -1894,8 +1893,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements Desktop.desktop, MessageManager.formatMessage( "label.couldnt_import_as_vamsas_session", - new Object[] - { fle }), + new Object[] { fle }), MessageManager .getString("label.vamsas_document_import_failed"), JOptionPane.ERROR_MESSAGE); @@ -1972,16 +1970,16 @@ public class Desktop extends jalview.jbgui.GDesktop implements } setProgressBar(MessageManager.formatMessage( - "status.importing_vamsas_session_from", new Object[] - { file.getName() }), file.hashCode()); + "status.importing_vamsas_session_from", + new Object[] { file.getName() }), file.hashCode()); try { v_client = new jalview.gui.VamsasApplication(this, file, null); } catch (Exception ex) { setProgressBar(MessageManager.formatMessage( - "status.importing_vamsas_session_from", new Object[] - { file.getName() }), file.hashCode()); + "status.importing_vamsas_session_from", + new Object[] { file.getName() }), file.hashCode()); jalview.bin.Cache.log.error( "New vamsas session from existing session file failed:", ex); return false; @@ -1989,8 +1987,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements setupVamsasConnectedGui(); v_client.initial_update(); // TODO: thread ? setProgressBar(MessageManager.formatMessage( - "status.importing_vamsas_session_from", new Object[] - { file.getName() }), file.hashCode()); + "status.importing_vamsas_session_from", + new Object[] { file.getName() }), file.hashCode()); return v_client.inSession(); } @@ -2097,8 +2095,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements JMenuItem sessit = new JMenuItem(); sessit.setText(sess[i]); sessit.setToolTipText(MessageManager.formatMessage( - "label.connect_to_session", new Object[] - { sess[i] })); + "label.connect_to_session", new Object[] { sess[i] })); final Desktop dsktp = this; final String mysesid = sess[i]; sessit.addActionListener(new ActionListener() @@ -2151,8 +2148,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements 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"); + new String[] { "Vamsas Document" }, "Vamsas Document"); chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle(MessageManager @@ -2164,8 +2160,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements { java.io.File choice = chooser.getSelectedFile(); JPanel progpanel = addProgressPanel(MessageManager.formatMessage( - "label.saving_vamsas_doc", new Object[] - { choice.getName() })); + "label.saving_vamsas_doc", + new Object[] { choice.getName() })); jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice.getParent()); String warnmsg = null; String warnttl = null; @@ -2331,9 +2327,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements { g.drawString(MessageManager.formatMessage( "label.memory_stats", - new Object[] - { df.format(totalFreeMemory), df.format(maxMemory), - df.format(percentUsage) }), 10, + new Object[] { df.format(totalFreeMemory), + df.format(maxMemory), df.format(percentUsage) }), 10, getHeight() - fm.getHeight()); } } @@ -2463,12 +2458,10 @@ public class Desktop extends jalview.jbgui.GDesktop implements "groovy.ui.Console"); Constructor gccons = gcClass.getConstructor(); java.lang.reflect.Method setvar = gcClass.getMethod("setVariable", - new Class[] - { String.class, Object.class }); + new Class[] { String.class, Object.class }); java.lang.reflect.Method run = gcClass.getMethod("run"); Object gc = gccons.newInstance(); - setvar.invoke(gc, new Object[] - { "Jalview", this }); + setvar.invoke(gc, new Object[] { "Jalview", this }); run.invoke(gc); } catch (Exception ex) { @@ -2546,9 +2539,9 @@ public class Desktop extends jalview.jbgui.GDesktop implements { handler.cancelActivity(id); us.setProgressBar(MessageManager.formatMessage( - "label.cancelled_params", new Object[] - { ((JLabel) progressPanel.getComponent(0)).getText() }), - id); + "label.cancelled_params", + new Object[] { ((JLabel) progressPanel.getComponent(0)) + .getText() }), id); } }); progressPanel.add(cancel, BorderLayout.EAST); @@ -2570,8 +2563,9 @@ public class Desktop extends jalview.jbgui.GDesktop implements } /** - * This will return the first AlignFrame holding the given viewport instance. It - * will break if there are more than one AlignFrames viewing a particular av. + * This will return the first AlignFrame holding the given viewport instance. + * It will break if there are more than one AlignFrames viewing a particular + * av. * * @param viewport * @return alignFrame for viewport @@ -2580,8 +2574,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements { if (desktop != null) { - AlignmentPanel[] aps = getAlignmentPanels(viewport - .getSequenceSetId()); + AlignmentPanel[] aps = getAlignmentPanels(viewport.getSequenceSetId()); for (int panel = 0; aps != null && panel < aps.length; panel++) { if (aps[panel] != null && aps[panel].av == viewport) @@ -2790,8 +2783,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements if (progress != null) { progress.setProgressBar(MessageManager.formatMessage( - "status.opening_params", new Object[] - { url }), this.hashCode()); + "status.opening_params", new Object[] { url }), this + .hashCode()); } jalview.util.BrowserLauncher.openURL(url); } catch (Exception ex) @@ -3020,7 +3013,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements myBottomFrame.viewport.setGatherViewsHere(true); String topViewId = myTopFrame.viewport.getSequenceSetId(); String bottomViewId = myBottomFrame.viewport.getSequenceSetId(); - + JInternalFrame[] frames = desktop.getAllFrames(); for (JInternalFrame frame : frames) { @@ -3048,7 +3041,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements myBottomFrame.addAlignmentPanel(bottomPanel, false); } } - + if (gatherThis) { topFrame.getAlignPanels().clear(); @@ -3075,5 +3068,4 @@ public class Desktop extends jalview.jbgui.GDesktop implements Desktop.currentAlignFrame = currentAlignFrame; } - } diff --git a/src/jalview/gui/EPSOptions.java b/src/jalview/gui/EPSOptions.java index b5c3762..69fde89 100644 --- a/src/jalview/gui/EPSOptions.java +++ b/src/jalview/gui/EPSOptions.java @@ -22,9 +22,19 @@ package jalview.gui; import jalview.util.MessageManager; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; +import java.awt.BorderLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.BorderFactory; +import javax.swing.ButtonGroup; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JDialog; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JRadioButton; public class EPSOptions extends JPanel { @@ -49,8 +59,7 @@ public class EPSOptions extends JPanel bg.add(text); JOptionPane pane = new JOptionPane(null, JOptionPane.DEFAULT_OPTION, - JOptionPane.DEFAULT_OPTION, null, new Object[] - { this }); + JOptionPane.DEFAULT_OPTION, null, new Object[] { this }); dialog = pane.createDialog(Desktop.desktop, "EPS Rendering options"); dialog.setVisible(true); diff --git a/src/jalview/gui/EditNameDialog.java b/src/jalview/gui/EditNameDialog.java index e88dcae..baad794 100644 --- a/src/jalview/gui/EditNameDialog.java +++ b/src/jalview/gui/EditNameDialog.java @@ -22,8 +22,15 @@ package jalview.gui; import jalview.util.MessageManager; -import java.awt.*; -import javax.swing.*; +import java.awt.BorderLayout; +import java.awt.Font; + +import javax.swing.JButton; +import javax.swing.JComponent; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTextField; public class EditNameDialog { diff --git a/src/jalview/gui/FeatureColourChooser.java b/src/jalview/gui/FeatureColourChooser.java index 7f76760..625cccc 100644 --- a/src/jalview/gui/FeatureColourChooser.java +++ b/src/jalview/gui/FeatureColourChooser.java @@ -20,19 +20,32 @@ */ package jalview.gui; -import java.util.*; - -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import javax.swing.border.LineBorder; -import javax.swing.event.*; - -import jalview.datamodel.*; -import jalview.schemes.*; +import jalview.datamodel.GraphLine; +import jalview.schemes.AnnotationColourGradient; +import jalview.schemes.GraduatedColor; import jalview.util.MessageManager; +import java.awt.BorderLayout; +import java.awt.Color; import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.Hashtable; + +import javax.swing.BorderFactory; +import javax.swing.JCheckBox; +import javax.swing.JColorChooser; +import javax.swing.JComboBox; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JSlider; +import javax.swing.JTextField; +import javax.swing.border.LineBorder; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; public class FeatureColourChooser extends JalviewDialog { diff --git a/src/jalview/gui/FeatureRenderer.java b/src/jalview/gui/FeatureRenderer.java index 9e09bfb..a0f1b80 100644 --- a/src/jalview/gui/FeatureRenderer.java +++ b/src/jalview/gui/FeatureRenderer.java @@ -55,7 +55,9 @@ import javax.swing.SwingConstants; * @author $author$ * @version $Revision$ */ -public class FeatureRenderer extends jalview.renderer.seqfeatures.FeatureRenderer implements jalview.api.FeatureRenderer +public class FeatureRenderer extends + jalview.renderer.seqfeatures.FeatureRenderer implements + jalview.api.FeatureRenderer { Color resBoxColour; @@ -72,7 +74,8 @@ public class FeatureRenderer extends jalview.renderer.seqfeatures.FeatureRendere super(); this.ap = ap; this.av = ap.av; - if (ap != null && ap.getSeqPanel() != null && ap.getSeqPanel().seqCanvas != null + if (ap != null && ap.getSeqPanel() != null + && ap.getSeqPanel().seqCanvas != null && ap.getSeqPanel().seqCanvas.fr != null) { transferSettings(ap.getSeqPanel().seqCanvas.fr); @@ -123,7 +126,8 @@ public class FeatureRenderer extends jalview.renderer.seqfeatures.FeatureRendere if (fcol instanceof Color) { Color col = JColorChooser.showDialog(Desktop.desktop, - MessageManager.getString("label.select_feature_colour"), ((Color) fcol)); + MessageManager.getString("label.select_feature_colour"), + ((Color) fcol)); if (col != null) { fcol = col; @@ -306,21 +310,22 @@ public class FeatureRenderer extends jalview.renderer.seqfeatures.FeatureRendere Object[] options; if (!newFeatures) { - options = new Object[] - { "Amend", "Delete", "Cancel" }; + options = new Object[] { "Amend", "Delete", "Cancel" }; } else { - options = new Object[] - { "OK", "Cancel" }; + options = new Object[] { "OK", "Cancel" }; } - String title = newFeatures ? MessageManager.getString("label.create_new_sequence_features") - : MessageManager.formatMessage("label.amend_delete_features", new String[]{sequences[0].getName()}); + String title = newFeatures ? MessageManager + .getString("label.create_new_sequence_features") + : MessageManager.formatMessage("label.amend_delete_features", + new String[] { sequences[0].getName() }); int reply = JOptionPane.showInternalOptionDialog(Desktop.desktop, bigPanel, title, JOptionPane.YES_NO_CANCEL_OPTION, - JOptionPane.QUESTION_MESSAGE, null, options, MessageManager.getString("action.ok")); + JOptionPane.QUESTION_MESSAGE, null, options, + MessageManager.getString("action.ok")); jalview.io.FeaturesFile ffile = new jalview.io.FeaturesFile(); @@ -406,7 +411,6 @@ public class FeatureRenderer extends jalview.renderer.seqfeatures.FeatureRendere return true; } - /** * update the amend feature button dependent on the given style * diff --git a/src/jalview/gui/FeatureSettings.java b/src/jalview/gui/FeatureSettings.java index 940a216..6b58b51 100644 --- a/src/jalview/gui/FeatureSettings.java +++ b/src/jalview/gui/FeatureSettings.java @@ -125,7 +125,8 @@ public class FeatureSettings extends JPanel implements this.af = af; fr = af.getFeatureRenderer(); // allow transparency to be recovered - transparency.setMaximum(100 - (int) ((originalTransparency=fr.getTransparency()) * 100)); + transparency.setMaximum(100 - (int) ((originalTransparency = fr + .getTransparency()) * 100)); try { @@ -135,15 +136,18 @@ public class FeatureSettings extends JPanel implements ex.printStackTrace(); } - table = new JTable() { + table = new JTable() + { @Override - public String getToolTipText(MouseEvent e) { - if (table.columnAtPoint(e.getPoint()) == 0) { + public String getToolTipText(MouseEvent e) + { + if (table.columnAtPoint(e.getPoint()) == 0) + { /* * Tooltip for feature name only */ - return JvSwingUtils.wrapTooltip(true, - MessageManager.getString("label.feature_settings_click_drag")); + return JvSwingUtils.wrapTooltip(true, MessageManager + .getString("label.feature_settings_click_drag")); } return null; } @@ -187,8 +191,7 @@ public class FeatureSettings extends JPanel implements { popupSort(selectedRow, (String) table.getValueAt(selectedRow, 0), table.getValueAt(selectedRow, 1), fr.getMinMax(), - evt.getX(), - evt.getY()); + evt.getX(), evt.getY()); } } }); @@ -217,8 +220,8 @@ public class FeatureSettings extends JPanel implements } } }); -// table.setToolTipText(JvSwingUtils.wrapTooltip(true, -// MessageManager.getString("label.feature_settings_click_drag"))); + // table.setToolTipText(JvSwingUtils.wrapTooltip(true, + // MessageManager.getString("label.feature_settings_click_drag"))); scrollPane.setViewportView(table); dassourceBrowser = new DasSourceBrowser(this); @@ -278,8 +281,7 @@ public class FeatureSettings extends JPanel implements final Object typeCol, final Hashtable minmax, int x, int y) { JPopupMenu men = new JPopupMenu(MessageManager.formatMessage( - "label.settings_for_param", new String[] - { type })); + "label.settings_for_param", new String[] { type })); JMenuItem scr = new JMenuItem( MessageManager.getString("label.sort_by_score")); men.add(scr); @@ -289,8 +291,7 @@ public class FeatureSettings extends JPanel implements public void actionPerformed(ActionEvent e) { - me.af.avc.sortAlignmentByFeatureScore(new String[] - { type }); + me.af.avc.sortAlignmentByFeatureScore(new String[] { type }); } }); @@ -301,8 +302,7 @@ public class FeatureSettings extends JPanel implements public void actionPerformed(ActionEvent e) { - me.af.avc.sortAlignmentByFeatureDensity(new String[] - { type }); + me.af.avc.sortAlignmentByFeatureDensity(new String[] { type }); } }); @@ -516,8 +516,7 @@ public class FeatureSettings extends JPanel implements af.alignPanel.overviewPanel.updateOverviewImage(); } - resetTable(new String[] - { grp }); + resetTable(new String[] { grp }); } }); groupPanel.add(check); @@ -705,11 +704,13 @@ public class FeatureSettings extends JPanel implements void load() { JalviewFileChooser chooser = new JalviewFileChooser( - jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] - { "fc" }, new String[] - { "Sequence Feature Colours" }, "Sequence Feature Colours"); + 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(MessageManager.getString("label.load_feature_colours")); + chooser.setDialogTitle(MessageManager + .getString("label.load_feature_colours")); chooser.setToolTipText(MessageManager.getString("action.load")); int value = chooser.showOpenDialog(this); @@ -724,8 +725,7 @@ public class FeatureSettings extends JPanel implements file), "UTF-8"); jalview.schemabinding.version2.JalviewUserColours jucs = new jalview.schemabinding.version2.JalviewUserColours(); - jucs = jucs - .unmarshal(in); + jucs = jucs.unmarshal(in); for (int i = jucs.getColourCount() - 1; i >= 0; i--) { @@ -803,11 +803,13 @@ public class FeatureSettings extends JPanel implements void save() { JalviewFileChooser chooser = new JalviewFileChooser( - jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] - { "fc" }, new String[] - { "Sequence Feature Colours" }, "Sequence Feature Colours"); + 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(MessageManager.getString("label.save_feature_colours")); + chooser.setDialogTitle(MessageManager + .getString("label.save_feature_colours")); chooser.setToolTipText(MessageManager.getString("action.save")); int value = chooser.showSaveDialog(this); @@ -942,9 +944,9 @@ public class FeatureSettings extends JPanel implements } } if (sort) - { + { jalview.util.QuickSort.sort(width, data); - // update global priority order + // update global priority order } updateFeatureRenderer(data, false); @@ -1169,8 +1171,10 @@ public class FeatureSettings extends JPanel implements } }); this.add(tabbedPane, java.awt.BorderLayout.CENTER); - tabbedPane.addTab(MessageManager.getString("label.feature_settings"), settingsPane); - tabbedPane.addTab(MessageManager.getString("label.das_settings"), dasSettingsPane); + tabbedPane.addTab(MessageManager.getString("label.feature_settings"), + settingsPane); + tabbedPane.addTab(MessageManager.getString("label.das_settings"), + dasSettingsPane); bigPanel.add(transPanel, java.awt.BorderLayout.SOUTH); transbuttons.add(optimizeOrder); transbuttons.add(invert); @@ -1364,8 +1368,10 @@ public class FeatureSettings extends JPanel implements this.data = data; } - private String[] columnNames = - { MessageManager.getString("label.feature_type"), MessageManager.getString("action.colour"), MessageManager.getString("label.display") }; + private String[] columnNames = { + MessageManager.getString("label.feature_type"), + MessageManager.getString("action.colour"), + MessageManager.getString("label.display") }; private Object[][] data; diff --git a/src/jalview/gui/Finder.java b/src/jalview/gui/Finder.java index 5d07562..6bff69a 100755 --- a/src/jalview/gui/Finder.java +++ b/src/jalview/gui/Finder.java @@ -20,6 +20,13 @@ */ package jalview.gui; +import jalview.datamodel.SearchResults; +import jalview.datamodel.SequenceFeature; +import jalview.datamodel.SequenceI; +import jalview.jbgui.GFinder; +import jalview.util.MessageManager; +import jalview.viewmodel.AlignmentViewport; + import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import java.util.Vector; @@ -33,13 +40,6 @@ import javax.swing.JLayeredPane; import javax.swing.JOptionPane; import javax.swing.KeyStroke; -import jalview.datamodel.SearchResults; -import jalview.datamodel.SequenceFeature; -import jalview.datamodel.SequenceI; -import jalview.jbgui.GFinder; -import jalview.util.MessageManager; -import jalview.viewmodel.AlignmentViewport; - /** * Performs the menu option for searching the alignment, for the next or all * matches. If matches are found, they are highlighted, and the user has the diff --git a/src/jalview/gui/FontChooser.java b/src/jalview/gui/FontChooser.java index 2ffb166..535196e 100755 --- a/src/jalview/gui/FontChooser.java +++ b/src/jalview/gui/FontChooser.java @@ -20,6 +20,10 @@ */ package jalview.gui; +import jalview.bin.Cache; +import jalview.jbgui.GFontChooser; +import jalview.util.MessageManager; + import java.awt.Font; import java.awt.FontMetrics; import java.awt.event.ActionEvent; @@ -29,10 +33,6 @@ import javax.swing.JInternalFrame; import javax.swing.JLayeredPane; import javax.swing.JOptionPane; -import jalview.bin.Cache; -import jalview.jbgui.GFontChooser; -import jalview.util.MessageManager; - /** * DOCUMENT ME! * @@ -249,11 +249,10 @@ public class FontChooser extends GFontChooser { final String messageKey = iBounds.getHeight() < 1 ? "label.font_doesnt_have_letters_defined" : "label.font_too_small"; - JOptionPane - .showInternalMessageDialog( - this, + JOptionPane.showInternalMessageDialog(this, MessageManager.getString(messageKey), - MessageManager.getString("label.invalid_font"), JOptionPane.WARNING_MESSAGE); + MessageManager.getString("label.invalid_font"), + JOptionPane.WARNING_MESSAGE); /* * Restore the changed value - note this will reinvoke this method via the * ActionListener, but now validation should pass diff --git a/src/jalview/gui/HTMLOptions.java b/src/jalview/gui/HTMLOptions.java index 0ef4710..97cbcb0 100644 --- a/src/jalview/gui/HTMLOptions.java +++ b/src/jalview/gui/HTMLOptions.java @@ -39,8 +39,7 @@ public class HTMLOptions extends JPanel bg.add(text); JOptionPane pane = new JOptionPane(null, JOptionPane.DEFAULT_OPTION, - JOptionPane.DEFAULT_OPTION, null, new Object[] - { this }); + JOptionPane.DEFAULT_OPTION, null, new Object[] { this }); dialog = pane.createDialog(Desktop.desktop, "HTML Rendering options"); dialog.setVisible(true); diff --git a/src/jalview/gui/Help.java b/src/jalview/gui/Help.java index b07cc4e..1224645 100644 --- a/src/jalview/gui/Help.java +++ b/src/jalview/gui/Help.java @@ -52,7 +52,9 @@ public class Help * * This is a workaround for issue JAL-914 - both Desktop and AlignFrame * responding to F1 key, resulting in duplicate help windows opened. - * @param id TODO + * + * @param id + * TODO * * @throws HelpSetException */ diff --git a/src/jalview/gui/IdCanvas.java b/src/jalview/gui/IdCanvas.java index fe42e1e..c89a9d5 100755 --- a/src/jalview/gui/IdCanvas.java +++ b/src/jalview/gui/IdCanvas.java @@ -98,8 +98,7 @@ public class IdCanvas extends JPanel * DOCUMENT ME! */ public void drawIdString(Graphics2D gg, boolean hiddenRows, SequenceI s, - int i, int starty, - int ypos) + int i, int starty, int ypos) { int xPos = 0; int panelWidth = getWidth(); @@ -453,11 +452,9 @@ public class IdCanvas extends JPanel if (below) { gg.fillPolygon( - new int[] - { getWidth() - av.getCharHeight(), - getWidth() - av.getCharHeight(), - getWidth() }, new int[] - { + new int[] { getWidth() - av.getCharHeight(), + getWidth() - av.getCharHeight(), getWidth() }, + new int[] { (i - starty) * av.getCharHeight() + yoffset, (i - starty) * av.getCharHeight() + yoffset + av.getCharHeight() / 4, @@ -466,11 +463,9 @@ public class IdCanvas extends JPanel if (above) { gg.fillPolygon( - new int[] - { getWidth() - av.getCharHeight(), - getWidth() - av.getCharHeight(), - getWidth() }, new int[] - { + new int[] { getWidth() - av.getCharHeight(), + getWidth() - av.getCharHeight(), getWidth() }, + new int[] { (i - starty + 1) * av.getCharHeight() + yoffset, (i - starty + 1) * av.getCharHeight() + yoffset - av.getCharHeight() / 4, diff --git a/src/jalview/gui/IdPanel.java b/src/jalview/gui/IdPanel.java index 88d0c69..5dfe581 100755 --- a/src/jalview/gui/IdPanel.java +++ b/src/jalview/gui/IdPanel.java @@ -109,10 +109,9 @@ public class IdPanel extends JPanel implements MouseListener, { SequenceI sequence = av.getAlignment().getSequenceAt(seq); StringBuffer tip = new StringBuffer(64); - seqAnnotReport - .createSequenceAnnotationReport(tip, sequence, + seqAnnotReport.createSequenceAnnotationReport(tip, sequence, av.isShowDBRefs(), av.isShowNPFeats(), - sp.seqCanvas.fr.getMinMax()); + sp.seqCanvas.fr.getMinMax()); setToolTipText("" + sequence.getDisplayId(true) + " " + tip.toString() + ""); } @@ -245,11 +244,10 @@ public class IdPanel extends JPanel implements MouseListener, jalview.util.BrowserLauncher.openURL(url); } catch (Exception ex) { - JOptionPane - .showInternalMessageDialog( - Desktop.desktop, - MessageManager.getString("label.web_browser_not_found_unix"), - MessageManager.getString("label.web_browser_not_found"), JOptionPane.WARNING_MESSAGE); + JOptionPane.showInternalMessageDialog(Desktop.desktop, + MessageManager.getString("label.web_browser_not_found_unix"), + MessageManager.getString("label.web_browser_not_found"), + JOptionPane.WARNING_MESSAGE); ex.printStackTrace(); } } diff --git a/src/jalview/gui/IdwidthAdjuster.java b/src/jalview/gui/IdwidthAdjuster.java index 3d82256..0c03db1 100755 --- a/src/jalview/gui/IdwidthAdjuster.java +++ b/src/jalview/gui/IdwidthAdjuster.java @@ -20,6 +20,8 @@ */ package jalview.gui; +import jalview.api.AlignViewportI; + import java.awt.Color; import java.awt.Graphics; import java.awt.Image; @@ -29,8 +31,6 @@ import java.awt.event.MouseMotionListener; import javax.swing.JPanel; -import jalview.api.AlignViewportI; - /** * DOCUMENT ME! * diff --git a/src/jalview/gui/JDatabaseTree.java b/src/jalview/gui/JDatabaseTree.java index 207c600..a886723 100644 --- a/src/jalview/gui/JDatabaseTree.java +++ b/src/jalview/gui/JDatabaseTree.java @@ -88,7 +88,9 @@ public class JDatabaseTree extends JalviewDialog implements KeyListener public JDatabaseTree(jalview.ws.SequenceFetcher sfetch) { - initDialogFrame(this, true, false, MessageManager.getString("label.select_database_retrieval_source"), + initDialogFrame(this, true, false, + MessageManager + .getString("label.select_database_retrieval_source"), 650, 490); /* * Dynamically generated database list will need a translation function from @@ -221,7 +223,9 @@ public class JDatabaseTree extends JalviewDialog implements KeyListener } else { - throw new Error(MessageManager.getString("error.implementation_error_cant_reorder_tree")); + throw new Error( + MessageManager + .getString("error.implementation_error_cant_reorder_tree")); } } jalview.util.QuickSort.sort(names, nodes); @@ -412,8 +416,7 @@ public class JDatabaseTree extends JalviewDialog implements KeyListener if (allowMultiSelections) { dbstatus.setText(MessageManager.formatMessage( - "label.selected_database_to_fetch_from", new String[] - { + "label.selected_database_to_fetch_from", new String[] { Integer.valueOf(srcs.size()).toString(), (srcs.size() == 1 ? "" : "s"), (srcs.size() > 0 ? " with " + x + " test quer" @@ -425,13 +428,11 @@ public class JDatabaseTree extends JalviewDialog implements KeyListener if (nm.length() > 0) { dbstatus.setText(MessageManager.formatMessage( - "label.database_param", new String[] - { nm })); + "label.database_param", new String[] { nm })); if (qr.length() > 0) { dbstatex.setText(MessageManager.formatMessage( - "label.example_param", new String[] - { qr })); + "label.example_param", new String[] { qr })); } else { diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index 2f90e91..f87fbe5 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -1854,8 +1854,8 @@ public class Jalview2XML } } throw new Error(MessageManager.formatMessage( - "error.unsupported_version_calcIdparam", new Object[] - { calcIdParam.toString() })); + "error.unsupported_version_calcIdparam", + new Object[] { calcIdParam.toString() })); } /** @@ -2839,8 +2839,8 @@ public class Jalview2XML else { // defer to later - frefedSequence.add(new Object[] - { maps[m].getDnasq(), cf, mapping }); + frefedSequence.add(new Object[] { maps[m].getDnasq(), cf, + mapping }); } } } @@ -4583,8 +4583,8 @@ public class Jalview2XML /** * Kludge for magic autoannotation names (see JAL-811) */ - String[] magicNames = new String[] - { "Consensus", "Quality", "Conservation" }; + String[] magicNames = new String[] { "Consensus", "Quality", + "Conservation" }; JvAnnotRow nullAnnot = new JvAnnotRow(-1, null); Hashtable visan = new Hashtable(); for (String nm : magicNames) @@ -4994,8 +4994,7 @@ public class Jalview2XML } else { - frefedSequence.add(new Object[] - { dsfor, jmap }); + frefedSequence.add(new Object[] { dsfor, jmap }); } } else diff --git a/src/jalview/gui/Jalview2XML_V1.java b/src/jalview/gui/Jalview2XML_V1.java index cb572cd..b551f5d 100755 --- a/src/jalview/gui/Jalview2XML_V1.java +++ b/src/jalview/gui/Jalview2XML_V1.java @@ -161,8 +161,7 @@ public class Jalview2XML_V1 + "\n"); JOptionPane.showInternalMessageDialog(Desktop.desktop, MessageManager.formatMessage("label.couldnt_locate", - new String[] - { file }), MessageManager + new String[] { file }), MessageManager .getString("label.url_not_found"), JOptionPane.WARNING_MESSAGE); } @@ -181,7 +180,10 @@ public class Jalview2XML_V1 { JOptionPane.showInternalMessageDialog(Desktop.desktop, - MessageManager.formatMessage("label.error_loading_file_params", new String[]{file}), MessageManager.getString("label.error_loading_jalview_file"), + MessageManager.formatMessage( + "label.error_loading_file_params", new String[] + { file }), MessageManager + .getString("label.error_loading_jalview_file"), JOptionPane.WARNING_MESSAGE); } }); @@ -348,8 +350,7 @@ public class Jalview2XML_V1 for (int s = 0; s < ids.length; s++) { - seqs.addElement(seqids - .elementAt(ids[s])); + seqs.addElement(seqids.elementAt(ids[s])); } jalview.datamodel.SequenceGroup sg = new jalview.datamodel.SequenceGroup( @@ -435,19 +436,21 @@ public class Jalview2XML_V1 { Setting setting = jms.getFeatureSettings().getSetting(fs); - featureColours.put( - setting.getType(), new java.awt.Color(setting.getColour())); + featureColours.put(setting.getType(), + new java.awt.Color(setting.getColour())); renderOrder[fs] = setting.getType(); if (setting.getDisplay()) { - featuresDisplayed.put(setting.getType(), new Integer( - setting.getColour())); + featuresDisplayed.put(setting.getType(), + new Integer(setting.getColour())); } } - FeatureRendererSettings frs = new FeatureRendererSettings(renderOrder, new Hashtable(), featureColours, 1.0f, null); - af.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer().transferSettings(frs); + FeatureRendererSettings frs = new FeatureRendererSettings( + renderOrder, new Hashtable(), featureColours, 1.0f, null); + af.alignPanel.getSeqPanel().seqCanvas.getFeatureRenderer() + .transferSettings(frs); } af.setMenusFromViewport(af.viewport); diff --git a/src/jalview/gui/JalviewChimeraBindingModel.java b/src/jalview/gui/JalviewChimeraBindingModel.java index a5af244..892e094 100644 --- a/src/jalview/gui/JalviewChimeraBindingModel.java +++ b/src/jalview/gui/JalviewChimeraBindingModel.java @@ -21,8 +21,7 @@ public class JalviewChimeraBindingModel extends JalviewChimeraBinding } @Override - public FeatureRenderer getFeatureRenderer( - AlignmentViewPanel alignment) + public FeatureRenderer getFeatureRenderer(AlignmentViewPanel alignment) { AlignmentPanel ap = (alignment == null) ? cvf.getAlignmentPanel() : (AlignmentPanel) alignment; @@ -103,17 +102,17 @@ public class JalviewChimeraBindingModel extends JalviewChimeraBinding @Override public void run() { - long stm = cvf.startProgressBar(progressMsg); - try - { - sendChimeraCommand(command, false); - } finally - { - cvf.stopProgressBar(null, stm); - } + long stm = cvf.startProgressBar(progressMsg); + try + { + sendChimeraCommand(command, false); + } finally + { + cvf.stopProgressBar(null, stm); + } } }); - thread.start(); + thread.start(); } } diff --git a/src/jalview/gui/JvSwingUtils.java b/src/jalview/gui/JvSwingUtils.java index 2cba586..052c314 100644 --- a/src/jalview/gui/JvSwingUtils.java +++ b/src/jalview/gui/JvSwingUtils.java @@ -86,9 +86,9 @@ public final class JvSwingUtils return enclose ? "" + ttext + "" : ttext; } - return (enclose ? "" : "") - + "

" - + ttext + "

" + ((enclose ? "" : "")); + return (enclose ? "" : "") + + "

" + + ttext + "

" + ((enclose ? "" : "")); } diff --git a/src/jalview/gui/OOMWarning.java b/src/jalview/gui/OOMWarning.java index 319c283..eb4425e 100644 --- a/src/jalview/gui/OOMWarning.java +++ b/src/jalview/gui/OOMWarning.java @@ -77,12 +77,11 @@ public class OOMWarning implements Runnable public void run() { - javax.swing.JOptionPane - .showInternalMessageDialog( - desktop, - MessageManager.formatMessage("warn.out_of_memory_when_action", new String[]{action}), - MessageManager.getString("label.out_of_memory"), - javax.swing.JOptionPane.WARNING_MESSAGE); + javax.swing.JOptionPane.showInternalMessageDialog(desktop, + MessageManager.formatMessage("warn.out_of_memory_when_action", + new String[] { action }), MessageManager + .getString("label.out_of_memory"), + javax.swing.JOptionPane.WARNING_MESSAGE); // hope that there's enough memory left that no more appear. oomInprogress = false; } diff --git a/src/jalview/gui/OptsAndParamsPage.java b/src/jalview/gui/OptsAndParamsPage.java index 9b805d1..8a0fe77 100644 --- a/src/jalview/gui/OptsAndParamsPage.java +++ b/src/jalview/gui/OptsAndParamsPage.java @@ -41,7 +41,6 @@ import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.net.URL; import java.util.ArrayList; -import java.util.Hashtable; import java.util.List; import java.util.Map; @@ -111,21 +110,21 @@ public class OptsAndParamsPage { hasLink = true; - enabled.setToolTipText( - JvSwingUtils - .wrapTooltip(true, ((desc == null || desc.trim().length() == 0) ? MessageManager.getString("label.opt_and_params_further_details ") + enabled.setToolTipText(JvSwingUtils + .wrapTooltip( + true, + ((desc == null || desc.trim().length() == 0) ? MessageManager + .getString("label.opt_and_params_further_details ") : desc) - + "
") - ); + + "
")); enabled.addMouseListener(this); } else { if (desc != null && desc.trim().length() > 0) { - enabled.setToolTipText( - JvSwingUtils.wrapTooltip(true, opt.getDescription()) - ); + enabled.setToolTipText(JvSwingUtils.wrapTooltip(true, + opt.getDescription())); } } add(enabled, BorderLayout.NORTH); @@ -345,10 +344,14 @@ public class OptsAndParamsPage { // Only create description boxes if there actually is a description. ttipText = (JvSwingUtils - .wrapTooltip(true, parm.getDescription() + .wrapTooltip( + true, + parm.getDescription() + (finfo != null ? "
"+MessageManager.getString("label.opt_and_params_further_detail") + + "\"/>" + + MessageManager + .getString("label.opt_and_params_further_detail") : ""))); } @@ -390,12 +393,21 @@ public class OptsAndParamsPage // Only create description boxes if there actually is a description. if (finfo != null) { - showDesc.setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.formatMessage("label.opt_and_params_show_brief_desc_image_link", new String[]{linkImageURL.toExternalForm()}))); + showDesc.setToolTipText(JvSwingUtils.wrapTooltip( + true, + MessageManager + .formatMessage( + "label.opt_and_params_show_brief_desc_image_link", + new String[] { linkImageURL + .toExternalForm() }))); showDesc.addMouseListener(this); } else { - showDesc.setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.opt_and_params_show_brief_desc"))); + showDesc.setToolTipText(JvSwingUtils.wrapTooltip( + true, + MessageManager + .getString("label.opt_and_params_show_brief_desc"))); } showDesc.addActionListener(new ActionListener() { @@ -678,8 +690,7 @@ public class OptsAndParamsPage { slider.setVisible(false); } - return new int[] - { iVal }; + return new int[] { iVal }; } else { @@ -721,8 +732,7 @@ public class OptsAndParamsPage { slider.setVisible(false); } - return new float[] - { fVal }; + return new float[] { fVal }; } } else @@ -730,13 +740,11 @@ public class OptsAndParamsPage if (!choice) { slider.setVisible(false); - return new String[] - { valueField.getText().trim() }; + return new String[] { valueField.getText().trim() }; } else { - return new String[] - { (String) choicebox.getSelectedItem() }; + return new String[] { (String) choicebox.getSelectedItem() }; } } @@ -767,8 +775,7 @@ public class OptsAndParamsPage JPopupMenu mnu = new JPopupMenu(); JMenuItem mitem = new JMenuItem(MessageManager.formatMessage( - "label.view_params", new String[] - { finfo })); + "label.view_params", new String[] { finfo })); mitem.addActionListener(new ActionListener() { @@ -854,7 +861,9 @@ public class OptsAndParamsPage } else { - throw new Error(MessageManager.formatMessage("error.invalid_value_for_option", new String[]{string,option.getName()})); + throw new Error(MessageManager.formatMessage( + "error.invalid_value_for_option", new String[] { string, + option.getName() })); } } diff --git a/src/jalview/gui/OverviewPanel.java b/src/jalview/gui/OverviewPanel.java index 609e010..de0dbe5 100755 --- a/src/jalview/gui/OverviewPanel.java +++ b/src/jalview/gui/OverviewPanel.java @@ -92,7 +92,7 @@ public class OverviewPanel extends JPanel implements Runnable sr.renderGaps = false; sr.forOverview = true; fr = new FeatureRenderer(ap); - + // scale the initial size of overviewpanel to shape of alignment float initialScale = (float) av.getAlignment().getWidth() / (float) av.getAlignment().getHeight(); @@ -364,8 +364,8 @@ public class OverviewPanel extends JPanel implements Runnable } if (hiddenRow - || (hasHiddenCols && !av.getColumnSelection() - .isVisible(lastcol))) + || (hasHiddenCols && !av.getColumnSelection().isVisible( + lastcol))) { color = new Color(color).darker().darker().getRGB(); } diff --git a/src/jalview/gui/PCAPanel.java b/src/jalview/gui/PCAPanel.java index f4fd70b..b6e5b94 100644 --- a/src/jalview/gui/PCAPanel.java +++ b/src/jalview/gui/PCAPanel.java @@ -20,6 +20,17 @@ */ package jalview.gui; +import jalview.datamodel.Alignment; +import jalview.datamodel.AlignmentView; +import jalview.datamodel.ColumnSelection; +import jalview.datamodel.SeqCigar; +import jalview.datamodel.SequenceI; +import jalview.jbgui.GPCAPanel; +import jalview.schemes.ResidueProperties; +import jalview.util.MessageManager; +import jalview.viewmodel.AlignmentViewport; +import jalview.viewmodel.PCAModel; + import java.awt.BorderLayout; import java.awt.Color; import java.awt.Graphics; @@ -37,17 +48,6 @@ import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JRadioButtonMenuItem; -import jalview.datamodel.Alignment; -import jalview.datamodel.AlignmentView; -import jalview.datamodel.ColumnSelection; -import jalview.datamodel.SeqCigar; -import jalview.datamodel.SequenceI; -import jalview.jbgui.GPCAPanel; -import jalview.schemes.ResidueProperties; -import jalview.util.MessageManager; -import jalview.viewmodel.AlignmentViewport; -import jalview.viewmodel.PCAModel; - /** * DOCUMENT ME! * @@ -113,11 +113,10 @@ public class PCAPanel extends GPCAPanel implements Runnable, if (!sameLength) { - JOptionPane - .showMessageDialog( - Desktop.desktop, - MessageManager.getString("label.pca_sequences_not_aligned"), - MessageManager.getString("label.sequences_not_aligned"), JOptionPane.WARNING_MESSAGE); + JOptionPane.showMessageDialog(Desktop.desktop, + MessageManager.getString("label.pca_sequences_not_aligned"), + MessageManager.getString("label.sequences_not_aligned"), + JOptionPane.WARNING_MESSAGE); return; } @@ -170,7 +169,8 @@ public class PCAPanel extends GPCAPanel implements Runnable, public void bgcolour_actionPerformed(ActionEvent e) { - Color col = JColorChooser.showDialog(this, MessageManager.getString("label.select_backgroud_colour"), + Color col = JColorChooser.showDialog(this, + MessageManager.getString("label.select_backgroud_colour"), rc.bgColour); if (col != null) @@ -397,8 +397,8 @@ public class PCAPanel extends GPCAPanel implements Runnable, // msaorder); Desktop.addInternalFrame(af, MessageManager.formatMessage( - "label.original_data_for_params", new String[] - { this.title }), AlignFrame.DEFAULT_WIDTH, + "label.original_data_for_params", + new String[] { this.title }), AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); } } @@ -488,15 +488,14 @@ public class PCAPanel extends GPCAPanel implements Runnable, if (type == jalview.util.ImageMaker.TYPE.PNG) { im = new jalview.util.ImageMaker(this, - jalview.util.ImageMaker.TYPE.PNG, - "Make PNG image from PCA", width, height, null, null); + jalview.util.ImageMaker.TYPE.PNG, "Make PNG image from PCA", + width, height, null, null); } else if (type == jalview.util.ImageMaker.TYPE.EPS) { im = new jalview.util.ImageMaker(this, - jalview.util.ImageMaker.TYPE.EPS, - "Make EPS file from PCA", width, height, null, - this.getTitle()); + jalview.util.ImageMaker.TYPE.EPS, "Make EPS file from PCA", + width, height, null, this.getTitle()); } else { @@ -597,8 +596,8 @@ public class PCAPanel extends GPCAPanel implements Runnable, xCombobox.getSelectedIndex(), yCombobox.getSelectedIndex(), zCombobox.getSelectedIndex())); Desktop.addInternalFrame(cap, MessageManager.formatMessage( - "label.points_for_params", new String[] - { this.getTitle() }), 500, 500); + "label.points_for_params", new String[] { this.getTitle() }), + 500, 500); } catch (OutOfMemoryError oom) { new OOMWarning("exporting PCA points", oom); @@ -622,14 +621,15 @@ public class PCAPanel extends GPCAPanel implements Runnable, xCombobox.getSelectedIndex(), yCombobox.getSelectedIndex(), zCombobox.getSelectedIndex())); Desktop.addInternalFrame(cap, MessageManager.formatMessage( - "label.transformed_points_for_params", new String[] - { this.getTitle() }), 500, 500); + "label.transformed_points_for_params", + new String[] { this.getTitle() }), 500, 500); } catch (OutOfMemoryError oom) { new OOMWarning("exporting transformed PCA points", oom); cap.dispose(); } } + /* * (non-Javadoc) * diff --git a/src/jalview/gui/PDBSearchPanel.java b/src/jalview/gui/PDBSearchPanel.java index 4e23f57..4c89f12 100644 --- a/src/jalview/gui/PDBSearchPanel.java +++ b/src/jalview/gui/PDBSearchPanel.java @@ -54,7 +54,6 @@ public class PDBSearchPanel extends GPDBSearchPanel .getProgressIndicator(); } - /** * Action performed when an input is detected on txt_search field. */ @@ -161,7 +160,6 @@ public class PDBSearchPanel extends GPDBSearchPanel return foundSearchTerms; } - @Override public void btn_ok_ActionPerformed() { diff --git a/src/jalview/gui/PopupMenu.java b/src/jalview/gui/PopupMenu.java index a11b40d..fee47e5 100644 --- a/src/jalview/gui/PopupMenu.java +++ b/src/jalview/gui/PopupMenu.java @@ -137,7 +137,7 @@ public class PopupMenu extends JPopupMenu JMenuItem sequenceDetails = new JMenuItem(); JMenuItem sequenceSelDetails = new JMenuItem(); - + JMenuItem makeReferenceSeq = new JMenuItem(); JMenuItem chooseAnnotations = new JMenuItem(); @@ -319,7 +319,9 @@ public class PopupMenu extends JPopupMenu { makeReferenceSeq.setText(MessageManager .getString("action.unmark_as_reference")); - } else { + } + else + { makeReferenceSeq.setText(MessageManager .getString("action.set_as_reference")); } @@ -348,8 +350,8 @@ public class PopupMenu extends JPopupMenu */ menuItem = new JMenuItem(); menuItem.setText(MessageManager.formatMessage( - "label.2d_rna_structure_line", new Object[] - { aa.label })); + "label.2d_rna_structure_line", + new Object[] { aa.label })); menuItem.addActionListener(new java.awt.event.ActionListener() { @Override @@ -376,8 +378,8 @@ public class PopupMenu extends JPopupMenu // TODO: make rnastrucF a bit more nice menuItem = new JMenuItem(); menuItem.setText(MessageManager.formatMessage( - "label.2d_rna_sequence_name", new Object[] - { seq.getName() })); + "label.2d_rna_sequence_name", + new Object[] { seq.getName() })); menuItem.addActionListener(new java.awt.event.ActionListener() { @Override @@ -413,8 +415,8 @@ public class PopupMenu extends JPopupMenu && ap.av.getSelectionGroup().getSize() > 1) { menuItem = new JMenuItem(MessageManager.formatMessage( - "label.represent_group_with", new Object[] - { seq.getName() })); + "label.represent_group_with", + new Object[] { seq.getName() })); menuItem.addActionListener(new java.awt.event.ActionListener() { @Override @@ -482,8 +484,7 @@ public class PopupMenu extends JPopupMenu if (sg != null && sg.getSize() > 0) { groupName.setText(MessageManager.formatMessage("label.name_param", - new Object[] - { sg.getName() })); + new Object[] { sg.getName() })); groupName.setText(MessageManager .getString("label.edit_name_and_description_current_group")); @@ -641,8 +642,7 @@ public class PopupMenu extends JPopupMenu // collect matching db-refs DBRefEntry[] dbr = jalview.util.DBRefUtils.selectRefs( - seq.getDBRef(), new String[] - { urlLink.getTarget() }); + seq.getDBRef(), new String[] { urlLink.getTarget() }); // collect id string too String id = seq.getName(); String descr = seq.getDescription(); @@ -773,17 +773,15 @@ public class PopupMenu extends JPopupMenu */ Map>> shownTypes = new LinkedHashMap>>(); Map>> hiddenTypes = new LinkedHashMap>>(); - AlignmentAnnotationUtils.getShownHiddenTypes(shownTypes, - hiddenTypes, - AlignmentAnnotationUtils.asList(annotations), - forSequences); + AlignmentAnnotationUtils.getShownHiddenTypes(shownTypes, hiddenTypes, + AlignmentAnnotationUtils.asList(annotations), forSequences); for (String calcId : hiddenTypes.keySet()) { for (List type : hiddenTypes.get(calcId)) { - addAnnotationTypeToShowHide(showMenu, forSequences, - calcId, type, false, true); + addAnnotationTypeToShowHide(showMenu, forSequences, calcId, type, + false, true); } } // grey out 'show annotations' if none are hidden @@ -793,8 +791,8 @@ public class PopupMenu extends JPopupMenu { for (List type : shownTypes.get(calcId)) { - addAnnotationTypeToShowHide(hideMenu, forSequences, - calcId, type, false, false); + addAnnotationTypeToShowHide(hideMenu, forSequences, calcId, type, + false, false); } } // grey out 'hide annotations' if none are shown @@ -855,8 +853,8 @@ public class PopupMenu extends JPopupMenu @Override public void actionPerformed(ActionEvent e) { - AlignmentUtils.showOrHideSequenceAnnotations(ap.getAlignment(), types, - forSequences, allTypes, actionIsShow); + AlignmentUtils.showOrHideSequenceAnnotations(ap.getAlignment(), + types, forSequences, allTypes, actionIsShow); refresh(); } }); @@ -872,8 +870,8 @@ public class PopupMenu extends JPopupMenu // ID/regex match URLs groupLinksMenu = new JMenu( MessageManager.getString("action.group_link")); - JMenu[] linkMenus = new JMenu[] - { null, new JMenu(MessageManager.getString("action.ids")), + JMenu[] linkMenus = new JMenu[] { null, + new JMenu(MessageManager.getString("action.ids")), new JMenu(MessageManager.getString("action.sequences")), new JMenu(MessageManager.getString("action.ids_sequences")) }; // three // types @@ -908,8 +906,7 @@ public class PopupMenu extends JPopupMenu if (sarray == null) { sarray = new Object[2]; - sarray[0] = new int[] - { 0 }; + sarray[0] = new int[] { 0 }; sarray[1] = new String[seqs.length]; commonDbrefs.put(src, sarray); @@ -1029,8 +1026,7 @@ public class PopupMenu extends JPopupMenu { JMenuItem item = new JMenuItem(label); item.setToolTipText(MessageManager.formatMessage( - "label.open_url_param", new Object[] - { url })); + "label.open_url_param", new Object[] { url })); item.addActionListener(new java.awt.event.ActionListener() { @Override @@ -1069,8 +1065,7 @@ public class PopupMenu extends JPopupMenu JMenuItem item = new JMenuItem(label); item.setToolTipText(MessageManager.formatMessage( "label.open_url_seqs_param", - new Object[] - { urlgenerator.getUrl_prefix(), + new Object[] { urlgenerator.getUrl_prefix(), urlgenerator.getNumberInvolved(urlstub) })); // TODO: put in info about what is being sent. item.addActionListener(new java.awt.event.ActionListener() @@ -1356,8 +1351,7 @@ public class PopupMenu extends JPopupMenu @Override public void actionPerformed(ActionEvent actionEvent) { - SequenceI[] selectedSeqs = new SequenceI[] - { sequence }; + SequenceI[] selectedSeqs = new SequenceI[] { sequence }; if (ap.av.getSelectionGroup() != null) { selectedSeqs = ap.av.getSequenceSelection(); @@ -1384,15 +1378,16 @@ public class PopupMenu extends JPopupMenu .getString("label.mark_as_representative")); makeReferenceSeq.addActionListener(new ActionListener() { - + @Override public void actionPerformed(ActionEvent actionEvent) { makeReferenceSeq_actionPerformed(actionEvent); - + } }); - hideInsertions.setText(MessageManager.getString("label.hide_insertions")); + hideInsertions.setText(MessageManager + .getString("label.hide_insertions")); hideInsertions.addActionListener(new ActionListener() { @@ -1413,7 +1408,7 @@ public class PopupMenu extends JPopupMenu add(sequenceMenu); add(rnaStructureMenu); add(pdbStructureDialog); - if (sequence!=null) + if (sequence != null) { add(hideInsertions); } @@ -1671,8 +1666,8 @@ public class PopupMenu extends JPopupMenu * @param menuItem * @param forSequences */ - protected void configureReferenceAnnotationsMenu( - JMenuItem menuItem, List forSequences) + protected void configureReferenceAnnotationsMenu(JMenuItem menuItem, + List forSequences) { menuItem.setEnabled(false); @@ -1768,6 +1763,7 @@ public class PopupMenu extends JPopupMenu } refresh(); } + protected void sequenceSelectionDetails_actionPerformed() { createSequenceDetailsReport(ap.av.getSequenceSelection()); @@ -1775,8 +1771,7 @@ public class PopupMenu extends JPopupMenu protected void sequenceDetails_actionPerformed() { - createSequenceDetailsReport(new SequenceI[] - { sequence }); + createSequenceDetailsReport(new SequenceI[] { sequence }); } public void createSequenceDetailsReport(SequenceI[] sequences) @@ -1789,8 +1784,8 @@ public class PopupMenu extends JPopupMenu + MessageManager .formatMessage( "label.create_sequence_details_report_annotation_for", - new Object[] - { seq.getDisplayId(true) }) + "

"); + new Object[] { seq.getDisplayId(true) }) + + "

"); new SequenceAnnotationReport(null) .createSequenceAnnotationReport( contents, @@ -1799,8 +1794,7 @@ public class PopupMenu extends JPopupMenu true, false, (ap.getSeqPanel().seqCanvas.fr != null) ? ap - .getSeqPanel().seqCanvas.fr - .getMinMax() + .getSeqPanel().seqCanvas.fr.getMinMax() : null); contents.append("

"); } @@ -1808,9 +1802,9 @@ public class PopupMenu extends JPopupMenu Desktop.addInternalFrame(cap, MessageManager.formatMessage( "label.sequence_details_for", - (sequences.length == 1 ? new Object[] - { sequences[0].getDisplayId(true) } : new Object[] - { MessageManager.getString("label.selection") })), 500, 400); + (sequences.length == 1 ? new Object[] { sequences[0] + .getDisplayId(true) } : new Object[] { MessageManager + .getString("label.selection") })), 500, 400); } @@ -2316,8 +2310,7 @@ public class PopupMenu extends JPopupMenu SequenceGroup sg = ap.av.getSelectionGroup(); if (sg == null || sg.getSize() < 1) { - ap.av.hideSequence(new SequenceI[] - { sequence }); + ap.av.hideSequence(new SequenceI[] { sequence }); return; } @@ -2356,8 +2349,7 @@ public class PopupMenu extends JPopupMenu if (sg != null) { List startEnd = ap.av.getVisibleRegionBoundaries( - sg.getStartRes(), - sg.getEndRes() + 1); + sg.getStartRes(), sg.getEndRes() + 1); String description; int caseChange; @@ -2395,8 +2387,8 @@ public class PopupMenu extends JPopupMenu CutAndPasteTransfer cap = new CutAndPasteTransfer(); cap.setForInput(null); Desktop.addInternalFrame(cap, MessageManager.formatMessage( - "label.alignment_output_command", new Object[] - { e.getActionCommand() }), 600, 500); + "label.alignment_output_command", + new Object[] { e.getActionCommand() }), 600, 500); String[] omitHidden = null; @@ -2414,11 +2406,11 @@ public class PopupMenu extends JPopupMenu jalview.bin.Cache.getProperty("LAST_DIRECTORY")); chooser.setFileView(new jalview.io.JalviewFileView()); chooser.setDialogTitle(MessageManager.formatMessage( - "label.select_pdb_file_for", new Object[] - { sequence.getDisplayId(false) })); + "label.select_pdb_file_for", + new Object[] { sequence.getDisplayId(false) })); chooser.setToolTipText(MessageManager.formatMessage( - "label.load_pdb_file_associate_with_sequence", new Object[] - { sequence.getDisplayId(false) })); + "label.load_pdb_file_associate_with_sequence", + new Object[] { sequence.getDisplayId(false) })); int value = chooser.showOpenDialog(null); @@ -2433,7 +2425,6 @@ public class PopupMenu extends JPopupMenu } - public void enterPDB_actionPerformed() { String id = JOptionPane.showInternalInputDialog(Desktop.desktop, diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index 88f5df3..5cb6512 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -263,8 +263,7 @@ public class Preferences extends GPreferences sortAutocalc.addItem("Autocalculated first"); sortAutocalc.addItem("Autocalculated last"); - final boolean showAbove = Cache.getDefault(SHOW_AUTOCALC_ABOVE, - true); + final boolean showAbove = Cache.getDefault(SHOW_AUTOCALC_ABOVE, true); sortAutocalc.setSelectedItem(showAbove ? sortAutocalc.getItemAt(0) : sortAutocalc.getItemAt(1)); startupCheckbox @@ -298,8 +297,7 @@ public class Preferences extends GPreferences structFromPdb.setSelected(structSelected); useRnaView.setSelected(Cache.getDefault(USE_RNAVIEW, false)); useRnaView.setEnabled(structSelected); - addSecondaryStructure - .setSelected(Cache.getDefault(ADD_SS_ANN, false)); + addSecondaryStructure.setSelected(Cache.getDefault(ADD_SS_ANN, false)); addSecondaryStructure.setEnabled(structSelected); addTempFactor.setSelected(Cache.getDefault(ADD_TEMPFACT_ANN, false)); addTempFactor.setEnabled(structSelected); @@ -465,8 +463,8 @@ public class Preferences extends GPreferences } final boolean showAutocalcFirst = sortAutocalc.getSelectedIndex() == 0; - Cache.applicationProperties.setProperty(SHOW_AUTOCALC_ABOVE, - Boolean.valueOf(showAutocalcFirst).toString()); + Cache.applicationProperties.setProperty(SHOW_AUTOCALC_ABOVE, Boolean + .valueOf(showAutocalcFirst).toString()); /* * Save Colours settings @@ -645,20 +643,21 @@ public class Preferences extends GPreferences return validateChimeraPath(); } + /** * DOCUMENT ME! */ public void startupFileTextfield_mouseClicked() { JalviewFileChooser chooser = new JalviewFileChooser( - jalview.bin.Cache.getProperty("LAST_DIRECTORY"), - new String[] - { "fa, fasta, fastq", "aln", "pfam", "msf", "pir", "blc", "jar" }, - new String[] - { "Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "Jalview" }, + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] { + "fa, fasta, fastq", "aln", "pfam", "msf", "pir", "blc", + "jar" }, new String[] { "Fasta", "Clustal", "PFAM", "MSF", + "PIR", "BLC", "Jalview" }, jalview.bin.Cache.getProperty("DEFAULT_FILE_FORMAT")); chooser.setFileView(new JalviewFileView()); - chooser.setDialogTitle(MessageManager.getString("label.select_startup_file")); + chooser.setDialogTitle(MessageManager + .getString("label.select_startup_file")); int value = chooser.showOpenDialog(this); @@ -800,7 +799,8 @@ public class Preferences extends GPreferences public void defaultBrowser_mouseClicked(MouseEvent e) { JFileChooser chooser = new JFileChooser("."); - chooser.setDialogTitle(MessageManager.getString("label.select_default_browser")); + chooser.setDialogTitle(MessageManager + .getString("label.select_default_browser")); int value = chooser.showOpenDialog(this); @@ -833,7 +833,8 @@ public class Preferences extends GPreferences public void minColour_actionPerformed(JPanel panel) { Color col = JColorChooser.showDialog(this, - MessageManager.getString("label.select_colour_minimum_value"), minColour.getBackground()); + MessageManager.getString("label.select_colour_minimum_value"), + minColour.getBackground()); if (col != null) { panel.setBackground(col); @@ -845,7 +846,8 @@ public class Preferences extends GPreferences public void maxColour_actionPerformed(JPanel panel) { Color col = JColorChooser.showDialog(this, - MessageManager.getString("label.select_colour_maximum_value"), maxColour.getBackground()); + MessageManager.getString("label.select_colour_maximum_value"), + maxColour.getBackground()); if (col != null) { panel.setBackground(col); @@ -870,12 +872,10 @@ public class Preferences extends GPreferences } } catch (NumberFormatException x) { - JOptionPane - .showInternalMessageDialog( - Desktop.desktop, - MessageManager.getString("warn.user_defined_width_requirements"), - MessageManager.getString("label.invalid_id_column_width"), - JOptionPane.WARNING_MESSAGE); + JOptionPane.showInternalMessageDialog(Desktop.desktop, MessageManager + .getString("warn.user_defined_width_requirements"), + MessageManager.getString("label.invalid_id_column_width"), + JOptionPane.WARNING_MESSAGE); userIdWidth.setText(""); } } @@ -936,14 +936,13 @@ public class Preferences extends GPreferences } if (!found) { - String[] options = - { "OK", "Help" }; + String[] options = { "OK", "Help" }; int showHelp = JOptionPane.showInternalOptionDialog( Desktop.desktop, JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.chimera_missing")), - "", JOptionPane.YES_NO_OPTION, - JOptionPane.WARNING_MESSAGE, null, options, options[0]); + "", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, + null, options, options[0]); if (showHelp == JOptionPane.NO_OPTION) { try diff --git a/src/jalview/gui/ProgressBar.java b/src/jalview/gui/ProgressBar.java index c7db535..bb5e780 100644 --- a/src/jalview/gui/ProgressBar.java +++ b/src/jalview/gui/ProgressBar.java @@ -102,7 +102,7 @@ public class ProgressBar implements IProgressIndicator public void setProgressBar(String message, long id) { Long longId = Long.valueOf(id); - + JPanel progressPanel = progressBars.get(longId); if (progressPanel != null) { @@ -126,15 +126,15 @@ public class ProgressBar implements IProgressIndicator * No progress bar for this id - add one now */ progressPanel = new JPanel(new BorderLayout(10, 5)); - + JProgressBar progressBar = new JProgressBar(); progressBar.setIndeterminate(true); - + progressPanel.add(new JLabel(message), BorderLayout.WEST); progressPanel.add(progressBar, BorderLayout.CENTER); - + addRow(progressPanel); - + progressBars.put(longId, progressPanel); } @@ -223,8 +223,9 @@ public class ProgressBar implements IProgressIndicator { handler.cancelActivity(id); us.setProgressBar(MessageManager.formatMessage( - "label.cancelled_params", new Object[] - { ((JLabel) progressPanel.getComponent(0)).getText() }), id); + "label.cancelled_params", + new Object[] { ((JLabel) progressPanel.getComponent(0)) + .getText() }), id); } }); progressPanel.add(cancel, BorderLayout.EAST); diff --git a/src/jalview/gui/PromptUserConfig.java b/src/jalview/gui/PromptUserConfig.java index 7655251..d7449d0 100644 --- a/src/jalview/gui/PromptUserConfig.java +++ b/src/jalview/gui/PromptUserConfig.java @@ -24,7 +24,7 @@ import jalview.bin.Cache; import java.awt.Component; -import javax.swing.*; +import javax.swing.JOptionPane; public class PromptUserConfig implements Runnable { diff --git a/src/jalview/gui/RedundancyPanel.java b/src/jalview/gui/RedundancyPanel.java index e541540..7fb0593 100755 --- a/src/jalview/gui/RedundancyPanel.java +++ b/src/jalview/gui/RedundancyPanel.java @@ -171,7 +171,8 @@ public class RedundancyPanel extends GSliderPanel implements Runnable progress.setVisible(false); progress = null; - label.setText(MessageManager.getString("label.enter_redundancy_thereshold")); + label.setText(MessageManager + .getString("label.enter_redundancy_thereshold")); slider.setVisible(true); applyButton.setEnabled(true); valueField.setVisible(true); @@ -240,7 +241,8 @@ public class RedundancyPanel extends GSliderPanel implements Runnable } } - EditCommand cut = new EditCommand(MessageManager.getString("action.remove_redundancy"), + EditCommand cut = new EditCommand( + MessageManager.getString("action.remove_redundancy"), Action.CUT, deleted, 0, width, ap.av.getAlignment()); for (int i = 0; i < del.size(); i++) @@ -257,7 +259,8 @@ public class RedundancyPanel extends GSliderPanel implements Runnable ap.alignFrame.addHistoryItem(cut); PaintRefresher.Refresh(this, ap.av.getSequenceSetId(), true, true); - ap.av.firePropertyChange("alignment", null, ap.av.getAlignment().getSequences()); + ap.av.firePropertyChange("alignment", null, ap.av.getAlignment() + .getSequences()); } } @@ -270,17 +273,19 @@ public class RedundancyPanel extends GSliderPanel implements Runnable */ public void undoButton_actionPerformed(ActionEvent e) { - if(historyList == null || historyList.isEmpty()){ - undoButton.setEnabled(false); - return; + if (historyList == null || historyList.isEmpty()) + { + undoButton.setEnabled(false); + return; } - + CommandI command = historyList.pop(); if (ap.av.getHistoryList().contains(command)) { command.undoCommand(af.getViewAlignments()); ap.av.getHistoryList().remove(command); - ap.av.firePropertyChange("alignment", null, ap.av.getAlignment().getSequences()); + ap.av.firePropertyChange("alignment", null, ap.av.getAlignment() + .getSequences()); af.updateEditMenuBar(); } diff --git a/src/jalview/gui/RestInputParamEditDialog.java b/src/jalview/gui/RestInputParamEditDialog.java index 9a71770..8056189 100644 --- a/src/jalview/gui/RestInputParamEditDialog.java +++ b/src/jalview/gui/RestInputParamEditDialog.java @@ -20,6 +20,13 @@ */ package jalview.gui; +import jalview.jbgui.GRestInputParamEditDialog; +import jalview.ws.params.InvalidArgumentException; +import jalview.ws.params.OptionI; +import jalview.ws.params.ParameterI; +import jalview.ws.rest.InputType; +import jalview.ws.rest.RestServiceDescription; + import java.util.ArrayList; import java.util.Hashtable; @@ -29,13 +36,6 @@ import javax.swing.event.ListSelectionEvent; import net.miginfocom.swing.MigLayout; -import jalview.jbgui.GRestInputParamEditDialog; -import jalview.ws.params.InvalidArgumentException; -import jalview.ws.params.OptionI; -import jalview.ws.params.ParameterI; -import jalview.ws.rest.InputType; -import jalview.ws.rest.RestServiceDescription; - public class RestInputParamEditDialog extends GRestInputParamEditDialog implements OptsParametersContainerI { diff --git a/src/jalview/gui/RestServiceEditorPane.java b/src/jalview/gui/RestServiceEditorPane.java index 8a77329..ec8e7f1 100644 --- a/src/jalview/gui/RestServiceEditorPane.java +++ b/src/jalview/gui/RestServiceEditorPane.java @@ -435,8 +435,7 @@ public class RestServiceEditorPane extends GRestServiceEditorPane parseRes.setText(MessageManager .formatMessage( "label.parsing_failed_syntax_errors_shown_below_param", - new String[] - { rsd.getInvalidMessage() })); + new String[] { rsd.getInvalidMessage() })); parseWarnings.setVisible(true); } } catch (Throwable e) @@ -445,8 +444,7 @@ public class RestServiceEditorPane extends GRestServiceEditorPane parseRes.setText(MessageManager .formatMessage( "label.parsing_failed_unrecoverable_exception_thrown_param", - new String[] - { e.toString() })); + new String[] { e.toString() })); parseWarnings.setVisible(true); } } diff --git a/src/jalview/gui/RotatableCanvas.java b/src/jalview/gui/RotatableCanvas.java index 4241c5f..0719fa0 100755 --- a/src/jalview/gui/RotatableCanvas.java +++ b/src/jalview/gui/RotatableCanvas.java @@ -20,18 +20,34 @@ */ package jalview.gui; -import java.util.*; -import java.awt.*; -import java.awt.event.*; - -import javax.swing.*; - import jalview.api.RotatableCanvasI; -import jalview.datamodel.*; -import jalview.math.*; +import jalview.datamodel.SequenceGroup; +import jalview.datamodel.SequenceI; +import jalview.datamodel.SequencePoint; +import jalview.math.RotatableMatrix; import jalview.util.MessageManager; import jalview.viewmodel.AlignmentViewport; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.RenderingHints; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.event.MouseWheelEvent; +import java.awt.event.MouseWheelListener; +import java.util.Vector; + +import javax.swing.JPanel; +import javax.swing.ToolTipManager; + /** * DOCUMENT ME! * @@ -826,8 +842,7 @@ public class RotatableCanvas extends JPanel implements MouseListener, } else { - return new AlignmentPanel[] - { ap }; + return new AlignmentPanel[] { ap }; } } diff --git a/src/jalview/gui/SVGOptions.java b/src/jalview/gui/SVGOptions.java index c3bdc70..a64819a 100644 --- a/src/jalview/gui/SVGOptions.java +++ b/src/jalview/gui/SVGOptions.java @@ -59,8 +59,7 @@ public class SVGOptions extends JPanel bg.add(text); JOptionPane pane = new JOptionPane(null, JOptionPane.DEFAULT_OPTION, - JOptionPane.DEFAULT_OPTION, null, new Object[] - { this }); + JOptionPane.DEFAULT_OPTION, null, new Object[] { this }); dialog = pane.createDialog(Desktop.desktop, "SVG Rendering options"); dialog.setVisible(true); diff --git a/src/jalview/gui/ScalePanel.java b/src/jalview/gui/ScalePanel.java index 519f2e2..62cd3f1 100755 --- a/src/jalview/gui/ScalePanel.java +++ b/src/jalview/gui/ScalePanel.java @@ -482,13 +482,13 @@ public class ScalePanel extends JPanel implements MouseMotionListener, gg.drawLine(((i - startx - 1) * avCharWidth) + (avCharWidth / 2), y + 2, - ((i - startx - 1) * avCharWidth) + (avCharWidth / 2), - y + (fm.getDescent() * 2)); + ((i - startx - 1) * avCharWidth) + (avCharWidth / 2), y + + (fm.getDescent() * 2)); } else { - gg.drawLine(((i - startx - 1) * avCharWidth) + (avCharWidth / 2), - y + fm.getDescent(), ((i - startx - 1) * avCharWidth) + gg.drawLine(((i - startx - 1) * avCharWidth) + (avCharWidth / 2), y + + fm.getDescent(), ((i - startx - 1) * avCharWidth) + (avCharWidth / 2), y + (fm.getDescent() * 2)); } } @@ -512,12 +512,10 @@ public class ScalePanel extends JPanel implements MouseMotionListener, continue; } - gg.fillPolygon(new int[] - { res * avCharWidth - avCharHeight / 4, + gg.fillPolygon(new int[] { res * avCharWidth - avCharHeight / 4, res * avCharWidth + avCharHeight / 4, res * avCharWidth }, - new int[] - { y - avCharHeight / 2, y - avCharHeight / 2, y + 8 }, - 3); + new int[] { y - avCharHeight / 2, y - avCharHeight / 2, + y + 8 }, 3); } } diff --git a/src/jalview/gui/SeqCanvas.java b/src/jalview/gui/SeqCanvas.java index 4c04ad3..5706fe7 100755 --- a/src/jalview/gui/SeqCanvas.java +++ b/src/jalview/gui/SeqCanvas.java @@ -106,6 +106,7 @@ public class SeqCanvas extends JComponent charHeight = av.getCharHeight(); charWidth = av.getCharWidth(); } + /** * DOCUMENT ME! * @@ -138,8 +139,7 @@ public class SeqCanvas extends JComponent g.drawLine(((i - startx - 1) * charWidth) + (charWidth / 2), (ypos + 2) - (charHeight / 2), ((i - startx - 1) * charWidth) - + (charWidth / 2), - ypos - 2); + + (charWidth / 2), ypos - 2); } } @@ -557,12 +557,12 @@ public class SeqCanvas extends JComponent continue; } - gg.fillPolygon(new int[] - { res * charWidth - charHeight / 4, - res * charWidth + charHeight / 4, res * charWidth }, - new int[] - { ypos - (charHeight / 2), ypos - (charHeight / 2), - ypos - (charHeight / 2) + 8 }, 3); + gg.fillPolygon( + new int[] { res * charWidth - charHeight / 4, + res * charWidth + charHeight / 4, res * charWidth }, + new int[] { ypos - (charHeight / 2), + ypos - (charHeight / 2), ypos - (charHeight / 2) + 8 }, + 3); } } @@ -591,8 +591,8 @@ public class SeqCanvas extends JComponent annotations = new AnnotationPanel(av); } - annotations.renderer.drawComponent(annotations, av, g, - -1, startRes, endx + 1); + annotations.renderer.drawComponent(annotations, av, g, -1, + startRes, endx + 1); g.translate(0, -cHeight - ypos - 3); } g.setClip(clip); @@ -638,8 +638,7 @@ public class SeqCanvas extends JComponent * DOCUMENT ME! */ public void drawPanel(Graphics g1, int startRes, int endRes, - int startSeq, - int endSeq, int offset) + int startSeq, int endSeq, int offset) { updateViewport(); if (!av.hasHiddenColumns()) @@ -700,8 +699,7 @@ public class SeqCanvas extends JComponent // int startRes, int endRes, int startSeq, int endSeq, int x, int y, // int x1, int x2, int y1, int y2, int startx, int starty, private void draw(Graphics g, int startRes, int endRes, int startSeq, - int endSeq, - int offset) + int endSeq, int offset) { g.setFont(av.getFont()); sr.prepare(g, av.isRenderGaps()); @@ -831,8 +829,8 @@ public class SeqCanvas extends JComponent if (group == av.getSelectionGroup()) { g.setStroke(new BasicStroke(1, BasicStroke.CAP_BUTT, - BasicStroke.JOIN_ROUND, 3f, new float[] - { 5f, 3f }, 0f)); + BasicStroke.JOIN_ROUND, 3f, new float[] { 5f, 3f }, + 0f)); g.setColor(Color.RED); } else @@ -941,8 +939,7 @@ public class SeqCanvas extends JComponent break; } - group = av.getAlignment().getGroups() - .get(groupIndex); + group = av.getAlignment().getGroups().get(groupIndex); } while (groupIndex < av.getAlignment().getGroups().size()); diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 01653b6..d379764 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -192,8 +192,7 @@ public class SeqPanel extends JPanel implements MouseListener, } int cHeight = av.getAlignment().getHeight() * av.getCharHeight() - + hgap - + seqCanvas.getAnnotationHeight(); + + hgap + seqCanvas.getAnnotationHeight(); int y = evt.getY(); y -= hgap; @@ -250,8 +249,7 @@ public class SeqPanel extends JPanel implements MouseListener, } int cHeight = av.getAlignment().getHeight() * av.getCharHeight() - + hgap - + seqCanvas.getAnnotationHeight(); + + hgap + seqCanvas.getAnnotationHeight(); y -= hgap; @@ -668,11 +666,12 @@ public class SeqPanel extends JPanel implements MouseListener, @Override public void highlightSequence(SearchResults results) { - if (results == null || results.equals(lastSearchResults)) { + if (results == null || results.equals(lastSearchResults)) + { return; } lastSearchResults = results; - + if (av.isFollowHighlight()) { /* @@ -696,6 +695,7 @@ public class SeqPanel extends JPanel implements MouseListener, { return this.ap == null ? null : this.ap.av; } + @Override public void updateColours(SequenceI seq, int index) { @@ -767,9 +767,9 @@ public class SeqPanel extends JPanel implements MouseListener, if (av.isShowSequenceFeatures()) { int rpos; - List features = ap.getFeatureRenderer().findFeaturesAtRes( - sequence.getDatasetSequence(), - rpos = sequence.findPosition(res)); + List features = ap.getFeatureRenderer() + .findFeaturesAtRes(sequence.getDatasetSequence(), + rpos = sequence.findPosition(res)); seqARep.appendFeatures(tooltipText, rpos, features, this.ap.getSeqPanel().seqCanvas.fr.getMinMax()); } @@ -1034,7 +1034,8 @@ public class SeqPanel extends JPanel implements MouseListener, message.append("Edit group:"); if (editCommand == null) { - editCommand = new EditCommand(MessageManager.getString("action.edit_group")); + editCommand = new EditCommand( + MessageManager.getString("action.edit_group")); } } else @@ -1047,7 +1048,8 @@ public class SeqPanel extends JPanel implements MouseListener, } if (editCommand == null) { - editCommand = new EditCommand(MessageManager.formatMessage("label.edit_params", new String[]{label})); + editCommand = new EditCommand(MessageManager.formatMessage( + "label.edit_params", new String[] { label })); } } @@ -1285,14 +1287,13 @@ public class SeqPanel extends JPanel implements MouseListener, { for (int j = lastres; j < startres; j++) { - insertChar(j, new SequenceI[] - { seq }, fixedRight); + insertChar(j, new SequenceI[] { seq }, fixedRight); } } else { - appendEdit(Action.INSERT_GAP, new SequenceI[] - { seq }, lastres, startres - lastres); + appendEdit(Action.INSERT_GAP, new SequenceI[] { seq }, lastres, + startres - lastres); } } else @@ -1309,8 +1310,7 @@ public class SeqPanel extends JPanel implements MouseListener, endEditing(); break; } - deleteChar(startres, new SequenceI[] - { seq }, fixedRight); + deleteChar(startres, new SequenceI[] { seq }, fixedRight); } } else @@ -1328,8 +1328,8 @@ public class SeqPanel extends JPanel implements MouseListener, if (max > 0) { - appendEdit(Action.DELETE_GAP, new SequenceI[] - { seq }, startres, max); + appendEdit(Action.DELETE_GAP, new SequenceI[] { seq }, + startres, max); } } } @@ -1339,14 +1339,13 @@ public class SeqPanel extends JPanel implements MouseListener, { for (int j = lastres; j < startres; j++) { - insertChar(j, new SequenceI[] - { seq }, fixedRight); + insertChar(j, new SequenceI[] { seq }, fixedRight); } } else { - appendEdit(Action.INSERT_NUC, new SequenceI[] - { seq }, lastres, startres - lastres); + appendEdit(Action.INSERT_NUC, new SequenceI[] { seq }, lastres, + startres - lastres); } } } @@ -1402,8 +1401,7 @@ public class SeqPanel extends JPanel implements MouseListener, final Edit edit = new EditCommand().new Edit(action, seq, pos, count, av.getAlignment().getGapCharacter()); - editCommand.appendEdit(edit, av.getAlignment(), - true, null); + editCommand.appendEdit(edit, av.getAlignment(), true, null); } void deleteChar(int j, SequenceI[] seq, int fixedColumn) @@ -1469,21 +1467,23 @@ public class SeqPanel extends JPanel implements MouseListener, av.setSelectionGroup(null); } - List features = seqCanvas.getFeatureRenderer().findFeaturesAtRes( - sequence.getDatasetSequence(), - sequence.findPosition(findRes(evt))); + List features = seqCanvas.getFeatureRenderer() + .findFeaturesAtRes(sequence.getDatasetSequence(), + sequence.findPosition(findRes(evt))); - if (features != null && features.size()> 0) + if (features != null && features.size() > 0) { SearchResults highlight = new SearchResults(); - highlight.addResult(sequence, features.get(0).getBegin(), - features.get(0).getEnd()); + highlight.addResult(sequence, features.get(0).getBegin(), features + .get(0).getEnd()); seqCanvas.highlightSearchResults(highlight); } - if (features != null && features.size()> 0) + if (features != null && features.size() > 0) { - seqCanvas.getFeatureRenderer().amendFeatures(new SequenceI[] - { sequence }, features.toArray(new SequenceFeature[features.size()]), false, ap); + seqCanvas.getFeatureRenderer().amendFeatures( + new SequenceI[] { sequence }, + features.toArray(new SequenceFeature[features.size()]), + false, ap); seqCanvas.highlightSearchResults(null); } @@ -1598,10 +1598,11 @@ public class SeqPanel extends JPanel implements MouseListener, if (javax.swing.SwingUtilities.isRightMouseButton(evt)) { - List allFeatures = ap.getFeatureRenderer().findFeaturesAtRes( - sequence.getDatasetSequence(), sequence.findPosition(res)); + List allFeatures = ap.getFeatureRenderer() + .findFeaturesAtRes(sequence.getDatasetSequence(), + sequence.findPosition(res)); Vector links = new Vector(); - for (SequenceFeature sf:allFeatures) + for (SequenceFeature sf : allFeatures) { if (sf.links != null) { @@ -1917,8 +1918,7 @@ public class SeqPanel extends JPanel implements MouseListener, // handles selection messages... // TODO: extend config options to allow user to control if selections may be // shared between viewports. - boolean iSentTheSelection = (av == source - || (source instanceof AlignViewport && ((AlignmentViewport) source) + boolean iSentTheSelection = (av == source || (source instanceof AlignViewport && ((AlignmentViewport) source) .getSequenceSetId().equals(av.getSequenceSetId()))); if (iSentTheSelection || !av.followSelection) { @@ -2034,11 +2034,13 @@ public class SeqPanel extends JPanel implements MouseListener, protected boolean selectionFromTranslation(SequenceGroup seqsel, ColumnSelection colsel, SelectionSource source) { - if (!(source instanceof AlignViewportI)) { + if (!(source instanceof AlignViewportI)) + { return false; } final AlignViewportI sourceAv = (AlignViewportI) source; - if (sourceAv.getCodingComplement() != av && av.getCodingComplement() != sourceAv) + if (sourceAv.getCodingComplement() != av + && av.getCodingComplement() != sourceAv) { return false; } diff --git a/src/jalview/gui/SequenceFetcher.java b/src/jalview/gui/SequenceFetcher.java index 6a0d010..a973757 100755 --- a/src/jalview/gui/SequenceFetcher.java +++ b/src/jalview/gui/SequenceFetcher.java @@ -115,6 +115,7 @@ public class SequenceFetcher extends JPanel implements Runnable private static Thread initingThread = null; int debounceTrap = 0; + /** * Blocking method that initialises and returns the shared instance of the * SequenceFetcher client @@ -130,9 +131,11 @@ public class SequenceFetcher extends JPanel implements Runnable { if (guiWindow != null) { - guiWindow.setProgressBar( - MessageManager.getString("status.waiting_sequence_database_fetchers_init"), - Thread.currentThread().hashCode()); + guiWindow + .setProgressBar( + MessageManager + .getString("status.waiting_sequence_database_fetchers_init"), + Thread.currentThread().hashCode()); } // initting happening on another thread - so wait around to see if it // finishes. @@ -149,9 +152,11 @@ public class SequenceFetcher extends JPanel implements Runnable } if (guiWindow != null) { - guiWindow.setProgressBar( - MessageManager.getString("status.waiting_sequence_database_fetchers_init"), - Thread.currentThread().hashCode()); + guiWindow + .setProgressBar( + MessageManager + .getString("status.waiting_sequence_database_fetchers_init"), + Thread.currentThread().hashCode()); } } if (sfetch == null @@ -168,7 +173,8 @@ public class SequenceFetcher extends JPanel implements Runnable */ if (guiWindow != null) { - guiWindow.setProgressBar(MessageManager.getString("status.init_sequence_database_fetchers"), + guiWindow.setProgressBar(MessageManager + .getString("status.init_sequence_database_fetchers"), Thread.currentThread().hashCode()); } dasRegistry = jalview.bin.Cache.getDasSourceRegistry(); @@ -189,6 +195,7 @@ public class SequenceFetcher extends JPanel implements Runnable } private IProgressIndicator progressIndicator; + public SequenceFetcher(IProgressIndicator guiIndic) { this.progressIndicator = guiIndic; @@ -214,8 +221,10 @@ public class SequenceFetcher extends JPanel implements Runnable JOptionPane .showInternalMessageDialog( Desktop.desktop, - MessageManager.getString("warn.couldnt_create_sequence_fetcher_client"), - MessageManager.getString("label.couldnt_create_sequence_fetcher"), + MessageManager + .getString("warn.couldnt_create_sequence_fetcher_client"), + MessageManager + .getString("label.couldnt_create_sequence_fetcher"), JOptionPane.ERROR_MESSAGE); } }); @@ -272,7 +281,9 @@ public class SequenceFetcher extends JPanel implements Runnable private String getFrameTitle() { - return ((alignFrame == null) ? MessageManager.getString("label.new_sequence_fetcher") : MessageManager.getString("label.additional_sequence_fetcher")); + return ((alignFrame == null) ? MessageManager + .getString("label.new_sequence_fetcher") : MessageManager + .getString("label.additional_sequence_fetcher")); } private void jbInit() throws Exception @@ -360,7 +371,7 @@ public class SequenceFetcher extends JPanel implements Runnable String currentSelection = database.getSelectedItem(); if (!currentSelection.equalsIgnoreCase("pdb")) { - otherSourceAction(); + otherSourceAction(); } if (currentSelection.equalsIgnoreCase("pdb") && (database.action == KeyEvent.VK_ENTER || ((debounceTrap % 2) == 0))) @@ -404,8 +415,7 @@ public class SequenceFetcher extends JPanel implements Runnable : "")); String eq = database.getExampleQueries(); dbeg.setText(MessageManager.formatMessage( - "label.example_query_param", new String[] - { eq })); + "label.example_query_param", new String[] { eq })); boolean enablePunct = !(eq != null && eq.indexOf(",") > -1); for (DbSourceProxy dbs : database.getSelectedSources()) { @@ -443,8 +453,6 @@ public class SequenceFetcher extends JPanel implements Runnable jPanel3.repaint(); } - - public void close_actionPerformed(ActionEvent e) { try @@ -537,8 +545,13 @@ public class SequenceFetcher extends JPanel implements Runnable try { // update status - guiWindow.setProgressBar(MessageManager.formatMessage("status.fetching_sequence_queries_from", new String[]{Integer.valueOf(nqueries).toString(),proxy.getDbName()}), Thread - .currentThread().hashCode()); + guiWindow + .setProgressBar(MessageManager.formatMessage( + "status.fetching_sequence_queries_from", + new String[] { + Integer.valueOf(nqueries).toString(), + proxy.getDbName() }), Thread.currentThread() + .hashCode()); isAliSource = proxy.isA(DBRefSource.ALIGNMENTDB); if (proxy.getAccessionSeparator() == null) { @@ -735,11 +748,15 @@ public class SequenceFetcher extends JPanel implements Runnable presultTitle.add(titl); } } - guiWindow.setProgressBar(MessageManager.getString("status.finshed_querying"), Thread.currentThread() + guiWindow.setProgressBar(MessageManager + .getString("status.finshed_querying"), Thread.currentThread() .hashCode()); } - guiWindow.setProgressBar((presult.size() > 0) ? MessageManager.getString("status.parsing_results") - : MessageManager.getString("status.processing"), Thread.currentThread().hashCode()); + guiWindow.setProgressBar( + (presult.size() > 0) ? MessageManager + .getString("status.parsing_results") : MessageManager + .getString("status.processing"), Thread.currentThread() + .hashCode()); // process results while (presult.size() > 0) { @@ -891,8 +908,6 @@ public class SequenceFetcher extends JPanel implements Runnable return progressIndicator; } - - public void setProgressIndicator(IProgressIndicator progressIndicator) { this.progressIndicator = progressIndicator; diff --git a/src/jalview/gui/SequenceRenderer.java b/src/jalview/gui/SequenceRenderer.java index 273bfd9..258a229 100755 --- a/src/jalview/gui/SequenceRenderer.java +++ b/src/jalview/gui/SequenceRenderer.java @@ -217,7 +217,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer int y1) { if (seq == null) - { + { return; // fix for racecondition } int i = start; @@ -425,8 +425,7 @@ public class SequenceRenderer implements jalview.api.SequenceRenderer charOffset = (av.getCharWidth() - fm.charWidth(s)) / 2; graphics.drawString(String.valueOf(s), - charOffset + av.getCharWidth() - * (i - start), y1); + charOffset + av.getCharWidth() * (i - start), y1); } } diff --git a/src/jalview/gui/SliderPanel.java b/src/jalview/gui/SliderPanel.java index af6bfff..e1e70dc 100755 --- a/src/jalview/gui/SliderPanel.java +++ b/src/jalview/gui/SliderPanel.java @@ -140,7 +140,10 @@ public class SliderPanel extends GSliderPanel sp.cs = cs; } - conservationSlider.setTitle(MessageManager.formatMessage("label.conservation_colour_increment", new String[]{source})); + conservationSlider + .setTitle(MessageManager.formatMessage( + "label.conservation_colour_increment", + new String[] { source })); if (ap.av.getAlignment().getGroups() != null) { @@ -216,7 +219,9 @@ public class SliderPanel extends GSliderPanel pid.cs = cs; } - PIDSlider.setTitle(MessageManager.formatMessage("label.percentage_identity_thereshold", new String[]{source})); + PIDSlider.setTitle(MessageManager + .formatMessage("label.percentage_identity_thereshold", + new String[] { source })); if (ap.av.getAlignment().getGroups() != null) { diff --git a/src/jalview/gui/SplitFrame.java b/src/jalview/gui/SplitFrame.java index aa658ce..9e2281e 100644 --- a/src/jalview/gui/SplitFrame.java +++ b/src/jalview/gui/SplitFrame.java @@ -72,7 +72,7 @@ public class SplitFrame extends GSplitFrame implements SplitContainerI adjustLayout(); addCloseFrameListener(); - + addKeyListener(); addKeyBindings(); @@ -155,7 +155,8 @@ public class SplitFrame extends GSplitFrame implements SplitContainerI */ protected void addKeyListener() { - addKeyListener(new KeyAdapter() { + addKeyListener(new KeyAdapter() + { @Override public void keyPressed(KeyEvent e) @@ -189,7 +190,7 @@ public class SplitFrame extends GSplitFrame implements SplitContainerI } } } - + }); } @@ -638,4 +639,3 @@ public class SplitFrame extends GSplitFrame implements SplitContainerI overrideKeyBinding(key_cmdF, action); } } - diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index 510ce78..347c1b2 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -75,7 +75,6 @@ public class StructureChooser extends GStructureChooser private boolean isValidPBDEntry; - public StructureChooser(SequenceI[] selectedSeqs, SequenceI selectedSeq, AlignmentPanel ap) { @@ -210,7 +209,8 @@ public class StructureChooser extends GStructureChooser if (seq.getDatasetSequence() != null && seq.getDatasetSequence().getAllPDBEntries() != null) { - for (PDBEntry pdbEntry : seq.getDatasetSequence().getAllPDBEntries()) + for (PDBEntry pdbEntry : seq.getDatasetSequence() + .getAllPDBEntries()) { if (pdbEntry.getFile() != null) { @@ -224,7 +224,6 @@ public class StructureChooser extends GStructureChooser tbl_local_pdb.setModel(tableModelx); } - /** * Builds a query string for a given sequences using its DBRef entries * @@ -390,14 +389,12 @@ public class StructureChooser extends GStructureChooser // Update table selection model here tbl_summary.addRowSelectionInterval(0, filterResponseCount - 1); mainFrame.setTitle(MessageManager.formatMessage( - "label.structure_chooser_filter_time", - totalTime)); + "label.structure_chooser_filter_time", totalTime)); } else { mainFrame.setTitle(MessageManager.formatMessage( - "label.structure_chooser_filter_time", - totalTime)); + "label.structure_chooser_filter_time", totalTime)); if (errors.size() > 0) { StringBuilder errorMsg = new StringBuilder(); @@ -405,7 +402,9 @@ public class StructureChooser extends GStructureChooser { errorMsg.append(error).append("\n"); } - JOptionPane.showMessageDialog(null, errorMsg.toString(), + JOptionPane.showMessageDialog( + null, + errorMsg.toString(), MessageManager.getString("label.pdb_web-service_error"), JOptionPane.ERROR_MESSAGE); } @@ -546,9 +545,9 @@ public class StructureChooser extends GStructureChooser lbl_pdbManualFetchStatus.setToolTipText(""); if (txt_search.getText().length() > 0) { - lbl_pdbManualFetchStatus.setToolTipText(JvSwingUtils.wrapTooltip( - true, MessageManager.formatMessage( - "info.no_pdb_entry_found_for", + lbl_pdbManualFetchStatus + .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager + .formatMessage("info.no_pdb_entry_found_for", txt_search.getText()))); } @@ -715,11 +714,9 @@ public class StructureChooser extends GStructureChooser selectedSequence.getDatasetSequence().addPDBId(pdbEntry); } - PDBEntry[] pdbEntriesToView = new PDBEntry[] - { pdbEntry }; + PDBEntry[] pdbEntriesToView = new PDBEntry[] { pdbEntry }; launchStructureViewer(ap.getStructureSelectionManager(), - pdbEntriesToView, ap, new SequenceI[] - { selectedSequence }); + pdbEntriesToView, ap, new SequenceI[] { selectedSequence }); } else if (currentView == VIEWS_FROM_FILE) { @@ -735,9 +732,8 @@ public class StructureChooser extends GStructureChooser selectedSequence, true, Desktop.instance); launchStructureViewer(ap.getStructureSelectionManager(), - new PDBEntry[] - { fileEntry }, ap, new SequenceI[] - { selectedSequence }); + new PDBEntry[] { fileEntry }, ap, + new SequenceI[] { selectedSequence }); } mainFrame.dispose(); } @@ -756,8 +752,7 @@ public class StructureChooser extends GStructureChooser ArrayList seqsMap = new ArrayList(); for (SequenceI seq : sequences) { - seqsMap.add(new SequenceI[] - { seq }); + seqsMap.add(new SequenceI[] { seq }); } SequenceI[][] collatedSeqs = seqsMap.toArray(new SequenceI[0][0]); sViewer.viewStructures(pdbEntriesToView, collatedSeqs, alignPanel); @@ -820,40 +815,40 @@ public class StructureChooser extends GStructureChooser { public void run() { - errorWarning.setLength(0); - isValidPBDEntry = false; - if (txt_search.getText().length() > 0) - { - List wantedFields = new ArrayList(); - wantedFields.add(PDBDocField.PDB_ID); - PDBRestRequest pdbRequest = new PDBRestRequest(); - pdbRequest.setAllowEmptySeq(false); - pdbRequest.setResponseSize(1); - pdbRequest.setFieldToSearchBy("(pdb_id:"); - pdbRequest.setWantedFields(wantedFields); - pdbRequest.setSearchTerm(txt_search.getText() + ")"); - pdbRequest.setAssociatedSequence(selectedSequence); - pdbRestCleint = new PDBRestClient(); - PDBRestResponse resultList; - try - { - resultList = pdbRestCleint.executeRequest(pdbRequest); - } catch (Exception e) - { - errorWarning.append(e.getMessage()); - return; - } finally - { + errorWarning.setLength(0); + isValidPBDEntry = false; + if (txt_search.getText().length() > 0) + { + List wantedFields = new ArrayList(); + wantedFields.add(PDBDocField.PDB_ID); + PDBRestRequest pdbRequest = new PDBRestRequest(); + pdbRequest.setAllowEmptySeq(false); + pdbRequest.setResponseSize(1); + pdbRequest.setFieldToSearchBy("(pdb_id:"); + pdbRequest.setWantedFields(wantedFields); + pdbRequest.setSearchTerm(txt_search.getText() + ")"); + pdbRequest.setAssociatedSequence(selectedSequence); + pdbRestCleint = new PDBRestClient(); + PDBRestResponse resultList; + try + { + resultList = pdbRestCleint.executeRequest(pdbRequest); + } catch (Exception e) + { + errorWarning.append(e.getMessage()); + return; + } finally + { + validateSelections(); + } + if (resultList.getSearchSummary() != null + && resultList.getSearchSummary().size() > 0) + { + isValidPBDEntry = true; + } + } validateSelections(); } - if (resultList.getSearchSummary() != null - && resultList.getSearchSummary().size() > 0) - { - isValidPBDEntry = true; - } - } - validateSelections(); - } }.start(); } @@ -878,8 +873,7 @@ public class StructureChooser extends GStructureChooser public class PDBEntryTableModel extends AbstractTableModel { - String[] columns = - { "Ref Sequence", "PDB Id", "Chain", "Type", "File" }; + String[] columns = { "Ref Sequence", "PDB Id", "Chain", "Type", "File" }; private List pdbEntries; diff --git a/src/jalview/gui/StructureViewer.java b/src/jalview/gui/StructureViewer.java index 2285765..21b2984 100644 --- a/src/jalview/gui/StructureViewer.java +++ b/src/jalview/gui/StructureViewer.java @@ -20,10 +20,6 @@ */ package jalview.gui; -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.List; - import jalview.api.structures.JalviewStructureDisplayI; import jalview.bin.Cache; import jalview.datamodel.PDBEntry; @@ -31,6 +27,10 @@ import jalview.datamodel.SequenceI; import jalview.datamodel.StructureViewerModel; import jalview.structure.StructureSelectionManager; +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.List; + /** * proxy for handling structure viewers. * @@ -98,8 +98,7 @@ public class StructureViewer * @return */ private JalviewStructureDisplayI onlyOnePdb(PDBEntry[] pdbs, - SequenceI[][] seqsForPdbs, - AlignmentPanel ap) + SequenceI[][] seqsForPdbs, AlignmentPanel ap) { List seqs = new ArrayList(); if (pdbs == null || pdbs.length == 0) @@ -190,8 +189,8 @@ public class StructureViewer */ public JalviewStructureDisplayI createView(ViewerType type, String[] pdbf, String[] id, SequenceI[][] sq, - AlignmentPanel alignPanel, StructureViewerModel viewerData, String fileloc, - Rectangle rect, String vid) + AlignmentPanel alignPanel, StructureViewerModel viewerData, + String fileloc, Rectangle rect, String vid) { final boolean useinViewerSuperpos = viewerData.isAlignWithPanel(); final boolean usetoColourbyseq = viewerData.isColourWithAlignPanel(); diff --git a/src/jalview/gui/StructureViewerBase.java b/src/jalview/gui/StructureViewerBase.java index 587e08a..9ba50ca 100644 --- a/src/jalview/gui/StructureViewerBase.java +++ b/src/jalview/gui/StructureViewerBase.java @@ -32,20 +32,28 @@ public abstract class StructureViewerBase extends GStructureViewer * list of sequenceSet ids associated with the view */ protected List _aps = new ArrayList(); + /** * list of alignment panels to use for superposition */ protected Vector _alignwith = new Vector(); + /** * list of alignment panels that are used for colouring structures by aligned * sequences */ protected Vector _colourwith = new Vector(); + private String viewId = null; + private AlignmentPanel ap; + protected boolean alignAddedStructures = false; + protected boolean _started = false; + protected boolean addingStructures = false; + protected Thread worker = null; /** @@ -60,7 +68,7 @@ public abstract class StructureViewerBase extends GStructureViewer public boolean isUsedforaligment(AlignmentPanel ap2) { - + return (_alignwith != null) && _alignwith.contains(ap2); } @@ -138,7 +146,7 @@ public abstract class StructureViewerBase extends GStructureViewer list = t; } } - + return list; } @@ -209,7 +217,8 @@ public abstract class StructureViewerBase extends GStructureViewer } } - public void useAlignmentPanelForColourbyseq(AlignmentPanel nap, boolean enableColourBySeq) + public void useAlignmentPanelForColourbyseq(AlignmentPanel nap, + boolean enableColourBySeq) { useAlignmentPanelForColourbyseq(nap); getBinding().setColourBySequence(enableColourBySeq); @@ -250,7 +259,8 @@ public abstract class StructureViewerBase extends GStructureViewer * alignment * @param alignFrame */ - protected void addStructure(final PDBEntry pdbentry, final SequenceI[] seqs, final String[] chains, + protected void addStructure(final PDBEntry pdbentry, + final SequenceI[] seqs, final String[] chains, final boolean align, final IProgressIndicator alignFrame) { if (pdbentry.getFile() == null) @@ -268,7 +278,7 @@ public abstract class StructureViewerBase extends GStructureViewer try { Thread.sleep(100 + ((int) Math.random() * 100)); - + } catch (Exception e) { } @@ -299,12 +309,13 @@ public abstract class StructureViewerBase extends GStructureViewer * @param view * @return YES, NO or CANCEL JOptionPane code */ - protected int chooseAlignStructureToViewer(String pdbId, StructureViewerBase view) + protected int chooseAlignStructureToViewer(String pdbId, + StructureViewerBase view) { int option = JOptionPane.showInternalConfirmDialog(Desktop.desktop, MessageManager.formatMessage("label.add_pdbentry_to_view", - new Object[] - { pdbId, view.getTitle() }), MessageManager + new Object[] { pdbId, view.getTitle() }), + MessageManager .getString("label.align_to_existing_structure_view"), JOptionPane.YES_NO_CANCEL_OPTION); return option; @@ -356,7 +367,7 @@ public abstract class StructureViewerBase extends GStructureViewer // NO_OPTION - offer the next viewer if any } } - + /* * nothing offered and selected */ @@ -379,9 +390,9 @@ public abstract class StructureViewerBase extends GStructureViewer /* * create the mappings */ - apanel.getStructureSelectionManager().setMapping(seq, chains, pdbFilename, - AppletFormatAdapter.FILE); - + apanel.getStructureSelectionManager().setMapping(seq, chains, + pdbFilename, AppletFormatAdapter.FILE); + /* * alert the FeatureRenderer to show new (PDB RESNUM) features */ @@ -390,7 +401,7 @@ public abstract class StructureViewerBase extends GStructureViewer apanel.getSeqPanel().seqCanvas.fr.featuresAdded(); apanel.paintAlignment(true); } - + /* * add the sequences to any other viewers (of the same type) for this pdb * file @@ -411,7 +422,8 @@ public abstract class StructureViewerBase extends GStructureViewer */ viewer.useAlignmentPanelForColourbyseq(apanel); viewer.buildActionMenu(); - apanel.getStructureSelectionManager().sequenceColoursChanged(apanel); + apanel.getStructureSelectionManager().sequenceColoursChanged( + apanel); break; } } @@ -434,18 +446,20 @@ public abstract class StructureViewerBase extends GStructureViewer boolean finished = false; String alreadyMapped = apanel.getStructureSelectionManager() .alreadyMappedToFile(pdbId); - + if (alreadyMapped != null) { /* * the PDB file is already loaded */ int option = JOptionPane.showInternalConfirmDialog(Desktop.desktop, - MessageManager.formatMessage( - "label.pdb_entry_is_already_displayed", new Object[] - { pdbId }), MessageManager.formatMessage( - "label.map_sequences_to_visible_window", new Object[] - { pdbId }), JOptionPane.YES_NO_CANCEL_OPTION); + MessageManager.formatMessage( + "label.pdb_entry_is_already_displayed", + new Object[] { pdbId }), MessageManager + .formatMessage( + "label.map_sequences_to_visible_window", + new Object[] { pdbId }), + JOptionPane.YES_NO_CANCEL_OPTION); if (option == JOptionPane.CANCEL_OPTION) { finished = true; diff --git a/src/jalview/gui/TextColourChooser.java b/src/jalview/gui/TextColourChooser.java index c8a4a08..6bac6df 100644 --- a/src/jalview/gui/TextColourChooser.java +++ b/src/jalview/gui/TextColourChooser.java @@ -78,8 +78,11 @@ public class TextColourChooser JPanel panel = new JPanel(); bigpanel.add(panel, BorderLayout.CENTER); bigpanel.add( - new JLabel(""+MessageManager.getString("label.select_dark_light_set_thereshold")+""), - BorderLayout.NORTH); + new JLabel( + "" + + MessageManager + .getString("label.select_dark_light_set_thereshold") + + ""), BorderLayout.NORTH); panel.add(col1); panel.add(slider); panel.add(col2); @@ -89,7 +92,8 @@ public class TextColourChooser public void mousePressed(MouseEvent e) { Color col = JColorChooser.showDialog(bigpanel, - MessageManager.getString("label.select_colour_for_text"), col1.getBackground()); + MessageManager.getString("label.select_colour_for_text"), + col1.getBackground()); if (col != null) { colour1Changed(col); @@ -103,7 +107,8 @@ public class TextColourChooser public void mousePressed(MouseEvent e) { Color col = JColorChooser.showDialog(bigpanel, - MessageManager.getString("label.select_colour_for_text"), col2.getBackground()); + MessageManager.getString("label.select_colour_for_text"), + col2.getBackground()); if (col != null) { colour2Changed(col); @@ -120,10 +125,14 @@ public class TextColourChooser } }); - int reply = JOptionPane.showInternalOptionDialog(ap, bigpanel, - MessageManager.getString("label.adjunst_foreground_text_colour_thereshold"), - JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, - null, null, null); + int reply = JOptionPane + .showInternalOptionDialog( + ap, + bigpanel, + MessageManager + .getString("label.adjunst_foreground_text_colour_thereshold"), + JOptionPane.OK_CANCEL_OPTION, + JOptionPane.QUESTION_MESSAGE, null, null, null); if (reply == JOptionPane.CANCEL_OPTION) { diff --git a/src/jalview/gui/TreeCanvas.java b/src/jalview/gui/TreeCanvas.java index 1bce84b..9cb3d18 100755 --- a/src/jalview/gui/TreeCanvas.java +++ b/src/jalview/gui/TreeCanvas.java @@ -294,8 +294,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, SequenceGroup selected = av.getSelectionGroup(); if ((selected != null) - && selected.getSequences(null).contains( - node.element())) + && selected.getSequences(null).contains(node.element())) { g.setColor(Color.gray); @@ -713,8 +712,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, labelLength = fm.stringWidth(longestName) + 20; // 20 allows for scrollbar - float wscale = (width - labelLength - (offx * 2)) - / tree.getMaxHeight(); + float wscale = (width - labelLength - (offx * 2)) / tree.getMaxHeight(); SequenceNode top = tree.getTopNode(); @@ -788,7 +786,8 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, if (SwingUtilities.isRightMouseButton(evt)) { Color col = JColorChooser.showDialog(this, - MessageManager.getString("label.select_subtree_colour"), highlightNode.color); + MessageManager.getString("label.select_subtree_colour"), + highlightNode.color); if (col != null) { setColor(highlightNode, col); @@ -1008,7 +1007,8 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, if (av.getCodingComplement() != null) { - ((AlignViewport) av.getCodingComplement()).getAlignPanel().updateAnnotation(); + ((AlignViewport) av.getCodingComplement()).getAlignPanel() + .updateAnnotation(); /* * idPanel. repaint () */ @@ -1059,8 +1059,7 @@ public class TreeCanvas extends JPanel implements MouseListener, Runnable, } else { - return new AlignmentPanel[] - { ap }; + return new AlignmentPanel[] { ap }; } } } diff --git a/src/jalview/gui/TreePanel.java b/src/jalview/gui/TreePanel.java index a806183..d2c86c8 100755 --- a/src/jalview/gui/TreePanel.java +++ b/src/jalview/gui/TreePanel.java @@ -439,7 +439,8 @@ public class TreePanel extends GTreePanel JalviewFileChooser chooser = new JalviewFileChooser( jalview.bin.Cache.getProperty("LAST_DIRECTORY")); chooser.setFileView(new JalviewFileView()); - chooser.setDialogTitle(MessageManager.getString("label.save_tree_as_newick")); + chooser.setDialogTitle(MessageManager + .getString("label.save_tree_as_newick")); chooser.setToolTipText(MessageManager.getString("action.save")); int value = chooser.showSaveDialog(null); @@ -533,8 +534,8 @@ public class TreePanel extends GTreePanel // msaorder); Desktop.addInternalFrame(af, MessageManager.formatMessage( - "label.original_data_for_params", new Object[] - { this.title }), AlignFrame.DEFAULT_WIDTH, + "label.original_data_for_params", + new Object[] { this.title }), AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); } } @@ -733,10 +734,11 @@ public class TreePanel extends GTreePanel { jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser( jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] - { "eps" }, new String[] - { "Encapsulated Postscript" }, "Encapsulated Postscript"); + { "eps" }, new String[] { "Encapsulated Postscript" }, + "Encapsulated Postscript"); chooser.setFileView(new jalview.io.JalviewFileView()); - chooser.setDialogTitle(MessageManager.getString("label.create_eps_from_tree")); + chooser.setDialogTitle(MessageManager + .getString("label.create_eps_from_tree")); chooser.setToolTipText(MessageManager.getString("action.save")); int value = chooser.showSaveDialog(this); @@ -779,11 +781,12 @@ public class TreePanel extends GTreePanel { jalview.io.JalviewFileChooser chooser = new jalview.io.JalviewFileChooser( jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] - { "png" }, new String[] - { "Portable network graphics" }, "Portable network graphics"); + { "png" }, new String[] { "Portable network graphics" }, + "Portable network graphics"); chooser.setFileView(new jalview.io.JalviewFileView()); - chooser.setDialogTitle(MessageManager.getString("label.create_png_from_tree")); + chooser.setDialogTitle(MessageManager + .getString("label.create_png_from_tree")); chooser.setToolTipText(MessageManager.getString("action.save")); int value = chooser.showSaveDialog(this); @@ -837,8 +840,8 @@ public class TreePanel extends GTreePanel { // search dbrefs, features and annotation DBRefEntry[] refs = jalview.util.DBRefUtils.selectRefs( - sq.getDBRef(), new String[] - { labelClass.toUpperCase() }); + 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 a907187..c9c1531 100755 --- a/src/jalview/gui/UserDefinedColours.java +++ b/src/jalview/gui/UserDefinedColours.java @@ -20,6 +20,16 @@ */ package jalview.gui; +import jalview.api.structures.JalviewStructureDisplayI; +import jalview.datamodel.SequenceGroup; +import jalview.io.JalviewFileChooser; +import jalview.jbgui.GUserDefinedColours; +import jalview.schemes.ColourSchemeI; +import jalview.schemes.ResidueProperties; +import jalview.schemes.UserColourScheme; +import jalview.util.ColorUtils; +import jalview.util.MessageManager; + import java.awt.Color; import java.awt.Font; import java.awt.event.ActionEvent; @@ -40,16 +50,6 @@ import javax.swing.JOptionPane; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; -import jalview.api.structures.JalviewStructureDisplayI; -import jalview.datamodel.SequenceGroup; -import jalview.io.JalviewFileChooser; -import jalview.jbgui.GUserDefinedColours; -import jalview.schemes.ColourSchemeI; -import jalview.schemes.ResidueProperties; -import jalview.schemes.UserColourScheme; -import jalview.util.ColorUtils; -import jalview.util.MessageManager; - /** * This panel allows the user to assign colours to Amino Acid residue codes, and * save the colour scheme. @@ -486,7 +486,8 @@ public class UserDefinedColours extends GUserDefinedColours implements || upperCaseButtons.isEmpty(); final boolean noLowerCaseSelected = caseSensitive.isSelected() && (lowerCaseButtons == null || lowerCaseButtons.isEmpty()); - final boolean noSelectionMade = noUpperCaseSelected || noLowerCaseSelected; + final boolean noSelectionMade = noUpperCaseSelected + || noLowerCaseSelected; return noSelectionMade; } @@ -501,12 +502,13 @@ public class UserDefinedColours extends GUserDefinedColours implements { if (isNoSelectionMade()) { - JOptionPane.showMessageDialog(Desktop.desktop, - MessageManager.getString("label.no_colour_selection_in_scheme"),MessageManager.getString("label.no_colour_selection_warn"), - JOptionPane.WARNING_MESSAGE); - - } - UserColourScheme ucs = getSchemeFromButtons(); + JOptionPane.showMessageDialog(Desktop.desktop, MessageManager + .getString("label.no_colour_selection_in_scheme"), + MessageManager.getString("label.no_colour_selection_warn"), + JOptionPane.WARNING_MESSAGE); + + } + UserColourScheme ucs = getSchemeFromButtons(); ucs.setName(schemeName.getText()); if (seqGroup != null) @@ -530,17 +532,22 @@ public class UserDefinedColours extends GUserDefinedColours implements Color[] newColours = new Color[24]; int length = upperCaseButtons.size(); - if (length<24){ - int i = 0; - for (JButton btn:upperCaseButtons){ - newColours[i] = btn.getBackground(); - i++; - } - }else{ - for (int i = 0; i < 24; i++){ - JButton button = upperCaseButtons.get(i); - newColours[i] = button.getBackground(); - } + if (length < 24) + { + int i = 0; + for (JButton btn : upperCaseButtons) + { + newColours[i] = btn.getBackground(); + i++; + } + } + else + { + for (int i = 0; i < 24; i++) + { + JButton button = upperCaseButtons.get(i); + newColours[i] = button.getBackground(); + } } UserColourScheme ucs = new UserColourScheme(newColours); @@ -549,17 +556,22 @@ public class UserDefinedColours extends GUserDefinedColours implements { newColours = new Color[23]; length = lowerCaseButtons.size(); - if (length<23){ - int i = 0; - for (JButton btn:lowerCaseButtons){ - newColours[i] = btn.getBackground(); - i++; - } - }else{ - for (int i = 0; i < 23; i++){ - JButton button = lowerCaseButtons.get(i); - newColours[i] = button.getBackground(); - } + if (length < 23) + { + int i = 0; + for (JButton btn : lowerCaseButtons) + { + newColours[i] = btn.getBackground(); + i++; + } + } + else + { + for (int i = 0; i < 23; i++) + { + JButton button = lowerCaseButtons.get(i); + newColours[i] = button.getBackground(); + } } ucs.setLowerCaseColours(newColours); } @@ -585,9 +597,9 @@ public class UserDefinedColours extends GUserDefinedColours implements lowerCaseButtons = new ArrayList(); JalviewFileChooser chooser = new JalviewFileChooser( - jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] - { "jc" }, new String[] - { "Jalview User Colours" }, "Jalview User Colours"); + 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(MessageManager .getString("label.load_colour_scheme")); @@ -710,8 +722,7 @@ public class UserDefinedColours extends GUserDefinedColours implements name = jucs.getColour(i).getName(); if (ResidueProperties.aa3Hash.containsKey(name)) { - index = ResidueProperties.aa3Hash.get(name) - .intValue(); + index = ResidueProperties.aa3Hash.get(name).intValue(); } else { @@ -810,8 +821,8 @@ public class UserDefinedColours extends GUserDefinedColours implements { int reply = JOptionPane.showInternalConfirmDialog(Desktop.desktop, MessageManager.formatMessage( - "label.colour_scheme_exists_overwrite", new Object[] - { schemeName.getText(), schemeName.getText() }), + "label.colour_scheme_exists_overwrite", new Object[] { + schemeName.getText(), schemeName.getText() }), MessageManager.getString("label.duplicate_scheme_name"), JOptionPane.YES_NO_OPTION); if (reply != JOptionPane.YES_OPTION) @@ -822,12 +833,13 @@ 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"); + 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(MessageManager.getString("label.save_colour_scheme")); + chooser.setDialogTitle(MessageManager + .getString("label.save_colour_scheme")); chooser.setToolTipText(MessageManager.getString("action.save")); int value = chooser.showSaveDialog(this); diff --git a/src/jalview/gui/UserQuestionnaireCheck.java b/src/jalview/gui/UserQuestionnaireCheck.java index 02f6054..eb38ee6 100644 --- a/src/jalview/gui/UserQuestionnaireCheck.java +++ b/src/jalview/gui/UserQuestionnaireCheck.java @@ -22,10 +22,11 @@ package jalview.gui; import jalview.util.MessageManager; -import java.io.*; -import java.net.*; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.URL; -import javax.swing.*; +import javax.swing.JOptionPane; public class UserQuestionnaireCheck implements Runnable { diff --git a/src/jalview/gui/VamsasApplication.java b/src/jalview/gui/VamsasApplication.java index 6444667..7588e07 100644 --- a/src/jalview/gui/VamsasApplication.java +++ b/src/jalview/gui/VamsasApplication.java @@ -156,7 +156,9 @@ public class VamsasApplication implements SelectionSource, VamsasSource { if (sess != null) { - throw new Error(MessageManager.getString("error.implementation_error_cannot_import_vamsas_doc")); + throw new Error( + MessageManager + .getString("error.implementation_error_cannot_import_vamsas_doc")); } try { @@ -176,8 +178,10 @@ public class VamsasApplication implements SelectionSource, VamsasSource .showInternalMessageDialog( Desktop.desktop, - MessageManager.getString("label.vamsas_doc_couldnt_be_opened_as_new_session"), - MessageManager.getString("label.vamsas_document_import_failed"), + MessageManager + .getString("label.vamsas_doc_couldnt_be_opened_as_new_session"), + MessageManager + .getString("label.vamsas_document_import_failed"), JOptionPane.ERROR_MESSAGE); } @@ -263,7 +267,9 @@ public class VamsasApplication implements SelectionSource, VamsasSource { if (!inSession()) { - throw new Error(MessageManager.getString("error.implementation_error_vamsas_operation_not_init")); + throw new Error( + MessageManager + .getString("error.implementation_error_vamsas_operation_not_init")); } addDocumentUpdateHandler(); addStoreDocumentHandler(); @@ -348,7 +354,9 @@ public class VamsasApplication implements SelectionSource, VamsasSource { if (!inSession()) { - throw new Error(MessageManager.getString("error.jalview_no_connected_vamsas_session")); + throw new Error( + MessageManager + .getString("error.jalview_no_connected_vamsas_session")); } Cache.log.info("Jalview disconnecting from the Vamsas Session."); try @@ -717,7 +725,9 @@ public class VamsasApplication implements SelectionSource, VamsasSource return; } - throw new Error(MessageManager.getString("error.implementation_error_cannot_recover_vamsas_object_mappings")); + throw new Error( + MessageManager + .getString("error.implementation_error_cannot_recover_vamsas_object_mappings")); } jv2vobj.clear(); Iterator el = _backup_jv2vobj.entrySet().iterator(); @@ -1013,9 +1023,9 @@ public class VamsasApplication implements SelectionSource, VamsasSource if (source instanceof AlignViewport) { // the empty selection. - sm = new SelectionMessage("jalview", new String[] - { ((AlignmentViewport) source).getSequenceSetId() }, null, - true); + sm = new SelectionMessage("jalview", + new String[] { ((AlignmentViewport) source) + .getSequenceSetId() }, null, true); } else { diff --git a/src/jalview/gui/ViewSelectionMenu.java b/src/jalview/gui/ViewSelectionMenu.java index e12fb5b..f1e2467 100644 --- a/src/jalview/gui/ViewSelectionMenu.java +++ b/src/jalview/gui/ViewSelectionMenu.java @@ -20,6 +20,8 @@ */ package jalview.gui; +import jalview.util.MessageManager; + import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -35,8 +37,6 @@ import javax.swing.JMenuItem; import javax.swing.event.MenuEvent; import javax.swing.event.MenuListener; -import jalview.util.MessageManager; - /** * this is an implementation of an abstract Jalview GUI class that provides a * dialog/menu which allows the user to select/deselect specific views from a diff --git a/src/jalview/gui/WebserviceInfo.java b/src/jalview/gui/WebserviceInfo.java index 8e78b93..dd0e6c2 100644 --- a/src/jalview/gui/WebserviceInfo.java +++ b/src/jalview/gui/WebserviceInfo.java @@ -20,6 +20,10 @@ */ package jalview.gui; +import jalview.jbgui.GWebserviceInfo; +import jalview.util.MessageManager; +import jalview.ws.WSClientI; + import java.awt.BorderLayout; import java.awt.Color; import java.awt.Font; @@ -45,10 +49,6 @@ import javax.swing.event.HyperlinkListener; import javax.swing.text.html.HTMLEditorKit; import javax.swing.text.html.StyleSheet; -import jalview.jbgui.GWebserviceInfo; -import jalview.util.MessageManager; -import jalview.ws.WSClientI; - /** * Base class for web service client thread and gui TODO: create StAX parser to * extract html body content reliably when preparing html formatted job statuses @@ -386,7 +386,9 @@ public class WebserviceInfo extends GWebserviceInfo implements { if (jobpane < 0 || jobpane >= jobPanes.size()) { - throw new Error(MessageManager.formatMessage("error.setstatus_called_non_existent_job_pane", new String[]{Integer.valueOf(jobpane).toString()})); + throw new Error(MessageManager.formatMessage( + "error.setstatus_called_non_existent_job_pane", + new String[] { Integer.valueOf(jobpane).toString() })); } switch (status) { @@ -680,7 +682,9 @@ public class WebserviceInfo extends GWebserviceInfo implements // anyhow - it has to stop threads and clean up // JBPNote : TODO: Instead of a warning, we should have an optional 'Are // you sure?' prompt - warnUser(MessageManager.getString("warn.job_cannot_be_cancelled_close_window"), + warnUser( + MessageManager + .getString("warn.job_cannot_be_cancelled_close_window"), MessageManager.getString("action.cancel_job")); } else diff --git a/src/jalview/gui/WsJobParameters.java b/src/jalview/gui/WsJobParameters.java index a3a61b7..c4d215e 100644 --- a/src/jalview/gui/WsJobParameters.java +++ b/src/jalview/gui/WsJobParameters.java @@ -20,6 +20,19 @@ */ package jalview.gui; +import jalview.gui.OptsAndParamsPage.OptionBox; +import jalview.gui.OptsAndParamsPage.ParamBox; +import jalview.util.MessageManager; +import jalview.ws.jws2.JabaParamStore; +import jalview.ws.jws2.JabaPreset; +import jalview.ws.jws2.Jws2Discoverer; +import jalview.ws.jws2.jabaws2.Jws2Instance; +import jalview.ws.params.ArgumentI; +import jalview.ws.params.OptionI; +import jalview.ws.params.ParamDatastoreI; +import jalview.ws.params.ParameterI; +import jalview.ws.params.WsParamSetI; + import java.awt.BorderLayout; import java.awt.Component; import java.awt.Dimension; @@ -66,19 +79,6 @@ import compbio.metadata.Preset; import compbio.metadata.PresetManager; import compbio.metadata.RunnerConfig; -import jalview.gui.OptsAndParamsPage.OptionBox; -import jalview.gui.OptsAndParamsPage.ParamBox; -import jalview.util.MessageManager; -import jalview.ws.jws2.JabaParamStore; -import jalview.ws.jws2.JabaPreset; -import jalview.ws.jws2.Jws2Discoverer; -import jalview.ws.jws2.jabaws2.Jws2Instance; -import jalview.ws.params.ArgumentI; -import jalview.ws.params.OptionI; -import jalview.ws.params.ParamDatastoreI; -import jalview.ws.params.ParameterI; -import jalview.ws.params.WsParamSetI; - /** * job parameter editing/browsing dialog box. User can browse existing settings * (user + presets + Defaults), and any changes to parameters creates a modified @@ -219,8 +219,7 @@ public class WsJobParameters extends JPanel implements ItemListener, frame = new JDialog(Desktop.instance, true); frame.setTitle(MessageManager.formatMessage("label.edit_params_for", - new String[] - { service.getActionText() })); + new String[] { service.getActionText() })); Rectangle deskr = Desktop.instance.getBounds(); Dimension pref = this.getPreferredSize(); frame.setBounds(new Rectangle( @@ -1101,8 +1100,8 @@ public class WsJobParameters extends JPanel implements ItemListener, WsJobParameters pgui = new WsJobParameters(lastserv, new JabaPreset(lastserv, pr)); JFrame jf = new JFrame(MessageManager.formatMessage( - "label.ws_parameters_for", new String[] - { lastserv.getActionText() })); + "label.ws_parameters_for", + new String[] { lastserv.getActionText() })); JPanel cont = new JPanel(new BorderLayout()); pgui.validate(); cont.setPreferredSize(pgui.getPreferredSize()); diff --git a/src/jalview/gui/WsParamSetManager.java b/src/jalview/gui/WsParamSetManager.java index f00f50c..b6a7672 100644 --- a/src/jalview/gui/WsParamSetManager.java +++ b/src/jalview/gui/WsParamSetManager.java @@ -178,17 +178,20 @@ public class WsParamSetManager implements ParamManager } if (parser == null) { - throw new Error(MessageManager.getString("error.implementation_error_cannot_find_marshaller_for_param_set")); + throw new Error( + MessageManager + .getString("error.implementation_error_cannot_find_marshaller_for_param_set")); } if (filename == null) { JalviewFileChooser chooser = new JalviewFileChooser( jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] - { "wsparams" }, new String[] - { "Web Service Parameter File" }, + { "wsparams" }, + new String[] { "Web Service Parameter File" }, "Web Service Parameter File"); chooser.setFileView(new jalview.io.JalviewFileView()); - chooser.setDialogTitle(MessageManager.getString("label.choose_filename_for_param_file")); + chooser.setDialogTitle(MessageManager + .getString("label.choose_filename_for_param_file")); chooser.setToolTipText(MessageManager.getString("action.save")); int value = chooser.showSaveDialog(Desktop.instance); if (value == JalviewFileChooser.APPROVE_OPTION) diff --git a/src/jalview/gui/WsPreferences.java b/src/jalview/gui/WsPreferences.java index 25ada33..6ec25b2 100644 --- a/src/jalview/gui/WsPreferences.java +++ b/src/jalview/gui/WsPreferences.java @@ -128,7 +128,8 @@ public class WsPreferences extends GWsPreferences } wsList.setModel(new WsUrlTableModel(tdat)); - wsList.getColumn(MessageManager.getString("label.status")).setMinWidth(10); + wsList.getColumn(MessageManager.getString("label.status")).setMinWidth( + 10); } private class JabaWSStatusRenderer extends JPanel implements @@ -187,8 +188,10 @@ public class WsPreferences extends GWsPreferences { private Object[][] data; - private String[] columnNames = new String[] - { MessageManager.getString("label.service_url"), MessageManager.getString("label.status") }; + + private String[] columnNames = new String[] { + MessageManager.getString("label.service_url"), + MessageManager.getString("label.status") }; public WsUrlTableModel(Object[][] tdat) { @@ -204,7 +207,7 @@ public class WsPreferences extends GWsPreferences @Override public String getColumnName(int column) { - return columnNames[column]; + return columnNames[column]; } @Override @@ -483,11 +486,10 @@ public class WsPreferences extends GWsPreferences } if (valid && resp == JOptionPane.OK_OPTION) { - int validate = JOptionPane - .showInternalConfirmDialog( - Desktop.desktop, - MessageManager.getString("info.validate_jabaws_server"), - MessageManager.getString("label.test_server"), JOptionPane.YES_NO_OPTION); + int validate = JOptionPane.showInternalConfirmDialog(Desktop.desktop, + MessageManager.getString("info.validate_jabaws_server"), + MessageManager.getString("label.test_server"), + JOptionPane.YES_NO_OPTION); if (validate == JOptionPane.OK_OPTION) { @@ -519,7 +521,6 @@ public class WsPreferences extends GWsPreferences .getString("warn.server_didnt_pass_validation")); } - } } else @@ -540,7 +541,8 @@ public class WsPreferences extends GWsPreferences @Override protected void newWsUrl_actionPerformed(ActionEvent e) { - String url = editUrl(null, MessageManager.getString("label.add_jabaws_url")); + String url = editUrl(null, + MessageManager.getString("label.add_jabaws_url")); if (url != null) { if (!wsUrls.contains(url)) @@ -625,8 +627,8 @@ public class WsPreferences extends GWsPreferences public void run() { long ct = System.currentTimeMillis(); - Desktop.instance.setProgressBar(MessageManager.getString("status.refreshing_web_service_menus"), - ct); + Desktop.instance.setProgressBar(MessageManager + .getString("status.refreshing_web_service_menus"), ct); if (lastrefresh != update) { lastrefresh = update; diff --git a/src/jalview/httpserver/HttpServer.java b/src/jalview/httpserver/HttpServer.java index 7ab0d63..59eef26 100644 --- a/src/jalview/httpserver/HttpServer.java +++ b/src/jalview/httpserver/HttpServer.java @@ -72,7 +72,8 @@ public class HttpServer { synchronized (HttpServer.class) { - if (instance == null) { + if (instance == null) + { instance = new HttpServer(); } return instance; @@ -229,8 +230,7 @@ public class HttpServer ch.setAllowNullPathInfo(true); ch.setContextPath("/" + JALVIEW_PATH + "/" + path); ch.setResourceBase("."); - ch.setClassLoader(Thread.currentThread() - .getContextClassLoader()); + ch.setClassLoader(Thread.currentThread().getContextClassLoader()); ch.setHandler(handler); /* diff --git a/src/jalview/io/AMSAFile.java b/src/jalview/io/AMSAFile.java index 2fc17d5..f82407e 100644 --- a/src/jalview/io/AMSAFile.java +++ b/src/jalview/io/AMSAFile.java @@ -20,7 +20,8 @@ */ package jalview.io; -import jalview.datamodel.*; +import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.AlignmentI; public class AMSAFile extends jalview.io.FastaFile { diff --git a/src/jalview/io/AlignFile.java b/src/jalview/io/AlignFile.java index 3b46760..7e0cabd 100755 --- a/src/jalview/io/AlignFile.java +++ b/src/jalview/io/AlignFile.java @@ -97,9 +97,10 @@ public abstract class AlignFile extends FileParse { this(true, inFile, type); } - + /** - * Constructor which (optionally delays) parsing of data from a file of some specified type. + * Constructor which (optionally delays) parsing of data from a file of some + * specified type. * * @param parseImmediately * if false, need to call 'doParse()' to begin parsing data @@ -109,14 +110,17 @@ public abstract class AlignFile extends FileParse * What type of file to read from (File, URL) * @throws IOException */ - public AlignFile(boolean parseImmediately, String inFile, String type) throws IOException + public AlignFile(boolean parseImmediately, String inFile, String type) + throws IOException { super(inFile, type); initData(); - if (parseImmediately) { + if (parseImmediately) + { doParse(); } } + /** * Attempt to read from the position where some other parsing process left * off. @@ -126,25 +130,31 @@ public abstract class AlignFile extends FileParse */ public AlignFile(FileParse source) throws IOException { - this(true,source); + this(true, source); } + /** - * Construct a new parser to read from the position where some other parsing process left + * Construct a new parser to read from the position where some other parsing + * process left * * @param parseImmediately * if false, need to call 'doParse()' to begin parsing data * @param source */ - public AlignFile(boolean parseImmediately, FileParse source) throws IOException + public AlignFile(boolean parseImmediately, FileParse source) + throws IOException { super(source); initData(); - if (parseImmediately) { + if (parseImmediately) + { doParse(); } } + /** * called if parsing was delayed till after parser was constructed + * * @throws IOException */ public void doParse() throws IOException @@ -155,7 +165,7 @@ public abstract class AlignFile extends FileParse "Implementation error: Parser called twice for same data.\n" + "Need to call initData() again before parsing can be reattempted."); } - parseCalled=true; + parseCalled = true; parse(); // sets the index of each sequence in the alignment for (int i = 0, c = seqs.size(); i < c; i++) @@ -164,7 +174,6 @@ public abstract class AlignFile extends FileParse } } - /** * Return the seqs Vector */ @@ -211,8 +220,7 @@ public abstract class AlignFile extends FileParse * Rna.GetBasePairsFromAlignmentAnnotation(annotations.elementAt(i)); * Rna.HelixMap(pairArray); */ - AlignmentAnnotation an = annotations - .elementAt(i); + AlignmentAnnotation an = annotations.elementAt(i); an.validateRangeAndDisplay(); al.addAnnotation(an); } @@ -264,7 +272,9 @@ public abstract class AlignFile extends FileParse { if (key == null) { - throw new Error(MessageManager.getString("error.implementation_error_cannot_have_null_alignment")); + throw new Error( + MessageManager + .getString("error.implementation_error_cannot_have_null_alignment")); } if (value == null) { @@ -294,7 +304,7 @@ public abstract class AlignFile extends FileParse seqs = new Vector(); annotations = new Vector(); seqGroups = new ArrayList(); - parseCalled=false; + parseCalled = false; } /** @@ -373,8 +383,7 @@ public abstract class AlignFile extends FileParse { newickStrings = new Vector(); } - newickStrings.addElement(new String[] - { treeName, newickString }); + newickStrings.addElement(new String[] { treeName, newickString }); } protected int getTreeCount() diff --git a/src/jalview/io/AlignmentProperties.java b/src/jalview/io/AlignmentProperties.java index cb4b7ad..f2a6150 100644 --- a/src/jalview/io/AlignmentProperties.java +++ b/src/jalview/io/AlignmentProperties.java @@ -20,14 +20,14 @@ */ package jalview.io; +import jalview.datamodel.Alignment; +import jalview.datamodel.AlignmentI; + import java.io.PrintWriter; import java.io.StringWriter; import java.util.Enumeration; import java.util.Hashtable; -import jalview.datamodel.Alignment; -import jalview.datamodel.AlignmentI; - /** * Render associated attributes of an alignment. The heart of this code was * refactored from jalview.gui.AlignFrame and jalview.appletgui.AlignFrame TODO: diff --git a/src/jalview/io/AnnotationFile.java b/src/jalview/io/AnnotationFile.java index dcca491..8b3aa98 100755 --- a/src/jalview/io/AnnotationFile.java +++ b/src/jalview/io/AnnotationFile.java @@ -294,8 +294,7 @@ public class AnnotationFile } else { - graphGroup_refs.put(key, new Object[] - { refSeq, refGroup }); + graphGroup_refs.put(key, new Object[] { refSeq, refGroup }); graphGroup.put(key, row.label); } } @@ -472,8 +471,9 @@ public class AnnotationFile text.append(properties.get(key)); } // TODO: output alignment visualization settings here if required - // iterate through one or more views, defining, marking columns and rows as visible/hidden, and emmitting view properties. - // View specific annotation is + // iterate through one or more views, defining, marking columns and rows + // as visible/hidden, and emmitting view properties. + // View specific annotation is } return text.toString(); @@ -670,14 +670,14 @@ public class AnnotationFile } boolean rslt = readAnnotationFile(viewport.getAlignment(), colSel, file, protocol); - if (rslt - && (colSel.hasSelectedColumns() || colSel.hasHiddenColumns())) + if (rslt && (colSel.hasSelectedColumns() || colSel.hasHiddenColumns())) { viewport.setColumnSelection(colSel); } return rslt; } + public boolean readAnnotationFile(AlignmentI al, String file, String protocol) { @@ -737,8 +737,7 @@ public class AnnotationFile private static String GRAPHLINE = "GRAPHLINE", COMBINE = "COMBINE"; public boolean parseAnnotationFrom(AlignmentI al, ColumnSelection colSel, - BufferedReader in) - throws Exception + BufferedReader in) throws Exception { nlinesread = 0; ArrayList combineAnnotation_calls = new ArrayList(); @@ -831,8 +830,8 @@ public class AnnotationFile else if (token.equalsIgnoreCase(COMBINE)) { // keep a record of current state and resolve groupRef at end - combineAnnotation_calls.add(new Object[] - { st, refSeq, groupRef }); + combineAnnotation_calls + .add(new Object[] { st, refSeq, groupRef }); modified = true; continue; } @@ -845,8 +844,8 @@ public class AnnotationFile else if (token.equalsIgnoreCase(GRAPHLINE)) { // resolve at end - deferredAnnotation_calls.add(new Object[] - { GRAPHLINE, st, refSeq, groupRef }); + deferredAnnotation_calls.add(new Object[] { GRAPHLINE, st, + refSeq, groupRef }); modified = true; continue; } @@ -1154,7 +1153,7 @@ public class AnnotationFile (SequenceI) _deferred_args[2], // refSeq (_deferred_args[3] == null) ? null : groupRefLookup .get(_deferred_args[3]) // the reference - // group, or null + // group, or null ); } } @@ -1174,7 +1173,7 @@ public class AnnotationFile (SequenceI) _combine_args[1], // refSeq (_combine_args[2] == null) ? null : groupRefLookup .get(_combine_args[2]) // the reference group, - // or null + // or null ); } } @@ -1183,7 +1182,7 @@ public class AnnotationFile private void parseHideCols(ColumnSelection colSel, String nextToken) { - StringTokenizer inval = new StringTokenizer(nextToken,","); + StringTokenizer inval = new StringTokenizer(nextToken, ","); while (inval.hasMoreTokens()) { String range = inval.nextToken().trim(); diff --git a/src/jalview/io/AppletFormatAdapter.java b/src/jalview/io/AppletFormatAdapter.java index 7dc263b..239c531 100755 --- a/src/jalview/io/AppletFormatAdapter.java +++ b/src/jalview/io/AppletFormatAdapter.java @@ -83,52 +83,51 @@ public class AppletFormatAdapter /** * List of valid format strings used in the isValidFormat method */ - public static final String[] READABLE_FORMATS = new String[] - { "BLC", "CLUSTAL", "FASTA", "MSF", "PileUp", "PIR", "PFAM", "STH", - "PDB", "JnetFile", "RNAML", PhylipFile.FILE_DESC, JSONFile.FILE_DESC, IdentifyFile.GFF3File, - "HTML" }; + public static final String[] READABLE_FORMATS = new String[] { "BLC", + "CLUSTAL", "FASTA", "MSF", "PileUp", "PIR", "PFAM", "STH", "PDB", + "JnetFile", "RNAML", PhylipFile.FILE_DESC, JSONFile.FILE_DESC, + IdentifyFile.GFF3File, "HTML" }; /** * List of readable format file extensions by application in order * corresponding to READABLE_FNAMES */ - public static final String[] READABLE_EXTENSIONS = new String[] - { "fa, fasta, mfa, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", + public static final String[] READABLE_EXTENSIONS = new String[] { + "fa, fasta, mfa, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "sto,stk", "xml,rnaml", PhylipFile.FILE_EXT, JSONFile.FILE_EXT, - ".gff2,gff3", - "jar,jvp", HtmlFile.FILE_EXT }; + ".gff2,gff3", "jar,jvp", HtmlFile.FILE_EXT }; /** * List of readable formats by application in order corresponding to * READABLE_EXTENSIONS */ - public static final String[] READABLE_FNAMES = new String[] - { "Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "AMSA", "Stockholm", - "RNAML", PhylipFile.FILE_DESC, JSONFile.FILE_DESC, IdentifyFile.GFF3File, "Jalview", - HtmlFile.FILE_DESC }; + public static final String[] READABLE_FNAMES = new String[] { "Fasta", + "Clustal", "PFAM", "MSF", "PIR", "BLC", "AMSA", "Stockholm", "RNAML", + PhylipFile.FILE_DESC, JSONFile.FILE_DESC, IdentifyFile.GFF3File, + "Jalview", HtmlFile.FILE_DESC }; /** * List of valid format strings for use by callers of the formatSequences * method */ - public static final String[] WRITEABLE_FORMATS = new String[] - { "BLC", "CLUSTAL", "FASTA", "MSF", "PileUp", "PIR", "PFAM", "AMSA", - "STH", PhylipFile.FILE_DESC, JSONFile.FILE_DESC }; + public static final String[] WRITEABLE_FORMATS = new String[] { "BLC", + "CLUSTAL", "FASTA", "MSF", "PileUp", "PIR", "PFAM", "AMSA", "STH", + PhylipFile.FILE_DESC, JSONFile.FILE_DESC }; /** * List of extensions corresponding to file format types in WRITABLE_FNAMES * that are writable by the application. */ - public static final String[] WRITABLE_EXTENSIONS = new String[] - { "fa, fasta, mfa, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", + public static final String[] WRITABLE_EXTENSIONS = new String[] { + "fa, fasta, mfa, fastq", "aln", "pfam", "msf", "pir", "blc", "amsa", "sto,stk", PhylipFile.FILE_EXT, JSONFile.FILE_EXT, "jvp" }; /** * List of writable formats by the application. Order must correspond with the * WRITABLE_EXTENSIONS list of formats. */ - public static final String[] WRITABLE_FNAMES = new String[] - { "Fasta", "Clustal", "PFAM", "MSF", "PIR", "BLC", "AMSA", "STH", + public static final String[] WRITABLE_FNAMES = new String[] { "Fasta", + "Clustal", "PFAM", "MSF", "PIR", "BLC", "AMSA", "STH", PhylipFile.FILE_DESC, JSONFile.FILE_DESC, "Jalview" }; public static String INVALID_CHARACTERS = "Contains invalid characters"; @@ -170,7 +169,6 @@ public class AppletFormatAdapter return list.toString(); } - public void setNewlineString(String nl) { newline = nl; @@ -480,7 +478,6 @@ public class AppletFormatAdapter } } - /** * boilerplate method to handle data from an AlignFile and construct a new * alignment or import to an existing alignment @@ -504,6 +501,7 @@ public class AppletFormatAdapter /** * create an alignment flatfile from a Jalview alignment view + * * @param format * @param jvsuffix * @param av @@ -592,10 +590,10 @@ public class AppletFormatAdapter { afile = new PhylipFile(); } - else if (format.equalsIgnoreCase(JSONFile.FILE_DESC)) - { + else if (format.equalsIgnoreCase(JSONFile.FILE_DESC)) + { afile = new JSONFile(); - } + } else if (format.equalsIgnoreCase("RNAML")) { afile = new RnamlFile(); @@ -603,7 +601,9 @@ public class AppletFormatAdapter else { - throw new Exception(MessageManager.getString("error.implementation_error_unknown_file_format_string")); + throw new Exception( + MessageManager + .getString("error.implementation_error_unknown_file_format_string")); } afile.setNewlineString(newline); @@ -684,7 +684,7 @@ public class AppletFormatAdapter } catch (Exception e) { System.err - .println("Couln't format the alignment for output as a FASTA file."); + .println("Couln't format the alignment for output as a FASTA file."); e.printStackTrace(System.err); } } @@ -694,8 +694,8 @@ public class AppletFormatAdapter } System.out.println("Read took " + (t1 / 1000.0) + " seconds."); System.out - .println("Difference between free memory now and before is " - + (memf / (1024.0 * 1024.0) * 1.0) + " MB"); + .println("Difference between free memory now and before is " + + (memf / (1024.0 * 1024.0) * 1.0) + " MB"); } catch (Exception e) { System.err.println("Exception when dealing with " + i @@ -761,7 +761,7 @@ public class AppletFormatAdapter } catch (Exception ex) { System.err - .println("Exception checking resources: " + file + " " + ex); + .println("Exception checking resources: " + file + " " + ex); } if (file.indexOf("://") > -1) @@ -863,7 +863,7 @@ public class AppletFormatAdapter if (debug) { System.out - .println("File deemed not accessible via " + protocol); + .println("File deemed not accessible via " + protocol); } fp.close(); return null; diff --git a/src/jalview/io/BLCFile.java b/src/jalview/io/BLCFile.java index c7cf2d6..a499f75 100755 --- a/src/jalview/io/BLCFile.java +++ b/src/jalview/io/BLCFile.java @@ -153,7 +153,7 @@ public class BLCFile extends AlignFile } } while (!idsFound); if (line == null) - { + { break; // end of file. } int starCol = line.indexOf("*"); diff --git a/src/jalview/io/BioJsHTMLOutput.java b/src/jalview/io/BioJsHTMLOutput.java index 50486f2..f5a4136 100644 --- a/src/jalview/io/BioJsHTMLOutput.java +++ b/src/jalview/io/BioJsHTMLOutput.java @@ -20,7 +20,6 @@ import java.net.URL; import java.util.Objects; import java.util.TreeMap; - public class BioJsHTMLOutput { private AlignmentViewPanel ap; @@ -94,8 +93,7 @@ public class BioJsHTMLOutput }; AlignmentExportData exportData = jalview.gui.AlignFrame - .getAlignmentForExport( -JSONFile.FILE_DESC, + .getAlignmentForExport(JSONFile.FILE_DESC, ap.getAlignViewport(), exportSettings); if (exportData.getSettings().isCancelled()) { @@ -109,8 +107,7 @@ JSONFile.FILE_DESC, String bioJSTemplateString = getBioJsTemplateAsString(); String generatedBioJsWithJalviewAlignmentAsJson = bioJSTemplateString - .replaceAll( -"#sequenceData#", jalviewAlignmentJson) + .replaceAll("#sequenceData#", jalviewAlignmentJson) .toString(); PrintWriter out = new java.io.PrintWriter(new java.io.FileWriter( @@ -132,9 +129,9 @@ JSONFile.FILE_DESC, { String selectedFile = null; JalviewFileChooser jvFileChooser = new JalviewFileChooser( - jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] - { "html" }, new String[] - { "HTML files" }, "HTML files"); + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), + new String[] { "html" }, new String[] { "HTML files" }, + "HTML files"); jvFileChooser.setFileView(new JalviewFileView()); jvFileChooser.setDialogTitle(MessageManager @@ -155,9 +152,7 @@ JSONFile.FILE_DESC, return selectedFile; } - - public static String getBioJsTemplateAsString() - throws IOException + public static String getBioJsTemplateAsString() throws IOException { InputStreamReader isReader = null; BufferedReader buffReader = null; @@ -257,7 +252,6 @@ JSONFile.FILE_DESC, } - public static void syncUpdates(String localDir, BioJSRepositoryPojo repo) { for (BioJSReleasePojo bjsRelease : repo.getReleases()) diff --git a/src/jalview/io/ClustalFile.java b/src/jalview/io/ClustalFile.java index 1b29b52..a9295a3 100755 --- a/src/jalview/io/ClustalFile.java +++ b/src/jalview/io/ClustalFile.java @@ -20,11 +20,15 @@ */ package jalview.io; -import java.io.*; -import java.util.*; - -import jalview.datamodel.*; -import jalview.util.*; +import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.Sequence; +import jalview.datamodel.SequenceI; +import jalview.util.Format; + +import java.io.IOException; +import java.util.Hashtable; +import java.util.StringTokenizer; +import java.util.Vector; public class ClustalFile extends AlignFile { diff --git a/src/jalview/io/FastaFile.java b/src/jalview/io/FastaFile.java index 8dbfbfd..b867ba4 100755 --- a/src/jalview/io/FastaFile.java +++ b/src/jalview/io/FastaFile.java @@ -20,9 +20,13 @@ */ package jalview.io; -import java.io.*; +import jalview.datamodel.Alignment; +import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.Annotation; +import jalview.datamodel.Sequence; +import jalview.datamodel.SequenceI; -import jalview.datamodel.*; +import java.io.IOException; /** * DOCUMENT ME! diff --git a/src/jalview/io/FeaturesFile.java b/src/jalview/io/FeaturesFile.java index fbe871b..498226b 100755 --- a/src/jalview/io/FeaturesFile.java +++ b/src/jalview/io/FeaturesFile.java @@ -214,7 +214,8 @@ public class FeaturesFile extends AlignFile { SequenceI seq = null; /** - * keep track of any sequences we try to create from the data if it is a GFF3 file + * keep track of any sequences we try to create from the data if it is a + * GFF3 file */ ArrayList newseqs = new ArrayList(); String type, desc, token = null; @@ -833,18 +834,19 @@ public class FeaturesFile extends AlignFile * @return true if sf was actually added to the sequence, false if it was * processed in another way */ - public boolean processOrAddSeqFeature(AlignmentI align, List newseqs, SequenceI seq, SequenceFeature sf, + public boolean processOrAddSeqFeature(AlignmentI align, + List newseqs, SequenceI seq, SequenceFeature sf, boolean gFFFile, boolean relaxedIdMatching) { String attr = (String) sf.getValue("ATTRIBUTES"); boolean add = true; if (gFFFile && attr != null) { - int nattr=8; + int nattr = 8; for (String attset : attr.split("\t")) { - if (attset==null || attset.trim().length()==0) + if (attset == null || attset.trim().length() == 0) { continue; } @@ -860,22 +862,25 @@ public class FeaturesFile extends AlignFile continue; } - // expect either space seperated (gff2) or '=' separated (gff3) + // expect either space seperated (gff2) or '=' separated (gff3) // key/value pairs here - int eqpos = pair.indexOf('='),sppos = pair.indexOf(' '); + int eqpos = pair.indexOf('='), sppos = pair.indexOf(' '); String key = null, value = null; if (sppos > -1 && (eqpos == -1 || sppos < eqpos)) { key = pair.substring(0, sppos); value = pair.substring(sppos + 1); - } else { + } + else + { if (eqpos > -1 && (sppos == -1 || eqpos < sppos)) { key = pair.substring(0, eqpos); value = pair.substring(eqpos + 1); - } else + } + else { key = pair; } @@ -898,8 +903,8 @@ public class FeaturesFile extends AlignFile { add &= processGffKey(set, nattr, seq, sf, align, newseqs, relaxedIdMatching); // process decides if - // feature is actually - // added + // feature is actually + // added } catch (InvalidGFF3FieldException ivfe) { System.err.println(ivfe); @@ -948,20 +953,20 @@ public class FeaturesFile extends AlignFile { int strand = sf.getStrand(); // exonerate cdna/protein map - // look for fields + // look for fields List querySeq = findNames(align, newseqs, - relaxedIdMatching, set.get(attr="Query")); - if (querySeq==null || querySeq.size()!=1) + relaxedIdMatching, set.get(attr = "Query")); + if (querySeq == null || querySeq.size() != 1) { - throw new InvalidGFF3FieldException( attr, set, + throw new InvalidGFF3FieldException(attr, set, "Expecting exactly one sequence in Query field (got " + set.get(attr) + ")"); } - if (set.containsKey(attr="Align")) + if (set.containsKey(attr = "Align")) { // process the align maps and create cdna/protein maps // ideally, the query sequences are in the alignment, but maybe not... - + AlignedCodonFrame alco = new AlignedCodonFrame(); MapList codonmapping = constructCodonMappingFromAlign(set, attr, strand); @@ -979,8 +984,8 @@ public class FeaturesFile extends AlignFile } private MapList constructCodonMappingFromAlign( - Map> set, - String attr, int strand) throws InvalidGFF3FieldException + Map> set, String attr, int strand) + throws InvalidGFF3FieldException { if (strand == 0) { @@ -1134,21 +1139,21 @@ public class FeaturesFile extends AlignFile } } } - + } - if (match==null && newseqs!=null) + if (match == null && newseqs != null) { match = new SequenceDummy(seqId); if (relaxedIdMatching) { - matcher.addAll(Arrays.asList(new SequenceI[] - { match })); + matcher.addAll(Arrays.asList(new SequenceI[] { match })); } // add dummy sequence to the newseqs list newseqs.add(match); } return match; } + public void parseDescriptionHTML(SequenceFeature sf, boolean removeHTML) { if (sf.getDescription() == null) @@ -1176,7 +1181,8 @@ public class FeaturesFile extends AlignFile * hash of feature types and colours * @return features file contents */ - public String printJalviewFormat(SequenceI[] seqs, Map visible) + public String printJalviewFormat(SequenceI[] seqs, + Map visible) { return printJalviewFormat(seqs, visible, true, true); } @@ -1424,13 +1430,13 @@ public class FeaturesFile extends AlignFile * @param visible * @return */ - public String printGFFFormat(SequenceI[] seqs, Map visible) + public String printGFFFormat(SequenceI[] seqs, Map visible) { return printGFFFormat(seqs, visible, true, true); } - public String printGFFFormat(SequenceI[] seqs, Map visible, - boolean visOnly, boolean nonpos) + public String printGFFFormat(SequenceI[] seqs, + Map visible, boolean visOnly, boolean nonpos) { StringBuffer out = new StringBuffer(); SequenceFeature[] next; diff --git a/src/jalview/io/FileLoader.java b/src/jalview/io/FileLoader.java index e2e7d19..9ff3ef9 100755 --- a/src/jalview/io/FileLoader.java +++ b/src/jalview/io/FileLoader.java @@ -399,8 +399,8 @@ public class FileLoader implements Runnable } alignFrame.statusBar.setText(MessageManager.formatMessage( - "label.successfully_loaded_file", new String[] - { title })); + "label.successfully_loaded_file", + new String[] { title })); if (raiseGUI) { @@ -470,8 +470,8 @@ public class FileLoader implements Runnable { javax.swing.JOptionPane.showInternalMessageDialog( Desktop.desktop, MessageManager.formatMessage( - "label.problems_opening_file", new String[] - { file }), MessageManager + "label.problems_opening_file", + new String[] { file }), MessageManager .getString("label.file_open_error"), javax.swing.JOptionPane.WARNING_MESSAGE); } diff --git a/src/jalview/io/FileParse.java b/src/jalview/io/FileParse.java index 1ab99db..405363d 100755 --- a/src/jalview/io/FileParse.java +++ b/src/jalview/io/FileParse.java @@ -80,7 +80,7 @@ public class FileParse public void setNewlineString(String nl) { - newline = nl; + newline = nl; } public String getNewlineString() @@ -124,7 +124,9 @@ public class FileParse { if (from == null) { - throw new Error(MessageManager.getString("error.implementation_error_null_fileparse")); + throw new Error( + MessageManager + .getString("error.implementation_error_null_fileparse")); } if (from == this) { @@ -239,7 +241,10 @@ public class FileParse { if (e != null) { - throw new IOException(MessageManager.getString("exception.failed_to_resolve_gzip_stream"), e); + throw new IOException( + MessageManager + .getString("exception.failed_to_resolve_gzip_stream"), + e); } throw q; } @@ -294,12 +299,17 @@ public class FileParse { if (checkFileSource(suffixLess)) { - throw new IOException(MessageManager.formatMessage("exception.problem_opening_file_also_tried", new String[]{inFile.getName(),suffixLess,errormessage})); + throw new IOException(MessageManager.formatMessage( + "exception.problem_opening_file_also_tried", + new String[] { inFile.getName(), suffixLess, + errormessage })); } } else { - throw new IOException(MessageManager.formatMessage("exception.problem_opening_file", new String[]{inFile.getName(),errormessage})); + throw new IOException(MessageManager.formatMessage( + "exception.problem_opening_file", + new String[] { inFile.getName(), errormessage })); } } } @@ -311,7 +321,7 @@ public class FileParse { checkURLSource(fileStr); if (suffixSeparator == '#') - { + { extractSuffix(fileStr); // URL lref is stored for later reference. } } catch (IOException e) @@ -378,7 +388,9 @@ public class FileParse if (dataIn == null || error) { // pass up the reason why we have no source to read from - throw new IOException(MessageManager.formatMessage("exception.failed_to_read_data_from_source", new String[]{errormessage})); + throw new IOException(MessageManager.formatMessage( + "exception.failed_to_read_data_from_source", + new String[] { errormessage })); } error = false; dataIn.mark(READAHEAD_LIMIT); @@ -398,7 +410,8 @@ public class FileParse } else { - throw new IOException(MessageManager.getString("exception.no_init_source_stream")); + throw new IOException( + MessageManager.getString("exception.no_init_source_stream")); } } @@ -408,7 +421,9 @@ public class FileParse { return dataIn.readLine(); } - throw new IOException(MessageManager.formatMessage("exception.invalid_source_stream", new String[]{errormessage})); + throw new IOException(MessageManager.formatMessage( + "exception.invalid_source_stream", + new String[] { errormessage })); } /** @@ -453,7 +468,9 @@ public class FileParse } else { - throw new IOException(MessageManager.getString("error.implementation_error_reset_called_for_invalid_source")); + throw new IOException( + MessageManager + .getString("error.implementation_error_reset_called_for_invalid_source")); } } @@ -558,7 +575,8 @@ public class FileParse */ public void configureForView(AlignmentViewPanel avpanel) { - if (avpanel!=null) { + if (avpanel != null) + { setViewport(avpanel.getAlignViewport()); } // could also set export/import settings diff --git a/src/jalview/io/FormatAdapter.java b/src/jalview/io/FormatAdapter.java index 63a14d7..ebca31b 100755 --- a/src/jalview/io/FormatAdapter.java +++ b/src/jalview/io/FormatAdapter.java @@ -63,9 +63,9 @@ public class FormatAdapter extends AppletFormatAdapter annotFromStructure = jalview.bin.Cache.getDefault("ADD_TEMPFACT_ANN", true); localSecondaryStruct = jalview.bin.Cache.getDefault("ADD_SS_ANN", - true); - serviceSecondaryStruct = jalview.bin.Cache.getDefault("USE_RNAVIEW", - true); + true); + serviceSecondaryStruct = jalview.bin.Cache.getDefault("USE_RNAVIEW", + true); } else { @@ -108,7 +108,6 @@ public class FormatAdapter extends AppletFormatAdapter startRes = seqs[i].getStart(); endRes = seqs[i].getEnd(); - if (startEnd != null) { startIndex = startEnd[0]; @@ -271,14 +270,12 @@ public class FormatAdapter extends AppletFormatAdapter ColumnSelection colSel) { return formatSequences(format, alignment, omitHidden, exportRange, - suffix, colSel, - null); + suffix, colSel, null); } public String formatSequences(String format, AlignmentI alignment, String[] omitHidden, int[] exportRange, boolean suffix, - ColumnSelection colSel, - jalview.datamodel.SequenceGroup selgp) + ColumnSelection colSel, jalview.datamodel.SequenceGroup selgp) { if (omitHidden != null) { @@ -363,5 +360,4 @@ public class FormatAdapter extends AppletFormatAdapter selectedOnly); } - } diff --git a/src/jalview/io/Gff3File.java b/src/jalview/io/Gff3File.java index 1f8c3be..6f0442a 100644 --- a/src/jalview/io/Gff3File.java +++ b/src/jalview/io/Gff3File.java @@ -100,6 +100,7 @@ public class Gff3File extends FeaturesFile AlignmentI dataset; List alignments; + @Override public void parse() { @@ -118,8 +119,7 @@ public class Gff3File extends FeaturesFile } else { - dataset = new Alignment(new SequenceI[] - {}); + dataset = new Alignment(new SequenceI[] {}); } boolean parseResult = parse(dataset, null, null, false, true); diff --git a/src/jalview/io/HTMLOutput.java b/src/jalview/io/HTMLOutput.java index 3c31b7f..df0dc06 100755 --- a/src/jalview/io/HTMLOutput.java +++ b/src/jalview/io/HTMLOutput.java @@ -20,14 +20,18 @@ */ package jalview.io; -import java.io.*; - -import java.awt.*; - -import jalview.datamodel.*; -import jalview.gui.*; +import jalview.datamodel.AlignmentI; +import jalview.datamodel.SequenceI; +import jalview.gui.AlignViewport; +import jalview.gui.AlignmentPanel; +import jalview.gui.FeatureRenderer; +import jalview.gui.SequenceRenderer; import jalview.util.MessageManager; +import java.awt.Color; +import java.awt.Font; +import java.io.PrintWriter; + public class HTMLOutput { AlignViewport av; @@ -48,9 +52,9 @@ public class HTMLOutput fr.transferSettings(fr1); JalviewFileChooser chooser = new JalviewFileChooser( - jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] - { "html" }, new String[] - { "HTML files" }, "HTML files"); + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), + new String[] { "html" }, new String[] { "HTML files" }, + "HTML files"); chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle(MessageManager.getString("label.save_as_html")); diff --git a/src/jalview/io/HtmlFile.java b/src/jalview/io/HtmlFile.java index dc14cc0..06c2717 100644 --- a/src/jalview/io/HtmlFile.java +++ b/src/jalview/io/HtmlFile.java @@ -103,8 +103,7 @@ public class HtmlFile extends AlignFile implements ComplexAlignFile throw new IOException(errormessage); } JSONFile jsonFile = new JSONFile().parse(new StringReader( - contentFromDiv ? content.text() : content - .val())); + contentFromDiv ? content.text() : content.val())); this.seqs = jsonFile.getSeqs(); this.seqGroups = jsonFile.getSeqGroups(); this.annotations = jsonFile.getAnnotations(); @@ -119,7 +118,6 @@ public class HtmlFile extends AlignFile implements ComplexAlignFile } } - @Override public String print() { diff --git a/src/jalview/io/HtmlSvgOutput.java b/src/jalview/io/HtmlSvgOutput.java index a93cd7f..387d374 100644 --- a/src/jalview/io/HtmlSvgOutput.java +++ b/src/jalview/io/HtmlSvgOutput.java @@ -26,8 +26,8 @@ public class HtmlSvgOutput AlignViewport av; FeatureRenderer fr; - AlignmentPanel ap; + AlignmentPanel ap; public HtmlSvgOutput(File file, AlignmentPanel ap) { @@ -44,18 +44,18 @@ public class HtmlSvgOutput if (file == null) { - JalviewFileChooser chooser = getHTMLChooser(); - chooser.setFileView(new jalview.io.JalviewFileView()); - chooser.setDialogTitle(ap.alignFrame.getTitle()); - chooser.setToolTipText(MessageManager.getString("action.save")); - int value = chooser.showSaveDialog(ap.alignFrame); + JalviewFileChooser chooser = getHTMLChooser(); + chooser.setFileView(new jalview.io.JalviewFileView()); + chooser.setDialogTitle(ap.alignFrame.getTitle()); + chooser.setToolTipText(MessageManager.getString("action.save")); + int value = chooser.showSaveDialog(ap.alignFrame); - if (value == jalview.io.JalviewFileChooser.APPROVE_OPTION) - { - jalview.bin.Cache.setProperty("LAST_DIRECTORY", chooser - .getSelectedFile().getParent()); - file = chooser.getSelectedFile(); - } + if (value == jalview.io.JalviewFileChooser.APPROVE_OPTION) + { + jalview.bin.Cache.setProperty("LAST_DIRECTORY", chooser + .getSelectedFile().getParent()); + file = chooser.getSelectedFile(); + } } AlignmentDimension aDimension = ap.getAlignmentDimension(); @@ -99,7 +99,8 @@ public class HtmlSvgOutput .getDefault("EXPORT_EMBBED_BIOJSON", "true")); if (isEmbbedBioJSON) { - AlignExportSettingI exportSettings = new AlignExportSettingI(){ + AlignExportSettingI exportSettings = new AlignExportSettingI() + { @Override public boolean isExportHiddenSequences() { @@ -135,14 +136,15 @@ public class HtmlSvgOutput { return false; } - + }; AlignmentExportData exportData = jalview.gui.AlignFrame .getAlignmentForExport(JSONFile.FILE_DESC, av, exportSettings); jsonData = new FormatAdapter(ap, exportData.getSettings()) - .formatSequences(JSONFile.FILE_DESC, exportData - .getAlignment(), exportData.getOmitHidden(), + .formatSequences(JSONFile.FILE_DESC, + exportData.getAlignment(), + exportData.getOmitHidden(), exportData.getStartEndPostions(), av.getColumnSelection()); } @@ -154,20 +156,21 @@ public class HtmlSvgOutput if (!(System.getProperty("java.awt.headless") != null && System .getProperty("java.awt.headless").equals("true"))) { - jalview.util.BrowserLauncher.openURL("file:///" + file); + jalview.util.BrowserLauncher.openURL("file:///" + file); } } catch (Exception e) { e.printStackTrace(); } } - + static JalviewFileChooser getHTMLChooser() { return new jalview.io.JalviewFileChooser( - jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] - { "html" }, new String[] - { "Hypertext Markup Language" }, "Hypertext Markup Language"); + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), + new String[] { "html" }, + new String[] { "Hypertext Markup Language" }, + "Hypertext Markup Language"); } public int printUnwrapped(int pwidth, int pheight, int pi, Graphics... pg) @@ -266,9 +269,7 @@ public class HtmlSvgOutput - fm.stringWidth(seq.getDisplayId(av.getShowJVSuffix())) - 4; } - pg[0].drawString( - seq.getDisplayId(av.getShowJVSuffix()), - xPos, + pg[0].drawString(seq.getDisplayId(av.getShowJVSuffix()), xPos, (((i - startSeq) * av.getCharHeight()) + av.getCharHeight()) - (av.getCharHeight() / 5)); } @@ -302,7 +303,7 @@ public class HtmlSvgOutput return Printable.PAGE_EXISTS; } - + private String getHtml(String titleSvg, String alignmentSvg, String jsonData) { @@ -355,9 +356,7 @@ public class HtmlSvgOutput htmlSvg.append("
"); htmlSvg.append( "
") - .append(alignmentSvg) -.append("
") - .append("
"); + .append(alignmentSvg).append("").append(""); htmlSvg.append(""); htmlSvg.append("\n" diff --git a/src/jalview/io/IdentifyFile.java b/src/jalview/io/IdentifyFile.java index a5e7fbc..ff0f0cc 100755 --- a/src/jalview/io/IdentifyFile.java +++ b/src/jalview/io/IdentifyFile.java @@ -306,19 +306,18 @@ public class IdentifyFile break; } - /* * // TODO comment out SimpleBLAST identification for Jalview 2.4.1 else * if (!lineswereskipped && data.indexOf("BLAST")<4) { reply = * "SimpleBLAST"; break; - * + * * } // end comments for Jalview 2.4.1 */ else if (!lineswereskipped && data.charAt(0) != '*' && data.charAt(0) != ' ' && data.indexOf(":") < data.indexOf(",")) // && - // data.indexOf(",") -1) diff --git a/src/jalview/io/PileUpfile.java b/src/jalview/io/PileUpfile.java index f54ad9c..9570552 100755 --- a/src/jalview/io/PileUpfile.java +++ b/src/jalview/io/PileUpfile.java @@ -35,10 +35,10 @@ package jalview.io; * found in Emboss (thanks David Martin!) * */ -import java.io.*; +import jalview.datamodel.SequenceI; +import jalview.util.Format; -import jalview.datamodel.*; -import jalview.util.*; +import java.io.IOException; public class PileUpfile extends MSFfile { diff --git a/src/jalview/io/RnamlFile.java b/src/jalview/io/RnamlFile.java index c15bc6c..0941a6f 100644 --- a/src/jalview/io/RnamlFile.java +++ b/src/jalview/io/RnamlFile.java @@ -100,21 +100,29 @@ public class RnamlFile extends AlignFile _parse(); } catch (ExceptionPermissionDenied pdx) { - errormessage = MessageManager.formatMessage("exception.rnaml_couldnt_access_datasource", new String[]{pdx.getMessage()}); + errormessage = MessageManager.formatMessage( + "exception.rnaml_couldnt_access_datasource", + new String[] { pdx.getMessage() }); throw new IOException(pdx); } catch (ExceptionLoadingFailed lf) { - errormessage = MessageManager.formatMessage("exception.ranml_couldnt_process_data", new String[]{lf.getMessage()}); + errormessage = MessageManager.formatMessage( + "exception.ranml_couldnt_process_data", + new String[] { lf.getMessage() }); throw new IOException(lf); } catch (ExceptionFileFormatOrSyntax iff) { - errormessage = MessageManager.formatMessage("exception.ranml_invalid_file", new String[]{iff.getMessage()}); + errormessage = MessageManager.formatMessage( + "exception.ranml_invalid_file", + new String[] { iff.getMessage() }); throw new IOException(iff); } catch (Exception x) { error = true; - errormessage = MessageManager.formatMessage("exception.ranml_problem_parsing_data", new String[]{x.getMessage()}); - throw new IOException(errormessage , x); + errormessage = MessageManager.formatMessage( + "exception.ranml_problem_parsing_data", + new String[] { x.getMessage() }); + throw new IOException(errormessage, x); } } diff --git a/src/jalview/io/SequenceAnnotationReport.java b/src/jalview/io/SequenceAnnotationReport.java index 6d8ce5f..72f8044 100644 --- a/src/jalview/io/SequenceAnnotationReport.java +++ b/src/jalview/io/SequenceAnnotationReport.java @@ -20,7 +20,6 @@ */ package jalview.io; - import jalview.datamodel.DBRefEntry; import jalview.datamodel.SequenceFeature; import jalview.datamodel.SequenceI; @@ -30,7 +29,6 @@ import java.util.ArrayList; import java.util.Hashtable; import java.util.List; - /** * generate HTML reports for a sequence * @@ -67,12 +65,11 @@ public class SequenceAnnotationReport String tmpString; if (features != null) { - for (SequenceFeature feature:features) + for (SequenceFeature feature : features) { if (feature.getType().equals("disulfide bond")) { - if (feature.getBegin() == rpos - || feature.getEnd() == rpos) + if (feature.getBegin() == rpos || feature.getEnd() == rpos) { if (tooltipText2.length() > 6) { @@ -104,8 +101,7 @@ public class SequenceAnnotationReport } if (feature.getDescription() != null - && !feature.description.equals(feature - .getType())) + && !feature.description.equals(feature.getType())) { tmpString = feature.getDescription(); String tmp2up = tmpString.toUpperCase(); @@ -235,8 +231,7 @@ public class SequenceAnnotationReport // collect matching db-refs DBRefEntry[] dbr = jalview.util.DBRefUtils.selectRefs(seq.getDBRef(), - new String[] - { target }); + new String[] { target }); // collect id string too String id = seq.getName(); String descr = seq.getDescription(); @@ -263,8 +258,8 @@ public class SequenceAnnotationReport String unq = urls[u] + "|" + urls[u + 1]; if (!uniques.contains(unq)) { - urlSets.add(new String[] - { target, label, urls[u], urls[u + 1] }); + urlSets.add(new String[] { target, label, urls[u], + urls[u + 1] }); uniques.add(unq); } } @@ -282,8 +277,8 @@ public class SequenceAnnotationReport String unq = urls[u] + "|" + urls[u + 1]; if (!uniques.contains(unq)) { - urlSets.add(new String[] - { target, label, urls[u], urls[u + 1] }); + urlSets.add(new String[] { target, label, urls[u], + urls[u + 1] }); uniques.add(unq); } } @@ -300,8 +295,8 @@ public class SequenceAnnotationReport String unq = urls[u] + "|" + urls[u + 1]; if (!uniques.contains(unq)) { - urlSets.add(new String[] - { target, label, urls[u], urls[u + 1] }); + urlSets.add(new String[] { target, label, urls[u], + urls[u + 1] }); uniques.add(unq); } } @@ -316,13 +311,12 @@ public class SequenceAnnotationReport { uniques.add(unq); // Add a non-dynamic link - urlSets.add(new String[] - { target, label, null, urlLink.getUrl_prefix() }); + urlSets.add(new String[] { target, label, null, + urlLink.getUrl_prefix() }); } } - return urlSets.toArray(new String[][] - {}); + return urlSets.toArray(new String[][] {}); } public void createSequenceAnnotationReport(final StringBuffer tip, diff --git a/src/jalview/io/SimpleBlastFile.java b/src/jalview/io/SimpleBlastFile.java index cebe47d..f4dc5a2 100644 --- a/src/jalview/io/SimpleBlastFile.java +++ b/src/jalview/io/SimpleBlastFile.java @@ -20,10 +20,13 @@ */ package jalview.io; -import java.io.*; -import java.util.*; +import jalview.datamodel.Sequence; +import jalview.datamodel.SequenceI; -import jalview.datamodel.*; +import java.io.IOException; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.Vector; /** * parse a simple blast report. Attempt to cope with query anchored and pairwise @@ -197,9 +200,8 @@ public class SimpleBlastFile extends AlignFile if (seqentry == null) { padseq = true; // prepend gaps to new sequences in this block - seqentry = new Object[] - { new StringBuffer(), new long[] - { rstart, rend } }; + seqentry = new Object[] { new StringBuffer(), + new long[] { rstart, rend } }; seqentries.addElement(seqentry); seqhash.put(sqid, seqentry); diff --git a/src/jalview/io/StockholmFile.java b/src/jalview/io/StockholmFile.java index f652035..9135b92 100644 --- a/src/jalview/io/StockholmFile.java +++ b/src/jalview/io/StockholmFile.java @@ -420,8 +420,8 @@ public class StockholmFile extends AlignFile { // logger.error("Could not parse sequence line: " + line); throw new IOException(MessageManager.formatMessage( - "exception.couldnt_parse_sequence_line", new String[] - { line })); + "exception.couldnt_parse_sequence_line", + new String[] { line })); } String ns = seqs.get(x.stringMatched(1)); if (ns == null) @@ -665,8 +665,8 @@ public class StockholmFile extends AlignFile else { throw new IOException(MessageManager.formatMessage( - "exception.unknown_annotation_detected", new String[] - { annType, annContent })); + "exception.unknown_annotation_detected", new String[] { + annType, annContent })); } } } @@ -779,9 +779,8 @@ public class StockholmFile extends AlignFile { for (DBRefEntry d : dbrs) { - jalview.util.MapList mp = new jalview.util.MapList(new int[] - { seqO.getStart(), seqO.getEnd() }, new int[] - { st, en }, 1, 1); + jalview.util.MapList mp = new jalview.util.MapList(new int[] { + seqO.getStart(), seqO.getEnd() }, new int[] { st, en }, 1, 1); jalview.datamodel.Mapping mping = new Mapping(mp); d.setMap(mping); } @@ -826,7 +825,7 @@ public class StockholmFile extends AlignFile // be written out if (ss) { - //if (" .-_".indexOf(pos) == -1) + // if (" .-_".indexOf(pos) == -1) { if (detectbrackets.search(pos)) { @@ -848,7 +847,7 @@ public class StockholmFile extends AlignFile ann.displayCharacter = " " + ann.displayCharacter; } } - + } els[i] = ann; @@ -1068,21 +1067,19 @@ public class StockholmFile extends AlignFile * @param ann * @param sequenceI */ - private char outputCharacter(String key, int k, - boolean isrna, Annotation[] ann, SequenceI sequenceI) + private char outputCharacter(String key, int k, boolean isrna, + Annotation[] ann, SequenceI sequenceI) { char seq = ' '; Annotation annot = ann[k]; String ch = (annot == null) ? ((sequenceI == null) ? "-" : Character - .toString(sequenceI.getCharAt(k))) - : annot.displayCharacter; + .toString(sequenceI.getCharAt(k))) : annot.displayCharacter; if (key != null && key.equals("SS")) { if (annot == null) { // sensible gap character if one is available or make one up - return sequenceI == null ? '-' : sequenceI - .getCharAt(k); + return sequenceI == null ? '-' : sequenceI.getCharAt(k); } else { diff --git a/src/jalview/io/TCoffeeScoreFile.java b/src/jalview/io/TCoffeeScoreFile.java index ca8a22a..07d7be4 100644 --- a/src/jalview/io/TCoffeeScoreFile.java +++ b/src/jalview/io/TCoffeeScoreFile.java @@ -525,8 +525,7 @@ public class TCoffeeScoreFile extends AlignFile /** * TCOFFEE score colourscheme */ - static final Color[] colors = - { new Color(102, 102, 255), // #6666FF + static final Color[] colors = { new Color(102, 102, 255), // #6666FF new Color(0, 255, 0), // #00FF00 new Color(102, 255, 0), // #66FF00 new Color(204, 255, 0), // #CCFF00 diff --git a/src/jalview/io/VamsasAppDatastore.java b/src/jalview/io/VamsasAppDatastore.java index d67293a..a093ebe 100644 --- a/src/jalview/io/VamsasAppDatastore.java +++ b/src/jalview/io/VamsasAppDatastore.java @@ -246,9 +246,12 @@ public class VamsasAppDatastore if (vobj2jv.containsKey(vobj.getVorbaId()) && !((VorbaId) vobj2jv.get(vobj.getVorbaId())).equals(jvobj)) { - Cache.log.debug( - "Warning? Overwriting existing vamsas id binding for " - + vobj.getVorbaId(), new Exception(MessageManager.getString("exception.overwriting_vamsas_id_binding"))); + Cache.log + .debug("Warning? Overwriting existing vamsas id binding for " + + vobj.getVorbaId(), + new Exception( + MessageManager + .getString("exception.overwriting_vamsas_id_binding"))); } else if (jv2vobj.containsKey(jvobj) && !((VorbaId) jv2vobj.get(jvobj)).equals(vobj.getVorbaId())) @@ -335,7 +338,9 @@ public class VamsasAppDatastore if (vbound.getV_parent() != null && dataset != vbound.getV_parent()) { - throw new Error(MessageManager.getString("error.implementation_error_cannot_map_alignment_sequences")); + throw new Error( + MessageManager + .getString("error.implementation_error_cannot_map_alignment_sequences")); // This occurs because the dataset for the alignment we are // trying to } @@ -1258,8 +1263,7 @@ public class VamsasAppDatastore end = start; start = t; } - return new int[] - { start, end, pol < 0 ? 1 : 0 }; + return new int[] { start, end, pol < 0 ? 1 : 0 }; } /** @@ -1500,7 +1504,9 @@ public class VamsasAppDatastore { // NOTE: this happens if user deletes object in one session then updates // from another client - throw new Error(MessageManager.formatMessage("error.implementation_error_old_jalview_object_not_bound", new String[]{oldjvobject.toString()})); + throw new Error(MessageManager.formatMessage( + "error.implementation_error_old_jalview_object_not_bound", + new String[] { oldjvobject.toString() })); } if (newjvobject != null) { @@ -2029,8 +2035,7 @@ public class VamsasAppDatastore // may not quite cope with this (without binding an array of annotations to // a vamsas alignment annotation) // summary flags saying what we found over the set of annotation rows. - boolean[] AeContent = new boolean[] - { false, false, false, false, false }; + boolean[] AeContent = new boolean[] { false, false, false, false, false }; int[] rangeMap = getMapping(annotation); jalview.datamodel.Annotation[][] anot = new jalview.datamodel.Annotation[][] { new jalview.datamodel.Annotation[rangeMap.length], @@ -2165,15 +2170,13 @@ public class VamsasAppDatastore anot[1][i].description = anot[1][i].description + " (after)"; } } - return new Object[] - { AeContent, rangeMap, anot[0], anot[1] }; + return new Object[] { AeContent, rangeMap, anot[0], anot[1] }; } else { // no annotations to parse. Just return an empty annotationElement[] // array. - return new Object[] - { AeContent, rangeMap, anot[0], anot[1] }; + return new Object[] { AeContent, rangeMap, anot[0], anot[1] }; } // return null; } @@ -2446,7 +2449,9 @@ public class VamsasAppDatastore int[] se = null; if (dseta.getSegCount() > 0 && dseta.getPosCount() > 0) { - throw new Error(MessageManager.getString("error.invalid_vamsas_rangetype_cannot_resolve_lists")); + throw new Error( + MessageManager + .getString("error.invalid_vamsas_rangetype_cannot_resolve_lists")); } if (dseta.getSegCount() > 0) { @@ -2469,8 +2474,7 @@ public class VamsasAppDatastore // could do a polarity for pos range too. and pass back indication of // discontinuities. int pos = dseta.getPos(0).getI(); - se = new int[] - { pos, pos }; + se = new int[] { pos, pos }; for (int p = 0, pSize = dseta.getPosCount(); p < pSize; p++) { pos = dseta.getPos(p).getI(); @@ -2504,7 +2508,9 @@ public class VamsasAppDatastore int[] se = null; if (dseta.getSegCount() > 0 && dseta.getPosCount() > 0) { - throw new Error(MessageManager.getString("error.invalid_vamsas_rangetype_cannot_resolve_lists")); + throw new Error( + MessageManager + .getString("error.invalid_vamsas_rangetype_cannot_resolve_lists")); } if (dseta.getSegCount() > 0) { @@ -2757,7 +2763,9 @@ public class VamsasAppDatastore } } catch (Exception e) { - throw new Exception(MessageManager.formatMessage("exception.couldnt_store_sequence_mappings", new String[]{title}),e); + throw new Exception(MessageManager.formatMessage( + "exception.couldnt_store_sequence_mappings", + new String[] { title }), e); } } diff --git a/src/jalview/io/WSWUBlastClient.java b/src/jalview/io/WSWUBlastClient.java index db4acc4..a6c1111 100755 --- a/src/jalview/io/WSWUBlastClient.java +++ b/src/jalview/io/WSWUBlastClient.java @@ -20,15 +20,29 @@ */ package jalview.io; -import java.util.*; +import jalview.analysis.AlignSeq; +import jalview.datamodel.AlignmentI; +import jalview.datamodel.DBRefEntry; +import jalview.datamodel.Sequence; +import jalview.gui.AlignmentPanel; +import jalview.gui.CutAndPasteTransfer; +import jalview.gui.Desktop; +import jalview.util.MessageManager; -import javax.swing.*; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.StringTokenizer; +import java.util.Vector; -import jalview.analysis.*; -import jalview.datamodel.*; -import jalview.gui.*; -import jalview.util.MessageManager; -import uk.ac.ebi.www.*; +import javax.swing.ImageIcon; +import javax.swing.JOptionPane; + +import uk.ac.ebi.www.Data; +import uk.ac.ebi.www.InputParams; +import uk.ac.ebi.www.WSFile; +import uk.ac.ebi.www.WSWUBlast; +import uk.ac.ebi.www.WSWUBlastService; +import uk.ac.ebi.www.WSWUBlastServiceLocator; /** * DOCUMENT ME! @@ -122,8 +136,7 @@ public class WSWUBlastClient { maxFound = value; buffer.append(" " + id2 + " " + value + "%; "); - suggestedIds.addElement(new Object[] - { seq, id2 }); + suggestedIds.addElement(new Object[] { seq, id2 }); } } } @@ -208,7 +221,9 @@ public class WSWUBlastClient imageIndex++; imageIndex %= 9; output.setFrameIcon(imageIcon[imageIndex]); - output.setTitle(MessageManager.formatMessage("label.blasting_for_unidentified_sequence_jobs_running", new String[]{Integer.valueOf(jobsRunning).toString()})); + output.setTitle(MessageManager.formatMessage( + "label.blasting_for_unidentified_sequence_jobs_running", + new String[] { Integer.valueOf(jobsRunning).toString() })); } catch (Exception ex) { } diff --git a/src/jalview/io/vamsas/Datasetsequence.java b/src/jalview/io/vamsas/Datasetsequence.java index 9c86557..f1b9f1a 100644 --- a/src/jalview/io/vamsas/Datasetsequence.java +++ b/src/jalview/io/vamsas/Datasetsequence.java @@ -23,6 +23,7 @@ package jalview.io.vamsas; import jalview.datamodel.DBRefEntry; import jalview.datamodel.SequenceI; import jalview.io.VamsasAppDatastore; + import uk.ac.vamsas.objects.core.DataSet; import uk.ac.vamsas.objects.core.DbRef; import uk.ac.vamsas.objects.core.Sequence; diff --git a/src/jalview/io/vamsas/DatastoreItem.java b/src/jalview/io/vamsas/DatastoreItem.java index 11c7e91..1560ad0 100644 --- a/src/jalview/io/vamsas/DatastoreItem.java +++ b/src/jalview/io/vamsas/DatastoreItem.java @@ -130,16 +130,22 @@ public abstract class DatastoreItem if (vobj2jv.containsKey(vobj.getVorbaId()) && !(vobj2jv.get(vobj.getVorbaId())).equals(jvobj)) { - Cache.log.debug( - "Warning? Overwriting existing vamsas id binding for " - + vobj.getVorbaId(), new Exception(MessageManager.getString("exception.overwriting_vamsas_id_binding"))); + Cache.log + .debug("Warning? Overwriting existing vamsas id binding for " + + vobj.getVorbaId(), + new Exception( + MessageManager + .getString("exception.overwriting_vamsas_id_binding"))); } else if (jv2vobj.containsKey(jvobj) && !((VorbaId) jv2vobj.get(jvobj)).equals(vobj.getVorbaId())) { - Cache.log.debug( - "Warning? Overwriting existing jalview object binding for " - + jvobj, new Exception(MessageManager.getString("exception.overwriting_jalview_id_binding"))); + Cache.log + .debug("Warning? Overwriting existing jalview object binding for " + + jvobj, + new Exception( + MessageManager + .getString("exception.overwriting_jalview_id_binding"))); } /* * Cache.log.error("Attempt to make conflicting object binding! "+vobj+" id " @@ -189,7 +195,9 @@ public abstract class DatastoreItem Object vobject = jv2vobj.remove(oldjvobject); if (vobject == null) { - throw new Error(MessageManager.formatMessage("error.implementation_error_old_jalview_object_not_bound", new String[]{oldjvobject.toString()})); + throw new Error(MessageManager.formatMessage( + "error.implementation_error_old_jalview_object_not_bound", + new String[] { oldjvobject.toString() })); } if (newjvobject != null) { @@ -228,8 +236,13 @@ public abstract class DatastoreItem tojalview = true; if (jvobj != null && !(boundType.isAssignableFrom(jvobj.getClass()))) { - throw new Error(MessageManager.formatMessage("error.implementation_error_vamsas_doc_class_should_bind_to_type" - , new String[]{vobj.getClass().toString(),boundType.toString(),jvobj.getClass().toString()})); + throw new Error( + MessageManager + .formatMessage( + "error.implementation_error_vamsas_doc_class_should_bind_to_type", + new String[] { vobj.getClass().toString(), + boundType.toString(), + jvobj.getClass().toString() })); } dsReg.registerDsObj(this); } @@ -255,8 +268,13 @@ public abstract class DatastoreItem vobj = getjv2vObj(jvobj); if (vobj != null && !(boundToType.isAssignableFrom(vobj.getClass()))) { - throw new Error(MessageManager.formatMessage("error.implementation_error_vamsas_doc_class_should_bind_to_type" - , new String[]{jvobj2.getClass().toString(),boundToType.toString(),vobj.getClass().toString()})); + throw new Error( + MessageManager + .formatMessage( + "error.implementation_error_vamsas_doc_class_should_bind_to_type", + new String[] { jvobj2.getClass().toString(), + boundToType.toString(), + vobj.getClass().toString() })); } dsReg.registerDsObj(this); } @@ -429,8 +447,7 @@ public abstract class DatastoreItem end = start; start = t; } - return new int[] - { start, end, pol < 0 ? 1 : 0 }; + return new int[] { start, end, pol < 0 ? 1 : 0 }; } /** diff --git a/src/jalview/io/vamsas/DatastoreRegistry.java b/src/jalview/io/vamsas/DatastoreRegistry.java index 7467d4d..2879889 100644 --- a/src/jalview/io/vamsas/DatastoreRegistry.java +++ b/src/jalview/io/vamsas/DatastoreRegistry.java @@ -83,8 +83,7 @@ public class DatastoreRegistry if (dsregitem == null) { // create a new item entry - dsregitem = new Object[] - { dsitem.jvobj, dsitem.vobj }; + dsregitem = new Object[] { dsitem.jvobj, dsitem.vobj }; dsItemReg.put(dsitem, dsregitem); dsObjReg.put(dsitem.jvobj, dsitem); dsObjReg.put(dsitem.vobj, dsitem); diff --git a/src/jalview/io/vamsas/Dbref.java b/src/jalview/io/vamsas/Dbref.java index aacdecf..3e2f4e5 100644 --- a/src/jalview/io/vamsas/Dbref.java +++ b/src/jalview/io/vamsas/Dbref.java @@ -22,11 +22,12 @@ package jalview.io.vamsas; import jalview.datamodel.DBRefEntry; import jalview.datamodel.SequenceI; +import jalview.io.VamsasAppDatastore; + import uk.ac.vamsas.objects.core.DataSet; import uk.ac.vamsas.objects.core.DbRef; import uk.ac.vamsas.objects.core.Map; import uk.ac.vamsas.objects.core.Sequence; -import jalview.io.VamsasAppDatastore; public class Dbref extends Rangetype { diff --git a/src/jalview/io/vamsas/Rangetype.java b/src/jalview/io/vamsas/Rangetype.java index 08b1b52..96820d3 100644 --- a/src/jalview/io/vamsas/Rangetype.java +++ b/src/jalview/io/vamsas/Rangetype.java @@ -78,7 +78,9 @@ public abstract class Rangetype extends DatastoreItem int[] se = null; if (dseta.getSegCount() > 0 && dseta.getPosCount() > 0) { - throw new Error(MessageManager.getString("error.invalid_vamsas_rangetype_cannot_resolve_lists")); + throw new Error( + MessageManager + .getString("error.invalid_vamsas_rangetype_cannot_resolve_lists")); } if (dseta.getSegCount() > 0) { @@ -101,8 +103,7 @@ public abstract class Rangetype extends DatastoreItem // could do a polarity for pos range too. and pass back indication of // discontinuities. int pos = dseta.getPos(0).getI(); - se = new int[] - { pos, pos }; + se = new int[] { pos, pos }; for (int p = 0, pSize = dseta.getPosCount(); p < pSize; p++) { pos = dseta.getPos(p).getI(); @@ -136,7 +137,9 @@ public abstract class Rangetype extends DatastoreItem int[] se = null; if (dseta.getSegCount() > 0 && dseta.getPosCount() > 0) { - throw new Error(MessageManager.getString("error.invalid_vamsas_rangetype_cannot_resolve_lists")); + throw new Error( + MessageManager + .getString("error.invalid_vamsas_rangetype_cannot_resolve_lists")); } if (dseta.getSegCount() > 0) { @@ -183,7 +186,9 @@ public abstract class Rangetype extends DatastoreItem int[] se = null; if (range.getSegCount() > 0 && range.getPosCount() > 0) { - throw new Error(MessageManager.getString("error.invalid_vamsas_rangetype_cannot_resolve_lists")); + throw new Error( + MessageManager + .getString("error.invalid_vamsas_rangetype_cannot_resolve_lists")); } if (range.getSegCount() > 0) { @@ -299,7 +304,9 @@ public abstract class Rangetype extends DatastoreItem { if (ml == null) { - throw new Error(MessageManager.getString("error.implementation_error_maplist_is_null")); + throw new Error( + MessageManager + .getString("error.implementation_error_maplist_is_null")); } maprange.setLocal(new Local()); maprange.setMapped(new Mapped()); diff --git a/src/jalview/io/vamsas/Sequencefeature.java b/src/jalview/io/vamsas/Sequencefeature.java index ffc9998..6e93f45 100644 --- a/src/jalview/io/vamsas/Sequencefeature.java +++ b/src/jalview/io/vamsas/Sequencefeature.java @@ -200,8 +200,7 @@ public class Sequencefeature extends Rangetype .debug("About to destroy complex annotation in vamsas document mapped to sequence feature (" + dsa.getVorbaId() + ")"); } - dsa.setSeg(new Seg[] - { vSeg }); + dsa.setSeg(new Seg[] { vSeg }); dsa.setDescription(feature.getDescription()); dsa.setStatus(feature.getStatus()); if (feature.links != null && feature.links.size() > 0) @@ -224,8 +223,7 @@ public class Sequencefeature extends Rangetype if (!Float.isNaN(feature.getScore())) { Score fscore = new Score(); - dsa.setScore(new Score[] - { fscore }); + dsa.setScore(new Score[] { fscore }); fscore.setContent(feature.getScore()); fscore.setName(feature.getType()); } diff --git a/src/jalview/io/vamsas/Sequencemapping.java b/src/jalview/io/vamsas/Sequencemapping.java index d23b264..31ccc48 100644 --- a/src/jalview/io/vamsas/Sequencemapping.java +++ b/src/jalview/io/vamsas/Sequencemapping.java @@ -364,7 +364,8 @@ public class Sequencemapping extends Rangetype } bindjvvobj(mapping, sequenceMapping); jalview.structure.StructureSelectionManager - .getStructureSelectionManager(Desktop.instance).registerMapping(acf); + .getStructureSelectionManager(Desktop.instance) + .registerMapping(acf); // Try to link up any conjugate database references in the two sequences // matchConjugateDBRefs(from, to, mapping); // Try to propagate any dbrefs across this mapping. diff --git a/src/jalview/io/vamsas/Tree.java b/src/jalview/io/vamsas/Tree.java index b5ada26..0bf4096 100644 --- a/src/jalview/io/vamsas/Tree.java +++ b/src/jalview/io/vamsas/Tree.java @@ -20,12 +20,6 @@ */ package jalview.io.vamsas; -import java.io.IOException; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.List; -import java.util.Vector; - import jalview.analysis.NJTree; import jalview.bin.Cache; import jalview.datamodel.AlignmentI; @@ -39,6 +33,13 @@ import jalview.gui.TreePanel; import jalview.io.NewickFile; import jalview.io.VamsasAppDatastore; import jalview.viewmodel.AlignmentViewport; + +import java.io.IOException; +import java.util.Enumeration; +import java.util.Hashtable; +import java.util.List; +import java.util.Vector; + import uk.ac.vamsas.client.Vobject; import uk.ac.vamsas.objects.core.AlignmentSequence; import uk.ac.vamsas.objects.core.Entry; @@ -421,8 +422,7 @@ public class Tree extends DatastoreItem tnv.copyInto(tn); return tn; } - return new Treenode[] - {}; + return new Treenode[] {}; } private String makeNodeSpec(Hashtable nodespecs, @@ -595,8 +595,7 @@ public class Tree extends DatastoreItem // off by // one for to } - return new Object[] - { new AlignmentView(view), jal }; + return new Object[] { new AlignmentView(view), jal }; } } Cache.log diff --git a/src/jalview/javascript/JSFunctionExec.java b/src/jalview/javascript/JSFunctionExec.java index cd9ca88..4d7c0d4 100644 --- a/src/jalview/javascript/JSFunctionExec.java +++ b/src/jalview/javascript/JSFunctionExec.java @@ -20,11 +20,12 @@ */ package jalview.javascript; +import jalview.bin.JalviewLite; + import java.net.URL; import java.util.Vector; import netscape.javascript.JSObject; -import jalview.bin.JalviewLite; public class JSFunctionExec implements Runnable { diff --git a/src/jalview/javascript/JsSelectionSender.java b/src/jalview/javascript/JsSelectionSender.java index e4a0916..60cff9a 100644 --- a/src/jalview/javascript/JsSelectionSender.java +++ b/src/jalview/javascript/JsSelectionSender.java @@ -62,10 +62,8 @@ public class JsSelectionSender extends JSFunctionExec implements } } - String[] seqs = new String[] - {}; - String[] cols = new String[] - {}; + String[] seqs = new String[] {}; + String[] cols = new String[] {}; int strt = 0, end = (src == null) ? -1 : src.alignPanel.av .getAlignment().getWidth(); if (seqsel != null && seqsel.getSize() > 0) @@ -111,10 +109,8 @@ public class JsSelectionSender extends JSFunctionExec implements } System.err.println("Relaying selection to jsfunction:" + _listener); - executeJavascriptFunction( - _listener, - new Object[] - { src, setid, jvlite.arrayToSeparatorList(seqs), + executeJavascriptFunction(_listener, + new Object[] { src, setid, jvlite.arrayToSeparatorList(seqs), jvlite.arrayToSeparatorList(cols) }); } catch (Exception ex) { diff --git a/src/jalview/javascript/MouseOverListener.java b/src/jalview/javascript/MouseOverListener.java index 9d0279b..7b751f8 100644 --- a/src/jalview/javascript/MouseOverListener.java +++ b/src/jalview/javascript/MouseOverListener.java @@ -64,10 +64,8 @@ public class MouseOverListener extends JSFunctionExec implements // function, then only events from that alignFrame are sent to that // function } - executeJavascriptFunction( - _listener, - new Object[] - { src, seq.getDisplayId(false), "" + (1 + i), + executeJavascriptFunction(_listener, + new Object[] { src, seq.getDisplayId(false), "" + (1 + i), "" + seq.findPosition(i) }); } catch (Exception ex) { diff --git a/src/jalview/javascript/MouseOverStructureListener.java b/src/jalview/javascript/MouseOverStructureListener.java index e3534ce..2ef957e 100644 --- a/src/jalview/javascript/MouseOverStructureListener.java +++ b/src/jalview/javascript/MouseOverStructureListener.java @@ -154,10 +154,10 @@ public class MouseOverStructureListener extends JSFunctionExec implements // field that is interpreted (in 2.8.2) as pdbId? // JBPComment: yep - this is right! the Javascript harness uses the // absolute pdbFile URI to locate the PDB file in the external viewer - executeJavascriptFunction(_listenerfn, new String[] - { "mouseover", "" + atom.getPdbFile(), - "" + atom.getChain(), - "" + (atom.getPdbResNum()), "" + atom.getAtomIndex() }); + executeJavascriptFunction(_listenerfn, + new String[] { "mouseover", "" + atom.getPdbFile(), + "" + atom.getChain(), "" + (atom.getPdbResNum()), + "" + atom.getAtomIndex() }); } catch (Exception ex) { System.err.println("Couldn't execute callback with " + _listenerfn @@ -253,8 +253,7 @@ public class MouseOverStructureListener extends JSFunctionExec implements { jvlite.setJsMessageSet(mclass, mhandle, ccomandset); // and notify javascript handler - String st[] = new String[] - { + String st[] = new String[] { "colourstruct", "" + ((jalview.appletgui.AlignmentPanel) source).av.getViewId(), "" + ccomandset.length, diff --git a/src/jalview/jbgui/GAlignExportSettings.java b/src/jalview/jbgui/GAlignExportSettings.java index 58005e8..8b2e4e1 100644 --- a/src/jalview/jbgui/GAlignExportSettings.java +++ b/src/jalview/jbgui/GAlignExportSettings.java @@ -53,8 +53,7 @@ public abstract class GAlignExportSettings extends JPanel { this.hasHiddenSeq = hasHiddenSeq; this.hasHiddenCols = hasHiddenCols; - String[] complexFormats = - { "JSON", "HTML" }; + String[] complexFormats = { "JSON", "HTML" }; for (String format : complexFormats) { @@ -143,7 +142,7 @@ public abstract class GAlignExportSettings extends JPanel add(actionPanel, BorderLayout.SOUTH); } - + private void checkAllAction() { boolean isSelected = chkAll.isSelected(); diff --git a/src/jalview/jbgui/GAlignFrame.java b/src/jalview/jbgui/GAlignFrame.java index 3504ea4..8d18064 100755 --- a/src/jalview/jbgui/GAlignFrame.java +++ b/src/jalview/jbgui/GAlignFrame.java @@ -491,8 +491,7 @@ public class GAlignFrame extends JInternalFrame MessageManager.getString("action.calculate")); webService.setText(MessageManager.getString("action.web_service")); JMenuItem selectAllSequenceMenuItem = new JMenuItem( - MessageManager - .getString("action.select_all")); + MessageManager.getString("action.select_all")); keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_A, Toolkit .getDefaultToolkit().getMenuShortcutKeyMask(), false); al = new ActionListener() @@ -703,8 +702,8 @@ public class GAlignFrame extends JInternalFrame } }); - JMenuItem removeRedundancyMenuItem = new JMenuItem(MessageManager -.getString("action.remove_redundancy")); + JMenuItem removeRedundancyMenuItem = new JMenuItem( + MessageManager.getString("action.remove_redundancy")); keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_D, Toolkit .getDefaultToolkit().getMenuShortcutKeyMask(), false); al = new ActionListener() @@ -1959,8 +1958,8 @@ public class GAlignFrame extends JInternalFrame JMenuItem invertColSel = new JMenuItem( MessageManager.getString("action.invert_column_selection")); - keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_I, - Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() + keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_I, Toolkit + .getDefaultToolkit().getMenuShortcutKeyMask() | KeyEvent.ALT_MASK, false); al = new ActionListener() { @@ -2803,6 +2802,7 @@ public class GAlignFrame extends JInternalFrame { } + protected void loadTreeMenuItem_actionPerformed(ActionEvent e) { @@ -3057,7 +3057,8 @@ public class GAlignFrame extends JInternalFrame return annotationSortOrder; } - protected void setAnnotationSortOrder(SequenceAnnotationOrder annotationSortOrder) + protected void setAnnotationSortOrder( + SequenceAnnotationOrder annotationSortOrder) { this.annotationSortOrder = annotationSortOrder; } diff --git a/src/jalview/jbgui/GAlignmentPanel.java b/src/jalview/jbgui/GAlignmentPanel.java index 474a92d..6e09799 100755 --- a/src/jalview/jbgui/GAlignmentPanel.java +++ b/src/jalview/jbgui/GAlignmentPanel.java @@ -20,9 +20,16 @@ */ package jalview.jbgui; -import java.awt.*; -import javax.swing.*; -import javax.swing.border.*; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; + +import javax.swing.BorderFactory; +import javax.swing.ButtonGroup; +import javax.swing.JPanel; +import javax.swing.JScrollBar; +import javax.swing.JScrollPane; +import javax.swing.border.Border; public class GAlignmentPanel extends JPanel { diff --git a/src/jalview/jbgui/GCutAndPasteHtmlTransfer.java b/src/jalview/jbgui/GCutAndPasteHtmlTransfer.java index 03154ee..a9e3112 100644 --- a/src/jalview/jbgui/GCutAndPasteHtmlTransfer.java +++ b/src/jalview/jbgui/GCutAndPasteHtmlTransfer.java @@ -23,10 +23,22 @@ package jalview.jbgui; import jalview.gui.JvSwingUtils; import jalview.util.MessageManager; -import java.awt.*; -import java.awt.event.*; - -import javax.swing.*; +import java.awt.BorderLayout; +import java.awt.Font; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; + +import javax.swing.JButton; +import javax.swing.JCheckBoxMenuItem; +import javax.swing.JEditorPane; +import javax.swing.JInternalFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JScrollPane; /** * DOCUMENT ME! diff --git a/src/jalview/jbgui/GCutAndPasteTransfer.java b/src/jalview/jbgui/GCutAndPasteTransfer.java index 4ac3a67..acf1581 100755 --- a/src/jalview/jbgui/GCutAndPasteTransfer.java +++ b/src/jalview/jbgui/GCutAndPasteTransfer.java @@ -23,9 +23,21 @@ package jalview.jbgui; import jalview.gui.JvSwingUtils; import jalview.util.MessageManager; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; +import java.awt.BorderLayout; +import java.awt.Font; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseEvent; + +import javax.swing.JButton; +import javax.swing.JInternalFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; /** * DOCUMENT ME! diff --git a/src/jalview/jbgui/GDasSourceBrowser.java b/src/jalview/jbgui/GDasSourceBrowser.java index d74900a..a2612e8 100755 --- a/src/jalview/jbgui/GDasSourceBrowser.java +++ b/src/jalview/jbgui/GDasSourceBrowser.java @@ -22,11 +22,30 @@ package jalview.jbgui; import jalview.util.MessageManager; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import javax.swing.border.*; -import javax.swing.event.*; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.BorderFactory; +import javax.swing.JButton; +import javax.swing.JEditorPane; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.JProgressBar; +import javax.swing.JScrollPane; +import javax.swing.JTable; +import javax.swing.JTextField; +import javax.swing.SwingConstants; +import javax.swing.border.TitledBorder; +import javax.swing.event.HyperlinkEvent; +import javax.swing.event.HyperlinkListener; public class GDasSourceBrowser extends JPanel { diff --git a/src/jalview/jbgui/GDesktop.java b/src/jalview/jbgui/GDesktop.java index 1c37e86..d22fd88 100755 --- a/src/jalview/jbgui/GDesktop.java +++ b/src/jalview/jbgui/GDesktop.java @@ -75,7 +75,7 @@ public class GDesktop extends JFrame JMenuItem saveState = new JMenuItem(); JMenuItem loadState = new JMenuItem(); - + JMenu inputMenu = new JMenu(); protected JMenuItem vamsasStart = new JMenuItem(); @@ -101,8 +101,9 @@ public class GDesktop extends JFrame protected JCheckBoxMenuItem showConsole = new JCheckBoxMenuItem(); protected JCheckBoxMenuItem showNews = new JCheckBoxMenuItem(); - + protected JMenuItem snapShotWindow = new JMenuItem(); + /** * Creates a new GDesktop object. */ @@ -353,7 +354,7 @@ public class GDesktop extends JFrame snapShotWindow_actionPerformed(e); } }); - + desktopMenubar.add(FileMenu); desktopMenubar.add(toolsMenu); VamsasMenu.setVisible(false); @@ -394,7 +395,7 @@ public class GDesktop extends JFrame protected void snapShotWindow_actionPerformed(ActionEvent e) { // TODO Auto-generated method stub - + } protected void showConsole_actionPerformed(ActionEvent e) diff --git a/src/jalview/jbgui/GFinder.java b/src/jalview/jbgui/GFinder.java index 0b2e6be..df09a61 100755 --- a/src/jalview/jbgui/GFinder.java +++ b/src/jalview/jbgui/GFinder.java @@ -90,7 +90,6 @@ public class GFinder extends JPanel } } - private void jbInit() throws Exception { jLabelFind.setFont(new java.awt.Font("Verdana", 0, 12)); diff --git a/src/jalview/jbgui/GFontChooser.java b/src/jalview/jbgui/GFontChooser.java index f379de8..8c893a2 100755 --- a/src/jalview/jbgui/GFontChooser.java +++ b/src/jalview/jbgui/GFontChooser.java @@ -20,6 +20,9 @@ */ package jalview.jbgui; +import jalview.gui.JvSwingUtils; +import jalview.util.MessageManager; + import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; @@ -35,9 +38,6 @@ import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SwingConstants; -import jalview.gui.JvSwingUtils; -import jalview.util.MessageManager; - /** * DOCUMENT ME! * @@ -46,7 +46,8 @@ import jalview.util.MessageManager; */ public class GFontChooser extends JPanel { - private static final Font VERDANA_11PT = new java.awt.Font("Verdana", 0, 11); + private static final Font VERDANA_11PT = new java.awt.Font("Verdana", 0, + 11); protected JComboBox fontSize = new JComboBox(); diff --git a/src/jalview/jbgui/GPDBSearchPanel.java b/src/jalview/jbgui/GPDBSearchPanel.java index 6f6f1aa..64095d0 100644 --- a/src/jalview/jbgui/GPDBSearchPanel.java +++ b/src/jalview/jbgui/GPDBSearchPanel.java @@ -72,11 +72,11 @@ public abstract class GPDBSearchPanel extends JPanel protected JButton btn_ok = new JButton(); protected JButton btn_back = new JButton(); - + protected JButton btn_cancel = new JButton(); - + protected JTextField txt_search = new JTextField(20); - + protected JTable tbl_summary = new JTable() { public String getToolTipText(MouseEvent evt) @@ -95,10 +95,8 @@ public abstract class GPDBSearchPanel extends JPanel } toolTipText = (toolTipText == null ? null : (toolTipText.length() > 500 ? JvSwingUtils.wrapTooltip( - true, toolTipText.subSequence(0, 500) - + "...") - : JvSwingUtils.wrapTooltip(true, - toolTipText))); + true, toolTipText.subSequence(0, 500) + "...") + : JvSwingUtils.wrapTooltip(true, toolTipText))); return toolTipText; } @@ -106,14 +104,14 @@ public abstract class GPDBSearchPanel extends JPanel protected StringBuilder errorWarning = new StringBuilder(); - protected JScrollPane scrl_searchResult = new JScrollPane( -tbl_summary); + protected JScrollPane scrl_searchResult = new JScrollPane(tbl_summary); protected ImageIcon warningImage = new ImageIcon(getClass().getResource( "/images/warning.gif")); protected ImageIcon loadingImage = new ImageIcon(getClass().getResource( "/images/loading.gif")); + protected JLabel lbl_warning = new JLabel(warningImage); protected JLabel lbl_loading = new JLabel(loadingImage); @@ -166,6 +164,7 @@ tbl_summary); { validateSelection(); } + public void mouseReleased(MouseEvent e) { validateSelection(); @@ -202,7 +201,6 @@ tbl_summary); } }); - scrl_searchResult.setPreferredSize(new Dimension(500, 300)); scrl_searchResult .setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); @@ -228,8 +226,9 @@ tbl_summary); else { tooltipText = MessageManager.formatMessage( - "label.separate_multiple_query_values", new Object[] - { getCmbSearchTarget().getSelectedItem().toString() }); + "label.separate_multiple_query_values", + new Object[] { getCmbSearchTarget().getSelectedItem() + .toString() }); } txt_search.setToolTipText(JvSwingUtils.wrapTooltip(true, tooltipText)); @@ -239,7 +238,6 @@ tbl_summary); populateCmbSearchTargetOptions(); - txt_search.setFont(new java.awt.Font("Verdana", 0, 12)); txt_search.addKeyListener(new KeyAdapter() @@ -286,7 +284,8 @@ tbl_summary); final String searchTabTitle = MessageManager .getString("label.search_result"); - final String configureCols = MessageManager.getString("label.configure_displayed_columns"); + final String configureCols = MessageManager + .getString("label.configure_displayed_columns"); ChangeListener changeListener = new ChangeListener() { public void stateChanged(ChangeEvent changeEvent) @@ -354,6 +353,7 @@ tbl_summary); : true; } + public void validateSelection() { if (tbl_summary.getSelectedRows().length > 0) @@ -365,6 +365,7 @@ tbl_summary); btn_ok.setEnabled(false); } } + public JComboBox getCmbSearchTarget() { return cmb_searchTarget; diff --git a/src/jalview/jbgui/GPairwiseAlignPanel.java b/src/jalview/jbgui/GPairwiseAlignPanel.java index 5875e2d..b064551 100755 --- a/src/jalview/jbgui/GPairwiseAlignPanel.java +++ b/src/jalview/jbgui/GPairwiseAlignPanel.java @@ -22,9 +22,13 @@ package jalview.jbgui; import jalview.util.MessageManager; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; +import java.awt.BorderLayout; +import java.awt.event.ActionEvent; + +import javax.swing.JButton; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; /** * DOCUMENT ME! diff --git a/src/jalview/jbgui/GPreferences.java b/src/jalview/jbgui/GPreferences.java index 4f4afb0..b12355a 100755 --- a/src/jalview/jbgui/GPreferences.java +++ b/src/jalview/jbgui/GPreferences.java @@ -76,8 +76,8 @@ public class GPreferences extends JPanel { private static final Font LABEL_FONT = JvSwingUtils.getLabelFont(); - private static final Font LABEL_FONT_ITALIC = JvSwingUtils - .getLabelFont(false, true); + private static final Font LABEL_FONT_ITALIC = JvSwingUtils.getLabelFont( + false, true); /* * Visual tab components @@ -156,7 +156,6 @@ public class GPreferences extends JPanel protected JTextField chimeraPath = new JTextField(); - /* * Colours tab components */ @@ -276,16 +275,17 @@ public class GPreferences extends JPanel tabbedPane.add(initConnectionsTab(), MessageManager.getString("label.connections")); - tabbedPane.add(initOutputTab(), MessageManager.getString("label.output")); + tabbedPane.add(initOutputTab(), + MessageManager.getString("label.output")); - tabbedPane.add(initEditingTab(), MessageManager.getString("label.editing")); + tabbedPane.add(initEditingTab(), + MessageManager.getString("label.editing")); /* * See DasSourceBrowser for the real work of configuring this tab. */ dasTab.setLayout(new BorderLayout()); - tabbedPane - .add(dasTab, MessageManager.getString("label.das_settings")); + tabbedPane.add(dasTab, MessageManager.getString("label.das_settings")); /* * See WsPreferences for the real work of configuring this tab. @@ -402,8 +402,9 @@ public class GPreferences extends JPanel autoIdWidth.setFont(LABEL_FONT); autoIdWidth.setText(MessageManager .getString("label.automatically_set_id_width")); - autoIdWidth - .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.adjusts_width_generated_eps_png"))); + autoIdWidth.setToolTipText(JvSwingUtils.wrapTooltip(true, + MessageManager + .getString("label.adjusts_width_generated_eps_png"))); autoIdWidth.setBounds(new Rectangle(228, 96, 188, 23)); autoIdWidth.addActionListener(new ActionListener() { @@ -418,9 +419,11 @@ public class GPreferences extends JPanel userIdWidthlabel.setText(MessageManager .getString("label.figure_id_column_width")); userIdWidth - .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.manually_specify_width_left_column"))); + .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager + .getString("label.manually_specify_width_left_column"))); userIdWidthlabel - .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.manually_specify_width_left_column"))); + .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager + .getString("label.manually_specify_width_left_column"))); userIdWidthlabel.setBounds(new Rectangle(236, 120, 168, 23)); userIdWidth.setFont(JvSwingUtils.getTextAreaFont()); userIdWidth.setText(""); @@ -727,8 +730,7 @@ public class GPreferences extends JPanel nucColourLabel.setFont(LABEL_FONT); nucColourLabel.setHorizontalAlignment(SwingConstants.LEFT); nucColourLabel.setText(MessageManager - .getString("label.nuc_alignment_colour") - + " "); + .getString("label.nuc_alignment_colour") + " "); JvSwingUtils.addtoLayout(coloursTab, MessageManager .getString("label.default_colour_scheme_for_alignment"), nucColourLabel, nucColour); @@ -765,7 +767,8 @@ public class GPreferences extends JPanel int ypos = 30; structFromPdb.setFont(LABEL_FONT); - structFromPdb.setText(MessageManager.getString("label.struct_from_pdb")); + structFromPdb + .setText(MessageManager.getString("label.struct_from_pdb")); structFromPdb.setBounds(new Rectangle(5, ypos, width, height)); structFromPdb.addActionListener(new ActionListener() { @@ -865,13 +868,9 @@ public class GPreferences extends JPanel docFieldPref.setBounds(new Rectangle(10, ypos + 5, 450, 120)); structureTab.add(docFieldPref); - - - return structureTab; } - /** * Action on choosing a structure viewer from combobox options. * @@ -1121,7 +1120,7 @@ public class GPreferences extends JPanel } } }); - + sortby.setFont(LABEL_FONT); sortby.setBounds(new Rectangle(172, 260, 155, 21)); JLabel sortLabel = new JLabel(); diff --git a/src/jalview/jbgui/GRestInputParamEditDialog.java b/src/jalview/jbgui/GRestInputParamEditDialog.java index 74ebcad..eb1a348 100644 --- a/src/jalview/jbgui/GRestInputParamEditDialog.java +++ b/src/jalview/jbgui/GRestInputParamEditDialog.java @@ -20,15 +20,20 @@ */ package jalview.jbgui; -import java.awt.Dimension; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; - import jalview.gui.JvSwingUtils; import jalview.gui.OptsAndParamsPage; import jalview.util.MessageManager; -import javax.swing.*; +import java.awt.Dimension; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; + +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextField; +import javax.swing.ListSelectionModel; import javax.swing.border.TitledBorder; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; diff --git a/src/jalview/jbgui/GRestServiceEditorPane.java b/src/jalview/jbgui/GRestServiceEditorPane.java index a8ac912..3329780 100644 --- a/src/jalview/jbgui/GRestServiceEditorPane.java +++ b/src/jalview/jbgui/GRestServiceEditorPane.java @@ -146,9 +146,8 @@ public class GRestServiceEditorPane extends JPanel // details.add(cpanel = new JPanel(), BorderLayout.CENTER); // cpanel.setLayout(new FlowLayout()); hSeparable = new JCheckBox(MessageManager.getString("label.per_seq")); - hSeparable - .setToolTipText(JvSwingUtils - .wrapTooltip(true, MessageManager.getString("label.job_created_when_checked"))); + hSeparable.setToolTipText(JvSwingUtils.wrapTooltip(true, + MessageManager.getString("label.job_created_when_checked"))); hSeparable.addActionListener(new ActionListener() { @@ -162,7 +161,10 @@ public class GRestServiceEditorPane extends JPanel vSeparable = new JCheckBox( MessageManager.getString("label.result_vertically_separable")); vSeparable - .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.when_checked_job_visible_region_and_results"))); + .setToolTipText(JvSwingUtils.wrapTooltip( + true, + MessageManager + .getString("label.when_checked_job_visible_region_and_results"))); vSeparable.addActionListener(new ActionListener() { @@ -392,8 +394,8 @@ public class GRestServiceEditorPane extends JPanel .getString("label.rsbs_encoded_service"))); urldescPane.add(urldescVp, "span"); paste.add(urldescPane, "span"); - urldescPane - .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.flat_file_representation"))); + urldescPane.setToolTipText(JvSwingUtils.wrapTooltip(true, + MessageManager.getString("label.flat_file_representation"))); parseRes = new JTextArea(); parseResVp = new JScrollPane(); @@ -404,8 +406,8 @@ public class GRestServiceEditorPane extends JPanel "[grow 100, fill]")); parseWarnings.setBorder(new TitledBorder(MessageManager .getString("label.parsing_errors"))); - parseWarnings - .setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.getString("label.result_of_parsing_rsbs"))); + parseWarnings.setToolTipText(JvSwingUtils.wrapTooltip(true, + MessageManager.getString("label.result_of_parsing_rsbs"))); parseWarnings.add(parseResVp, "center"); parseRes.setEditable(false); paste.add(parseWarnings, "span"); diff --git a/src/jalview/jbgui/GRnaStructureViewer.java b/src/jalview/jbgui/GRnaStructureViewer.java index 95c9a1c..60f5436 100644 --- a/src/jalview/jbgui/GRnaStructureViewer.java +++ b/src/jalview/jbgui/GRnaStructureViewer.java @@ -20,7 +20,7 @@ */ package jalview.jbgui; -import javax.swing.*; +import javax.swing.JInternalFrame; public class GRnaStructureViewer extends JInternalFrame { diff --git a/src/jalview/jbgui/GSequenceLink.java b/src/jalview/jbgui/GSequenceLink.java index ed74f02..46580a2 100755 --- a/src/jalview/jbgui/GSequenceLink.java +++ b/src/jalview/jbgui/GSequenceLink.java @@ -24,9 +24,21 @@ import jalview.gui.JvSwingUtils; import jalview.util.MessageManager; import jalview.util.UrlLink; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; +import java.awt.Font; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.Insets; +import java.awt.Panel; +import java.awt.Rectangle; +import java.awt.event.KeyAdapter; +import java.awt.event.KeyEvent; + +import javax.swing.BorderFactory; +import javax.swing.JLabel; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.SwingConstants; public class GSequenceLink extends Panel { @@ -118,11 +130,10 @@ public class GSequenceLink extends Panel return true; } - JOptionPane - .showInternalMessageDialog( - jalview.gui.Desktop.desktop, - MessageManager.getString("warn.url_must_contain"), - MessageManager.getString("label.invalid_url"), JOptionPane.WARNING_MESSAGE); + JOptionPane.showInternalMessageDialog(jalview.gui.Desktop.desktop, + MessageManager.getString("warn.url_must_contain"), + MessageManager.getString("label.invalid_url"), + JOptionPane.WARNING_MESSAGE); return false; } diff --git a/src/jalview/jbgui/GSliderPanel.java b/src/jalview/jbgui/GSliderPanel.java index 93f7040..1362007 100755 --- a/src/jalview/jbgui/GSliderPanel.java +++ b/src/jalview/jbgui/GSliderPanel.java @@ -22,9 +22,22 @@ package jalview.jbgui; import jalview.util.MessageManager; -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; + +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JSlider; +import javax.swing.JTextField; +import javax.swing.SwingConstants; /** * DOCUMENT ME! diff --git a/src/jalview/jbgui/GSplitFrame.java b/src/jalview/jbgui/GSplitFrame.java index bcd5f64..b9f07db 100644 --- a/src/jalview/jbgui/GSplitFrame.java +++ b/src/jalview/jbgui/GSplitFrame.java @@ -1,5 +1,7 @@ package jalview.jbgui; +import jalview.util.Platform; + import java.awt.Component; import java.awt.MouseInfo; import java.awt.Point; @@ -9,8 +11,6 @@ import javax.swing.JInternalFrame; import javax.swing.JSplitPane; import javax.swing.plaf.basic.BasicInternalFrameUI; -import jalview.util.Platform; - public class GSplitFrame extends JInternalFrame { private static final long serialVersionUID = 1L; @@ -95,7 +95,7 @@ public class GSplitFrame extends JInternalFrame protected GAlignFrame getFrameAtMouse() { Point loc = MouseInfo.getPointerInfo().getLocation(); - + if (isIn(loc, splitPane.getTopComponent())) { return getTopFrame(); diff --git a/src/jalview/jbgui/GStructureChooser.java b/src/jalview/jbgui/GStructureChooser.java index 2c51b3d..c4043c4 100644 --- a/src/jalview/jbgui/GStructureChooser.java +++ b/src/jalview/jbgui/GStructureChooser.java @@ -75,7 +75,7 @@ public abstract class GStructureChooser extends JPanel implements protected JComboBox cmb_filterOption = new JComboBox(); protected AlignmentPanel ap; - + protected StringBuilder errorWarning = new StringBuilder(); protected JLabel lbl_result = new JLabel( @@ -136,7 +136,6 @@ public abstract class GStructureChooser extends JPanel implements protected JLabel lbl_fromFileStatus = new JLabel(errorImage); - protected AssciateSeqPanel idInputAssSeqPanel = new AssciateSeqPanel(); protected AssciateSeqPanel fileChooserAssSeqPanel = new AssciateSeqPanel(); @@ -174,8 +173,7 @@ public abstract class GStructureChooser extends JPanel implements } }; - protected JScrollPane scrl_foundStructures = new JScrollPane( - tbl_summary); + protected JScrollPane scrl_foundStructures = new JScrollPane(tbl_summary); protected JTable tbl_local_pdb = new JTable(); @@ -187,6 +185,7 @@ public abstract class GStructureChooser extends JPanel implements PreferenceSource.STRUCTURE_CHOOSER); protected PDBDocField[] previousWantedFields; + public GStructureChooser() { try @@ -306,7 +305,6 @@ public abstract class GStructureChooser extends JPanel implements pnl_main.add(chk_invertFilter); lbl_loading.setVisible(false); - pnl_fileChooser.add(btn_pdbFromFile); pnl_fileChooser.add(lbl_fromFileStatus); pnl_fileChooserBL.add(fileChooserAssSeqPanel, BorderLayout.NORTH); @@ -316,7 +314,7 @@ public abstract class GStructureChooser extends JPanel implements pnl_idInput.add(lbl_pdbManualFetchStatus); pnl_idInputBL.add(idInputAssSeqPanel, BorderLayout.NORTH); pnl_idInputBL.add(pnl_idInput, BorderLayout.CENTER); - + final String foundStructureSummary = MessageManager .getString("label.found_structures_summary"); final String configureCols = MessageManager @@ -328,8 +326,7 @@ public abstract class GStructureChooser extends JPanel implements JTabbedPane sourceTabbedPane = (JTabbedPane) changeEvent .getSource(); int index = sourceTabbedPane.getSelectedIndex(); - if (sourceTabbedPane.getTitleAt(index) -.equals(configureCols)) + if (sourceTabbedPane.getTitleAt(index).equals(configureCols)) { btn_view.setEnabled(false); btn_cancel.setEnabled(false); @@ -356,14 +353,14 @@ public abstract class GStructureChooser extends JPanel implements pnl_filter.setPreferredSize(new Dimension(500, 300)); pnl_filter.add(foundStructureSummary, scrl_foundStructures); pnl_filter.add(configureCols, pdbDocFieldPrefs); - + pnl_locPDB.add(scrl_localPDB); pnl_switchableViews.add(pnl_fileChooserBL, VIEWS_FROM_FILE); pnl_switchableViews.add(pnl_idInputBL, VIEWS_ENTER_ID); pnl_switchableViews.add(pnl_filter, VIEWS_FILTER); pnl_switchableViews.add(pnl_locPDB, VIEWS_LOCAL_PDB); - + this.setLayout(mainLayout); this.add(pnl_main, java.awt.BorderLayout.NORTH); this.add(pnl_switchableViews, java.awt.BorderLayout.CENTER); @@ -387,7 +384,7 @@ public abstract class GStructureChooser extends JPanel implements previousWantedFields) ? false : true; } - + @Override /** * Event listener for the 'filter' combo-box and 'invert' check-box @@ -464,6 +461,7 @@ public abstract class GStructureChooser extends JPanel implements public class AssociateSeqOptions { private SequenceI sequence; + private String name; public AssociateSeqOptions(SequenceI seq) diff --git a/src/jalview/jbgui/GStructureViewer.java b/src/jalview/jbgui/GStructureViewer.java index 982036d..943aa8c 100644 --- a/src/jalview/jbgui/GStructureViewer.java +++ b/src/jalview/jbgui/GStructureViewer.java @@ -20,6 +20,9 @@ */ package jalview.jbgui; +import jalview.api.structures.JalviewStructureDisplayI; +import jalview.util.MessageManager; + import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -33,9 +36,6 @@ import javax.swing.JMenuItem; import javax.swing.JPanel; import javax.swing.JRadioButtonMenuItem; -import jalview.api.structures.JalviewStructureDisplayI; -import jalview.util.MessageManager; - public abstract class GStructureViewer extends JInternalFrame implements JalviewStructureDisplayI { @@ -166,7 +166,8 @@ public abstract class GStructureViewer extends JInternalFrame implements colourMenu.setText(MessageManager.getString("label.colours")); JMenuItem backGround = new JMenuItem(); - backGround.setText(MessageManager.getString("action.background_colour")); + backGround + .setText(MessageManager.getString("action.background_colour")); backGround.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent actionEvent) diff --git a/src/jalview/jbgui/GUserDefinedColours.java b/src/jalview/jbgui/GUserDefinedColours.java index 8b20939..b5695b2 100755 --- a/src/jalview/jbgui/GUserDefinedColours.java +++ b/src/jalview/jbgui/GUserDefinedColours.java @@ -23,10 +23,23 @@ package jalview.jbgui; import jalview.gui.JvSwingUtils; import jalview.util.MessageManager; -import java.awt.*; -import java.awt.event.*; - -import javax.swing.*; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.GridBagLayout; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JColorChooser; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.SwingConstants; import javax.swing.colorchooser.AbstractColorChooserPanel; /** @@ -185,11 +198,11 @@ 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(MessageManager.formatMessage( - "label.html_content", - new String[] - { MessageManager - .getString("label.save_colour_scheme_with_unique_name_added_to_colour_menu") })); + label.setText(MessageManager + .formatMessage( + "label.html_content", + new String[] { MessageManager + .getString("label.save_colour_scheme_with_unique_name_added_to_colour_menu") })); caseSensitive.setText(MessageManager.getString("label.case_sensitive")); caseSensitive.addActionListener(new ActionListener() { @@ -229,12 +242,16 @@ public class GUserDefinedColours extends JPanel jPanel4.add(panel1, java.awt.BorderLayout.CENTER); this.add(jPanel4, java.awt.BorderLayout.CENTER); this.add(colorChooser, java.awt.BorderLayout.EAST); - + AbstractColorChooserPanel[] choosers = colorChooser.getChooserPanels(); - // JAL-1360 larger JColorChooser in Java 7 overwrites AA panel; restrict to swatch picker only - if (choosers.length > 3) { - // Java 7 default has 5 options rather than 3 for choosing colours; keep the first only - colorChooser.setChooserPanels(new AbstractColorChooserPanel[]{choosers[0]}); + // JAL-1360 larger JColorChooser in Java 7 overwrites AA panel; restrict to + // swatch picker only + if (choosers.length > 3) + { + // Java 7 default has 5 options rather than 3 for choosing colours; keep + // the first only + colorChooser + .setChooserPanels(new AbstractColorChooserPanel[] { choosers[0] }); } } diff --git a/src/jalview/jbgui/GWebserviceInfo.java b/src/jalview/jbgui/GWebserviceInfo.java index 624f2e0..9169e63 100755 --- a/src/jalview/jbgui/GWebserviceInfo.java +++ b/src/jalview/jbgui/GWebserviceInfo.java @@ -22,10 +22,20 @@ package jalview.jbgui; import jalview.util.MessageManager; -import java.awt.*; -import java.awt.event.*; - -import javax.swing.*; +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.GridLayout; +import java.awt.Insets; +import java.awt.event.ActionEvent; + +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; /** * DOCUMENT ME! diff --git a/src/jalview/jbgui/PDBDocFieldPreferences.java b/src/jalview/jbgui/PDBDocFieldPreferences.java index 4ec649a..4b400a3 100644 --- a/src/jalview/jbgui/PDBDocFieldPreferences.java +++ b/src/jalview/jbgui/PDBDocFieldPreferences.java @@ -50,16 +50,14 @@ public class PDBDocFieldPreferences extends JScrollPane switch (source) { case SEARCH_SUMMARY: - columnNames = new String[] - { "PDB Field", "Show in search summary" }; + columnNames = new String[] { "PDB Field", "Show in search summary" }; break; case STRUCTURE_CHOOSER: - columnNames = new String[] - { "PDB Field", "Show in structure summary" }; + columnNames = new String[] { "PDB Field", "Show in structure summary" }; break; case PREFERENCES: - columnNames = new String[] - { "PDB Field", "Show in search summary", "Show in structure summary" }; + columnNames = new String[] { "PDB Field", "Show in search summary", + "Show in structure summary" }; break; default: break; @@ -77,16 +75,16 @@ public class PDBDocFieldPreferences extends JScrollPane switch (source) { case SEARCH_SUMMARY: - data[x++] = new Object[] - { field.getName(), searchSummaryFields.contains(field) }; + data[x++] = new Object[] { field.getName(), + searchSummaryFields.contains(field) }; break; case STRUCTURE_CHOOSER: - data[x++] = new Object[] - { field.getName(), structureSummaryFields.contains(field) }; + data[x++] = new Object[] { field.getName(), + structureSummaryFields.contains(field) }; break; case PREFERENCES: - data[x++] = new Object[] - { field.getName(), searchSummaryFields.contains(field), + data[x++] = new Object[] { field.getName(), + searchSummaryFields.contains(field), structureSummaryFields.contains(field) }; break; default: @@ -232,8 +230,7 @@ public class PDBDocFieldPreferences extends JScrollPane } private void updatePrefs(Collection prefConfig, - PDBDocField pdbField, - boolean selected) + PDBDocField pdbField, boolean selected) { if (prefConfig.contains(pdbField) && !selected) { diff --git a/src/jalview/json/binding/biojs/BioJSRepositoryPojo.java b/src/jalview/json/binding/biojs/BioJSRepositoryPojo.java index 46b4ab8..5c79e51 100644 --- a/src/jalview/json/binding/biojs/BioJSRepositoryPojo.java +++ b/src/jalview/json/binding/biojs/BioJSRepositoryPojo.java @@ -45,8 +45,7 @@ public class BioJSRepositoryPojo this.latestReleaseVersion = (String) JsonObj .get("latestReleaseVersion"); - JSONArray repositoriesJsonArray = (JSONArray) JsonObj -.get("releases"); + JSONArray repositoriesJsonArray = (JSONArray) JsonObj.get("releases"); for (Iterator repoIter = repositoriesJsonArray.iterator(); repoIter .hasNext();) { @@ -69,7 +68,6 @@ public class BioJSRepositoryPojo this.description = description; } - public String getLatestReleaseVersion() { return latestReleaseVersion; diff --git a/src/jalview/json/binding/biojson/v1/AlignmentAnnotationPojo.java b/src/jalview/json/binding/biojson/v1/AlignmentAnnotationPojo.java index 9fd712f..6b9cf42 100644 --- a/src/jalview/json/binding/biojson/v1/AlignmentAnnotationPojo.java +++ b/src/jalview/json/binding/biojson/v1/AlignmentAnnotationPojo.java @@ -8,10 +8,14 @@ import com.github.reinert.jjschema.Attributes; public class AlignmentAnnotationPojo { - @Attributes(required = false, description = "Label for the Alignment Annotation") + @Attributes( + required = false, + description = "Label for the Alignment Annotation") private String label; - @Attributes(required = false, description = "Description for the Alignment Annotation") + @Attributes( + required = false, + description = "Description for the Alignment Annotation") private String description; @Attributes(required = false) @@ -47,6 +51,4 @@ public class AlignmentAnnotationPojo this.annotations = annotations; } - - } diff --git a/src/jalview/json/binding/biojson/v1/AlignmentPojo.java b/src/jalview/json/binding/biojson/v1/AlignmentPojo.java index 9021a73..bd2ebe7 100644 --- a/src/jalview/json/binding/biojson/v1/AlignmentPojo.java +++ b/src/jalview/json/binding/biojson/v1/AlignmentPojo.java @@ -1,6 +1,5 @@ package jalview.json.binding.biojson.v1; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -8,16 +7,20 @@ import java.util.Map; import com.github.reinert.jjschema.Attributes; -@Attributes(title="BioJSON", description="A specification for the representation and exchange of bioinformatics data") +@Attributes( + title = "BioJSON", + description = "A specification for the representation and exchange of bioinformatics data") public class AlignmentPojo { - @Attributes(required = true, description = "Serial version identifier for BioJSON schema") + @Attributes( + required = true, + description = "Serial version identifier for BioJSON schema") private String svid = "1.0"; @Attributes( required = true, minItems = 1, - description = "An array of Sequences which makes up the Alignment") + description = "An array of Sequences which makes up the Alignment") private List seqs = new ArrayList(); @Attributes( @@ -48,12 +51,13 @@ public class AlignmentPojo "Blosum62", "RNA Helices", "% Identity" }, description = "The Colour Scheme applied to the alignment") private String colourScheme; - + @Attributes( - required = true, - maxItems = 0, description = "AppSettings stores key=value pairs of custom application specific
" - + "settings (i.e visualisation settings, etc) for different applications
" - + "that consume or generate BioJSON") + required = true, + maxItems = 0, + description = "AppSettings stores key=value pairs of custom application specific
" + + "settings (i.e visualisation settings, etc) for different applications
" + + "that consume or generate BioJSON") Map appSettings = new HashMap(); public AlignmentPojo() diff --git a/src/jalview/json/binding/biojson/v1/AnnotationPojo.java b/src/jalview/json/binding/biojson/v1/AnnotationPojo.java index 919f6ab..9b693fa 100644 --- a/src/jalview/json/binding/biojson/v1/AnnotationPojo.java +++ b/src/jalview/json/binding/biojson/v1/AnnotationPojo.java @@ -4,19 +4,25 @@ import com.github.reinert.jjschema.Attributes; public class AnnotationPojo { - @Attributes(required = false, description = "Display character for the given annotation") + @Attributes( + required = false, + description = "Display character for the given annotation") private String displayCharacter; - @Attributes(required = false, description = "Description for the annotation") + @Attributes( + required = false, + description = "Description for the annotation") private String description; - @Attributes(required = true, enums = {"E", "H", "\u0000", ")", "("}, description = "Determines what is rendered for the secondary
structure
  • ’E’ - indicates Beta Sheet/Strand
  • ’H’ - indicates alpha helix
  • ‘\\u0000’ - indicates blank

For RNA Helix (only shown when working with
nucleotide sequences):
  • ‘(’ - indicates bases pair with columns upstream
    (to right)
  • ’(’ - indicate region pairs with bases to the left
") + @Attributes( + required = true, + enums = { "E", "H", "\u0000", ")", "(" }, + description = "Determines what is rendered for the secondary
structure
  • ’E’ - indicates Beta Sheet/Strand
  • ’H’ - indicates alpha helix
  • ‘\\u0000’ - indicates blank

For RNA Helix (only shown when working with
nucleotide sequences):
  • ‘(’ - indicates bases pair with columns upstream
    (to right)
  • ’(’ - indicate region pairs with bases to the left
") private char secondaryStructure; @Attributes(required = false, description = "Value of the annotation") private float value; - public String getDisplayCharacter() { return displayCharacter; diff --git a/src/jalview/json/binding/biojson/v1/SequenceFeaturesPojo.java b/src/jalview/json/binding/biojson/v1/SequenceFeaturesPojo.java index 64fee65..6729139 100644 --- a/src/jalview/json/binding/biojson/v1/SequenceFeaturesPojo.java +++ b/src/jalview/json/binding/biojson/v1/SequenceFeaturesPojo.java @@ -7,10 +7,14 @@ import com.github.reinert.jjschema.Attributes; public class SequenceFeaturesPojo { - @Attributes(required = true, description = "Start residue position for the sequence feature") + @Attributes( + required = true, + description = "Start residue position for the sequence feature") private int xStart; - @Attributes(required = true, description = "End residue position for the sequence feature") + @Attributes( + required = true, + description = "End residue position for the sequence feature") private int xEnd; @Attributes( @@ -20,7 +24,9 @@ public class SequenceFeaturesPojo description = "Reference to the sequence in the alignment
(more like a foreign key)") private String sequenceRef; - @Attributes(required = true, description = "The name or type of the SequenceFeature") + @Attributes( + required = true, + description = "The name or type of the SequenceFeature") private String type; @Attributes(required = false, description = "Score") @@ -28,8 +34,10 @@ public class SequenceFeaturesPojo @Attributes(required = false, description = "Description for the feature") private String description; - - @Attributes(required = false, description = "Additional metadata for the feature") + + @Attributes( + required = false, + description = "Additional metadata for the feature") private Map otherDetails; @Attributes(required = false, description = "Fill colour") @@ -38,7 +46,9 @@ public class SequenceFeaturesPojo @Attributes(required = true, description = "Feature group") private String featureGroup; - @Attributes(required = false, description = "URL links associated to the feature") + @Attributes( + required = false, + description = "URL links associated to the feature") private Vector links; public SequenceFeaturesPojo() diff --git a/src/jalview/json/binding/biojson/v1/SequenceGrpPojo.java b/src/jalview/json/binding/biojson/v1/SequenceGrpPojo.java index e5c4395..41dec70 100644 --- a/src/jalview/json/binding/biojson/v1/SequenceGrpPojo.java +++ b/src/jalview/json/binding/biojson/v1/SequenceGrpPojo.java @@ -11,30 +11,46 @@ public class SequenceGrpPojo description = "The Colour Scheme applied to the Sequence Group") private String colourScheme; - @Attributes(required = true, description = "The name assigned to the seqGroup") + @Attributes( + required = true, + description = "The name assigned to the seqGroup") private String groupName; - @Attributes(required = false, description = "Serial version identifier for the seqGroup object model") + @Attributes( + required = false, + description = "Serial version identifier for the seqGroup object model") private String description; - @Attributes(required = false, description = "Determines if the seqGroup border should be visible or not") + @Attributes( + required = false, + description = "Determines if the seqGroup border should be visible or not") private boolean displayBoxes; - @Attributes(required = false, description = "Determines if the texts of the group is displayed or not") + @Attributes( + required = false, + description = "Determines if the texts of the group is displayed or not") private boolean displayText; - @Attributes(required = false, description = "Determines if the residues text for the group is coloured") + @Attributes( + required = false, + description = "Determines if the residues text for the group is coloured") private boolean colourText; - @Attributes(required = false, description = "Boolean value indicating whether residues should only be shown
that are different from current reference or consensus sequence") + @Attributes( + required = false, + description = "Boolean value indicating whether residues should only be shown
that are different from current reference or consensus sequence") private boolean showNonconserved; - @Attributes(required = true, description = "The index of the group’s first residue in the alignment space") + @Attributes( + required = true, + description = "The index of the group’s first residue in the alignment space") private int startRes; - @Attributes(required = true, description = "The index of the group’s last residue in the alignment space") + @Attributes( + required = true, + description = "The index of the group’s last residue in the alignment space") private int endRes; - + @Attributes( required = true, minItems = 1, @@ -142,5 +158,4 @@ public class SequenceGrpPojo this.sequenceRefs = sequenceRefs; } - } diff --git a/src/jalview/json/binding/biojson/v1/SequencePojo.java b/src/jalview/json/binding/biojson/v1/SequencePojo.java index 9d39d42..069832a 100644 --- a/src/jalview/json/binding/biojson/v1/SequencePojo.java +++ b/src/jalview/json/binding/biojson/v1/SequencePojo.java @@ -2,8 +2,6 @@ package jalview.json.binding.biojson.v1; import com.github.reinert.jjschema.Attributes; - - public class SequencePojo { @Attributes( @@ -16,22 +14,30 @@ public class SequencePojo @Attributes(required = true, description = "Sequence name") private String name; - @Attributes(required = false, description = "Sequence type", enums = {"DNA", "RNA", "Protein"}) + @Attributes(required = false, description = "Sequence type", enums = { + "DNA", "RNA", "Protein" }) private String type; - @Attributes(required = true, description = "Unique identifier for a given Sequence") + @Attributes( + required = true, + description = "Unique identifier for a given Sequence") private String id; - - @Attributes(required = false, description = "The order/position of a sequence in the alignment space") + + @Attributes( + required = false, + description = "The order/position of a sequence in the alignment space") private int order; - - @Attributes(required = true, description = "The index of the sequence’s first residue in its source database,
using a one-based numbering index system") + + @Attributes( + required = true, + description = "The index of the sequence’s first residue in its source database,
using a one-based numbering index system") private int start; - @Attributes(required = true, description = "The index of the sequence’s last residue in its source database,
using a one-based numbering index system") + @Attributes( + required = true, + description = "The index of the sequence’s last residue in its source database,
using a one-based numbering index system") private int end; - public SequencePojo() { } @@ -42,6 +48,7 @@ public class SequencePojo this.name = name; this.seq = seq; } + public String getSeq() { return seq; @@ -103,7 +110,6 @@ public class SequencePojo this.order = order; } - public String getType() { return type; diff --git a/src/jalview/math/Matrix.java b/src/jalview/math/Matrix.java index 9ac75d2..bb7ed37 100755 --- a/src/jalview/math/Matrix.java +++ b/src/jalview/math/Matrix.java @@ -20,9 +20,10 @@ */ package jalview.math; -import java.io.*; +import jalview.util.Format; +import jalview.util.MessageManager; -import jalview.util.*; +import java.io.PrintStream; /** * DOCUMENT ME! @@ -403,7 +404,9 @@ public class Matrix if (iter == maxIter) { - throw new Exception(MessageManager.formatMessage("exception.matrix_too_many_iteration", new String[]{"tqli", Integer.valueOf(maxIter).toString()})); + throw new Exception(MessageManager.formatMessage( + "exception.matrix_too_many_iteration", new String[] { + "tqli", Integer.valueOf(maxIter).toString() })); } else { @@ -652,7 +655,9 @@ public class Matrix if (iter == maxIter) { - throw new Exception(MessageManager.formatMessage("exception.matrix_too_many_iteration", new String[]{"tqli2", Integer.valueOf(maxIter).toString()})); + throw new Exception(MessageManager.formatMessage( + "exception.matrix_too_many_iteration", new String[] { + "tqli2", Integer.valueOf(maxIter).toString() })); } else { diff --git a/src/jalview/renderer/AnnotationRenderer.java b/src/jalview/renderer/AnnotationRenderer.java index 61194ce..e5c2218 100644 --- a/src/jalview/renderer/AnnotationRenderer.java +++ b/src/jalview/renderer/AnnotationRenderer.java @@ -102,9 +102,9 @@ public class AnnotationRenderer // if (validRes && column>1 && row_annotations[column-2]!=null && // dc.equals(row_annotations[column-2].displayCharacter)) { - g.fillPolygon(new int[] - { lastSSX + 5, lastSSX + 5, lastSSX }, new int[] - { y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset }, 3); + g.fillPolygon(new int[] { lastSSX + 5, lastSSX + 5, lastSSX }, + new int[] { y + iconOffset, y + 14 + iconOffset, + y + 8 + iconOffset }, 3); x1 += 5; } if (diffdownstream) @@ -118,9 +118,8 @@ public class AnnotationRenderer // display a forward arrow if (diffdownstream) { - g.fillPolygon(new int[] - { x2 - 5, x2 - 5, x2 }, new int[] - { y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset }, 3); + g.fillPolygon(new int[] { x2 - 5, x2 - 5, x2 }, new int[] { + y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset }, 3); x2 -= 5; } if (diffupstream) @@ -227,9 +226,9 @@ public class AnnotationRenderer // if (validRes && column>1 && row_annotations[column-2]!=null && // dc.equals(row_annotations[column-2].displayCharacter)) { - g.fillPolygon(new int[] - { lastSSX + 5, lastSSX + 5, lastSSX }, new int[] - { y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset }, 3); + g.fillPolygon(new int[] { lastSSX + 5, lastSSX + 5, lastSSX }, + new int[] { y + iconOffset, y + 14 + iconOffset, + y + 8 + iconOffset }, 3); x1 += 5; } if (diffdownstream) @@ -243,9 +242,8 @@ public class AnnotationRenderer // display a forward arrow if (diffdownstream) { - g.fillPolygon(new int[] - { x2 - 5, x2 - 5, x2 }, new int[] - { y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset }, 3); + g.fillPolygon(new int[] { x2 - 5, x2 - 5, x2 }, new int[] { + y + iconOffset, y + 14 + iconOffset, y + 8 + iconOffset }, 3); x2 -= 5; } if (diffupstream) @@ -634,17 +632,17 @@ public class AnnotationRenderer // // if (scaleColLabel) // { - // justify the label and scale to fit in column - if (fmWidth > charWidth) - { - // scale only if the current font isn't already small enough - fmScaling = charWidth; - fmScaling /= fmWidth; - g.setFont(ofont.deriveFont(AffineTransform - .getScaleInstance(fmScaling, 1.0))); - // and update the label's width to reflect the scaling. - fmWidth = charWidth; - } + // justify the label and scale to fit in column + if (fmWidth > charWidth) + { + // scale only if the current font isn't already small enough + fmScaling = charWidth; + fmScaling /= fmWidth; + g.setFont(ofont.deriveFont(AffineTransform + .getScaleInstance(fmScaling, 1.0))); + // and update the label's width to reflect the scaling. + fmWidth = charWidth; + } // } } // TODO is it ok to use width of / show all characters here? @@ -1096,11 +1094,9 @@ public class AnnotationRenderer { g.fillRect(lastSSX, y + 4 + iconOffset, (x * charWidth) - lastSSX - 4, 7); - g.fillPolygon(new int[] - { (x * charWidth) - 4, (x * charWidth) - 4, (x * charWidth) }, - new int[] - { y + iconOffset, y + 14 + iconOffset, y + 7 + iconOffset }, - 3); + g.fillPolygon(new int[] { (x * charWidth) - 4, (x * charWidth) - 4, + (x * charWidth) }, new int[] { y + iconOffset, + y + 14 + iconOffset, y + 7 + iconOffset }, 3); } else { @@ -1255,8 +1251,7 @@ public class AnnotationRenderer g.setColor(_aa.threshold.colour); Graphics2D g2 = (Graphics2D) g; g2.setStroke(new BasicStroke(1, BasicStroke.CAP_SQUARE, - BasicStroke.JOIN_ROUND, 3f, new float[] - { 5f, 3f }, 0f)); + BasicStroke.JOIN_ROUND, 3f, new float[] { 5f, 3f }, 0f)); y2 = (int) (y - ((_aa.threshold.value - min) / range) * graphHeight); g.drawLine(0, y2, (eRes - sRes) * charWidth, y2); @@ -1439,8 +1434,7 @@ public class AnnotationRenderer g.setColor(_aa.threshold.colour); Graphics2D g2 = (Graphics2D) g; g2.setStroke(new BasicStroke(1, BasicStroke.CAP_SQUARE, - BasicStroke.JOIN_ROUND, 3f, new float[] - { 5f, 3f }, 0f)); + BasicStroke.JOIN_ROUND, 3f, new float[] { 5f, 3f }, 0f)); y2 = (int) (y - ((_aa.threshold.value - min) / range) * _aa.graphHeight); diff --git a/src/jalview/renderer/seqfeatures/FeatureRenderer.java b/src/jalview/renderer/seqfeatures/FeatureRenderer.java index 0f2a49c..2957e49 100644 --- a/src/jalview/renderer/seqfeatures/FeatureRenderer.java +++ b/src/jalview/renderer/seqfeatures/FeatureRenderer.java @@ -157,8 +157,8 @@ public class FeatureRenderer extends * This is used by the Molecule Viewer and Overview to get the accurate * colourof the rendered sequence */ - public synchronized int findFeatureColour(int initialCol, final SequenceI seq, - int column) + public synchronized int findFeatureColour(int initialCol, + final SequenceI seq, int column) { if (!av.isShowSequenceFeatures()) { @@ -316,7 +316,7 @@ public class FeatureRenderer extends } if (offscreenRender && offscreenImage == null) - { + { if (sequenceFeature.begin <= start && sequenceFeature.end >= start) { diff --git a/src/jalview/rest/RestHandler.java b/src/jalview/rest/RestHandler.java index 3f00c07..488e9f0 100644 --- a/src/jalview/rest/RestHandler.java +++ b/src/jalview/rest/RestHandler.java @@ -1,5 +1,7 @@ package jalview.rest; +import jalview.httpserver.AbstractRequestHandler; + import java.io.IOException; import java.io.PrintWriter; import java.net.BindException; @@ -7,8 +9,6 @@ import java.net.BindException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import jalview.httpserver.AbstractRequestHandler; - /** * A simple handler to process (or delegate) HTTP requests on /jalview/rest */ diff --git a/src/jalview/schemabinding/version2/AlcodMap.java b/src/jalview/schemabinding/version2/AlcodMap.java index 61866aa..e2522a1 100644 --- a/src/jalview/schemabinding/version2/AlcodMap.java +++ b/src/jalview/schemabinding/version2/AlcodMap.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,166 +19,174 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class AlcodMap implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * internal jalview id for the dnasq for this mapping. - * - */ - private java.lang.String _dnasq; - - /** - * a Mapping entry and an associated protein sequence - * - */ - private jalview.schemabinding.version2.Mapping _mapping; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public AlcodMap() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Returns the value of field 'dnasq'. The field 'dnasq' has - * the following description: internal jalview id for the dnasq - * for this mapping. - * - * - * @return the value of field 'Dnasq'. - */ - public java.lang.String getDnasq( - ) { - return this._dnasq; - } - - /** - * Returns the value of field 'mapping'. The field 'mapping' - * has the following description: a Mapping entry and an - * associated protein sequence - * - * - * @return the value of field 'Mapping'. - */ - public jalview.schemabinding.version2.Mapping getMapping( - ) { - return this._mapping; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'dnasq'. The field 'dnasq' has the - * following description: internal jalview id for the dnasq for - * this mapping. - * - * - * @param dnasq the value of field 'dnasq'. - */ - public void setDnasq( - final java.lang.String dnasq) { - this._dnasq = dnasq; - } - - /** - * Sets the value of field 'mapping'. The field 'mapping' has - * the following description: a Mapping entry and an associated - * protein sequence - * - * - * @param mapping the value of field 'mapping'. - */ - public void setMapping( - final jalview.schemabinding.version2.Mapping mapping) { - this._mapping = mapping; - } - - /** - * 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.AlcodMap - */ - public static jalview.schemabinding.version2.AlcodMap unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.AlcodMap) Unmarshaller.unmarshal(jalview.schemabinding.version2.AlcodMap.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); +public class AlcodMap implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * internal jalview id for the dnasq for this mapping. + * + */ + private java.lang.String _dnasq; + + /** + * a Mapping entry and an associated protein sequence + * + */ + private jalview.schemabinding.version2.Mapping _mapping; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public AlcodMap() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Returns the value of field 'dnasq'. The field 'dnasq' has the following + * description: internal jalview id for the dnasq for this mapping. + * + * + * @return the value of field 'Dnasq'. + */ + public java.lang.String getDnasq() + { + return this._dnasq; + } + + /** + * Returns the value of field 'mapping'. The field 'mapping' has the following + * description: a Mapping entry and an associated protein sequence + * + * + * @return the value of field 'Mapping'. + */ + public jalview.schemabinding.version2.Mapping getMapping() + { + return this._mapping; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'dnasq'. The field 'dnasq' has the following + * description: internal jalview id for the dnasq for this mapping. + * + * + * @param dnasq + * the value of field 'dnasq'. + */ + public void setDnasq(final java.lang.String dnasq) + { + this._dnasq = dnasq; + } + + /** + * Sets the value of field 'mapping'. The field 'mapping' has the following + * description: a Mapping entry and an associated protein sequence + * + * + * @param mapping + * the value of field 'mapping'. + */ + public void setMapping( + final jalview.schemabinding.version2.Mapping mapping) + { + this._mapping = mapping; + } + + /** + * 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.AlcodMap + */ + public static jalview.schemabinding.version2.AlcodMap unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.AlcodMap) Unmarshaller + .unmarshal(jalview.schemabinding.version2.AlcodMap.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/Alcodon.java b/src/jalview/schemabinding/version2/Alcodon.java index 1732401..3bd1cbb 100644 --- a/src/jalview/schemabinding/version2/Alcodon.java +++ b/src/jalview/schemabinding/version2/Alcodon.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,245 +19,257 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Alcodon implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _pos1. - */ - private long _pos1; - - /** - * keeps track of state for field: _pos1 - */ - private boolean _has_pos1; - - /** - * Field _pos2. - */ - private long _pos2; - - /** - * keeps track of state for field: _pos2 - */ - private boolean _has_pos2; - - /** - * Field _pos3. - */ - private long _pos3; - - /** - * keeps track of state for field: _pos3 - */ - private boolean _has_pos3; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Alcodon() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deletePos1( - ) { - this._has_pos1= false; - } - - /** - */ - public void deletePos2( - ) { - this._has_pos2= false; - } - - /** - */ - public void deletePos3( - ) { - this._has_pos3= false; - } - - /** - * Returns the value of field 'pos1'. - * - * @return the value of field 'Pos1'. - */ - public long getPos1( - ) { - return this._pos1; - } - - /** - * Returns the value of field 'pos2'. - * - * @return the value of field 'Pos2'. +public class Alcodon implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _pos1. + */ + private long _pos1; + + /** + * keeps track of state for field: _pos1 + */ + private boolean _has_pos1; + + /** + * Field _pos2. + */ + private long _pos2; + + /** + * keeps track of state for field: _pos2 + */ + private boolean _has_pos2; + + /** + * Field _pos3. + */ + private long _pos3; + + /** + * keeps track of state for field: _pos3 + */ + private boolean _has_pos3; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Alcodon() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** */ - public long getPos2( - ) { - return this._pos2; - } - - /** - * Returns the value of field 'pos3'. - * - * @return the value of field 'Pos3'. - */ - public long getPos3( - ) { - return this._pos3; - } - - /** - * Method hasPos1. - * - * @return true if at least one Pos1 has been added - */ - public boolean hasPos1( - ) { - return this._has_pos1; - } - - /** - * Method hasPos2. - * - * @return true if at least one Pos2 has been added - */ - public boolean hasPos2( - ) { - return this._has_pos2; - } - - /** - * Method hasPos3. - * - * @return true if at least one Pos3 has been added - */ - public boolean hasPos3( - ) { - return this._has_pos3; - } - - /** - * 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; - } + public void deletePos1() + { + this._has_pos1 = false; + } - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema + /** */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'pos1'. - * - * @param pos1 the value of field 'pos1'. - */ - public void setPos1( - final long pos1) { - this._pos1 = pos1; - this._has_pos1 = true; - } - - /** - * Sets the value of field 'pos2'. - * - * @param pos2 the value of field 'pos2'. - */ - public void setPos2( - final long pos2) { - this._pos2 = pos2; - this._has_pos2 = true; - } - - /** - * Sets the value of field 'pos3'. - * - * @param pos3 the value of field 'pos3'. - */ - public void setPos3( - final long pos3) { - this._pos3 = pos3; - this._has_pos3 = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled jalview.schemabinding.version2.Alcodo - */ - public static jalview.schemabinding.version2.Alcodon unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.Alcodon) Unmarshaller.unmarshal(jalview.schemabinding.version2.Alcodon.class, reader); - } + public void deletePos2() + { + this._has_pos2 = false; + } - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema + /** */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); + public void deletePos3() + { + this._has_pos3 = false; + } + + /** + * Returns the value of field 'pos1'. + * + * @return the value of field 'Pos1'. + */ + public long getPos1() + { + return this._pos1; + } + + /** + * Returns the value of field 'pos2'. + * + * @return the value of field 'Pos2'. + */ + public long getPos2() + { + return this._pos2; + } + + /** + * Returns the value of field 'pos3'. + * + * @return the value of field 'Pos3'. + */ + public long getPos3() + { + return this._pos3; + } + + /** + * Method hasPos1. + * + * @return true if at least one Pos1 has been added + */ + public boolean hasPos1() + { + return this._has_pos1; + } + + /** + * Method hasPos2. + * + * @return true if at least one Pos2 has been added + */ + public boolean hasPos2() + { + return this._has_pos2; + } + + /** + * Method hasPos3. + * + * @return true if at least one Pos3 has been added + */ + public boolean hasPos3() + { + return this._has_pos3; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'pos1'. + * + * @param pos1 + * the value of field 'pos1'. + */ + public void setPos1(final long pos1) + { + this._pos1 = pos1; + this._has_pos1 = true; + } + + /** + * Sets the value of field 'pos2'. + * + * @param pos2 + * the value of field 'pos2'. + */ + public void setPos2(final long pos2) + { + this._pos2 = pos2; + this._has_pos2 = true; + } + + /** + * Sets the value of field 'pos3'. + * + * @param pos3 + * the value of field 'pos3'. + */ + public void setPos3(final long pos3) + { + this._pos3 = pos3; + this._has_pos3 = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.schemabinding.version2.Alcodo + */ + public static jalview.schemabinding.version2.Alcodon unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Alcodon) Unmarshaller.unmarshal( + jalview.schemabinding.version2.Alcodon.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/AlcodonFrame.java b/src/jalview/schemabinding/version2/AlcodonFrame.java index 76db239..218e07e 100644 --- a/src/jalview/schemabinding/version2/AlcodonFrame.java +++ b/src/jalview/schemabinding/version2/AlcodonFrame.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,414 +19,448 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class AlcodonFrame implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _alcodonList. - */ - private java.util.Vector _alcodonList; - - /** - * Field _alcodMapList. - */ - private java.util.Vector _alcodMapList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public AlcodonFrame() { - super(); - this._alcodonList = new java.util.Vector(); - this._alcodMapList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vAlcodMap - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addAlcodMap( - final jalview.schemabinding.version2.AlcodMap vAlcodMap) - throws java.lang.IndexOutOfBoundsException { - this._alcodMapList.addElement(vAlcodMap); - } - - /** - * - * - * @param index - * @param vAlcodMap - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addAlcodMap( - final int index, - final jalview.schemabinding.version2.AlcodMap vAlcodMap) - throws java.lang.IndexOutOfBoundsException { - this._alcodMapList.add(index, vAlcodMap); - } - - /** - * - * - * @param vAlcodon - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addAlcodon( - final jalview.schemabinding.version2.Alcodon vAlcodon) - throws java.lang.IndexOutOfBoundsException { - this._alcodonList.addElement(vAlcodon); - } - - /** - * - * - * @param index - * @param vAlcodon - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addAlcodon( - final int index, - final jalview.schemabinding.version2.Alcodon vAlcodon) - throws java.lang.IndexOutOfBoundsException { - this._alcodonList.add(index, vAlcodon); - } - - /** - * Method enumerateAlcodMap. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.AlcodMap elements - */ - public java.util.Enumeration enumerateAlcodMap( - ) { - return this._alcodMapList.elements(); - } - - /** - * Method enumerateAlcodon. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.Alcodon elements - */ - public java.util.Enumeration enumerateAlcodon( - ) { - return this._alcodonList.elements(); - } - - /** - * Method getAlcodMap. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.AlcodMap at the given index - */ - public jalview.schemabinding.version2.AlcodMap getAlcodMap( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._alcodMapList.size()) { - throw new IndexOutOfBoundsException("getAlcodMap: Index value '" + index + "' not in range [0.." + (this._alcodMapList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.AlcodMap) _alcodMapList.get(index); - } - - /** - * Method getAlcodMap.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 jalview.schemabinding.version2.AlcodMap[] getAlcodMap( - ) { - jalview.schemabinding.version2.AlcodMap[] array = new jalview.schemabinding.version2.AlcodMap[0]; - return (jalview.schemabinding.version2.AlcodMap[]) this._alcodMapList.toArray(array); - } - - /** - * Method getAlcodMapCount. - * - * @return the size of this collection - */ - public int getAlcodMapCount( - ) { - return this._alcodMapList.size(); - } - - /** - * Method getAlcodon. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.Alcodon at the given index - */ - public jalview.schemabinding.version2.Alcodon getAlcodon( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._alcodonList.size()) { - throw new IndexOutOfBoundsException("getAlcodon: Index value '" + index + "' not in range [0.." + (this._alcodonList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.Alcodon) _alcodonList.get(index); - } - - /** - * Method getAlcodon.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 jalview.schemabinding.version2.Alcodon[] getAlcodon( - ) { - jalview.schemabinding.version2.Alcodon[] array = new jalview.schemabinding.version2.Alcodon[0]; - return (jalview.schemabinding.version2.Alcodon[]) this._alcodonList.toArray(array); - } - - /** - * Method getAlcodonCount. - * - * @return the size of this collection - */ - public int getAlcodonCount( - ) { - return this._alcodonList.size(); - } - - /** - * 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); - } - - /** - * Method removeAlcodMap. - * - * @param vAlcodMap - * @return true if the object was removed from the collection. - */ - public boolean removeAlcodMap( - final jalview.schemabinding.version2.AlcodMap vAlcodMap) { - boolean removed = _alcodMapList.remove(vAlcodMap); - return removed; +public class AlcodonFrame implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _alcodonList. + */ + private java.util.Vector _alcodonList; + + /** + * Field _alcodMapList. + */ + private java.util.Vector _alcodMapList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public AlcodonFrame() + { + super(); + this._alcodonList = new java.util.Vector(); + this._alcodMapList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vAlcodMap + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addAlcodMap( + final jalview.schemabinding.version2.AlcodMap vAlcodMap) + throws java.lang.IndexOutOfBoundsException + { + this._alcodMapList.addElement(vAlcodMap); + } + + /** + * + * + * @param index + * @param vAlcodMap + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addAlcodMap(final int index, + final jalview.schemabinding.version2.AlcodMap vAlcodMap) + throws java.lang.IndexOutOfBoundsException + { + this._alcodMapList.add(index, vAlcodMap); + } + + /** + * + * + * @param vAlcodon + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addAlcodon( + final jalview.schemabinding.version2.Alcodon vAlcodon) + throws java.lang.IndexOutOfBoundsException + { + this._alcodonList.addElement(vAlcodon); + } + + /** + * + * + * @param index + * @param vAlcodon + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addAlcodon(final int index, + final jalview.schemabinding.version2.Alcodon vAlcodon) + throws java.lang.IndexOutOfBoundsException + { + this._alcodonList.add(index, vAlcodon); + } + + /** + * Method enumerateAlcodMap. + * + * @return an Enumeration over all jalview.schemabinding.version2.AlcodMap + * elements + */ + public java.util.Enumeration enumerateAlcodMap() + { + return this._alcodMapList.elements(); + } + + /** + * Method enumerateAlcodon. + * + * @return an Enumeration over all jalview.schemabinding.version2.Alcodon + * elements + */ + public java.util.Enumeration enumerateAlcodon() + { + return this._alcodonList.elements(); + } + + /** + * Method getAlcodMap. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.AlcodMap at the + * given index + */ + public jalview.schemabinding.version2.AlcodMap getAlcodMap(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._alcodMapList.size()) + { + throw new IndexOutOfBoundsException("getAlcodMap: Index value '" + + index + "' not in range [0.." + + (this._alcodMapList.size() - 1) + "]"); } - /** - * Method removeAlcodMapAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.AlcodMap removeAlcodMapAt( - final int index) { - java.lang.Object obj = this._alcodMapList.remove(index); - return (jalview.schemabinding.version2.AlcodMap) obj; - } - - /** - * Method removeAlcodon. - * - * @param vAlcodon - * @return true if the object was removed from the collection. - */ - public boolean removeAlcodon( - final jalview.schemabinding.version2.Alcodon vAlcodon) { - boolean removed = _alcodonList.remove(vAlcodon); - return removed; - } - - /** - * Method removeAlcodonAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.Alcodon removeAlcodonAt( - final int index) { - java.lang.Object obj = this._alcodonList.remove(index); - return (jalview.schemabinding.version2.Alcodon) obj; - } - - /** - */ - public void removeAllAlcodMap( - ) { - this._alcodMapList.clear(); + return (jalview.schemabinding.version2.AlcodMap) _alcodMapList + .get(index); + } + + /** + * Method getAlcodMap.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 jalview.schemabinding.version2.AlcodMap[] getAlcodMap() + { + jalview.schemabinding.version2.AlcodMap[] array = new jalview.schemabinding.version2.AlcodMap[0]; + return (jalview.schemabinding.version2.AlcodMap[]) this._alcodMapList + .toArray(array); + } + + /** + * Method getAlcodMapCount. + * + * @return the size of this collection + */ + public int getAlcodMapCount() + { + return this._alcodMapList.size(); + } + + /** + * Method getAlcodon. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.Alcodon at the + * given index + */ + public jalview.schemabinding.version2.Alcodon getAlcodon(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._alcodonList.size()) + { + throw new IndexOutOfBoundsException("getAlcodon: Index value '" + + index + "' not in range [0.." + + (this._alcodonList.size() - 1) + "]"); } - /** - */ - public void removeAllAlcodon( - ) { - this._alcodonList.clear(); + return (jalview.schemabinding.version2.Alcodon) _alcodonList.get(index); + } + + /** + * Method getAlcodon.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 jalview.schemabinding.version2.Alcodon[] getAlcodon() + { + jalview.schemabinding.version2.Alcodon[] array = new jalview.schemabinding.version2.Alcodon[0]; + return (jalview.schemabinding.version2.Alcodon[]) this._alcodonList + .toArray(array); + } + + /** + * Method getAlcodonCount. + * + * @return the size of this collection + */ + public int getAlcodonCount() + { + return this._alcodonList.size(); + } + + /** + * 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; } - - /** - * - * - * @param index - * @param vAlcodMap - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setAlcodMap( - final int index, - final jalview.schemabinding.version2.AlcodMap vAlcodMap) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._alcodMapList.size()) { - throw new IndexOutOfBoundsException("setAlcodMap: Index value '" + index + "' not in range [0.." + (this._alcodMapList.size() - 1) + "]"); - } - - this._alcodMapList.set(index, vAlcodMap); - } - - /** - * - * - * @param vAlcodMapArray + 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); + } + + /** + * Method removeAlcodMap. + * + * @param vAlcodMap + * @return true if the object was removed from the collection. + */ + public boolean removeAlcodMap( + final jalview.schemabinding.version2.AlcodMap vAlcodMap) + { + boolean removed = _alcodMapList.remove(vAlcodMap); + return removed; + } + + /** + * Method removeAlcodMapAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.AlcodMap removeAlcodMapAt( + final int index) + { + java.lang.Object obj = this._alcodMapList.remove(index); + return (jalview.schemabinding.version2.AlcodMap) obj; + } + + /** + * Method removeAlcodon. + * + * @param vAlcodon + * @return true if the object was removed from the collection. + */ + public boolean removeAlcodon( + final jalview.schemabinding.version2.Alcodon vAlcodon) + { + boolean removed = _alcodonList.remove(vAlcodon); + return removed; + } + + /** + * Method removeAlcodonAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.Alcodon removeAlcodonAt( + final int index) + { + java.lang.Object obj = this._alcodonList.remove(index); + return (jalview.schemabinding.version2.Alcodon) obj; + } + + /** */ - public void setAlcodMap( - final jalview.schemabinding.version2.AlcodMap[] vAlcodMapArray) { - //-- copy array - _alcodMapList.clear(); - - for (int i = 0; i < vAlcodMapArray.length; i++) { - this._alcodMapList.add(vAlcodMapArray[i]); - } - } + public void removeAllAlcodMap() + { + this._alcodMapList.clear(); + } - /** - * - * - * @param index - * @param vAlcodon - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection + /** */ - public void setAlcodon( - final int index, - final jalview.schemabinding.version2.Alcodon vAlcodon) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._alcodonList.size()) { - throw new IndexOutOfBoundsException("setAlcodon: Index value '" + index + "' not in range [0.." + (this._alcodonList.size() - 1) + "]"); - } - - this._alcodonList.set(index, vAlcodon); + public void removeAllAlcodon() + { + this._alcodonList.clear(); + } + + /** + * + * + * @param index + * @param vAlcodMap + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setAlcodMap(final int index, + final jalview.schemabinding.version2.AlcodMap vAlcodMap) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._alcodMapList.size()) + { + throw new IndexOutOfBoundsException("setAlcodMap: Index value '" + + index + "' not in range [0.." + + (this._alcodMapList.size() - 1) + "]"); } - /** - * - * - * @param vAlcodonArray - */ - public void setAlcodon( - final jalview.schemabinding.version2.Alcodon[] vAlcodonArray) { - //-- copy array - _alcodonList.clear(); - - for (int i = 0; i < vAlcodonArray.length; i++) { - this._alcodonList.add(vAlcodonArray[i]); - } + this._alcodMapList.set(index, vAlcodMap); + } + + /** + * + * + * @param vAlcodMapArray + */ + public void setAlcodMap( + final jalview.schemabinding.version2.AlcodMap[] vAlcodMapArray) + { + // -- copy array + _alcodMapList.clear(); + + for (int i = 0; i < vAlcodMapArray.length; i++) + { + this._alcodMapList.add(vAlcodMapArray[i]); } - - /** - * 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.AlcodonFrame - */ - public static jalview.schemabinding.version2.AlcodonFrame unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.AlcodonFrame) Unmarshaller.unmarshal(jalview.schemabinding.version2.AlcodonFrame.class, reader); + } + + /** + * + * + * @param index + * @param vAlcodon + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setAlcodon(final int index, + final jalview.schemabinding.version2.Alcodon vAlcodon) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._alcodonList.size()) + { + throw new IndexOutOfBoundsException("setAlcodon: Index value '" + + index + "' not in range [0.." + + (this._alcodonList.size() - 1) + "]"); } - /** - * - * - * @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._alcodonList.set(index, vAlcodon); + } + + /** + * + * + * @param vAlcodonArray + */ + public void setAlcodon( + final jalview.schemabinding.version2.Alcodon[] vAlcodonArray) + { + // -- copy array + _alcodonList.clear(); + + for (int i = 0; i < vAlcodonArray.length; i++) + { + this._alcodonList.add(vAlcodonArray[i]); } + } + + /** + * 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.AlcodonFrame + */ + public static jalview.schemabinding.version2.AlcodonFrame unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.AlcodonFrame) Unmarshaller + .unmarshal(jalview.schemabinding.version2.AlcodonFrame.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/Annotation.java b/src/jalview/schemabinding/version2/Annotation.java index 3da8552..2fead37 100644 --- a/src/jalview/schemabinding/version2/Annotation.java +++ b/src/jalview/schemabinding/version2/Annotation.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,1329 +19,1378 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Annotation implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _graph. - */ - private boolean _graph; - - /** - * keeps track of state for field: _graph - */ - private boolean _has_graph; - - /** - * Field _graphType. - */ - private int _graphType; - - /** - * keeps track of state for field: _graphType - */ - private boolean _has_graphType; - - /** - * Field _sequenceRef. - */ - private java.lang.String _sequenceRef; - - /** - * Field _groupRef. - */ - private java.lang.String _groupRef; - - /** - * Field _graphColour. - */ - private int _graphColour; - - /** - * keeps track of state for field: _graphColour - */ - private boolean _has_graphColour; - - /** - * Field _graphGroup. - */ - private int _graphGroup; - - /** - * keeps track of state for field: _graphGroup - */ - private boolean _has_graphGroup; - - /** - * height in pixels for the graph if this is a graph-type - * annotation. - */ - private int _graphHeight; - - /** - * keeps track of state for field: _graphHeight - */ - private boolean _has_graphHeight; - - /** - * Field _id. - */ - private java.lang.String _id; - - /** - * Field _scoreOnly. - */ - private boolean _scoreOnly = false; - - /** - * keeps track of state for field: _scoreOnly - */ - private boolean _has_scoreOnly; - - /** - * Field _score. - */ - private double _score; - - /** - * keeps track of state for field: _score - */ - private boolean _has_score; - - /** - * Field _visible. - */ - private boolean _visible; - - /** - * keeps track of state for field: _visible - */ - private boolean _has_visible; - - /** - * Field _centreColLabels. - */ - private boolean _centreColLabels; - - /** - * keeps track of state for field: _centreColLabels - */ - private boolean _has_centreColLabels; - - /** - * Field _scaleColLabels. - */ - private boolean _scaleColLabels; - - /** - * keeps track of state for field: _scaleColLabels - */ - private boolean _has_scaleColLabels; - - /** - * Field _showAllColLabels. - */ - private boolean _showAllColLabels; - - /** - * keeps track of state for field: _showAllColLabels - */ - private boolean _has_showAllColLabels; - - /** - * is an autocalculated annotation row - */ - private boolean _autoCalculated = false; - - /** - * keeps track of state for field: _autoCalculated - */ - private boolean _has_autoCalculated; - - /** - * is to be shown below the alignment - introduced in Jalview - * 2.8 for visualizing T-COFFEE alignment scores - */ - private boolean _belowAlignment = true; - - /** - * keeps track of state for field: _belowAlignment - */ - private boolean _has_belowAlignment; - - /** - * Optional string identifier used to group sets of annotation - * produced by a particular calculation. Values are opaque - * strings but have semantic meaning to Jalview's renderer, - * data importer and calculation system. - */ - private java.lang.String _calcId; - - /** - * Field _annotationElementList. - */ - private java.util.Vector _annotationElementList; - - /** - * Field _label. - */ - private java.lang.String _label; - - /** - * Field _description. - */ - private java.lang.String _description; - - /** - * Field _thresholdLine. - */ - private jalview.schemabinding.version2.ThresholdLine _thresholdLine; - - /** - * Field _propertyList. - */ - private java.util.Vector _propertyList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Annotation() { - super(); - this._annotationElementList = new java.util.Vector(); - this._propertyList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vAnnotationElement - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addAnnotationElement( - final jalview.schemabinding.version2.AnnotationElement vAnnotationElement) - throws java.lang.IndexOutOfBoundsException { - this._annotationElementList.addElement(vAnnotationElement); - } - - /** - * - * - * @param index - * @param vAnnotationElement - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addAnnotationElement( - final int index, - final jalview.schemabinding.version2.AnnotationElement vAnnotationElement) - throws java.lang.IndexOutOfBoundsException { - this._annotationElementList.add(index, vAnnotationElement); - } - - /** - * - * - * @param vProperty - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addProperty( - final jalview.schemabinding.version2.Property vProperty) - throws java.lang.IndexOutOfBoundsException { - this._propertyList.addElement(vProperty); - } - - /** - * - * - * @param index - * @param vProperty - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addProperty( - final int index, - final jalview.schemabinding.version2.Property vProperty) - throws java.lang.IndexOutOfBoundsException { - this._propertyList.add(index, vProperty); - } - - /** - */ - public void deleteAutoCalculated( - ) { - this._has_autoCalculated= false; - } - - /** - */ - public void deleteBelowAlignment( - ) { - this._has_belowAlignment= false; - } - - /** - */ - public void deleteCentreColLabels( - ) { - this._has_centreColLabels= false; - } - - /** - */ - public void deleteGraph( - ) { - this._has_graph= false; - } - - /** - */ - public void deleteGraphColour( - ) { - this._has_graphColour= false; - } - - /** - */ - public void deleteGraphGroup( - ) { - this._has_graphGroup= false; - } - - /** - */ - public void deleteGraphHeight( - ) { - this._has_graphHeight= false; - } - - /** - */ - public void deleteGraphType( - ) { - this._has_graphType= false; - } - - /** - */ - public void deleteScaleColLabels( - ) { - this._has_scaleColLabels= false; - } - - /** - */ - public void deleteScore( - ) { - this._has_score= false; - } - - /** - */ - public void deleteScoreOnly( - ) { - this._has_scoreOnly= false; - } - - /** - */ - public void deleteShowAllColLabels( - ) { - this._has_showAllColLabels= false; - } - - /** - */ - public void deleteVisible( - ) { - this._has_visible= false; - } - - /** - * Method enumerateAnnotationElement. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.AnnotationElement elements - */ - public java.util.Enumeration enumerateAnnotationElement( - ) { - return this._annotationElementList.elements(); - } - - /** - * Method enumerateProperty. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.Property elements - */ - public java.util.Enumeration enumerateProperty( - ) { - return this._propertyList.elements(); - } - - /** - * Method getAnnotationElement. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.AnnotationElement at the - * given index - */ - public jalview.schemabinding.version2.AnnotationElement getAnnotationElement( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._annotationElementList.size()) { - throw new IndexOutOfBoundsException("getAnnotationElement: Index value '" + index + "' not in range [0.." + (this._annotationElementList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.AnnotationElement) _annotationElementList.get(index); - } - - /** - * Method getAnnotationElement.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 jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement( - ) { - jalview.schemabinding.version2.AnnotationElement[] array = new jalview.schemabinding.version2.AnnotationElement[0]; - return (jalview.schemabinding.version2.AnnotationElement[]) this._annotationElementList.toArray(array); - } - - /** - * Method getAnnotationElementCount. - * - * @return the size of this collection - */ - public int getAnnotationElementCount( - ) { - return this._annotationElementList.size(); - } - - /** - * Returns the value of field 'autoCalculated'. The field - * 'autoCalculated' has the following description: is an - * autocalculated annotation row - * - * @return the value of field 'AutoCalculated'. - */ - public boolean getAutoCalculated( - ) { - return this._autoCalculated; - } - - /** - * Returns the value of field 'belowAlignment'. The field - * 'belowAlignment' has the following description: is to be - * shown below the alignment - introduced in Jalview 2.8 for - * visualizing T-COFFEE alignment scores - * - * @return the value of field 'BelowAlignment'. - */ - public boolean getBelowAlignment( - ) { - return this._belowAlignment; - } - - /** - * Returns the value of field 'calcId'. The field 'calcId' has - * the following description: Optional string identifier used - * to group sets of annotation produced by a particular - * calculation. Values are opaque strings but have semantic - * meaning to Jalview's renderer, data importer and calculation - * system. - * - * @return the value of field 'CalcId'. - */ - public java.lang.String getCalcId( - ) { - return this._calcId; - } - - /** - * Returns the value of field 'centreColLabels'. - * - * @return the value of field 'CentreColLabels'. - */ - public boolean getCentreColLabels( - ) { - return this._centreColLabels; - } - - /** - * Returns the value of field 'description'. - * - * @return the value of field 'Description'. - */ - public java.lang.String getDescription( - ) { - return this._description; - } - - /** - * Returns the value of field 'graph'. - * - * @return the value of field 'Graph'. - */ - public boolean getGraph( - ) { - return this._graph; - } - - /** - * Returns the value of field 'graphColour'. - * - * @return the value of field 'GraphColour'. - */ - public int getGraphColour( - ) { - return this._graphColour; - } - - /** - * Returns the value of field 'graphGroup'. - * - * @return the value of field 'GraphGroup'. - */ - public int getGraphGroup( - ) { - return this._graphGroup; - } - - /** - * Returns the value of field 'graphHeight'. The field - * 'graphHeight' has the following description: height in - * pixels for the graph if this is a graph-type annotation. - * - * @return the value of field 'GraphHeight'. - */ - public int getGraphHeight( - ) { - return this._graphHeight; - } - - /** - * Returns the value of field 'graphType'. - * - * @return the value of field 'GraphType'. - */ - public int getGraphType( - ) { - return this._graphType; - } - - /** - * Returns the value of field 'groupRef'. - * - * @return the value of field 'GroupRef'. - */ - public java.lang.String getGroupRef( - ) { - return this._groupRef; - } - - /** - * Returns the value of field 'id'. - * - * @return the value of field 'Id'. - */ - public java.lang.String getId( - ) { - return this._id; - } - - /** - * Returns the value of field 'label'. - * - * @return the value of field 'Label'. - */ - public java.lang.String getLabel( - ) { - return this._label; - } - - /** - * Method getProperty. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.Property at the given index - */ - public jalview.schemabinding.version2.Property getProperty( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._propertyList.size()) { - throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.Property) _propertyList.get(index); - } - - /** - * Method getProperty.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 jalview.schemabinding.version2.Property[] getProperty( - ) { - jalview.schemabinding.version2.Property[] array = new jalview.schemabinding.version2.Property[0]; - return (jalview.schemabinding.version2.Property[]) this._propertyList.toArray(array); - } - - /** - * Method getPropertyCount. - * - * @return the size of this collection - */ - public int getPropertyCount( - ) { - return this._propertyList.size(); - } - - /** - * Returns the value of field 'scaleColLabels'. - * - * @return the value of field 'ScaleColLabels'. - */ - public boolean getScaleColLabels( - ) { - return this._scaleColLabels; - } - - /** - * Returns the value of field 'score'. - * - * @return the value of field 'Score'. - */ - public double getScore( - ) { - return this._score; - } - - /** - * Returns the value of field 'scoreOnly'. - * - * @return the value of field 'ScoreOnly'. - */ - public boolean getScoreOnly( - ) { - return this._scoreOnly; - } - - /** - * Returns the value of field 'sequenceRef'. - * - * @return the value of field 'SequenceRef'. - */ - public java.lang.String getSequenceRef( - ) { - return this._sequenceRef; - } - - /** - * Returns the value of field 'showAllColLabels'. - * - * @return the value of field 'ShowAllColLabels'. - */ - public boolean getShowAllColLabels( - ) { - return this._showAllColLabels; - } - - /** - * Returns the value of field 'thresholdLine'. - * - * @return the value of field 'ThresholdLine'. - */ - public jalview.schemabinding.version2.ThresholdLine getThresholdLine( - ) { - return this._thresholdLine; - } - - /** - * Returns the value of field 'visible'. - * - * @return the value of field 'Visible'. - */ - public boolean getVisible( - ) { - return this._visible; - } - - /** - * Method hasAutoCalculated. - * - * @return true if at least one AutoCalculated has been added - */ - public boolean hasAutoCalculated( - ) { - return this._has_autoCalculated; - } - - /** - * Method hasBelowAlignment. - * - * @return true if at least one BelowAlignment has been added - */ - public boolean hasBelowAlignment( - ) { - return this._has_belowAlignment; - } - - /** - * Method hasCentreColLabels. - * - * @return true if at least one CentreColLabels has been added - */ - public boolean hasCentreColLabels( - ) { - return this._has_centreColLabels; - } - - /** - * Method hasGraph. - * - * @return true if at least one Graph has been added - */ - public boolean hasGraph( - ) { - return this._has_graph; - } - - /** - * Method hasGraphColour. - * - * @return true if at least one GraphColour has been added - */ - public boolean hasGraphColour( - ) { - return this._has_graphColour; - } - - /** - * Method hasGraphGroup. - * - * @return true if at least one GraphGroup has been added - */ - public boolean hasGraphGroup( - ) { - return this._has_graphGroup; - } - - /** - * Method hasGraphHeight. - * - * @return true if at least one GraphHeight has been added - */ - public boolean hasGraphHeight( - ) { - return this._has_graphHeight; - } - - /** - * Method hasGraphType. - * - * @return true if at least one GraphType has been added - */ - public boolean hasGraphType( - ) { - return this._has_graphType; - } - - /** - * Method hasScaleColLabels. - * - * @return true if at least one ScaleColLabels has been added - */ - public boolean hasScaleColLabels( - ) { - return this._has_scaleColLabels; - } - - /** - * Method hasScore. - * - * @return true if at least one Score has been added - */ - public boolean hasScore( - ) { - return this._has_score; - } - - /** - * Method hasScoreOnly. - * - * @return true if at least one ScoreOnly has been added - */ - public boolean hasScoreOnly( - ) { - return this._has_scoreOnly; - } - - /** - * Method hasShowAllColLabels. - * - * @return true if at least one ShowAllColLabels has been added - */ - public boolean hasShowAllColLabels( - ) { - return this._has_showAllColLabels; - } - - /** - * Method hasVisible. - * - * @return true if at least one Visible has been added - */ - public boolean hasVisible( - ) { - return this._has_visible; - } - - /** - * Returns the value of field 'autoCalculated'. The field - * 'autoCalculated' has the following description: is an - * autocalculated annotation row - * - * @return the value of field 'AutoCalculated'. - */ - public boolean isAutoCalculated( - ) { - return this._autoCalculated; - } - - /** - * Returns the value of field 'belowAlignment'. The field - * 'belowAlignment' has the following description: is to be - * shown below the alignment - introduced in Jalview 2.8 for - * visualizing T-COFFEE alignment scores - * - * @return the value of field 'BelowAlignment'. - */ - public boolean isBelowAlignment( - ) { - return this._belowAlignment; - } - - /** - * Returns the value of field 'centreColLabels'. - * - * @return the value of field 'CentreColLabels'. - */ - public boolean isCentreColLabels( - ) { - return this._centreColLabels; - } - - /** - * Returns the value of field 'graph'. - * - * @return the value of field 'Graph'. - */ - public boolean isGraph( - ) { - return this._graph; - } - - /** - * Returns the value of field 'scaleColLabels'. - * - * @return the value of field 'ScaleColLabels'. - */ - public boolean isScaleColLabels( - ) { - return this._scaleColLabels; - } - - /** - * Returns the value of field 'scoreOnly'. - * - * @return the value of field 'ScoreOnly'. - */ - public boolean isScoreOnly( - ) { - return this._scoreOnly; - } - - /** - * Returns the value of field 'showAllColLabels'. - * - * @return the value of field 'ShowAllColLabels'. - */ - public boolean isShowAllColLabels( - ) { - return this._showAllColLabels; - } - - /** - * 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; - } - - /** - * Returns the value of field 'visible'. - * - * @return the value of field 'Visible'. - */ - public boolean isVisible( - ) { - return this._visible; - } - - /** - * - * - * @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 removeAllAnnotationElement( - ) { - this._annotationElementList.clear(); - } - - /** - */ - public void removeAllProperty( - ) { - this._propertyList.clear(); - } - - /** - * Method removeAnnotationElement. - * - * @param vAnnotationElement - * @return true if the object was removed from the collection. - */ - public boolean removeAnnotationElement( - final jalview.schemabinding.version2.AnnotationElement vAnnotationElement) { - boolean removed = _annotationElementList.remove(vAnnotationElement); - return removed; - } - - /** - * Method removeAnnotationElementAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.AnnotationElement removeAnnotationElementAt( - final int index) { - java.lang.Object obj = this._annotationElementList.remove(index); - return (jalview.schemabinding.version2.AnnotationElement) obj; - } - - /** - * Method removeProperty. - * - * @param vProperty - * @return true if the object was removed from the collection. - */ - public boolean removeProperty( - final jalview.schemabinding.version2.Property vProperty) { - boolean removed = _propertyList.remove(vProperty); - return removed; - } - - /** - * Method removePropertyAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.Property removePropertyAt( - final int index) { - java.lang.Object obj = this._propertyList.remove(index); - return (jalview.schemabinding.version2.Property) obj; - } - - /** - * - * - * @param index - * @param vAnnotationElement - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setAnnotationElement( - final int index, - final jalview.schemabinding.version2.AnnotationElement vAnnotationElement) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._annotationElementList.size()) { - throw new IndexOutOfBoundsException("setAnnotationElement: Index value '" + index + "' not in range [0.." + (this._annotationElementList.size() - 1) + "]"); - } - - this._annotationElementList.set(index, vAnnotationElement); - } - - /** - * - * - * @param vAnnotationElementArray - */ - public void setAnnotationElement( - final jalview.schemabinding.version2.AnnotationElement[] vAnnotationElementArray) { - //-- copy array - _annotationElementList.clear(); - - for (int i = 0; i < vAnnotationElementArray.length; i++) { - this._annotationElementList.add(vAnnotationElementArray[i]); - } - } - - /** - * Sets the value of field 'autoCalculated'. The field - * 'autoCalculated' has the following description: is an - * autocalculated annotation row - * - * @param autoCalculated the value of field 'autoCalculated'. - */ - public void setAutoCalculated( - final boolean autoCalculated) { - this._autoCalculated = autoCalculated; - this._has_autoCalculated = true; - } - - /** - * Sets the value of field 'belowAlignment'. The field - * 'belowAlignment' has the following description: is to be - * shown below the alignment - introduced in Jalview 2.8 for - * visualizing T-COFFEE alignment scores - * - * @param belowAlignment the value of field 'belowAlignment'. - */ - public void setBelowAlignment( - final boolean belowAlignment) { - this._belowAlignment = belowAlignment; - this._has_belowAlignment = true; - } - - /** - * Sets the value of field 'calcId'. The field 'calcId' has the - * following description: Optional string identifier used to - * group sets of annotation produced by a particular - * calculation. Values are opaque strings but have semantic - * meaning to Jalview's renderer, data importer and calculation - * system. - * - * @param calcId the value of field 'calcId'. - */ - public void setCalcId( - final java.lang.String calcId) { - this._calcId = calcId; - } - - /** - * Sets the value of field 'centreColLabels'. - * - * @param centreColLabels the value of field 'centreColLabels'. - */ - public void setCentreColLabels( - final boolean centreColLabels) { - this._centreColLabels = centreColLabels; - this._has_centreColLabels = true; - } - - /** - * Sets the value of field 'description'. - * - * @param description the value of field 'description'. - */ - public void setDescription( - final java.lang.String description) { - this._description = description; - } - - /** - * Sets the value of field 'graph'. - * - * @param graph the value of field 'graph'. - */ - public void setGraph( - final boolean graph) { - this._graph = graph; - this._has_graph = true; - } - - /** - * Sets the value of field 'graphColour'. - * - * @param graphColour the value of field 'graphColour'. - */ - public void setGraphColour( - final int graphColour) { - this._graphColour = graphColour; - this._has_graphColour = true; - } - - /** - * Sets the value of field 'graphGroup'. - * - * @param graphGroup the value of field 'graphGroup'. - */ - public void setGraphGroup( - final int graphGroup) { - this._graphGroup = graphGroup; - this._has_graphGroup = true; - } - - /** - * Sets the value of field 'graphHeight'. The field - * 'graphHeight' has the following description: height in - * pixels for the graph if this is a graph-type annotation. - * - * @param graphHeight the value of field 'graphHeight'. - */ - public void setGraphHeight( - final int graphHeight) { - this._graphHeight = graphHeight; - this._has_graphHeight = true; - } - - /** - * Sets the value of field 'graphType'. - * - * @param graphType the value of field 'graphType'. - */ - public void setGraphType( - final int graphType) { - this._graphType = graphType; - this._has_graphType = true; - } - - /** - * Sets the value of field 'groupRef'. - * - * @param groupRef the value of field 'groupRef'. - */ - public void setGroupRef( - final java.lang.String groupRef) { - this._groupRef = groupRef; - } - - /** - * Sets the value of field 'id'. - * - * @param id the value of field 'id'. - */ - public void setId( - final java.lang.String id) { - this._id = id; - } - - /** - * Sets the value of field 'label'. - * - * @param label the value of field 'label'. - */ - public void setLabel( - final java.lang.String label) { - this._label = label; - } - - /** - * - * - * @param index - * @param vProperty - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setProperty( - final int index, - final jalview.schemabinding.version2.Property vProperty) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._propertyList.size()) { - throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); - } - - this._propertyList.set(index, vProperty); - } - - /** - * - * - * @param vPropertyArray - */ - public void setProperty( - final jalview.schemabinding.version2.Property[] vPropertyArray) { - //-- copy array - _propertyList.clear(); - - for (int i = 0; i < vPropertyArray.length; i++) { - this._propertyList.add(vPropertyArray[i]); - } - } - - /** - * Sets the value of field 'scaleColLabels'. - * - * @param scaleColLabels the value of field 'scaleColLabels'. - */ - public void setScaleColLabels( - final boolean scaleColLabels) { - this._scaleColLabels = scaleColLabels; - this._has_scaleColLabels = true; - } - - /** - * Sets the value of field 'score'. - * - * @param score the value of field 'score'. - */ - public void setScore( - final double score) { - this._score = score; - this._has_score = true; - } - - /** - * Sets the value of field 'scoreOnly'. - * - * @param scoreOnly the value of field 'scoreOnly'. - */ - public void setScoreOnly( - final boolean scoreOnly) { - this._scoreOnly = scoreOnly; - this._has_scoreOnly = true; - } - - /** - * Sets the value of field 'sequenceRef'. - * - * @param sequenceRef the value of field 'sequenceRef'. - */ - public void setSequenceRef( - final java.lang.String sequenceRef) { - this._sequenceRef = sequenceRef; - } - - /** - * Sets the value of field 'showAllColLabels'. - * - * @param showAllColLabels the value of field 'showAllColLabels' - */ - public void setShowAllColLabels( - final boolean showAllColLabels) { - this._showAllColLabels = showAllColLabels; - this._has_showAllColLabels = true; - } - - /** - * Sets the value of field 'thresholdLine'. - * - * @param thresholdLine the value of field 'thresholdLine'. - */ - public void setThresholdLine( - final jalview.schemabinding.version2.ThresholdLine thresholdLine) { - this._thresholdLine = thresholdLine; - } - - /** - * Sets the value of field 'visible'. - * - * @param visible the value of field 'visible'. - */ - public void setVisible( - final boolean visible) { - this._visible = visible; - this._has_visible = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled - * jalview.schemabinding.version2.Annotation - */ - public static jalview.schemabinding.version2.Annotation unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.Annotation) Unmarshaller.unmarshal(jalview.schemabinding.version2.Annotation.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class Annotation implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _graph. + */ + private boolean _graph; + + /** + * keeps track of state for field: _graph + */ + private boolean _has_graph; + + /** + * Field _graphType. + */ + private int _graphType; + + /** + * keeps track of state for field: _graphType + */ + private boolean _has_graphType; + + /** + * Field _sequenceRef. + */ + private java.lang.String _sequenceRef; + + /** + * Field _groupRef. + */ + private java.lang.String _groupRef; + + /** + * Field _graphColour. + */ + private int _graphColour; + + /** + * keeps track of state for field: _graphColour + */ + private boolean _has_graphColour; + + /** + * Field _graphGroup. + */ + private int _graphGroup; + + /** + * keeps track of state for field: _graphGroup + */ + private boolean _has_graphGroup; + + /** + * height in pixels for the graph if this is a graph-type annotation. + */ + private int _graphHeight; + + /** + * keeps track of state for field: _graphHeight + */ + private boolean _has_graphHeight; + + /** + * Field _id. + */ + private java.lang.String _id; + + /** + * Field _scoreOnly. + */ + private boolean _scoreOnly = false; + + /** + * keeps track of state for field: _scoreOnly + */ + private boolean _has_scoreOnly; + + /** + * Field _score. + */ + private double _score; + + /** + * keeps track of state for field: _score + */ + private boolean _has_score; + + /** + * Field _visible. + */ + private boolean _visible; + + /** + * keeps track of state for field: _visible + */ + private boolean _has_visible; + + /** + * Field _centreColLabels. + */ + private boolean _centreColLabels; + + /** + * keeps track of state for field: _centreColLabels + */ + private boolean _has_centreColLabels; + + /** + * Field _scaleColLabels. + */ + private boolean _scaleColLabels; + + /** + * keeps track of state for field: _scaleColLabels + */ + private boolean _has_scaleColLabels; + + /** + * Field _showAllColLabels. + */ + private boolean _showAllColLabels; + + /** + * keeps track of state for field: _showAllColLabels + */ + private boolean _has_showAllColLabels; + + /** + * is an autocalculated annotation row + */ + private boolean _autoCalculated = false; + + /** + * keeps track of state for field: _autoCalculated + */ + private boolean _has_autoCalculated; + + /** + * is to be shown below the alignment - introduced in Jalview 2.8 for + * visualizing T-COFFEE alignment scores + */ + private boolean _belowAlignment = true; + + /** + * keeps track of state for field: _belowAlignment + */ + private boolean _has_belowAlignment; + + /** + * Optional string identifier used to group sets of annotation produced by a + * particular calculation. Values are opaque strings but have semantic meaning + * to Jalview's renderer, data importer and calculation system. + */ + private java.lang.String _calcId; + + /** + * Field _annotationElementList. + */ + private java.util.Vector _annotationElementList; + + /** + * Field _label. + */ + private java.lang.String _label; + + /** + * Field _description. + */ + private java.lang.String _description; + + /** + * Field _thresholdLine. + */ + private jalview.schemabinding.version2.ThresholdLine _thresholdLine; + + /** + * Field _propertyList. + */ + private java.util.Vector _propertyList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Annotation() + { + super(); + this._annotationElementList = new java.util.Vector(); + this._propertyList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vAnnotationElement + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addAnnotationElement( + final jalview.schemabinding.version2.AnnotationElement vAnnotationElement) + throws java.lang.IndexOutOfBoundsException + { + this._annotationElementList.addElement(vAnnotationElement); + } + + /** + * + * + * @param index + * @param vAnnotationElement + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addAnnotationElement( + final int index, + final jalview.schemabinding.version2.AnnotationElement vAnnotationElement) + throws java.lang.IndexOutOfBoundsException + { + this._annotationElementList.add(index, vAnnotationElement); + } + + /** + * + * + * @param vProperty + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addProperty( + final jalview.schemabinding.version2.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + this._propertyList.addElement(vProperty); + } + + /** + * + * + * @param index + * @param vProperty + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addProperty(final int index, + final jalview.schemabinding.version2.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + this._propertyList.add(index, vProperty); + } + + /** + */ + public void deleteAutoCalculated() + { + this._has_autoCalculated = false; + } + + /** + */ + public void deleteBelowAlignment() + { + this._has_belowAlignment = false; + } + + /** + */ + public void deleteCentreColLabels() + { + this._has_centreColLabels = false; + } + + /** + */ + public void deleteGraph() + { + this._has_graph = false; + } + + /** + */ + public void deleteGraphColour() + { + this._has_graphColour = false; + } + + /** + */ + public void deleteGraphGroup() + { + this._has_graphGroup = false; + } + + /** + */ + public void deleteGraphHeight() + { + this._has_graphHeight = false; + } + + /** + */ + public void deleteGraphType() + { + this._has_graphType = false; + } + + /** + */ + public void deleteScaleColLabels() + { + this._has_scaleColLabels = false; + } + + /** + */ + public void deleteScore() + { + this._has_score = false; + } + + /** + */ + public void deleteScoreOnly() + { + this._has_scoreOnly = false; + } + + /** + */ + public void deleteShowAllColLabels() + { + this._has_showAllColLabels = false; + } + + /** + */ + public void deleteVisible() + { + this._has_visible = false; + } + + /** + * Method enumerateAnnotationElement. + * + * @return an Enumeration over all + * jalview.schemabinding.version2.AnnotationElement elements + */ + public java.util.Enumeration enumerateAnnotationElement() + { + return this._annotationElementList.elements(); + } + + /** + * Method enumerateProperty. + * + * @return an Enumeration over all jalview.schemabinding.version2.Property + * elements + */ + public java.util.Enumeration enumerateProperty() + { + return this._propertyList.elements(); + } + + /** + * Method getAnnotationElement. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.AnnotationElement + * at the given index + */ + public jalview.schemabinding.version2.AnnotationElement getAnnotationElement( + final int index) throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._annotationElementList.size()) + { + throw new IndexOutOfBoundsException( + "getAnnotationElement: Index value '" + index + + "' not in range [0.." + + (this._annotationElementList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.AnnotationElement) _annotationElementList + .get(index); + } + + /** + * Method getAnnotationElement.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 jalview.schemabinding.version2.AnnotationElement[] getAnnotationElement() + { + jalview.schemabinding.version2.AnnotationElement[] array = new jalview.schemabinding.version2.AnnotationElement[0]; + return (jalview.schemabinding.version2.AnnotationElement[]) this._annotationElementList + .toArray(array); + } + + /** + * Method getAnnotationElementCount. + * + * @return the size of this collection + */ + public int getAnnotationElementCount() + { + return this._annotationElementList.size(); + } + + /** + * Returns the value of field 'autoCalculated'. The field 'autoCalculated' has + * the following description: is an autocalculated annotation row + * + * @return the value of field 'AutoCalculated'. + */ + public boolean getAutoCalculated() + { + return this._autoCalculated; + } + + /** + * Returns the value of field 'belowAlignment'. The field 'belowAlignment' has + * the following description: is to be shown below the alignment - introduced + * in Jalview 2.8 for visualizing T-COFFEE alignment scores + * + * @return the value of field 'BelowAlignment'. + */ + public boolean getBelowAlignment() + { + return this._belowAlignment; + } + + /** + * Returns the value of field 'calcId'. The field 'calcId' has the following + * description: Optional string identifier used to group sets of annotation + * produced by a particular calculation. Values are opaque strings but have + * semantic meaning to Jalview's renderer, data importer and calculation + * system. + * + * @return the value of field 'CalcId'. + */ + public java.lang.String getCalcId() + { + return this._calcId; + } + + /** + * Returns the value of field 'centreColLabels'. + * + * @return the value of field 'CentreColLabels'. + */ + public boolean getCentreColLabels() + { + return this._centreColLabels; + } + + /** + * Returns the value of field 'description'. + * + * @return the value of field 'Description'. + */ + public java.lang.String getDescription() + { + return this._description; + } + + /** + * Returns the value of field 'graph'. + * + * @return the value of field 'Graph'. + */ + public boolean getGraph() + { + return this._graph; + } + + /** + * Returns the value of field 'graphColour'. + * + * @return the value of field 'GraphColour'. + */ + public int getGraphColour() + { + return this._graphColour; + } + + /** + * Returns the value of field 'graphGroup'. + * + * @return the value of field 'GraphGroup'. + */ + public int getGraphGroup() + { + return this._graphGroup; + } + + /** + * Returns the value of field 'graphHeight'. The field 'graphHeight' has the + * following description: height in pixels for the graph if this is a + * graph-type annotation. + * + * @return the value of field 'GraphHeight'. + */ + public int getGraphHeight() + { + return this._graphHeight; + } + + /** + * Returns the value of field 'graphType'. + * + * @return the value of field 'GraphType'. + */ + public int getGraphType() + { + return this._graphType; + } + + /** + * Returns the value of field 'groupRef'. + * + * @return the value of field 'GroupRef'. + */ + public java.lang.String getGroupRef() + { + return this._groupRef; + } + + /** + * Returns the value of field 'id'. + * + * @return the value of field 'Id'. + */ + public java.lang.String getId() + { + return this._id; + } + + /** + * Returns the value of field 'label'. + * + * @return the value of field 'Label'. + */ + public java.lang.String getLabel() + { + return this._label; + } + + /** + * Method getProperty. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.Property at the + * given index + */ + public jalview.schemabinding.version2.Property getProperty(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) + { + throw new IndexOutOfBoundsException("getProperty: Index value '" + + index + "' not in range [0.." + + (this._propertyList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.Property) _propertyList + .get(index); + } + + /** + * Method getProperty.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 jalview.schemabinding.version2.Property[] getProperty() + { + jalview.schemabinding.version2.Property[] array = new jalview.schemabinding.version2.Property[0]; + return (jalview.schemabinding.version2.Property[]) this._propertyList + .toArray(array); + } + + /** + * Method getPropertyCount. + * + * @return the size of this collection + */ + public int getPropertyCount() + { + return this._propertyList.size(); + } + + /** + * Returns the value of field 'scaleColLabels'. + * + * @return the value of field 'ScaleColLabels'. + */ + public boolean getScaleColLabels() + { + return this._scaleColLabels; + } + + /** + * Returns the value of field 'score'. + * + * @return the value of field 'Score'. + */ + public double getScore() + { + return this._score; + } + + /** + * Returns the value of field 'scoreOnly'. + * + * @return the value of field 'ScoreOnly'. + */ + public boolean getScoreOnly() + { + return this._scoreOnly; + } + + /** + * Returns the value of field 'sequenceRef'. + * + * @return the value of field 'SequenceRef'. + */ + public java.lang.String getSequenceRef() + { + return this._sequenceRef; + } + + /** + * Returns the value of field 'showAllColLabels'. + * + * @return the value of field 'ShowAllColLabels'. + */ + public boolean getShowAllColLabels() + { + return this._showAllColLabels; + } + + /** + * Returns the value of field 'thresholdLine'. + * + * @return the value of field 'ThresholdLine'. + */ + public jalview.schemabinding.version2.ThresholdLine getThresholdLine() + { + return this._thresholdLine; + } + + /** + * Returns the value of field 'visible'. + * + * @return the value of field 'Visible'. + */ + public boolean getVisible() + { + return this._visible; + } + + /** + * Method hasAutoCalculated. + * + * @return true if at least one AutoCalculated has been added + */ + public boolean hasAutoCalculated() + { + return this._has_autoCalculated; + } + + /** + * Method hasBelowAlignment. + * + * @return true if at least one BelowAlignment has been added + */ + public boolean hasBelowAlignment() + { + return this._has_belowAlignment; + } + + /** + * Method hasCentreColLabels. + * + * @return true if at least one CentreColLabels has been added + */ + public boolean hasCentreColLabels() + { + return this._has_centreColLabels; + } + + /** + * Method hasGraph. + * + * @return true if at least one Graph has been added + */ + public boolean hasGraph() + { + return this._has_graph; + } + + /** + * Method hasGraphColour. + * + * @return true if at least one GraphColour has been added + */ + public boolean hasGraphColour() + { + return this._has_graphColour; + } + + /** + * Method hasGraphGroup. + * + * @return true if at least one GraphGroup has been added + */ + public boolean hasGraphGroup() + { + return this._has_graphGroup; + } + + /** + * Method hasGraphHeight. + * + * @return true if at least one GraphHeight has been added + */ + public boolean hasGraphHeight() + { + return this._has_graphHeight; + } + + /** + * Method hasGraphType. + * + * @return true if at least one GraphType has been added + */ + public boolean hasGraphType() + { + return this._has_graphType; + } + + /** + * Method hasScaleColLabels. + * + * @return true if at least one ScaleColLabels has been added + */ + public boolean hasScaleColLabels() + { + return this._has_scaleColLabels; + } + + /** + * Method hasScore. + * + * @return true if at least one Score has been added + */ + public boolean hasScore() + { + return this._has_score; + } + + /** + * Method hasScoreOnly. + * + * @return true if at least one ScoreOnly has been added + */ + public boolean hasScoreOnly() + { + return this._has_scoreOnly; + } + + /** + * Method hasShowAllColLabels. + * + * @return true if at least one ShowAllColLabels has been added + */ + public boolean hasShowAllColLabels() + { + return this._has_showAllColLabels; + } + + /** + * Method hasVisible. + * + * @return true if at least one Visible has been added + */ + public boolean hasVisible() + { + return this._has_visible; + } + + /** + * Returns the value of field 'autoCalculated'. The field 'autoCalculated' has + * the following description: is an autocalculated annotation row + * + * @return the value of field 'AutoCalculated'. + */ + public boolean isAutoCalculated() + { + return this._autoCalculated; + } + + /** + * Returns the value of field 'belowAlignment'. The field 'belowAlignment' has + * the following description: is to be shown below the alignment - introduced + * in Jalview 2.8 for visualizing T-COFFEE alignment scores + * + * @return the value of field 'BelowAlignment'. + */ + public boolean isBelowAlignment() + { + return this._belowAlignment; + } + + /** + * Returns the value of field 'centreColLabels'. + * + * @return the value of field 'CentreColLabels'. + */ + public boolean isCentreColLabels() + { + return this._centreColLabels; + } + + /** + * Returns the value of field 'graph'. + * + * @return the value of field 'Graph'. + */ + public boolean isGraph() + { + return this._graph; + } + + /** + * Returns the value of field 'scaleColLabels'. + * + * @return the value of field 'ScaleColLabels'. + */ + public boolean isScaleColLabels() + { + return this._scaleColLabels; + } + + /** + * Returns the value of field 'scoreOnly'. + * + * @return the value of field 'ScoreOnly'. + */ + public boolean isScoreOnly() + { + return this._scoreOnly; + } + + /** + * Returns the value of field 'showAllColLabels'. + * + * @return the value of field 'ShowAllColLabels'. + */ + public boolean isShowAllColLabels() + { + return this._showAllColLabels; + } + + /** + * 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; + } + + /** + * Returns the value of field 'visible'. + * + * @return the value of field 'Visible'. + */ + public boolean isVisible() + { + return this._visible; + } + + /** + * + * + * @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 removeAllAnnotationElement() + { + this._annotationElementList.clear(); + } + + /** + */ + public void removeAllProperty() + { + this._propertyList.clear(); + } + + /** + * Method removeAnnotationElement. + * + * @param vAnnotationElement + * @return true if the object was removed from the collection. + */ + public boolean removeAnnotationElement( + final jalview.schemabinding.version2.AnnotationElement vAnnotationElement) + { + boolean removed = _annotationElementList.remove(vAnnotationElement); + return removed; + } + + /** + * Method removeAnnotationElementAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.AnnotationElement removeAnnotationElementAt( + final int index) + { + java.lang.Object obj = this._annotationElementList.remove(index); + return (jalview.schemabinding.version2.AnnotationElement) obj; + } + + /** + * Method removeProperty. + * + * @param vProperty + * @return true if the object was removed from the collection. + */ + public boolean removeProperty( + final jalview.schemabinding.version2.Property vProperty) + { + boolean removed = _propertyList.remove(vProperty); + return removed; + } + + /** + * Method removePropertyAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.Property removePropertyAt( + final int index) + { + java.lang.Object obj = this._propertyList.remove(index); + return (jalview.schemabinding.version2.Property) obj; + } + + /** + * + * + * @param index + * @param vAnnotationElement + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setAnnotationElement( + final int index, + final jalview.schemabinding.version2.AnnotationElement vAnnotationElement) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._annotationElementList.size()) + { + throw new IndexOutOfBoundsException( + "setAnnotationElement: Index value '" + index + + "' not in range [0.." + + (this._annotationElementList.size() - 1) + "]"); + } + + this._annotationElementList.set(index, vAnnotationElement); + } + + /** + * + * + * @param vAnnotationElementArray + */ + public void setAnnotationElement( + final jalview.schemabinding.version2.AnnotationElement[] vAnnotationElementArray) + { + // -- copy array + _annotationElementList.clear(); + + for (int i = 0; i < vAnnotationElementArray.length; i++) + { + this._annotationElementList.add(vAnnotationElementArray[i]); + } + } + + /** + * Sets the value of field 'autoCalculated'. The field 'autoCalculated' has + * the following description: is an autocalculated annotation row + * + * @param autoCalculated + * the value of field 'autoCalculated'. + */ + public void setAutoCalculated(final boolean autoCalculated) + { + this._autoCalculated = autoCalculated; + this._has_autoCalculated = true; + } + + /** + * Sets the value of field 'belowAlignment'. The field 'belowAlignment' has + * the following description: is to be shown below the alignment - introduced + * in Jalview 2.8 for visualizing T-COFFEE alignment scores + * + * @param belowAlignment + * the value of field 'belowAlignment'. + */ + public void setBelowAlignment(final boolean belowAlignment) + { + this._belowAlignment = belowAlignment; + this._has_belowAlignment = true; + } + + /** + * Sets the value of field 'calcId'. The field 'calcId' has the following + * description: Optional string identifier used to group sets of annotation + * produced by a particular calculation. Values are opaque strings but have + * semantic meaning to Jalview's renderer, data importer and calculation + * system. + * + * @param calcId + * the value of field 'calcId'. + */ + public void setCalcId(final java.lang.String calcId) + { + this._calcId = calcId; + } + + /** + * Sets the value of field 'centreColLabels'. + * + * @param centreColLabels + * the value of field 'centreColLabels'. + */ + public void setCentreColLabels(final boolean centreColLabels) + { + this._centreColLabels = centreColLabels; + this._has_centreColLabels = true; + } + + /** + * Sets the value of field 'description'. + * + * @param description + * the value of field 'description'. + */ + public void setDescription(final java.lang.String description) + { + this._description = description; + } + + /** + * Sets the value of field 'graph'. + * + * @param graph + * the value of field 'graph'. + */ + public void setGraph(final boolean graph) + { + this._graph = graph; + this._has_graph = true; + } + + /** + * Sets the value of field 'graphColour'. + * + * @param graphColour + * the value of field 'graphColour'. + */ + public void setGraphColour(final int graphColour) + { + this._graphColour = graphColour; + this._has_graphColour = true; + } + + /** + * Sets the value of field 'graphGroup'. + * + * @param graphGroup + * the value of field 'graphGroup'. + */ + public void setGraphGroup(final int graphGroup) + { + this._graphGroup = graphGroup; + this._has_graphGroup = true; + } + + /** + * Sets the value of field 'graphHeight'. The field 'graphHeight' has the + * following description: height in pixels for the graph if this is a + * graph-type annotation. + * + * @param graphHeight + * the value of field 'graphHeight'. + */ + public void setGraphHeight(final int graphHeight) + { + this._graphHeight = graphHeight; + this._has_graphHeight = true; + } + + /** + * Sets the value of field 'graphType'. + * + * @param graphType + * the value of field 'graphType'. + */ + public void setGraphType(final int graphType) + { + this._graphType = graphType; + this._has_graphType = true; + } + + /** + * Sets the value of field 'groupRef'. + * + * @param groupRef + * the value of field 'groupRef'. + */ + public void setGroupRef(final java.lang.String groupRef) + { + this._groupRef = groupRef; + } + + /** + * Sets the value of field 'id'. + * + * @param id + * the value of field 'id'. + */ + public void setId(final java.lang.String id) + { + this._id = id; + } + + /** + * Sets the value of field 'label'. + * + * @param label + * the value of field 'label'. + */ + public void setLabel(final java.lang.String label) + { + this._label = label; + } + + /** + * + * + * @param index + * @param vProperty + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setProperty(final int index, + final jalview.schemabinding.version2.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) + { + throw new IndexOutOfBoundsException("setProperty: Index value '" + + index + "' not in range [0.." + + (this._propertyList.size() - 1) + "]"); + } + + this._propertyList.set(index, vProperty); + } + + /** + * + * + * @param vPropertyArray + */ + public void setProperty( + final jalview.schemabinding.version2.Property[] vPropertyArray) + { + // -- copy array + _propertyList.clear(); + + for (int i = 0; i < vPropertyArray.length; i++) + { + this._propertyList.add(vPropertyArray[i]); + } + } + + /** + * Sets the value of field 'scaleColLabels'. + * + * @param scaleColLabels + * the value of field 'scaleColLabels'. + */ + public void setScaleColLabels(final boolean scaleColLabels) + { + this._scaleColLabels = scaleColLabels; + this._has_scaleColLabels = true; + } + + /** + * Sets the value of field 'score'. + * + * @param score + * the value of field 'score'. + */ + public void setScore(final double score) + { + this._score = score; + this._has_score = true; + } + + /** + * Sets the value of field 'scoreOnly'. + * + * @param scoreOnly + * the value of field 'scoreOnly'. + */ + public void setScoreOnly(final boolean scoreOnly) + { + this._scoreOnly = scoreOnly; + this._has_scoreOnly = true; + } + + /** + * Sets the value of field 'sequenceRef'. + * + * @param sequenceRef + * the value of field 'sequenceRef'. + */ + public void setSequenceRef(final java.lang.String sequenceRef) + { + this._sequenceRef = sequenceRef; + } + + /** + * Sets the value of field 'showAllColLabels'. + * + * @param showAllColLabels + * the value of field 'showAllColLabels' + */ + public void setShowAllColLabels(final boolean showAllColLabels) + { + this._showAllColLabels = showAllColLabels; + this._has_showAllColLabels = true; + } + + /** + * Sets the value of field 'thresholdLine'. + * + * @param thresholdLine + * the value of field 'thresholdLine'. + */ + public void setThresholdLine( + final jalview.schemabinding.version2.ThresholdLine thresholdLine) + { + this._thresholdLine = thresholdLine; + } + + /** + * Sets the value of field 'visible'. + * + * @param visible + * the value of field 'visible'. + */ + public void setVisible(final boolean visible) + { + this._visible = visible; + this._has_visible = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.schemabinding.version2.Annotation + */ + public static jalview.schemabinding.version2.Annotation unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Annotation) Unmarshaller + .unmarshal(jalview.schemabinding.version2.Annotation.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/AnnotationColourScheme.java b/src/jalview/schemabinding/version2/AnnotationColourScheme.java index 91222f1..2f76e76 100644 --- a/src/jalview/schemabinding/version2/AnnotationColourScheme.java +++ b/src/jalview/schemabinding/version2/AnnotationColourScheme.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,461 +19,479 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class AnnotationColourScheme implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _aboveThreshold. - */ - private int _aboveThreshold; - - /** - * keeps track of state for field: _aboveThreshold - */ - private boolean _has_aboveThreshold; - - /** - * Field _annotation. - */ - private java.lang.String _annotation; - - /** - * Field _minColour. - */ - private int _minColour; - - /** - * keeps track of state for field: _minColour - */ - private boolean _has_minColour; - - /** - * Field _maxColour. - */ - private int _maxColour; - - /** - * keeps track of state for field: _maxColour - */ - private boolean _has_maxColour; - - /** - * Field _colourScheme. - */ - private java.lang.String _colourScheme; - - /** - * Field _threshold. - */ - private float _threshold; - - /** - * keeps track of state for field: _threshold - */ - private boolean _has_threshold; - - /** - * Field _perSequence. - */ - private boolean _perSequence; - - /** - * keeps track of state for field: _perSequence - */ - private boolean _has_perSequence; - - /** - * Field _predefinedColours. - */ - private boolean _predefinedColours; - - /** - * keeps track of state for field: _predefinedColours - */ - private boolean _has_predefinedColours; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public AnnotationColourScheme() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deleteAboveThreshold( - ) { - this._has_aboveThreshold= false; - } - - /** - */ - public void deleteMaxColour( - ) { - this._has_maxColour= false; - } - - /** - */ - public void deleteMinColour( - ) { - this._has_minColour= false; - } - - /** - */ - public void deletePerSequence( - ) { - this._has_perSequence= false; - } - - /** - */ - public void deletePredefinedColours( - ) { - this._has_predefinedColours= false; - } - - /** - */ - public void deleteThreshold( - ) { - this._has_threshold= false; - } - - /** - * Returns the value of field 'aboveThreshold'. - * - * @return the value of field 'AboveThreshold'. - */ - public int getAboveThreshold( - ) { - return this._aboveThreshold; - } - - /** - * Returns the value of field 'annotation'. - * - * @return the value of field 'Annotation'. - */ - public java.lang.String getAnnotation( - ) { - return this._annotation; - } - - /** - * Returns the value of field 'colourScheme'. - * - * @return the value of field 'ColourScheme'. - */ - public java.lang.String getColourScheme( - ) { - return this._colourScheme; - } - - /** - * Returns the value of field 'maxColour'. - * - * @return the value of field 'MaxColour'. - */ - public int getMaxColour( - ) { - return this._maxColour; - } - - /** - * Returns the value of field 'minColour'. - * - * @return the value of field 'MinColour'. - */ - public int getMinColour( - ) { - return this._minColour; - } - - /** - * Returns the value of field 'perSequence'. - * - * @return the value of field 'PerSequence'. - */ - public boolean getPerSequence( - ) { - return this._perSequence; - } - - /** - * Returns the value of field 'predefinedColours'. - * - * @return the value of field 'PredefinedColours'. - */ - public boolean getPredefinedColours( - ) { - return this._predefinedColours; - } - - /** - * Returns the value of field 'threshold'. - * - * @return the value of field 'Threshold'. - */ - public float getThreshold( - ) { - return this._threshold; - } - - /** - * Method hasAboveThreshold. - * - * @return true if at least one AboveThreshold has been added - */ - public boolean hasAboveThreshold( - ) { - return this._has_aboveThreshold; - } - - /** - * Method hasMaxColour. - * - * @return true if at least one MaxColour has been added - */ - public boolean hasMaxColour( - ) { - return this._has_maxColour; - } - - /** - * Method hasMinColour. - * - * @return true if at least one MinColour has been added - */ - public boolean hasMinColour( - ) { - return this._has_minColour; - } - - /** - * Method hasPerSequence. - * - * @return true if at least one PerSequence has been added - */ - public boolean hasPerSequence( - ) { - return this._has_perSequence; - } - - /** - * Method hasPredefinedColours. - * - * @return true if at least one PredefinedColours has been added - */ - public boolean hasPredefinedColours( - ) { - return this._has_predefinedColours; - } - - /** - * Method hasThreshold. - * - * @return true if at least one Threshold has been added - */ - public boolean hasThreshold( - ) { - return this._has_threshold; - } - - /** - * Returns the value of field 'perSequence'. - * - * @return the value of field 'PerSequence'. - */ - public boolean isPerSequence( - ) { - return this._perSequence; - } - - /** - * Returns the value of field 'predefinedColours'. - * - * @return the value of field 'PredefinedColours'. - */ - public boolean isPredefinedColours( - ) { - return this._predefinedColours; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'aboveThreshold'. - * - * @param aboveThreshold the value of field 'aboveThreshold'. - */ - public void setAboveThreshold( - final int aboveThreshold) { - this._aboveThreshold = aboveThreshold; - this._has_aboveThreshold = true; - } - - /** - * Sets the value of field 'annotation'. - * - * @param annotation the value of field 'annotation'. - */ - public void setAnnotation( - final java.lang.String annotation) { - this._annotation = annotation; - } - - /** - * Sets the value of field 'colourScheme'. - * - * @param colourScheme the value of field 'colourScheme'. - */ - public void setColourScheme( - final java.lang.String colourScheme) { - this._colourScheme = colourScheme; - } - - /** - * Sets the value of field 'maxColour'. - * - * @param maxColour the value of field 'maxColour'. - */ - public void setMaxColour( - final int maxColour) { - this._maxColour = maxColour; - this._has_maxColour = true; - } - - /** - * Sets the value of field 'minColour'. - * - * @param minColour the value of field 'minColour'. - */ - public void setMinColour( - final int minColour) { - this._minColour = minColour; - this._has_minColour = true; - } - - /** - * Sets the value of field 'perSequence'. - * - * @param perSequence the value of field 'perSequence'. - */ - public void setPerSequence( - final boolean perSequence) { - this._perSequence = perSequence; - this._has_perSequence = true; - } - - /** - * Sets the value of field 'predefinedColours'. - * - * @param predefinedColours the value of field - * 'predefinedColours'. - */ - public void setPredefinedColours( - final boolean predefinedColours) { - this._predefinedColours = predefinedColours; - this._has_predefinedColours = true; - } - - /** - * Sets the value of field 'threshold'. - * - * @param threshold the value of field 'threshold'. - */ - public void setThreshold( - final float threshold) { - this._threshold = threshold; - this._has_threshold = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled - * jalview.schemabinding.version2.AnnotationColourScheme - */ - public static jalview.schemabinding.version2.AnnotationColourScheme unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.AnnotationColourScheme) Unmarshaller.unmarshal(jalview.schemabinding.version2.AnnotationColourScheme.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class AnnotationColourScheme implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _aboveThreshold. + */ + private int _aboveThreshold; + + /** + * keeps track of state for field: _aboveThreshold + */ + private boolean _has_aboveThreshold; + + /** + * Field _annotation. + */ + private java.lang.String _annotation; + + /** + * Field _minColour. + */ + private int _minColour; + + /** + * keeps track of state for field: _minColour + */ + private boolean _has_minColour; + + /** + * Field _maxColour. + */ + private int _maxColour; + + /** + * keeps track of state for field: _maxColour + */ + private boolean _has_maxColour; + + /** + * Field _colourScheme. + */ + private java.lang.String _colourScheme; + + /** + * Field _threshold. + */ + private float _threshold; + + /** + * keeps track of state for field: _threshold + */ + private boolean _has_threshold; + + /** + * Field _perSequence. + */ + private boolean _perSequence; + + /** + * keeps track of state for field: _perSequence + */ + private boolean _has_perSequence; + + /** + * Field _predefinedColours. + */ + private boolean _predefinedColours; + + /** + * keeps track of state for field: _predefinedColours + */ + private boolean _has_predefinedColours; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public AnnotationColourScheme() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + */ + public void deleteAboveThreshold() + { + this._has_aboveThreshold = false; + } + + /** + */ + public void deleteMaxColour() + { + this._has_maxColour = false; + } + + /** + */ + public void deleteMinColour() + { + this._has_minColour = false; + } + + /** + */ + public void deletePerSequence() + { + this._has_perSequence = false; + } + + /** + */ + public void deletePredefinedColours() + { + this._has_predefinedColours = false; + } + + /** + */ + public void deleteThreshold() + { + this._has_threshold = false; + } + + /** + * Returns the value of field 'aboveThreshold'. + * + * @return the value of field 'AboveThreshold'. + */ + public int getAboveThreshold() + { + return this._aboveThreshold; + } + + /** + * Returns the value of field 'annotation'. + * + * @return the value of field 'Annotation'. + */ + public java.lang.String getAnnotation() + { + return this._annotation; + } + + /** + * Returns the value of field 'colourScheme'. + * + * @return the value of field 'ColourScheme'. + */ + public java.lang.String getColourScheme() + { + return this._colourScheme; + } + + /** + * Returns the value of field 'maxColour'. + * + * @return the value of field 'MaxColour'. + */ + public int getMaxColour() + { + return this._maxColour; + } + + /** + * Returns the value of field 'minColour'. + * + * @return the value of field 'MinColour'. + */ + public int getMinColour() + { + return this._minColour; + } + + /** + * Returns the value of field 'perSequence'. + * + * @return the value of field 'PerSequence'. + */ + public boolean getPerSequence() + { + return this._perSequence; + } + + /** + * Returns the value of field 'predefinedColours'. + * + * @return the value of field 'PredefinedColours'. + */ + public boolean getPredefinedColours() + { + return this._predefinedColours; + } + + /** + * Returns the value of field 'threshold'. + * + * @return the value of field 'Threshold'. + */ + public float getThreshold() + { + return this._threshold; + } + + /** + * Method hasAboveThreshold. + * + * @return true if at least one AboveThreshold has been added + */ + public boolean hasAboveThreshold() + { + return this._has_aboveThreshold; + } + + /** + * Method hasMaxColour. + * + * @return true if at least one MaxColour has been added + */ + public boolean hasMaxColour() + { + return this._has_maxColour; + } + + /** + * Method hasMinColour. + * + * @return true if at least one MinColour has been added + */ + public boolean hasMinColour() + { + return this._has_minColour; + } + + /** + * Method hasPerSequence. + * + * @return true if at least one PerSequence has been added + */ + public boolean hasPerSequence() + { + return this._has_perSequence; + } + + /** + * Method hasPredefinedColours. + * + * @return true if at least one PredefinedColours has been added + */ + public boolean hasPredefinedColours() + { + return this._has_predefinedColours; + } + + /** + * Method hasThreshold. + * + * @return true if at least one Threshold has been added + */ + public boolean hasThreshold() + { + return this._has_threshold; + } + + /** + * Returns the value of field 'perSequence'. + * + * @return the value of field 'PerSequence'. + */ + public boolean isPerSequence() + { + return this._perSequence; + } + + /** + * Returns the value of field 'predefinedColours'. + * + * @return the value of field 'PredefinedColours'. + */ + public boolean isPredefinedColours() + { + return this._predefinedColours; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; + } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'aboveThreshold'. + * + * @param aboveThreshold + * the value of field 'aboveThreshold'. + */ + public void setAboveThreshold(final int aboveThreshold) + { + this._aboveThreshold = aboveThreshold; + this._has_aboveThreshold = true; + } + + /** + * Sets the value of field 'annotation'. + * + * @param annotation + * the value of field 'annotation'. + */ + public void setAnnotation(final java.lang.String annotation) + { + this._annotation = annotation; + } + + /** + * Sets the value of field 'colourScheme'. + * + * @param colourScheme + * the value of field 'colourScheme'. + */ + public void setColourScheme(final java.lang.String colourScheme) + { + this._colourScheme = colourScheme; + } + + /** + * Sets the value of field 'maxColour'. + * + * @param maxColour + * the value of field 'maxColour'. + */ + public void setMaxColour(final int maxColour) + { + this._maxColour = maxColour; + this._has_maxColour = true; + } + + /** + * Sets the value of field 'minColour'. + * + * @param minColour + * the value of field 'minColour'. + */ + public void setMinColour(final int minColour) + { + this._minColour = minColour; + this._has_minColour = true; + } + + /** + * Sets the value of field 'perSequence'. + * + * @param perSequence + * the value of field 'perSequence'. + */ + public void setPerSequence(final boolean perSequence) + { + this._perSequence = perSequence; + this._has_perSequence = true; + } + + /** + * Sets the value of field 'predefinedColours'. + * + * @param predefinedColours + * the value of field 'predefinedColours'. + */ + public void setPredefinedColours(final boolean predefinedColours) + { + this._predefinedColours = predefinedColours; + this._has_predefinedColours = true; + } + + /** + * Sets the value of field 'threshold'. + * + * @param threshold + * the value of field 'threshold'. + */ + public void setThreshold(final float threshold) + { + this._threshold = threshold; + this._has_threshold = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled + * jalview.schemabinding.version2.AnnotationColourScheme + */ + public static jalview.schemabinding.version2.AnnotationColourScheme unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.AnnotationColourScheme) Unmarshaller + .unmarshal( + jalview.schemabinding.version2.AnnotationColourScheme.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/AnnotationColours.java b/src/jalview/schemabinding/version2/AnnotationColours.java index 965fc07..350ebce 100644 --- a/src/jalview/schemabinding/version2/AnnotationColours.java +++ b/src/jalview/schemabinding/version2/AnnotationColours.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,99 +19,110 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class AnnotationColours extends AnnotationColourScheme -implements java.io.Serializable +public class AnnotationColours extends AnnotationColourScheme implements + java.io.Serializable { + // ----------------/ + // - Constructors -/ + // ----------------/ - //----------------/ - //- Constructors -/ - //----------------/ - - public AnnotationColours() { - super(); - } - + public AnnotationColours() + { + super(); + } - //-----------/ - //- Methods -/ - //-----------/ + // -----------/ + // - Methods -/ + // -----------/ - /** - * 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; + /** + * 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 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); - } + /** + * + * + * @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); + } - /** - * 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.AnnotationColourScheme - */ - public static jalview.schemabinding.version2.AnnotationColourScheme unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.AnnotationColourScheme) Unmarshaller.unmarshal(jalview.schemabinding.version2.AnnotationColours.class, reader); - } + /** + * 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.AnnotationColourScheme + */ + public static jalview.schemabinding.version2.AnnotationColourScheme unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.AnnotationColourScheme) Unmarshaller + .unmarshal( + jalview.schemabinding.version2.AnnotationColours.class, + reader); + } - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } + /** + * + * + * @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/AnnotationElement.java b/src/jalview/schemabinding/version2/AnnotationElement.java index 6df737f..2a765ea 100644 --- a/src/jalview/schemabinding/version2/AnnotationElement.java +++ b/src/jalview/schemabinding/version2/AnnotationElement.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,322 +19,338 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class AnnotationElement implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _position. - */ - private int _position; - - /** - * keeps track of state for field: _position - */ - private boolean _has_position; - - /** - * Field _colour. - */ - private int _colour; - - /** - * keeps track of state for field: _colour - */ - private boolean _has_colour; - - /** - * Field _displayCharacter. - */ - private java.lang.String _displayCharacter; - - /** - * Field _description. - */ - private java.lang.String _description; - - /** - * Field _secondaryStructure. - */ - private java.lang.String _secondaryStructure; - - /** - * Field _value. - */ - private float _value; - - /** - * keeps track of state for field: _value - */ - private boolean _has_value; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public AnnotationElement() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deleteColour( - ) { - this._has_colour= false; - } - - /** - */ - public void deletePosition( - ) { - this._has_position= false; - } - - /** - */ - public void deleteValue( - ) { - this._has_value= false; - } - - /** - * Returns the value of field 'colour'. - * - * @return the value of field 'Colour'. - */ - public int getColour( - ) { - return this._colour; - } - - /** - * Returns the value of field 'description'. - * - * @return the value of field 'Description'. - */ - public java.lang.String getDescription( - ) { - return this._description; - } - - /** - * Returns the value of field 'displayCharacter'. - * - * @return the value of field 'DisplayCharacter'. - */ - public java.lang.String getDisplayCharacter( - ) { - return this._displayCharacter; - } - - /** - * Returns the value of field 'position'. - * - * @return the value of field 'Position'. - */ - public int getPosition( - ) { - return this._position; - } - - /** - * Returns the value of field 'secondaryStructure'. - * - * @return the value of field 'SecondaryStructure'. - */ - public java.lang.String getSecondaryStructure( - ) { - return this._secondaryStructure; - } - - /** - * Returns the value of field 'value'. - * - * @return the value of field 'Value'. - */ - public float getValue( - ) { - return this._value; - } - - /** - * Method hasColour. - * - * @return true if at least one Colour has been added - */ - public boolean hasColour( - ) { - return this._has_colour; - } - - /** - * Method hasPosition. - * - * @return true if at least one Position has been added - */ - public boolean hasPosition( - ) { - return this._has_position; - } - - /** - * Method hasValue. - * - * @return true if at least one Value has been added - */ - public boolean hasValue( - ) { - return this._has_value; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'colour'. - * - * @param colour the value of field 'colour'. - */ - public void setColour( - final int colour) { - this._colour = colour; - this._has_colour = true; - } - - /** - * Sets the value of field 'description'. - * - * @param description the value of field 'description'. - */ - public void setDescription( - final java.lang.String description) { - this._description = description; - } - - /** - * Sets the value of field 'displayCharacter'. - * - * @param displayCharacter the value of field 'displayCharacter' - */ - public void setDisplayCharacter( - final java.lang.String displayCharacter) { - this._displayCharacter = displayCharacter; - } - - /** - * Sets the value of field 'position'. - * - * @param position the value of field 'position'. - */ - public void setPosition( - final int position) { - this._position = position; - this._has_position = true; - } - - /** - * Sets the value of field 'secondaryStructure'. - * - * @param secondaryStructure the value of field - * 'secondaryStructure'. - */ - public void setSecondaryStructure( - final java.lang.String secondaryStructure) { - this._secondaryStructure = secondaryStructure; - } - - /** - * Sets the value of field 'value'. - * - * @param value the value of field 'value'. - */ - public void setValue( - final float value) { - this._value = value; - this._has_value = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled - * jalview.schemabinding.version2.AnnotationElement - */ - public static jalview.schemabinding.version2.AnnotationElement unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.AnnotationElement) Unmarshaller.unmarshal(jalview.schemabinding.version2.AnnotationElement.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); +public class AnnotationElement implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _position. + */ + private int _position; + + /** + * keeps track of state for field: _position + */ + private boolean _has_position; + + /** + * Field _colour. + */ + private int _colour; + + /** + * keeps track of state for field: _colour + */ + private boolean _has_colour; + + /** + * Field _displayCharacter. + */ + private java.lang.String _displayCharacter; + + /** + * Field _description. + */ + private java.lang.String _description; + + /** + * Field _secondaryStructure. + */ + private java.lang.String _secondaryStructure; + + /** + * Field _value. + */ + private float _value; + + /** + * keeps track of state for field: _value + */ + private boolean _has_value; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public AnnotationElement() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + */ + public void deleteColour() + { + this._has_colour = false; + } + + /** + */ + public void deletePosition() + { + this._has_position = false; + } + + /** + */ + public void deleteValue() + { + this._has_value = false; + } + + /** + * Returns the value of field 'colour'. + * + * @return the value of field 'Colour'. + */ + public int getColour() + { + return this._colour; + } + + /** + * Returns the value of field 'description'. + * + * @return the value of field 'Description'. + */ + public java.lang.String getDescription() + { + return this._description; + } + + /** + * Returns the value of field 'displayCharacter'. + * + * @return the value of field 'DisplayCharacter'. + */ + public java.lang.String getDisplayCharacter() + { + return this._displayCharacter; + } + + /** + * Returns the value of field 'position'. + * + * @return the value of field 'Position'. + */ + public int getPosition() + { + return this._position; + } + + /** + * Returns the value of field 'secondaryStructure'. + * + * @return the value of field 'SecondaryStructure'. + */ + public java.lang.String getSecondaryStructure() + { + return this._secondaryStructure; + } + + /** + * Returns the value of field 'value'. + * + * @return the value of field 'Value'. + */ + public float getValue() + { + return this._value; + } + + /** + * Method hasColour. + * + * @return true if at least one Colour has been added + */ + public boolean hasColour() + { + return this._has_colour; + } + + /** + * Method hasPosition. + * + * @return true if at least one Position has been added + */ + public boolean hasPosition() + { + return this._has_position; + } + + /** + * Method hasValue. + * + * @return true if at least one Value has been added + */ + public boolean hasValue() + { + return this._has_value; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'colour'. + * + * @param colour + * the value of field 'colour'. + */ + public void setColour(final int colour) + { + this._colour = colour; + this._has_colour = true; + } + + /** + * Sets the value of field 'description'. + * + * @param description + * the value of field 'description'. + */ + public void setDescription(final java.lang.String description) + { + this._description = description; + } + + /** + * Sets the value of field 'displayCharacter'. + * + * @param displayCharacter + * the value of field 'displayCharacter' + */ + public void setDisplayCharacter(final java.lang.String displayCharacter) + { + this._displayCharacter = displayCharacter; + } + + /** + * Sets the value of field 'position'. + * + * @param position + * the value of field 'position'. + */ + public void setPosition(final int position) + { + this._position = position; + this._has_position = true; + } + + /** + * Sets the value of field 'secondaryStructure'. + * + * @param secondaryStructure + * the value of field 'secondaryStructure'. + */ + public void setSecondaryStructure( + final java.lang.String secondaryStructure) + { + this._secondaryStructure = secondaryStructure; + } + + /** + * Sets the value of field 'value'. + * + * @param value + * the value of field 'value'. + */ + public void setValue(final float value) + { + this._value = value; + this._has_value = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.schemabinding.version2.AnnotationElement + */ + public static jalview.schemabinding.version2.AnnotationElement unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.AnnotationElement) Unmarshaller + .unmarshal( + jalview.schemabinding.version2.AnnotationElement.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/CalcIdParam.java b/src/jalview/schemabinding/version2/CalcIdParam.java index cae3ec2..57d6986 100644 --- a/src/jalview/schemabinding/version2/CalcIdParam.java +++ b/src/jalview/schemabinding/version2/CalcIdParam.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,282 +19,282 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class CalcIdParam extends WebServiceParameterSet -implements java.io.Serializable +public class CalcIdParam extends WebServiceParameterSet implements + java.io.Serializable { - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * handle for the calculation which uses - * this parameter set - * - */ - private java.lang.String _calcId; - - /** - * should the calculation be performed - * immediately after loading in order to refresh results - * - */ - private boolean _needsUpdate = false; - - /** - * keeps track of state for field: _needsUpdate - */ - private boolean _has_needsUpdate; - - /** - * should the calculation be automatically - * performed on edits - * + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * handle for the calculation which uses this parameter set + * + */ + private java.lang.String _calcId; + + /** + * should the calculation be performed immediately after loading in order to + * refresh results + * + */ + private boolean _needsUpdate = false; + + /** + * keeps track of state for field: _needsUpdate + */ + private boolean _has_needsUpdate; + + /** + * should the calculation be automatically performed on edits + * + */ + private boolean _autoUpdate; + + /** + * keeps track of state for field: _autoUpdate + */ + private boolean _has_autoUpdate; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public CalcIdParam() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** */ - private boolean _autoUpdate; - - /** - * keeps track of state for field: _autoUpdate - */ - private boolean _has_autoUpdate; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public CalcIdParam() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deleteAutoUpdate( - ) { - this._has_autoUpdate= false; - } - - /** - */ - public void deleteNeedsUpdate( - ) { - this._has_needsUpdate= false; - } - - /** - * Returns the value of field 'autoUpdate'. The field - * 'autoUpdate' has the following description: should the - * calculation be automatically - * performed on edits - * - * - * @return the value of field 'AutoUpdate'. - */ - public boolean getAutoUpdate( - ) { - return this._autoUpdate; - } - - /** - * Returns the value of field 'calcId'. The field 'calcId' has - * the following description: handle for the calculation which - * uses - * this parameter set - * - * - * @return the value of field 'CalcId'. - */ - public java.lang.String getCalcId( - ) { - return this._calcId; - } - - /** - * Returns the value of field 'needsUpdate'. The field - * 'needsUpdate' has the following description: should the - * calculation be performed - * immediately after loading in order to refresh results - * - * - * @return the value of field 'NeedsUpdate'. - */ - public boolean getNeedsUpdate( - ) { - return this._needsUpdate; - } - - /** - * Method hasAutoUpdate. - * - * @return true if at least one AutoUpdate has been added - */ - public boolean hasAutoUpdate( - ) { - return this._has_autoUpdate; - } - - /** - * Method hasNeedsUpdate. - * - * @return true if at least one NeedsUpdate has been added - */ - public boolean hasNeedsUpdate( - ) { - return this._has_needsUpdate; - } - - /** - * Returns the value of field 'autoUpdate'. The field - * 'autoUpdate' has the following description: should the - * calculation be automatically - * performed on edits - * - * - * @return the value of field 'AutoUpdate'. - */ - public boolean isAutoUpdate( - ) { - return this._autoUpdate; - } - - /** - * Returns the value of field 'needsUpdate'. The field - * 'needsUpdate' has the following description: should the - * calculation be performed - * immediately after loading in order to refresh results - * - * - * @return the value of field 'NeedsUpdate'. - */ - public boolean isNeedsUpdate( - ) { - return this._needsUpdate; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'autoUpdate'. The field 'autoUpdate' - * has the following description: should the calculation be - * automatically - * performed on edits - * - * - * @param autoUpdate the value of field 'autoUpdate'. - */ - public void setAutoUpdate( - final boolean autoUpdate) { - this._autoUpdate = autoUpdate; - this._has_autoUpdate = true; - } - - /** - * Sets the value of field 'calcId'. The field 'calcId' has the - * following description: handle for the calculation which uses - * this parameter set - * - * - * @param calcId the value of field 'calcId'. - */ - public void setCalcId( - final java.lang.String calcId) { - this._calcId = calcId; - } - - /** - * Sets the value of field 'needsUpdate'. The field - * 'needsUpdate' has the following description: should the - * calculation be performed - * immediately after loading in order to refresh results - * - * - * @param needsUpdate the value of field 'needsUpdate'. - */ - public void setNeedsUpdate( - final boolean needsUpdate) { - this._needsUpdate = needsUpdate; - this._has_needsUpdate = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled - * jalview.schemabinding.version2.CalcIdParam - */ - public static jalview.schemabinding.version2.CalcIdParam unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.CalcIdParam) Unmarshaller.unmarshal(jalview.schemabinding.version2.CalcIdParam.class, reader); - } + public void deleteAutoUpdate() + { + this._has_autoUpdate = false; + } - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema + /** */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); + public void deleteNeedsUpdate() + { + this._has_needsUpdate = false; + } + + /** + * Returns the value of field 'autoUpdate'. The field 'autoUpdate' has the + * following description: should the calculation be automatically performed on + * edits + * + * + * @return the value of field 'AutoUpdate'. + */ + public boolean getAutoUpdate() + { + return this._autoUpdate; + } + + /** + * Returns the value of field 'calcId'. The field 'calcId' has the following + * description: handle for the calculation which uses this parameter set + * + * + * @return the value of field 'CalcId'. + */ + public java.lang.String getCalcId() + { + return this._calcId; + } + + /** + * Returns the value of field 'needsUpdate'. The field 'needsUpdate' has the + * following description: should the calculation be performed immediately + * after loading in order to refresh results + * + * + * @return the value of field 'NeedsUpdate'. + */ + public boolean getNeedsUpdate() + { + return this._needsUpdate; + } + + /** + * Method hasAutoUpdate. + * + * @return true if at least one AutoUpdate has been added + */ + public boolean hasAutoUpdate() + { + return this._has_autoUpdate; + } + + /** + * Method hasNeedsUpdate. + * + * @return true if at least one NeedsUpdate has been added + */ + public boolean hasNeedsUpdate() + { + return this._has_needsUpdate; + } + + /** + * Returns the value of field 'autoUpdate'. The field 'autoUpdate' has the + * following description: should the calculation be automatically performed on + * edits + * + * + * @return the value of field 'AutoUpdate'. + */ + public boolean isAutoUpdate() + { + return this._autoUpdate; + } + + /** + * Returns the value of field 'needsUpdate'. The field 'needsUpdate' has the + * following description: should the calculation be performed immediately + * after loading in order to refresh results + * + * + * @return the value of field 'NeedsUpdate'. + */ + public boolean isNeedsUpdate() + { + return this._needsUpdate; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'autoUpdate'. The field 'autoUpdate' has the + * following description: should the calculation be automatically performed on + * edits + * + * + * @param autoUpdate + * the value of field 'autoUpdate'. + */ + public void setAutoUpdate(final boolean autoUpdate) + { + this._autoUpdate = autoUpdate; + this._has_autoUpdate = true; + } + + /** + * Sets the value of field 'calcId'. The field 'calcId' has the following + * description: handle for the calculation which uses this parameter set + * + * + * @param calcId + * the value of field 'calcId'. + */ + public void setCalcId(final java.lang.String calcId) + { + this._calcId = calcId; + } + + /** + * Sets the value of field 'needsUpdate'. The field 'needsUpdate' has the + * following description: should the calculation be performed immediately + * after loading in order to refresh results + * + * + * @param needsUpdate + * the value of field 'needsUpdate'. + */ + public void setNeedsUpdate(final boolean needsUpdate) + { + this._needsUpdate = needsUpdate; + this._has_needsUpdate = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.schemabinding.version2.CalcIdParam + */ + public static jalview.schemabinding.version2.CalcIdParam unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.CalcIdParam) Unmarshaller + .unmarshal(jalview.schemabinding.version2.CalcIdParam.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/Colour.java b/src/jalview/schemabinding/version2/Colour.java index d64263d..9d5a916 100644 --- a/src/jalview/schemabinding/version2/Colour.java +++ b/src/jalview/schemabinding/version2/Colour.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,465 +19,481 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Colour implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _name. - */ - private java.lang.String _name; - - /** - * Field _RGB. - */ - private java.lang.String _RGB; - - /** - * Field _minRGB. - */ - private java.lang.String _minRGB; - - /** - * loosely specified enumeration: NONE,ABOVE, or BELOW - */ - private java.lang.String _threshType; - - /** - * Field _threshold. - */ - private float _threshold; - - /** - * keeps track of state for field: _threshold - */ - private boolean _has_threshold; - - /** - * Field _max. - */ - private float _max; - - /** - * keeps track of state for field: _max - */ - private boolean _has_max; - - /** - * Field _min. - */ - private float _min; - - /** - * keeps track of state for field: _min - */ - private boolean _has_min; - - /** - * Field _colourByLabel. - */ - private boolean _colourByLabel; - - /** - * keeps track of state for field: _colourByLabel - */ - private boolean _has_colourByLabel; - - /** - * Field _autoScale. - */ - private boolean _autoScale; - - /** - * keeps track of state for field: _autoScale - */ - private boolean _has_autoScale; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Colour() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deleteAutoScale( - ) { - this._has_autoScale= false; - } - - /** - */ - public void deleteColourByLabel( - ) { - this._has_colourByLabel= false; - } - - /** - */ - public void deleteMax( - ) { - this._has_max= false; - } - - /** - */ - public void deleteMin( - ) { - this._has_min= false; - } - - /** - */ - public void deleteThreshold( - ) { - this._has_threshold= false; - } - - /** - * Returns the value of field 'autoScale'. - * - * @return the value of field 'AutoScale'. - */ - public boolean getAutoScale( - ) { - return this._autoScale; - } - - /** - * Returns the value of field 'colourByLabel'. - * - * @return the value of field 'ColourByLabel'. - */ - public boolean getColourByLabel( - ) { - return this._colourByLabel; - } - - /** - * Returns the value of field 'max'. - * - * @return the value of field 'Max'. - */ - public float getMax( - ) { - return this._max; - } - - /** - * Returns the value of field 'min'. - * - * @return the value of field 'Min'. - */ - public float getMin( - ) { - return this._min; - } - - /** - * Returns the value of field 'minRGB'. - * - * @return the value of field 'MinRGB'. - */ - public java.lang.String getMinRGB( - ) { - return this._minRGB; - } - - /** - * Returns the value of field 'name'. - * - * @return the value of field 'Name'. - */ - public java.lang.String getName( - ) { - return this._name; - } - - /** - * Returns the value of field 'RGB'. - * - * @return the value of field 'RGB'. - */ - public java.lang.String getRGB( - ) { - return this._RGB; - } - - /** - * Returns the value of field 'threshType'. The field - * 'threshType' has the following description: loosely - * specified enumeration: NONE,ABOVE, or BELOW - * - * @return the value of field 'ThreshType'. - */ - public java.lang.String getThreshType( - ) { - return this._threshType; - } - - /** - * Returns the value of field 'threshold'. - * - * @return the value of field 'Threshold'. - */ - public float getThreshold( - ) { - return this._threshold; - } - - /** - * Method hasAutoScale. - * - * @return true if at least one AutoScale has been added - */ - public boolean hasAutoScale( - ) { - return this._has_autoScale; - } - - /** - * Method hasColourByLabel. - * - * @return true if at least one ColourByLabel has been added - */ - public boolean hasColourByLabel( - ) { - return this._has_colourByLabel; - } - - /** - * Method hasMax. - * - * @return true if at least one Max has been added - */ - public boolean hasMax( - ) { - return this._has_max; - } - - /** - * Method hasMin. - * - * @return true if at least one Min has been added - */ - public boolean hasMin( - ) { - return this._has_min; - } - - /** - * Method hasThreshold. - * - * @return true if at least one Threshold has been added - */ - public boolean hasThreshold( - ) { - return this._has_threshold; - } - - /** - * Returns the value of field 'autoScale'. - * - * @return the value of field 'AutoScale'. - */ - public boolean isAutoScale( - ) { - return this._autoScale; - } - - /** - * Returns the value of field 'colourByLabel'. - * - * @return the value of field 'ColourByLabel'. - */ - public boolean isColourByLabel( - ) { - return this._colourByLabel; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'autoScale'. - * - * @param autoScale the value of field 'autoScale'. - */ - public void setAutoScale( - final boolean autoScale) { - this._autoScale = autoScale; - this._has_autoScale = true; - } - - /** - * Sets the value of field 'colourByLabel'. - * - * @param colourByLabel the value of field 'colourByLabel'. - */ - public void setColourByLabel( - final boolean colourByLabel) { - this._colourByLabel = colourByLabel; - this._has_colourByLabel = true; - } - - /** - * Sets the value of field 'max'. - * - * @param max the value of field 'max'. - */ - public void setMax( - final float max) { - this._max = max; - this._has_max = true; - } - - /** - * Sets the value of field 'min'. - * - * @param min the value of field 'min'. - */ - public void setMin( - final float min) { - this._min = min; - this._has_min = true; - } - - /** - * Sets the value of field 'minRGB'. - * - * @param minRGB the value of field 'minRGB'. - */ - public void setMinRGB( - final java.lang.String minRGB) { - this._minRGB = minRGB; - } - - /** - * Sets the value of field 'name'. - * - * @param name the value of field 'name'. - */ - public void setName( - final java.lang.String name) { - this._name = name; - } - - /** - * Sets the value of field 'RGB'. - * - * @param RGB the value of field 'RGB'. - */ - public void setRGB( - final java.lang.String RGB) { - this._RGB = RGB; - } - - /** - * Sets the value of field 'threshType'. The field 'threshType' - * has the following description: loosely specified - * enumeration: NONE,ABOVE, or BELOW - * - * @param threshType the value of field 'threshType'. - */ - public void setThreshType( - final java.lang.String threshType) { - this._threshType = threshType; - } - - /** - * Sets the value of field 'threshold'. - * - * @param threshold the value of field 'threshold'. - */ - public void setThreshold( - final float threshold) { - this._threshold = threshold; - this._has_threshold = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled jalview.schemabinding.version2.Colour - */ - public static jalview.schemabinding.version2.Colour unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.Colour) Unmarshaller.unmarshal(jalview.schemabinding.version2.Colour.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class Colour implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _name. + */ + private java.lang.String _name; + + /** + * Field _RGB. + */ + private java.lang.String _RGB; + + /** + * Field _minRGB. + */ + private java.lang.String _minRGB; + + /** + * loosely specified enumeration: NONE,ABOVE, or BELOW + */ + private java.lang.String _threshType; + + /** + * Field _threshold. + */ + private float _threshold; + + /** + * keeps track of state for field: _threshold + */ + private boolean _has_threshold; + + /** + * Field _max. + */ + private float _max; + + /** + * keeps track of state for field: _max + */ + private boolean _has_max; + + /** + * Field _min. + */ + private float _min; + + /** + * keeps track of state for field: _min + */ + private boolean _has_min; + + /** + * Field _colourByLabel. + */ + private boolean _colourByLabel; + + /** + * keeps track of state for field: _colourByLabel + */ + private boolean _has_colourByLabel; + + /** + * Field _autoScale. + */ + private boolean _autoScale; + + /** + * keeps track of state for field: _autoScale + */ + private boolean _has_autoScale; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Colour() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + */ + public void deleteAutoScale() + { + this._has_autoScale = false; + } + + /** + */ + public void deleteColourByLabel() + { + this._has_colourByLabel = false; + } + + /** + */ + public void deleteMax() + { + this._has_max = false; + } + + /** + */ + public void deleteMin() + { + this._has_min = false; + } + + /** + */ + public void deleteThreshold() + { + this._has_threshold = false; + } + + /** + * Returns the value of field 'autoScale'. + * + * @return the value of field 'AutoScale'. + */ + public boolean getAutoScale() + { + return this._autoScale; + } + + /** + * Returns the value of field 'colourByLabel'. + * + * @return the value of field 'ColourByLabel'. + */ + public boolean getColourByLabel() + { + return this._colourByLabel; + } + + /** + * Returns the value of field 'max'. + * + * @return the value of field 'Max'. + */ + public float getMax() + { + return this._max; + } + + /** + * Returns the value of field 'min'. + * + * @return the value of field 'Min'. + */ + public float getMin() + { + return this._min; + } + + /** + * Returns the value of field 'minRGB'. + * + * @return the value of field 'MinRGB'. + */ + public java.lang.String getMinRGB() + { + return this._minRGB; + } + + /** + * Returns the value of field 'name'. + * + * @return the value of field 'Name'. + */ + public java.lang.String getName() + { + return this._name; + } + + /** + * Returns the value of field 'RGB'. + * + * @return the value of field 'RGB'. + */ + public java.lang.String getRGB() + { + return this._RGB; + } + + /** + * Returns the value of field 'threshType'. The field 'threshType' has the + * following description: loosely specified enumeration: NONE,ABOVE, or BELOW + * + * @return the value of field 'ThreshType'. + */ + public java.lang.String getThreshType() + { + return this._threshType; + } + + /** + * Returns the value of field 'threshold'. + * + * @return the value of field 'Threshold'. + */ + public float getThreshold() + { + return this._threshold; + } + + /** + * Method hasAutoScale. + * + * @return true if at least one AutoScale has been added + */ + public boolean hasAutoScale() + { + return this._has_autoScale; + } + + /** + * Method hasColourByLabel. + * + * @return true if at least one ColourByLabel has been added + */ + public boolean hasColourByLabel() + { + return this._has_colourByLabel; + } + + /** + * Method hasMax. + * + * @return true if at least one Max has been added + */ + public boolean hasMax() + { + return this._has_max; + } + + /** + * Method hasMin. + * + * @return true if at least one Min has been added + */ + public boolean hasMin() + { + return this._has_min; + } + + /** + * Method hasThreshold. + * + * @return true if at least one Threshold has been added + */ + public boolean hasThreshold() + { + return this._has_threshold; + } + + /** + * Returns the value of field 'autoScale'. + * + * @return the value of field 'AutoScale'. + */ + public boolean isAutoScale() + { + return this._autoScale; + } + + /** + * Returns the value of field 'colourByLabel'. + * + * @return the value of field 'ColourByLabel'. + */ + public boolean isColourByLabel() + { + return this._colourByLabel; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; + } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'autoScale'. + * + * @param autoScale + * the value of field 'autoScale'. + */ + public void setAutoScale(final boolean autoScale) + { + this._autoScale = autoScale; + this._has_autoScale = true; + } + + /** + * Sets the value of field 'colourByLabel'. + * + * @param colourByLabel + * the value of field 'colourByLabel'. + */ + public void setColourByLabel(final boolean colourByLabel) + { + this._colourByLabel = colourByLabel; + this._has_colourByLabel = true; + } + + /** + * Sets the value of field 'max'. + * + * @param max + * the value of field 'max'. + */ + public void setMax(final float max) + { + this._max = max; + this._has_max = true; + } + + /** + * Sets the value of field 'min'. + * + * @param min + * the value of field 'min'. + */ + public void setMin(final float min) + { + this._min = min; + this._has_min = true; + } + + /** + * Sets the value of field 'minRGB'. + * + * @param minRGB + * the value of field 'minRGB'. + */ + public void setMinRGB(final java.lang.String minRGB) + { + this._minRGB = minRGB; + } + + /** + * Sets the value of field 'name'. + * + * @param name + * the value of field 'name'. + */ + public void setName(final java.lang.String name) + { + this._name = name; + } + + /** + * Sets the value of field 'RGB'. + * + * @param RGB + * the value of field 'RGB'. + */ + public void setRGB(final java.lang.String RGB) + { + this._RGB = RGB; + } + + /** + * Sets the value of field 'threshType'. The field 'threshType' has the + * following description: loosely specified enumeration: NONE,ABOVE, or BELOW + * + * @param threshType + * the value of field 'threshType'. + */ + public void setThreshType(final java.lang.String threshType) + { + this._threshType = threshType; + } + + /** + * Sets the value of field 'threshold'. + * + * @param threshold + * the value of field 'threshold'. + */ + public void setThreshold(final float threshold) + { + this._threshold = threshold; + this._has_threshold = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.schemabinding.version2.Colour + */ + public static jalview.schemabinding.version2.Colour unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Colour) Unmarshaller.unmarshal( + jalview.schemabinding.version2.Colour.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/DBRef.java b/src/jalview/schemabinding/version2/DBRef.java index 3917e13..85997ff 100644 --- a/src/jalview/schemabinding/version2/DBRef.java +++ b/src/jalview/schemabinding/version2/DBRef.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,201 +19,215 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class DBRef implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _source. - */ - private java.lang.String _source; - - /** - * Field _version. - */ - private java.lang.String _version; - - /** - * Field _accessionId. - */ - private java.lang.String _accessionId; - - /** - * Field _mapping. - */ - private jalview.schemabinding.version2.Mapping _mapping; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public DBRef() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Returns the value of field 'accessionId'. - * - * @return the value of field 'AccessionId'. - */ - public java.lang.String getAccessionId( - ) { - return this._accessionId; - } - - /** - * Returns the value of field 'mapping'. - * - * @return the value of field 'Mapping'. - */ - public jalview.schemabinding.version2.Mapping getMapping( - ) { - return this._mapping; - } - - /** - * Returns the value of field 'source'. - * - * @return the value of field 'Source'. - */ - public java.lang.String getSource( - ) { - return this._source; - } - - /** - * Returns the value of field 'version'. - * - * @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; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'accessionId'. - * - * @param accessionId the value of field 'accessionId'. - */ - public void setAccessionId( - final java.lang.String accessionId) { - this._accessionId = accessionId; - } - - /** - * Sets the value of field 'mapping'. - * - * @param mapping the value of field 'mapping'. - */ - public void setMapping( - final jalview.schemabinding.version2.Mapping mapping) { - this._mapping = mapping; - } - - /** - * Sets the value of field 'source'. - * - * @param source the value of field 'source'. - */ - public void setSource( - final java.lang.String source) { - this._source = source; - } - - /** - * Sets the value of field 'version'. - * - * @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.DBRef - */ - public static jalview.schemabinding.version2.DBRef unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.DBRef) Unmarshaller.unmarshal(jalview.schemabinding.version2.DBRef.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); +public class DBRef implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _source. + */ + private java.lang.String _source; + + /** + * Field _version. + */ + private java.lang.String _version; + + /** + * Field _accessionId. + */ + private java.lang.String _accessionId; + + /** + * Field _mapping. + */ + private jalview.schemabinding.version2.Mapping _mapping; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public DBRef() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Returns the value of field 'accessionId'. + * + * @return the value of field 'AccessionId'. + */ + public java.lang.String getAccessionId() + { + return this._accessionId; + } + + /** + * Returns the value of field 'mapping'. + * + * @return the value of field 'Mapping'. + */ + public jalview.schemabinding.version2.Mapping getMapping() + { + return this._mapping; + } + + /** + * Returns the value of field 'source'. + * + * @return the value of field 'Source'. + */ + public java.lang.String getSource() + { + return this._source; + } + + /** + * Returns the value of field 'version'. + * + * @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; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'accessionId'. + * + * @param accessionId + * the value of field 'accessionId'. + */ + public void setAccessionId(final java.lang.String accessionId) + { + this._accessionId = accessionId; + } + + /** + * Sets the value of field 'mapping'. + * + * @param mapping + * the value of field 'mapping'. + */ + public void setMapping( + final jalview.schemabinding.version2.Mapping mapping) + { + this._mapping = mapping; + } + + /** + * Sets the value of field 'source'. + * + * @param source + * the value of field 'source'. + */ + public void setSource(final java.lang.String source) + { + this._source = source; + } + + /** + * Sets the value of field 'version'. + * + * @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.DBRef + */ + public static jalview.schemabinding.version2.DBRef unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.DBRef) Unmarshaller.unmarshal( + jalview.schemabinding.version2.DBRef.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/Feature.java b/src/jalview/schemabinding/version2/Feature.java index c1bbb25..9e484d5 100644 --- a/src/jalview/schemabinding/version2/Feature.java +++ b/src/jalview/schemabinding/version2/Feature.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,501 +19,530 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Feature implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _begin. - */ - private int _begin; - - /** - * keeps track of state for field: _begin - */ - private boolean _has_begin; - - /** - * Field _end. - */ - private int _end; - - /** - * keeps track of state for field: _end - */ - private boolean _has_end; - - /** - * Field _type. - */ - private java.lang.String _type; - - /** - * Field _description. - */ - private java.lang.String _description; - - /** - * Field _status. - */ - private java.lang.String _status; - - /** - * Field _featureGroup. - */ - private java.lang.String _featureGroup; - - /** - * Field _score. - */ - private float _score; - - /** - * keeps track of state for field: _score - */ - private boolean _has_score; - - /** - * Field _otherDataList. - */ - private java.util.Vector _otherDataList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Feature() { - super(); - this._otherDataList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vOtherData - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addOtherData( - final jalview.schemabinding.version2.OtherData vOtherData) - throws java.lang.IndexOutOfBoundsException { - this._otherDataList.addElement(vOtherData); - } - - /** - * - * - * @param index - * @param vOtherData - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addOtherData( - final int index, - final jalview.schemabinding.version2.OtherData vOtherData) - throws java.lang.IndexOutOfBoundsException { - this._otherDataList.add(index, vOtherData); - } - - /** - */ - public void deleteBegin( - ) { - this._has_begin= false; - } - - /** - */ - public void deleteEnd( - ) { - this._has_end= false; - } - - /** - */ - public void deleteScore( - ) { - this._has_score= false; - } - - /** - * Method enumerateOtherData. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.OtherData elements - */ - public java.util.Enumeration enumerateOtherData( - ) { - return this._otherDataList.elements(); - } - - /** - * Returns the value of field 'begin'. - * - * @return the value of field 'Begin'. - */ - public int getBegin( - ) { - return this._begin; - } - - /** - * Returns the value of field 'description'. - * - * @return the value of field 'Description'. - */ - public java.lang.String getDescription( - ) { - return this._description; - } - - /** - * Returns the value of field 'end'. - * - * @return the value of field 'End'. - */ - public int getEnd( - ) { - return this._end; - } - - /** - * Returns the value of field 'featureGroup'. - * - * @return the value of field 'FeatureGroup'. - */ - public java.lang.String getFeatureGroup( - ) { - return this._featureGroup; - } - - /** - * Method getOtherData. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.OtherData at the given index - */ - public jalview.schemabinding.version2.OtherData getOtherData( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._otherDataList.size()) { - throw new IndexOutOfBoundsException("getOtherData: Index value '" + index + "' not in range [0.." + (this._otherDataList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.OtherData) _otherDataList.get(index); - } - - /** - * Method getOtherData.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 jalview.schemabinding.version2.OtherData[] getOtherData( - ) { - jalview.schemabinding.version2.OtherData[] array = new jalview.schemabinding.version2.OtherData[0]; - return (jalview.schemabinding.version2.OtherData[]) this._otherDataList.toArray(array); - } - - /** - * Method getOtherDataCount. - * - * @return the size of this collection - */ - public int getOtherDataCount( - ) { - return this._otherDataList.size(); - } - - /** - * Returns the value of field 'score'. - * - * @return the value of field 'Score'. - */ - public float getScore( - ) { - return this._score; - } - - /** - * Returns the value of field 'status'. - * - * @return the value of field 'Status'. - */ - public java.lang.String getStatus( - ) { - return this._status; - } - - /** - * Returns the value of field 'type'. - * - * @return the value of field 'Type'. - */ - public java.lang.String getType( - ) { - return this._type; - } - - /** - * Method hasBegin. - * - * @return true if at least one Begin has been added - */ - public boolean hasBegin( - ) { - return this._has_begin; - } - - /** - * Method hasEnd. - * - * @return true if at least one End has been added - */ - public boolean hasEnd( - ) { - return this._has_end; - } - - /** - * Method hasScore. - * - * @return true if at least one Score has been added - */ - public boolean hasScore( - ) { - return this._has_score; - } - - /** - * 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 removeAllOtherData( - ) { - this._otherDataList.clear(); - } - - /** - * Method removeOtherData. - * - * @param vOtherData - * @return true if the object was removed from the collection. - */ - public boolean removeOtherData( - final jalview.schemabinding.version2.OtherData vOtherData) { - boolean removed = _otherDataList.remove(vOtherData); - return removed; - } - - /** - * Method removeOtherDataAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.OtherData removeOtherDataAt( - final int index) { - java.lang.Object obj = this._otherDataList.remove(index); - return (jalview.schemabinding.version2.OtherData) obj; - } - - /** - * Sets the value of field 'begin'. - * - * @param begin the value of field 'begin'. - */ - public void setBegin( - final int begin) { - this._begin = begin; - this._has_begin = true; - } - - /** - * Sets the value of field 'description'. - * - * @param description the value of field 'description'. - */ - public void setDescription( - final java.lang.String description) { - this._description = description; - } - - /** - * Sets the value of field 'end'. - * - * @param end the value of field 'end'. - */ - public void setEnd( - final int end) { - this._end = end; - this._has_end = true; - } - - /** - * Sets the value of field 'featureGroup'. - * - * @param featureGroup the value of field 'featureGroup'. - */ - public void setFeatureGroup( - final java.lang.String featureGroup) { - this._featureGroup = featureGroup; - } - - /** - * - * - * @param index - * @param vOtherData - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setOtherData( - final int index, - final jalview.schemabinding.version2.OtherData vOtherData) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._otherDataList.size()) { - throw new IndexOutOfBoundsException("setOtherData: Index value '" + index + "' not in range [0.." + (this._otherDataList.size() - 1) + "]"); - } - - this._otherDataList.set(index, vOtherData); - } - - /** - * - * - * @param vOtherDataArray - */ - public void setOtherData( - final jalview.schemabinding.version2.OtherData[] vOtherDataArray) { - //-- copy array - _otherDataList.clear(); - - for (int i = 0; i < vOtherDataArray.length; i++) { - this._otherDataList.add(vOtherDataArray[i]); - } - } - - /** - * Sets the value of field 'score'. - * - * @param score the value of field 'score'. - */ - public void setScore( - final float score) { - this._score = score; - this._has_score = true; - } - - /** - * Sets the value of field 'status'. - * - * @param status the value of field 'status'. - */ - public void setStatus( - final java.lang.String status) { - this._status = status; - } - - /** - * Sets the value of field 'type'. - * - * @param type the value of field 'type'. - */ - public void setType( - final java.lang.String type) { - this._type = type; - } - - /** - * 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.Featur - */ - public static jalview.schemabinding.version2.Feature unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.Feature) Unmarshaller.unmarshal(jalview.schemabinding.version2.Feature.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class Feature implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _begin. + */ + private int _begin; + + /** + * keeps track of state for field: _begin + */ + private boolean _has_begin; + + /** + * Field _end. + */ + private int _end; + + /** + * keeps track of state for field: _end + */ + private boolean _has_end; + + /** + * Field _type. + */ + private java.lang.String _type; + + /** + * Field _description. + */ + private java.lang.String _description; + + /** + * Field _status. + */ + private java.lang.String _status; + + /** + * Field _featureGroup. + */ + private java.lang.String _featureGroup; + + /** + * Field _score. + */ + private float _score; + + /** + * keeps track of state for field: _score + */ + private boolean _has_score; + + /** + * Field _otherDataList. + */ + private java.util.Vector _otherDataList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Feature() + { + super(); + this._otherDataList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vOtherData + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addOtherData( + final jalview.schemabinding.version2.OtherData vOtherData) + throws java.lang.IndexOutOfBoundsException + { + this._otherDataList.addElement(vOtherData); + } + + /** + * + * + * @param index + * @param vOtherData + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addOtherData(final int index, + final jalview.schemabinding.version2.OtherData vOtherData) + throws java.lang.IndexOutOfBoundsException + { + this._otherDataList.add(index, vOtherData); + } + + /** + */ + public void deleteBegin() + { + this._has_begin = false; + } + + /** + */ + public void deleteEnd() + { + this._has_end = false; + } + + /** + */ + public void deleteScore() + { + this._has_score = false; + } + + /** + * Method enumerateOtherData. + * + * @return an Enumeration over all jalview.schemabinding.version2.OtherData + * elements + */ + public java.util.Enumeration enumerateOtherData() + { + return this._otherDataList.elements(); + } + + /** + * Returns the value of field 'begin'. + * + * @return the value of field 'Begin'. + */ + public int getBegin() + { + return this._begin; + } + + /** + * Returns the value of field 'description'. + * + * @return the value of field 'Description'. + */ + public java.lang.String getDescription() + { + return this._description; + } + + /** + * Returns the value of field 'end'. + * + * @return the value of field 'End'. + */ + public int getEnd() + { + return this._end; + } + + /** + * Returns the value of field 'featureGroup'. + * + * @return the value of field 'FeatureGroup'. + */ + public java.lang.String getFeatureGroup() + { + return this._featureGroup; + } + + /** + * Method getOtherData. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.OtherData at the + * given index + */ + public jalview.schemabinding.version2.OtherData getOtherData( + final int index) throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._otherDataList.size()) + { + throw new IndexOutOfBoundsException("getOtherData: Index value '" + + index + "' not in range [0.." + + (this._otherDataList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.OtherData) _otherDataList + .get(index); + } + + /** + * Method getOtherData.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 jalview.schemabinding.version2.OtherData[] getOtherData() + { + jalview.schemabinding.version2.OtherData[] array = new jalview.schemabinding.version2.OtherData[0]; + return (jalview.schemabinding.version2.OtherData[]) this._otherDataList + .toArray(array); + } + + /** + * Method getOtherDataCount. + * + * @return the size of this collection + */ + public int getOtherDataCount() + { + return this._otherDataList.size(); + } + + /** + * Returns the value of field 'score'. + * + * @return the value of field 'Score'. + */ + public float getScore() + { + return this._score; + } + + /** + * Returns the value of field 'status'. + * + * @return the value of field 'Status'. + */ + public java.lang.String getStatus() + { + return this._status; + } + + /** + * Returns the value of field 'type'. + * + * @return the value of field 'Type'. + */ + public java.lang.String getType() + { + return this._type; + } + + /** + * Method hasBegin. + * + * @return true if at least one Begin has been added + */ + public boolean hasBegin() + { + return this._has_begin; + } + + /** + * Method hasEnd. + * + * @return true if at least one End has been added + */ + public boolean hasEnd() + { + return this._has_end; + } + + /** + * Method hasScore. + * + * @return true if at least one Score has been added + */ + public boolean hasScore() + { + return this._has_score; + } + + /** + * 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 removeAllOtherData() + { + this._otherDataList.clear(); + } + + /** + * Method removeOtherData. + * + * @param vOtherData + * @return true if the object was removed from the collection. + */ + public boolean removeOtherData( + final jalview.schemabinding.version2.OtherData vOtherData) + { + boolean removed = _otherDataList.remove(vOtherData); + return removed; + } + + /** + * Method removeOtherDataAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.OtherData removeOtherDataAt( + final int index) + { + java.lang.Object obj = this._otherDataList.remove(index); + return (jalview.schemabinding.version2.OtherData) obj; + } + + /** + * Sets the value of field 'begin'. + * + * @param begin + * the value of field 'begin'. + */ + public void setBegin(final int begin) + { + this._begin = begin; + this._has_begin = true; + } + + /** + * Sets the value of field 'description'. + * + * @param description + * the value of field 'description'. + */ + public void setDescription(final java.lang.String description) + { + this._description = description; + } + + /** + * Sets the value of field 'end'. + * + * @param end + * the value of field 'end'. + */ + public void setEnd(final int end) + { + this._end = end; + this._has_end = true; + } + + /** + * Sets the value of field 'featureGroup'. + * + * @param featureGroup + * the value of field 'featureGroup'. + */ + public void setFeatureGroup(final java.lang.String featureGroup) + { + this._featureGroup = featureGroup; + } + + /** + * + * + * @param index + * @param vOtherData + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setOtherData(final int index, + final jalview.schemabinding.version2.OtherData vOtherData) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._otherDataList.size()) + { + throw new IndexOutOfBoundsException("setOtherData: Index value '" + + index + "' not in range [0.." + + (this._otherDataList.size() - 1) + "]"); + } + + this._otherDataList.set(index, vOtherData); + } + + /** + * + * + * @param vOtherDataArray + */ + public void setOtherData( + final jalview.schemabinding.version2.OtherData[] vOtherDataArray) + { + // -- copy array + _otherDataList.clear(); + + for (int i = 0; i < vOtherDataArray.length; i++) + { + this._otherDataList.add(vOtherDataArray[i]); + } + } + + /** + * Sets the value of field 'score'. + * + * @param score + * the value of field 'score'. + */ + public void setScore(final float score) + { + this._score = score; + this._has_score = true; + } + + /** + * Sets the value of field 'status'. + * + * @param status + * the value of field 'status'. + */ + public void setStatus(final java.lang.String status) + { + this._status = status; + } + + /** + * Sets the value of field 'type'. + * + * @param type + * the value of field 'type'. + */ + public void setType(final java.lang.String type) + { + this._type = type; + } + + /** + * 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.Featur + */ + public static jalview.schemabinding.version2.Feature unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Feature) Unmarshaller.unmarshal( + jalview.schemabinding.version2.Feature.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/FeatureSettings.java b/src/jalview/schemabinding/version2/FeatureSettings.java index 19c567c..fa75e76 100644 --- a/src/jalview/schemabinding/version2/FeatureSettings.java +++ b/src/jalview/schemabinding/version2/FeatureSettings.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,414 +19,444 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class FeatureSettings implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _settingList. - */ - private java.util.Vector _settingList; - - /** - * Field _groupList. - */ - private java.util.Vector _groupList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public FeatureSettings() { - super(); - this._settingList = new java.util.Vector(); - this._groupList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vGroup - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addGroup( - final jalview.schemabinding.version2.Group vGroup) - throws java.lang.IndexOutOfBoundsException { - this._groupList.addElement(vGroup); - } - - /** - * - * - * @param index - * @param vGroup - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addGroup( - final int index, - final jalview.schemabinding.version2.Group vGroup) - throws java.lang.IndexOutOfBoundsException { - this._groupList.add(index, vGroup); - } - - /** - * - * - * @param vSetting - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSetting( - final jalview.schemabinding.version2.Setting vSetting) - throws java.lang.IndexOutOfBoundsException { - this._settingList.addElement(vSetting); - } - - /** - * - * - * @param index - * @param vSetting - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSetting( - final int index, - final jalview.schemabinding.version2.Setting vSetting) - throws java.lang.IndexOutOfBoundsException { - this._settingList.add(index, vSetting); - } - - /** - * Method enumerateGroup. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.Group elements - */ - public java.util.Enumeration enumerateGroup( - ) { - return this._groupList.elements(); - } - - /** - * Method enumerateSetting. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.Setting elements - */ - public java.util.Enumeration enumerateSetting( - ) { - return this._settingList.elements(); - } - - /** - * Method getGroup. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.Group at the given index - */ - public jalview.schemabinding.version2.Group getGroup( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._groupList.size()) { - throw new IndexOutOfBoundsException("getGroup: Index value '" + index + "' not in range [0.." + (this._groupList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.Group) _groupList.get(index); - } - - /** - * Method getGroup.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 jalview.schemabinding.version2.Group[] getGroup( - ) { - jalview.schemabinding.version2.Group[] array = new jalview.schemabinding.version2.Group[0]; - return (jalview.schemabinding.version2.Group[]) this._groupList.toArray(array); - } - - /** - * Method getGroupCount. - * - * @return the size of this collection - */ - public int getGroupCount( - ) { - return this._groupList.size(); - } - - /** - * Method getSetting. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.Setting at the given index - */ - public jalview.schemabinding.version2.Setting getSetting( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._settingList.size()) { - throw new IndexOutOfBoundsException("getSetting: Index value '" + index + "' not in range [0.." + (this._settingList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.Setting) _settingList.get(index); - } - - /** - * Method getSetting.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 jalview.schemabinding.version2.Setting[] getSetting( - ) { - jalview.schemabinding.version2.Setting[] array = new jalview.schemabinding.version2.Setting[0]; - return (jalview.schemabinding.version2.Setting[]) this._settingList.toArray(array); - } - - /** - * Method getSettingCount. - * - * @return the size of this collection - */ - public int getSettingCount( - ) { - return this._settingList.size(); - } - - /** - * 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 removeAllGroup( - ) { - this._groupList.clear(); +public class FeatureSettings implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _settingList. + */ + private java.util.Vector _settingList; + + /** + * Field _groupList. + */ + private java.util.Vector _groupList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public FeatureSettings() + { + super(); + this._settingList = new java.util.Vector(); + this._groupList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vGroup + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addGroup(final jalview.schemabinding.version2.Group vGroup) + throws java.lang.IndexOutOfBoundsException + { + this._groupList.addElement(vGroup); + } + + /** + * + * + * @param index + * @param vGroup + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addGroup(final int index, + final jalview.schemabinding.version2.Group vGroup) + throws java.lang.IndexOutOfBoundsException + { + this._groupList.add(index, vGroup); + } + + /** + * + * + * @param vSetting + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSetting( + final jalview.schemabinding.version2.Setting vSetting) + throws java.lang.IndexOutOfBoundsException + { + this._settingList.addElement(vSetting); + } + + /** + * + * + * @param index + * @param vSetting + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSetting(final int index, + final jalview.schemabinding.version2.Setting vSetting) + throws java.lang.IndexOutOfBoundsException + { + this._settingList.add(index, vSetting); + } + + /** + * Method enumerateGroup. + * + * @return an Enumeration over all jalview.schemabinding.version2.Group + * elements + */ + public java.util.Enumeration enumerateGroup() + { + return this._groupList.elements(); + } + + /** + * Method enumerateSetting. + * + * @return an Enumeration over all jalview.schemabinding.version2.Setting + * elements + */ + public java.util.Enumeration enumerateSetting() + { + return this._settingList.elements(); + } + + /** + * Method getGroup. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.Group at the given + * index + */ + public jalview.schemabinding.version2.Group getGroup(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._groupList.size()) + { + throw new IndexOutOfBoundsException("getGroup: Index value '" + index + + "' not in range [0.." + (this._groupList.size() - 1) + "]"); } - /** - */ - public void removeAllSetting( - ) { - this._settingList.clear(); - } - - /** - * Method removeGroup. - * - * @param vGroup - * @return true if the object was removed from the collection. - */ - public boolean removeGroup( - final jalview.schemabinding.version2.Group vGroup) { - boolean removed = _groupList.remove(vGroup); - return removed; - } - - /** - * Method removeGroupAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.Group removeGroupAt( - final int index) { - java.lang.Object obj = this._groupList.remove(index); - return (jalview.schemabinding.version2.Group) obj; - } - - /** - * Method removeSetting. - * - * @param vSetting - * @return true if the object was removed from the collection. - */ - public boolean removeSetting( - final jalview.schemabinding.version2.Setting vSetting) { - boolean removed = _settingList.remove(vSetting); - return removed; + return (jalview.schemabinding.version2.Group) _groupList.get(index); + } + + /** + * Method getGroup.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 jalview.schemabinding.version2.Group[] getGroup() + { + jalview.schemabinding.version2.Group[] array = new jalview.schemabinding.version2.Group[0]; + return (jalview.schemabinding.version2.Group[]) this._groupList + .toArray(array); + } + + /** + * Method getGroupCount. + * + * @return the size of this collection + */ + public int getGroupCount() + { + return this._groupList.size(); + } + + /** + * Method getSetting. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.Setting at the + * given index + */ + public jalview.schemabinding.version2.Setting getSetting(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._settingList.size()) + { + throw new IndexOutOfBoundsException("getSetting: Index value '" + + index + "' not in range [0.." + + (this._settingList.size() - 1) + "]"); } - /** - * Method removeSettingAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.Setting removeSettingAt( - final int index) { - java.lang.Object obj = this._settingList.remove(index); - return (jalview.schemabinding.version2.Setting) obj; + return (jalview.schemabinding.version2.Setting) _settingList.get(index); + } + + /** + * Method getSetting.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 jalview.schemabinding.version2.Setting[] getSetting() + { + jalview.schemabinding.version2.Setting[] array = new jalview.schemabinding.version2.Setting[0]; + return (jalview.schemabinding.version2.Setting[]) this._settingList + .toArray(array); + } + + /** + * Method getSettingCount. + * + * @return the size of this collection + */ + public int getSettingCount() + { + return this._settingList.size(); + } + + /** + * 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; } - - /** - * - * - * @param index - * @param vGroup - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setGroup( - final int index, - final jalview.schemabinding.version2.Group vGroup) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._groupList.size()) { - throw new IndexOutOfBoundsException("setGroup: Index value '" + index + "' not in range [0.." + (this._groupList.size() - 1) + "]"); - } - - this._groupList.set(index, vGroup); - } - - /** - * - * - * @param vGroupArray + 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 setGroup( - final jalview.schemabinding.version2.Group[] vGroupArray) { - //-- copy array - _groupList.clear(); - - for (int i = 0; i < vGroupArray.length; i++) { - this._groupList.add(vGroupArray[i]); - } - } + public void removeAllGroup() + { + this._groupList.clear(); + } - /** - * - * - * @param index - * @param vSetting - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection + /** */ - public void setSetting( - final int index, - final jalview.schemabinding.version2.Setting vSetting) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._settingList.size()) { - throw new IndexOutOfBoundsException("setSetting: Index value '" + index + "' not in range [0.." + (this._settingList.size() - 1) + "]"); - } - - this._settingList.set(index, vSetting); + public void removeAllSetting() + { + this._settingList.clear(); + } + + /** + * Method removeGroup. + * + * @param vGroup + * @return true if the object was removed from the collection. + */ + public boolean removeGroup( + final jalview.schemabinding.version2.Group vGroup) + { + boolean removed = _groupList.remove(vGroup); + return removed; + } + + /** + * Method removeGroupAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.Group removeGroupAt(final int index) + { + java.lang.Object obj = this._groupList.remove(index); + return (jalview.schemabinding.version2.Group) obj; + } + + /** + * Method removeSetting. + * + * @param vSetting + * @return true if the object was removed from the collection. + */ + public boolean removeSetting( + final jalview.schemabinding.version2.Setting vSetting) + { + boolean removed = _settingList.remove(vSetting); + return removed; + } + + /** + * Method removeSettingAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.Setting removeSettingAt( + final int index) + { + java.lang.Object obj = this._settingList.remove(index); + return (jalview.schemabinding.version2.Setting) obj; + } + + /** + * + * + * @param index + * @param vGroup + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setGroup(final int index, + final jalview.schemabinding.version2.Group vGroup) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._groupList.size()) + { + throw new IndexOutOfBoundsException("setGroup: Index value '" + index + + "' not in range [0.." + (this._groupList.size() - 1) + "]"); } - /** - * - * - * @param vSettingArray - */ - public void setSetting( - final jalview.schemabinding.version2.Setting[] vSettingArray) { - //-- copy array - _settingList.clear(); - - for (int i = 0; i < vSettingArray.length; i++) { - this._settingList.add(vSettingArray[i]); - } + this._groupList.set(index, vGroup); + } + + /** + * + * + * @param vGroupArray + */ + public void setGroup( + final jalview.schemabinding.version2.Group[] vGroupArray) + { + // -- copy array + _groupList.clear(); + + for (int i = 0; i < vGroupArray.length; i++) + { + this._groupList.add(vGroupArray[i]); } - - /** - * 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.FeatureSettings - */ - public static jalview.schemabinding.version2.FeatureSettings unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.FeatureSettings) Unmarshaller.unmarshal(jalview.schemabinding.version2.FeatureSettings.class, reader); + } + + /** + * + * + * @param index + * @param vSetting + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setSetting(final int index, + final jalview.schemabinding.version2.Setting vSetting) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._settingList.size()) + { + throw new IndexOutOfBoundsException("setSetting: Index value '" + + index + "' not in range [0.." + + (this._settingList.size() - 1) + "]"); } - /** - * - * - * @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._settingList.set(index, vSetting); + } + + /** + * + * + * @param vSettingArray + */ + public void setSetting( + final jalview.schemabinding.version2.Setting[] vSettingArray) + { + // -- copy array + _settingList.clear(); + + for (int i = 0; i < vSettingArray.length; i++) + { + this._settingList.add(vSettingArray[i]); } + } + + /** + * 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.FeatureSettings + */ + public static jalview.schemabinding.version2.FeatureSettings unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.FeatureSettings) Unmarshaller + .unmarshal( + jalview.schemabinding.version2.FeatureSettings.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/Features.java b/src/jalview/schemabinding/version2/Features.java index f0c5ad5..5d17512 100644 --- a/src/jalview/schemabinding/version2/Features.java +++ b/src/jalview/schemabinding/version2/Features.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,98 +19,106 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Features extends Feature -implements java.io.Serializable +public class Features extends Feature implements java.io.Serializable { + // ----------------/ + // - Constructors -/ + // ----------------/ - //----------------/ - //- Constructors -/ - //----------------/ - - public Features() { - super(); - } - + public Features() + { + super(); + } - //-----------/ - //- Methods -/ - //-----------/ + // -----------/ + // - Methods -/ + // -----------/ - /** - * 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; + /** + * 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 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); - } + /** + * + * + * @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); + } - /** - * 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.Featur - */ - public static jalview.schemabinding.version2.Feature unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.Feature) Unmarshaller.unmarshal(jalview.schemabinding.version2.Features.class, reader); - } + /** + * 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.Featur + */ + public static jalview.schemabinding.version2.Feature unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Feature) Unmarshaller.unmarshal( + jalview.schemabinding.version2.Features.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); - } + /** + * + * + * @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/Group.java b/src/jalview/schemabinding/version2/Group.java index 774321b..ec1af95 100644 --- a/src/jalview/schemabinding/version2/Group.java +++ b/src/jalview/schemabinding/version2/Group.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,184 +19,195 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Group implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _name. - */ - private java.lang.String _name; - - /** - * Field _display. - */ - private boolean _display; - - /** - * keeps track of state for field: _display - */ - private boolean _has_display; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Group() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deleteDisplay( - ) { - this._has_display= false; - } - - /** - * Returns the value of field 'display'. - * - * @return the value of field 'Display'. - */ - public boolean getDisplay( - ) { - return this._display; - } - - /** - * Returns the value of field 'name'. - * - * @return the value of field 'Name'. - */ - public java.lang.String getName( - ) { - return this._name; - } - - /** - * Method hasDisplay. - * - * @return true if at least one Display has been added - */ - public boolean hasDisplay( - ) { - return this._has_display; - } - - /** - * Returns the value of field 'display'. - * - * @return the value of field 'Display'. - */ - public boolean isDisplay( - ) { - return this._display; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'display'. - * - * @param display the value of field 'display'. - */ - public void setDisplay( - final boolean display) { - this._display = display; - this._has_display = true; - } - - /** - * Sets the value of field 'name'. - * - * @param name the value of field 'name'. - */ - public void setName( - final java.lang.String name) { - this._name = name; - } - - /** - * 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.Group - */ - public static jalview.schemabinding.version2.Group unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.Group) Unmarshaller.unmarshal(jalview.schemabinding.version2.Group.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema +public class Group implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _name. + */ + private java.lang.String _name; + + /** + * Field _display. + */ + private boolean _display; + + /** + * keeps track of state for field: _display + */ + private boolean _has_display; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Group() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); + public void deleteDisplay() + { + this._has_display = false; + } + + /** + * Returns the value of field 'display'. + * + * @return the value of field 'Display'. + */ + public boolean getDisplay() + { + return this._display; + } + + /** + * Returns the value of field 'name'. + * + * @return the value of field 'Name'. + */ + public java.lang.String getName() + { + return this._name; + } + + /** + * Method hasDisplay. + * + * @return true if at least one Display has been added + */ + public boolean hasDisplay() + { + return this._has_display; + } + + /** + * Returns the value of field 'display'. + * + * @return the value of field 'Display'. + */ + public boolean isDisplay() + { + return this._display; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'display'. + * + * @param display + * the value of field 'display'. + */ + public void setDisplay(final boolean display) + { + this._display = display; + this._has_display = true; + } + + /** + * Sets the value of field 'name'. + * + * @param name + * the value of field 'name'. + */ + public void setName(final java.lang.String name) + { + this._name = name; + } + + /** + * 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.Group + */ + public static jalview.schemabinding.version2.Group unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Group) Unmarshaller.unmarshal( + jalview.schemabinding.version2.Group.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/HiddenColumns.java b/src/jalview/schemabinding/version2/HiddenColumns.java index f65c9de..beac4e0 100644 --- a/src/jalview/schemabinding/version2/HiddenColumns.java +++ b/src/jalview/schemabinding/version2/HiddenColumns.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,198 +19,209 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class HiddenColumns implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _start. - */ - private int _start; - - /** - * keeps track of state for field: _start - */ - private boolean _has_start; - - /** - * Field _end. - */ - private int _end; - - /** - * keeps track of state for field: _end - */ - private boolean _has_end; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public HiddenColumns() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deleteEnd( - ) { - this._has_end= false; - } - - /** - */ - public void deleteStart( - ) { - this._has_start= false; - } - - /** - * Returns the value of field 'end'. - * - * @return the value of field 'End'. - */ - public int getEnd( - ) { - return this._end; - } - - /** - * Returns the value of field 'start'. - * - * @return the value of field 'Start'. - */ - public int getStart( - ) { - return this._start; - } - - /** - * Method hasEnd. - * - * @return true if at least one End has been added - */ - public boolean hasEnd( - ) { - return this._has_end; - } - - /** - * Method hasStart. - * - * @return true if at least one Start has been added - */ - public boolean hasStart( - ) { - return this._has_start; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'end'. - * - * @param end the value of field 'end'. - */ - public void setEnd( - final int end) { - this._end = end; - this._has_end = true; - } - - /** - * Sets the value of field 'start'. - * - * @param start the value of field 'start'. - */ - public void setStart( - final int start) { - this._start = start; - this._has_start = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled - * jalview.schemabinding.version2.HiddenColumns - */ - public static jalview.schemabinding.version2.HiddenColumns unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.HiddenColumns) Unmarshaller.unmarshal(jalview.schemabinding.version2.HiddenColumns.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); +public class HiddenColumns implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _start. + */ + private int _start; + + /** + * keeps track of state for field: _start + */ + private boolean _has_start; + + /** + * Field _end. + */ + private int _end; + + /** + * keeps track of state for field: _end + */ + private boolean _has_end; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public HiddenColumns() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + */ + public void deleteEnd() + { + this._has_end = false; + } + + /** + */ + public void deleteStart() + { + this._has_start = false; + } + + /** + * Returns the value of field 'end'. + * + * @return the value of field 'End'. + */ + public int getEnd() + { + return this._end; + } + + /** + * Returns the value of field 'start'. + * + * @return the value of field 'Start'. + */ + public int getStart() + { + return this._start; + } + + /** + * Method hasEnd. + * + * @return true if at least one End has been added + */ + public boolean hasEnd() + { + return this._has_end; + } + + /** + * Method hasStart. + * + * @return true if at least one Start has been added + */ + public boolean hasStart() + { + return this._has_start; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'end'. + * + * @param end + * the value of field 'end'. + */ + public void setEnd(final int end) + { + this._end = end; + this._has_end = true; + } + + /** + * Sets the value of field 'start'. + * + * @param start + * the value of field 'start'. + */ + public void setStart(final int start) + { + this._start = start; + this._has_start = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.schemabinding.version2.HiddenColumns + */ + public static jalview.schemabinding.version2.HiddenColumns unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.HiddenColumns) Unmarshaller + .unmarshal(jalview.schemabinding.version2.HiddenColumns.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/JGroup.java b/src/jalview/schemabinding/version2/JGroup.java index 602473f..962569f 100644 --- a/src/jalview/schemabinding/version2/JGroup.java +++ b/src/jalview/schemabinding/version2/JGroup.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,1224 +19,1242 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class JGroup implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _start. - */ - private int _start; - - /** - * keeps track of state for field: _start - */ - private boolean _has_start; - - /** - * Field _end. - */ - private int _end; - - /** - * keeps track of state for field: _end - */ - private boolean _has_end; - - /** - * Field _name. - */ - private java.lang.String _name; - - /** - * Field _colour. - */ - private java.lang.String _colour; - - /** - * Field _consThreshold. - */ - private int _consThreshold; - - /** - * keeps track of state for field: _consThreshold - */ - private boolean _has_consThreshold; - - /** - * Field _pidThreshold. - */ - private int _pidThreshold; - - /** - * keeps track of state for field: _pidThreshold - */ - private boolean _has_pidThreshold; - - /** - * Field _outlineColour. - */ - private int _outlineColour; - - /** - * keeps track of state for field: _outlineColour - */ - private boolean _has_outlineColour; - - /** - * Field _displayBoxes. - */ - private boolean _displayBoxes; - - /** - * keeps track of state for field: _displayBoxes - */ - private boolean _has_displayBoxes; - - /** - * Field _displayText. - */ - private boolean _displayText; - - /** - * keeps track of state for field: _displayText - */ - private boolean _has_displayText; - - /** - * Field _colourText. - */ - private boolean _colourText; - - /** - * keeps track of state for field: _colourText - */ - private boolean _has_colourText; - - /** - * Field _textCol1. - */ - private int _textCol1; - - /** - * keeps track of state for field: _textCol1 - */ - private boolean _has_textCol1; - - /** - * Field _textCol2. - */ - private int _textCol2; - - /** - * keeps track of state for field: _textCol2 - */ - private boolean _has_textCol2; - - /** - * Field _textColThreshold. - */ - private int _textColThreshold; - - /** - * keeps track of state for field: _textColThreshold - */ - private boolean _has_textColThreshold; - - /** - * Field _showUnconserved. - */ - private boolean _showUnconserved; - - /** - * keeps track of state for field: _showUnconserved - */ - private boolean _has_showUnconserved; - - /** - * Field _ignoreGapsinConsensus. - */ - private boolean _ignoreGapsinConsensus = true; - - /** - * keeps track of state for field: _ignoreGapsinConsensus - */ - private boolean _has_ignoreGapsinConsensus; - - /** - * Field _showConsensusHistogram. - */ - private boolean _showConsensusHistogram = true; - - /** - * keeps track of state for field: _showConsensusHistogram - */ - private boolean _has_showConsensusHistogram; - - /** - * Field _showSequenceLogo. - */ - private boolean _showSequenceLogo = false; - - /** - * keeps track of state for field: _showSequenceLogo - */ - private boolean _has_showSequenceLogo; - - /** - * Field _normaliseSequenceLogo. - */ - private boolean _normaliseSequenceLogo = false; - - /** - * keeps track of state for field: _normaliseSequenceLogo - */ - private boolean _has_normaliseSequenceLogo; - - /** - * Optional sequence group ID (only - * needs to be - * unique for this - * alignment) - * - */ - private java.lang.String _id; - - /** - * Field _seqList. - */ - private java.util.Vector _seqList; - - /** - * Field _annotationColours. - */ - private jalview.schemabinding.version2.AnnotationColours _annotationColours; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public JGroup() { - super(); - this._seqList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vSeq - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSeq( - final java.lang.String vSeq) - throws java.lang.IndexOutOfBoundsException { - this._seqList.addElement(vSeq); - } - - /** - * - * - * @param index - * @param vSeq - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSeq( - final int index, - final java.lang.String vSeq) - throws java.lang.IndexOutOfBoundsException { - this._seqList.add(index, vSeq); - } - - /** - */ - public void deleteColourText( - ) { - this._has_colourText= false; - } - - /** - */ - public void deleteConsThreshold( - ) { - this._has_consThreshold= false; - } - - /** - */ - public void deleteDisplayBoxes( - ) { - this._has_displayBoxes= false; - } - - /** - */ - public void deleteDisplayText( - ) { - this._has_displayText= false; - } - - /** - */ - public void deleteEnd( - ) { - this._has_end= false; - } - - /** - */ - public void deleteIgnoreGapsinConsensus( - ) { - this._has_ignoreGapsinConsensus= false; - } - - /** - */ - public void deleteNormaliseSequenceLogo( - ) { - this._has_normaliseSequenceLogo= false; - } - - /** - */ - public void deleteOutlineColour( - ) { - this._has_outlineColour= false; - } - - /** - */ - public void deletePidThreshold( - ) { - this._has_pidThreshold= false; - } - - /** - */ - public void deleteShowConsensusHistogram( - ) { - this._has_showConsensusHistogram= false; - } - - /** - */ - public void deleteShowSequenceLogo( - ) { - this._has_showSequenceLogo= false; - } - - /** - */ - public void deleteShowUnconserved( - ) { - this._has_showUnconserved= false; - } - - /** - */ - public void deleteStart( - ) { - this._has_start= false; - } - - /** - */ - public void deleteTextCol1( - ) { - this._has_textCol1= false; - } - - /** - */ - public void deleteTextCol2( - ) { - this._has_textCol2= false; - } - - /** - */ - public void deleteTextColThreshold( - ) { - this._has_textColThreshold= false; - } - - /** - * Method enumerateSeq. - * - * @return an Enumeration over all java.lang.String elements - */ - public java.util.Enumeration enumerateSeq( - ) { - return this._seqList.elements(); - } - - /** - * Returns the value of field 'annotationColours'. - * - * @return the value of field 'AnnotationColours'. - */ - public jalview.schemabinding.version2.AnnotationColours getAnnotationColours( - ) { - return this._annotationColours; - } - - /** - * Returns the value of field 'colour'. - * - * @return the value of field 'Colour'. - */ - public java.lang.String getColour( - ) { - return this._colour; - } - - /** - * Returns the value of field 'colourText'. - * - * @return the value of field 'ColourText'. - */ - public boolean getColourText( - ) { - return this._colourText; - } - - /** - * Returns the value of field 'consThreshold'. - * - * @return the value of field 'ConsThreshold'. - */ - public int getConsThreshold( - ) { - return this._consThreshold; - } - - /** - * Returns the value of field 'displayBoxes'. - * - * @return the value of field 'DisplayBoxes'. - */ - public boolean getDisplayBoxes( - ) { - return this._displayBoxes; - } - - /** - * Returns the value of field 'displayText'. - * - * @return the value of field 'DisplayText'. - */ - public boolean getDisplayText( - ) { - return this._displayText; - } - - /** - * Returns the value of field 'end'. - * - * @return the value of field 'End'. - */ - public int getEnd( - ) { - return this._end; - } - - /** - * Returns the value of field 'id'. The field 'id' has the - * following description: Optional sequence group ID (only - * needs to be - * unique for this - * alignment) - * - * - * @return the value of field 'Id'. - */ - public java.lang.String getId( - ) { - return this._id; - } - - /** - * Returns the value of field 'ignoreGapsinConsensus'. - * - * @return the value of field 'IgnoreGapsinConsensus'. - */ - public boolean getIgnoreGapsinConsensus( - ) { - return this._ignoreGapsinConsensus; - } - - /** - * Returns the value of field 'name'. - * - * @return the value of field 'Name'. - */ - public java.lang.String getName( - ) { - return this._name; - } - - /** - * Returns the value of field 'normaliseSequenceLogo'. - * - * @return the value of field 'NormaliseSequenceLogo'. - */ - public boolean getNormaliseSequenceLogo( - ) { - return this._normaliseSequenceLogo; - } - - /** - * Returns the value of field 'outlineColour'. - * - * @return the value of field 'OutlineColour'. - */ - public int getOutlineColour( - ) { - return this._outlineColour; - } - - /** - * Returns the value of field 'pidThreshold'. - * - * @return the value of field 'PidThreshold'. - */ - public int getPidThreshold( - ) { - return this._pidThreshold; - } - - /** - * Method getSeq. - * - * @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 getSeq( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._seqList.size()) { - throw new IndexOutOfBoundsException("getSeq: Index value '" + index + "' not in range [0.." + (this._seqList.size() - 1) + "]"); - } - - return (java.lang.String) _seqList.get(index); - } - - /** - * Method getSeq.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[] getSeq( - ) { - java.lang.String[] array = new java.lang.String[0]; - return (java.lang.String[]) this._seqList.toArray(array); - } - - /** - * Method getSeqCount. - * - * @return the size of this collection - */ - public int getSeqCount( - ) { - return this._seqList.size(); - } - - /** - * Returns the value of field 'showConsensusHistogram'. - * - * @return the value of field 'ShowConsensusHistogram'. - */ - public boolean getShowConsensusHistogram( - ) { - return this._showConsensusHistogram; - } - - /** - * Returns the value of field 'showSequenceLogo'. - * - * @return the value of field 'ShowSequenceLogo'. - */ - public boolean getShowSequenceLogo( - ) { - return this._showSequenceLogo; - } - - /** - * Returns the value of field 'showUnconserved'. - * - * @return the value of field 'ShowUnconserved'. - */ - public boolean getShowUnconserved( - ) { - return this._showUnconserved; - } - - /** - * Returns the value of field 'start'. - * - * @return the value of field 'Start'. - */ - public int getStart( - ) { - return this._start; - } - - /** - * Returns the value of field 'textCol1'. - * - * @return the value of field 'TextCol1'. - */ - public int getTextCol1( - ) { - return this._textCol1; - } - - /** - * Returns the value of field 'textCol2'. - * - * @return the value of field 'TextCol2'. - */ - public int getTextCol2( - ) { - return this._textCol2; - } - - /** - * Returns the value of field 'textColThreshold'. - * - * @return the value of field 'TextColThreshold'. - */ - public int getTextColThreshold( - ) { - return this._textColThreshold; - } - - /** - * Method hasColourText. - * - * @return true if at least one ColourText has been added - */ - public boolean hasColourText( - ) { - return this._has_colourText; - } - - /** - * Method hasConsThreshold. - * - * @return true if at least one ConsThreshold has been added - */ - public boolean hasConsThreshold( - ) { - return this._has_consThreshold; - } - - /** - * Method hasDisplayBoxes. - * - * @return true if at least one DisplayBoxes has been added - */ - public boolean hasDisplayBoxes( - ) { - return this._has_displayBoxes; - } - - /** - * Method hasDisplayText. - * - * @return true if at least one DisplayText has been added - */ - public boolean hasDisplayText( - ) { - return this._has_displayText; - } - - /** - * Method hasEnd. - * - * @return true if at least one End has been added - */ - public boolean hasEnd( - ) { - return this._has_end; - } - - /** - * Method hasIgnoreGapsinConsensus. - * - * @return true if at least one IgnoreGapsinConsensus has been - * added - */ - public boolean hasIgnoreGapsinConsensus( - ) { - return this._has_ignoreGapsinConsensus; - } - - /** - * Method hasNormaliseSequenceLogo. - * - * @return true if at least one NormaliseSequenceLogo has been - * added - */ - public boolean hasNormaliseSequenceLogo( - ) { - return this._has_normaliseSequenceLogo; - } - - /** - * Method hasOutlineColour. - * - * @return true if at least one OutlineColour has been added - */ - public boolean hasOutlineColour( - ) { - return this._has_outlineColour; - } - - /** - * Method hasPidThreshold. - * - * @return true if at least one PidThreshold has been added - */ - public boolean hasPidThreshold( - ) { - return this._has_pidThreshold; - } - - /** - * Method hasShowConsensusHistogram. - * - * @return true if at least one ShowConsensusHistogram has been - * added - */ - public boolean hasShowConsensusHistogram( - ) { - return this._has_showConsensusHistogram; - } - - /** - * Method hasShowSequenceLogo. - * - * @return true if at least one ShowSequenceLogo has been added - */ - public boolean hasShowSequenceLogo( - ) { - return this._has_showSequenceLogo; - } - - /** - * Method hasShowUnconserved. - * - * @return true if at least one ShowUnconserved has been added - */ - public boolean hasShowUnconserved( - ) { - return this._has_showUnconserved; - } - - /** - * Method hasStart. - * - * @return true if at least one Start has been added - */ - public boolean hasStart( - ) { - return this._has_start; - } - - /** - * Method hasTextCol1. - * - * @return true if at least one TextCol1 has been added - */ - public boolean hasTextCol1( - ) { - return this._has_textCol1; - } - - /** - * Method hasTextCol2. - * - * @return true if at least one TextCol2 has been added - */ - public boolean hasTextCol2( - ) { - return this._has_textCol2; - } - - /** - * Method hasTextColThreshold. - * - * @return true if at least one TextColThreshold has been added - */ - public boolean hasTextColThreshold( - ) { - return this._has_textColThreshold; - } - - /** - * Returns the value of field 'colourText'. - * - * @return the value of field 'ColourText'. - */ - public boolean isColourText( - ) { - return this._colourText; - } - - /** - * Returns the value of field 'displayBoxes'. - * - * @return the value of field 'DisplayBoxes'. - */ - public boolean isDisplayBoxes( - ) { - return this._displayBoxes; - } - - /** - * Returns the value of field 'displayText'. - * - * @return the value of field 'DisplayText'. - */ - public boolean isDisplayText( - ) { - return this._displayText; - } - - /** - * Returns the value of field 'ignoreGapsinConsensus'. - * - * @return the value of field 'IgnoreGapsinConsensus'. - */ - public boolean isIgnoreGapsinConsensus( - ) { - return this._ignoreGapsinConsensus; - } - - /** - * Returns the value of field 'normaliseSequenceLogo'. - * - * @return the value of field 'NormaliseSequenceLogo'. - */ - public boolean isNormaliseSequenceLogo( - ) { - return this._normaliseSequenceLogo; - } - - /** - * Returns the value of field 'showConsensusHistogram'. - * - * @return the value of field 'ShowConsensusHistogram'. - */ - public boolean isShowConsensusHistogram( - ) { - return this._showConsensusHistogram; - } - - /** - * Returns the value of field 'showSequenceLogo'. - * - * @return the value of field 'ShowSequenceLogo'. - */ - public boolean isShowSequenceLogo( - ) { - return this._showSequenceLogo; - } - - /** - * Returns the value of field 'showUnconserved'. - * - * @return the value of field 'ShowUnconserved'. - */ - public boolean isShowUnconserved( - ) { - return this._showUnconserved; - } - - /** - * 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 removeAllSeq( - ) { - this._seqList.clear(); - } - - /** - * Method removeSeq. - * - * @param vSeq - * @return true if the object was removed from the collection. - */ - public boolean removeSeq( - final java.lang.String vSeq) { - boolean removed = _seqList.remove(vSeq); - return removed; - } - - /** - * Method removeSeqAt. - * - * @param index - * @return the element removed from the collection - */ - public java.lang.String removeSeqAt( - final int index) { - java.lang.Object obj = this._seqList.remove(index); - return (java.lang.String) obj; - } - - /** - * Sets the value of field 'annotationColours'. - * - * @param annotationColours the value of field - * 'annotationColours'. - */ - public void setAnnotationColours( - final jalview.schemabinding.version2.AnnotationColours annotationColours) { - this._annotationColours = annotationColours; - } - - /** - * Sets the value of field 'colour'. - * - * @param colour the value of field 'colour'. - */ - public void setColour( - final java.lang.String colour) { - this._colour = colour; - } - - /** - * Sets the value of field 'colourText'. - * - * @param colourText the value of field 'colourText'. - */ - public void setColourText( - final boolean colourText) { - this._colourText = colourText; - this._has_colourText = true; - } - - /** - * Sets the value of field 'consThreshold'. - * - * @param consThreshold the value of field 'consThreshold'. - */ - public void setConsThreshold( - final int consThreshold) { - this._consThreshold = consThreshold; - this._has_consThreshold = true; - } - - /** - * Sets the value of field 'displayBoxes'. - * - * @param displayBoxes the value of field 'displayBoxes'. - */ - public void setDisplayBoxes( - final boolean displayBoxes) { - this._displayBoxes = displayBoxes; - this._has_displayBoxes = true; - } - - /** - * Sets the value of field 'displayText'. - * - * @param displayText the value of field 'displayText'. - */ - public void setDisplayText( - final boolean displayText) { - this._displayText = displayText; - this._has_displayText = true; - } - - /** - * Sets the value of field 'end'. - * - * @param end the value of field 'end'. - */ - public void setEnd( - final int end) { - this._end = end; - this._has_end = true; - } - - /** - * Sets the value of field 'id'. The field 'id' has the - * following description: Optional sequence group ID (only - * needs to be - * unique for this - * alignment) - * - * - * @param id the value of field 'id'. - */ - public void setId( - final java.lang.String id) { - this._id = id; - } - - /** - * Sets the value of field 'ignoreGapsinConsensus'. - * - * @param ignoreGapsinConsensus the value of field - * 'ignoreGapsinConsensus'. - */ - public void setIgnoreGapsinConsensus( - final boolean ignoreGapsinConsensus) { - this._ignoreGapsinConsensus = ignoreGapsinConsensus; - this._has_ignoreGapsinConsensus = true; - } - - /** - * Sets the value of field 'name'. - * - * @param name the value of field 'name'. - */ - public void setName( - final java.lang.String name) { - this._name = name; - } - - /** - * Sets the value of field 'normaliseSequenceLogo'. - * - * @param normaliseSequenceLogo the value of field - * 'normaliseSequenceLogo'. - */ - public void setNormaliseSequenceLogo( - final boolean normaliseSequenceLogo) { - this._normaliseSequenceLogo = normaliseSequenceLogo; - this._has_normaliseSequenceLogo = true; - } - - /** - * Sets the value of field 'outlineColour'. - * - * @param outlineColour the value of field 'outlineColour'. - */ - public void setOutlineColour( - final int outlineColour) { - this._outlineColour = outlineColour; - this._has_outlineColour = true; - } - - /** - * Sets the value of field 'pidThreshold'. - * - * @param pidThreshold the value of field 'pidThreshold'. - */ - public void setPidThreshold( - final int pidThreshold) { - this._pidThreshold = pidThreshold; - this._has_pidThreshold = true; - } - - /** - * - * - * @param index - * @param vSeq - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setSeq( - final int index, - final java.lang.String vSeq) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._seqList.size()) { - throw new IndexOutOfBoundsException("setSeq: Index value '" + index + "' not in range [0.." + (this._seqList.size() - 1) + "]"); - } - - this._seqList.set(index, vSeq); - } - - /** - * - * - * @param vSeqArray - */ - public void setSeq( - final java.lang.String[] vSeqArray) { - //-- copy array - _seqList.clear(); - - for (int i = 0; i < vSeqArray.length; i++) { - this._seqList.add(vSeqArray[i]); - } - } - - /** - * Sets the value of field 'showConsensusHistogram'. - * - * @param showConsensusHistogram the value of field - * 'showConsensusHistogram'. - */ - public void setShowConsensusHistogram( - final boolean showConsensusHistogram) { - this._showConsensusHistogram = showConsensusHistogram; - this._has_showConsensusHistogram = true; - } - - /** - * Sets the value of field 'showSequenceLogo'. - * - * @param showSequenceLogo the value of field 'showSequenceLogo' - */ - public void setShowSequenceLogo( - final boolean showSequenceLogo) { - this._showSequenceLogo = showSequenceLogo; - this._has_showSequenceLogo = true; - } - - /** - * Sets the value of field 'showUnconserved'. - * - * @param showUnconserved the value of field 'showUnconserved'. - */ - public void setShowUnconserved( - final boolean showUnconserved) { - this._showUnconserved = showUnconserved; - this._has_showUnconserved = true; - } - - /** - * Sets the value of field 'start'. - * - * @param start the value of field 'start'. - */ - public void setStart( - final int start) { - this._start = start; - this._has_start = true; - } - - /** - * Sets the value of field 'textCol1'. - * - * @param textCol1 the value of field 'textCol1'. - */ - public void setTextCol1( - final int textCol1) { - this._textCol1 = textCol1; - this._has_textCol1 = true; - } - - /** - * Sets the value of field 'textCol2'. - * - * @param textCol2 the value of field 'textCol2'. - */ - public void setTextCol2( - final int textCol2) { - this._textCol2 = textCol2; - this._has_textCol2 = true; - } - - /** - * Sets the value of field 'textColThreshold'. - * - * @param textColThreshold the value of field 'textColThreshold' - */ - public void setTextColThreshold( - final int textColThreshold) { - this._textColThreshold = textColThreshold; - this._has_textColThreshold = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled jalview.schemabinding.version2.JGroup - */ - public static jalview.schemabinding.version2.JGroup unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.JGroup) Unmarshaller.unmarshal(jalview.schemabinding.version2.JGroup.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class JGroup implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _start. + */ + private int _start; + + /** + * keeps track of state for field: _start + */ + private boolean _has_start; + + /** + * Field _end. + */ + private int _end; + + /** + * keeps track of state for field: _end + */ + private boolean _has_end; + + /** + * Field _name. + */ + private java.lang.String _name; + + /** + * Field _colour. + */ + private java.lang.String _colour; + + /** + * Field _consThreshold. + */ + private int _consThreshold; + + /** + * keeps track of state for field: _consThreshold + */ + private boolean _has_consThreshold; + + /** + * Field _pidThreshold. + */ + private int _pidThreshold; + + /** + * keeps track of state for field: _pidThreshold + */ + private boolean _has_pidThreshold; + + /** + * Field _outlineColour. + */ + private int _outlineColour; + + /** + * keeps track of state for field: _outlineColour + */ + private boolean _has_outlineColour; + + /** + * Field _displayBoxes. + */ + private boolean _displayBoxes; + + /** + * keeps track of state for field: _displayBoxes + */ + private boolean _has_displayBoxes; + + /** + * Field _displayText. + */ + private boolean _displayText; + + /** + * keeps track of state for field: _displayText + */ + private boolean _has_displayText; + + /** + * Field _colourText. + */ + private boolean _colourText; + + /** + * keeps track of state for field: _colourText + */ + private boolean _has_colourText; + + /** + * Field _textCol1. + */ + private int _textCol1; + + /** + * keeps track of state for field: _textCol1 + */ + private boolean _has_textCol1; + + /** + * Field _textCol2. + */ + private int _textCol2; + + /** + * keeps track of state for field: _textCol2 + */ + private boolean _has_textCol2; + + /** + * Field _textColThreshold. + */ + private int _textColThreshold; + + /** + * keeps track of state for field: _textColThreshold + */ + private boolean _has_textColThreshold; + + /** + * Field _showUnconserved. + */ + private boolean _showUnconserved; + + /** + * keeps track of state for field: _showUnconserved + */ + private boolean _has_showUnconserved; + + /** + * Field _ignoreGapsinConsensus. + */ + private boolean _ignoreGapsinConsensus = true; + + /** + * keeps track of state for field: _ignoreGapsinConsensus + */ + private boolean _has_ignoreGapsinConsensus; + + /** + * Field _showConsensusHistogram. + */ + private boolean _showConsensusHistogram = true; + + /** + * keeps track of state for field: _showConsensusHistogram + */ + private boolean _has_showConsensusHistogram; + + /** + * Field _showSequenceLogo. + */ + private boolean _showSequenceLogo = false; + + /** + * keeps track of state for field: _showSequenceLogo + */ + private boolean _has_showSequenceLogo; + + /** + * Field _normaliseSequenceLogo. + */ + private boolean _normaliseSequenceLogo = false; + + /** + * keeps track of state for field: _normaliseSequenceLogo + */ + private boolean _has_normaliseSequenceLogo; + + /** + * Optional sequence group ID (only needs to be unique for this alignment) + * + */ + private java.lang.String _id; + + /** + * Field _seqList. + */ + private java.util.Vector _seqList; + + /** + * Field _annotationColours. + */ + private jalview.schemabinding.version2.AnnotationColours _annotationColours; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public JGroup() + { + super(); + this._seqList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vSeq + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSeq(final java.lang.String vSeq) + throws java.lang.IndexOutOfBoundsException + { + this._seqList.addElement(vSeq); + } + + /** + * + * + * @param index + * @param vSeq + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSeq(final int index, final java.lang.String vSeq) + throws java.lang.IndexOutOfBoundsException + { + this._seqList.add(index, vSeq); + } + + /** + */ + public void deleteColourText() + { + this._has_colourText = false; + } + + /** + */ + public void deleteConsThreshold() + { + this._has_consThreshold = false; + } + + /** + */ + public void deleteDisplayBoxes() + { + this._has_displayBoxes = false; + } + + /** + */ + public void deleteDisplayText() + { + this._has_displayText = false; + } + + /** + */ + public void deleteEnd() + { + this._has_end = false; + } + + /** + */ + public void deleteIgnoreGapsinConsensus() + { + this._has_ignoreGapsinConsensus = false; + } + + /** + */ + public void deleteNormaliseSequenceLogo() + { + this._has_normaliseSequenceLogo = false; + } + + /** + */ + public void deleteOutlineColour() + { + this._has_outlineColour = false; + } + + /** + */ + public void deletePidThreshold() + { + this._has_pidThreshold = false; + } + + /** + */ + public void deleteShowConsensusHistogram() + { + this._has_showConsensusHistogram = false; + } + + /** + */ + public void deleteShowSequenceLogo() + { + this._has_showSequenceLogo = false; + } + + /** + */ + public void deleteShowUnconserved() + { + this._has_showUnconserved = false; + } + + /** + */ + public void deleteStart() + { + this._has_start = false; + } + + /** + */ + public void deleteTextCol1() + { + this._has_textCol1 = false; + } + + /** + */ + public void deleteTextCol2() + { + this._has_textCol2 = false; + } + + /** + */ + public void deleteTextColThreshold() + { + this._has_textColThreshold = false; + } + + /** + * Method enumerateSeq. + * + * @return an Enumeration over all java.lang.String elements + */ + public java.util.Enumeration enumerateSeq() + { + return this._seqList.elements(); + } + + /** + * Returns the value of field 'annotationColours'. + * + * @return the value of field 'AnnotationColours'. + */ + public jalview.schemabinding.version2.AnnotationColours getAnnotationColours() + { + return this._annotationColours; + } + + /** + * Returns the value of field 'colour'. + * + * @return the value of field 'Colour'. + */ + public java.lang.String getColour() + { + return this._colour; + } + + /** + * Returns the value of field 'colourText'. + * + * @return the value of field 'ColourText'. + */ + public boolean getColourText() + { + return this._colourText; + } + + /** + * Returns the value of field 'consThreshold'. + * + * @return the value of field 'ConsThreshold'. + */ + public int getConsThreshold() + { + return this._consThreshold; + } + + /** + * Returns the value of field 'displayBoxes'. + * + * @return the value of field 'DisplayBoxes'. + */ + public boolean getDisplayBoxes() + { + return this._displayBoxes; + } + + /** + * Returns the value of field 'displayText'. + * + * @return the value of field 'DisplayText'. + */ + public boolean getDisplayText() + { + return this._displayText; + } + + /** + * Returns the value of field 'end'. + * + * @return the value of field 'End'. + */ + public int getEnd() + { + return this._end; + } + + /** + * Returns the value of field 'id'. The field 'id' has the following + * description: Optional sequence group ID (only needs to be unique for this + * alignment) + * + * + * @return the value of field 'Id'. + */ + public java.lang.String getId() + { + return this._id; + } + + /** + * Returns the value of field 'ignoreGapsinConsensus'. + * + * @return the value of field 'IgnoreGapsinConsensus'. + */ + public boolean getIgnoreGapsinConsensus() + { + return this._ignoreGapsinConsensus; + } + + /** + * Returns the value of field 'name'. + * + * @return the value of field 'Name'. + */ + public java.lang.String getName() + { + return this._name; + } + + /** + * Returns the value of field 'normaliseSequenceLogo'. + * + * @return the value of field 'NormaliseSequenceLogo'. + */ + public boolean getNormaliseSequenceLogo() + { + return this._normaliseSequenceLogo; + } + + /** + * Returns the value of field 'outlineColour'. + * + * @return the value of field 'OutlineColour'. + */ + public int getOutlineColour() + { + return this._outlineColour; + } + + /** + * Returns the value of field 'pidThreshold'. + * + * @return the value of field 'PidThreshold'. + */ + public int getPidThreshold() + { + return this._pidThreshold; + } + + /** + * Method getSeq. + * + * @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 getSeq(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._seqList.size()) + { + throw new IndexOutOfBoundsException("getSeq: Index value '" + index + + "' not in range [0.." + (this._seqList.size() - 1) + "]"); + } + + return (java.lang.String) _seqList.get(index); + } + + /** + * Method getSeq.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[] getSeq() + { + java.lang.String[] array = new java.lang.String[0]; + return (java.lang.String[]) this._seqList.toArray(array); + } + + /** + * Method getSeqCount. + * + * @return the size of this collection + */ + public int getSeqCount() + { + return this._seqList.size(); + } + + /** + * Returns the value of field 'showConsensusHistogram'. + * + * @return the value of field 'ShowConsensusHistogram'. + */ + public boolean getShowConsensusHistogram() + { + return this._showConsensusHistogram; + } + + /** + * Returns the value of field 'showSequenceLogo'. + * + * @return the value of field 'ShowSequenceLogo'. + */ + public boolean getShowSequenceLogo() + { + return this._showSequenceLogo; + } + + /** + * Returns the value of field 'showUnconserved'. + * + * @return the value of field 'ShowUnconserved'. + */ + public boolean getShowUnconserved() + { + return this._showUnconserved; + } + + /** + * Returns the value of field 'start'. + * + * @return the value of field 'Start'. + */ + public int getStart() + { + return this._start; + } + + /** + * Returns the value of field 'textCol1'. + * + * @return the value of field 'TextCol1'. + */ + public int getTextCol1() + { + return this._textCol1; + } + + /** + * Returns the value of field 'textCol2'. + * + * @return the value of field 'TextCol2'. + */ + public int getTextCol2() + { + return this._textCol2; + } + + /** + * Returns the value of field 'textColThreshold'. + * + * @return the value of field 'TextColThreshold'. + */ + public int getTextColThreshold() + { + return this._textColThreshold; + } + + /** + * Method hasColourText. + * + * @return true if at least one ColourText has been added + */ + public boolean hasColourText() + { + return this._has_colourText; + } + + /** + * Method hasConsThreshold. + * + * @return true if at least one ConsThreshold has been added + */ + public boolean hasConsThreshold() + { + return this._has_consThreshold; + } + + /** + * Method hasDisplayBoxes. + * + * @return true if at least one DisplayBoxes has been added + */ + public boolean hasDisplayBoxes() + { + return this._has_displayBoxes; + } + + /** + * Method hasDisplayText. + * + * @return true if at least one DisplayText has been added + */ + public boolean hasDisplayText() + { + return this._has_displayText; + } + + /** + * Method hasEnd. + * + * @return true if at least one End has been added + */ + public boolean hasEnd() + { + return this._has_end; + } + + /** + * Method hasIgnoreGapsinConsensus. + * + * @return true if at least one IgnoreGapsinConsensus has been added + */ + public boolean hasIgnoreGapsinConsensus() + { + return this._has_ignoreGapsinConsensus; + } + + /** + * Method hasNormaliseSequenceLogo. + * + * @return true if at least one NormaliseSequenceLogo has been added + */ + public boolean hasNormaliseSequenceLogo() + { + return this._has_normaliseSequenceLogo; + } + + /** + * Method hasOutlineColour. + * + * @return true if at least one OutlineColour has been added + */ + public boolean hasOutlineColour() + { + return this._has_outlineColour; + } + + /** + * Method hasPidThreshold. + * + * @return true if at least one PidThreshold has been added + */ + public boolean hasPidThreshold() + { + return this._has_pidThreshold; + } + + /** + * Method hasShowConsensusHistogram. + * + * @return true if at least one ShowConsensusHistogram has been added + */ + public boolean hasShowConsensusHistogram() + { + return this._has_showConsensusHistogram; + } + + /** + * Method hasShowSequenceLogo. + * + * @return true if at least one ShowSequenceLogo has been added + */ + public boolean hasShowSequenceLogo() + { + return this._has_showSequenceLogo; + } + + /** + * Method hasShowUnconserved. + * + * @return true if at least one ShowUnconserved has been added + */ + public boolean hasShowUnconserved() + { + return this._has_showUnconserved; + } + + /** + * Method hasStart. + * + * @return true if at least one Start has been added + */ + public boolean hasStart() + { + return this._has_start; + } + + /** + * Method hasTextCol1. + * + * @return true if at least one TextCol1 has been added + */ + public boolean hasTextCol1() + { + return this._has_textCol1; + } + + /** + * Method hasTextCol2. + * + * @return true if at least one TextCol2 has been added + */ + public boolean hasTextCol2() + { + return this._has_textCol2; + } + + /** + * Method hasTextColThreshold. + * + * @return true if at least one TextColThreshold has been added + */ + public boolean hasTextColThreshold() + { + return this._has_textColThreshold; + } + + /** + * Returns the value of field 'colourText'. + * + * @return the value of field 'ColourText'. + */ + public boolean isColourText() + { + return this._colourText; + } + + /** + * Returns the value of field 'displayBoxes'. + * + * @return the value of field 'DisplayBoxes'. + */ + public boolean isDisplayBoxes() + { + return this._displayBoxes; + } + + /** + * Returns the value of field 'displayText'. + * + * @return the value of field 'DisplayText'. + */ + public boolean isDisplayText() + { + return this._displayText; + } + + /** + * Returns the value of field 'ignoreGapsinConsensus'. + * + * @return the value of field 'IgnoreGapsinConsensus'. + */ + public boolean isIgnoreGapsinConsensus() + { + return this._ignoreGapsinConsensus; + } + + /** + * Returns the value of field 'normaliseSequenceLogo'. + * + * @return the value of field 'NormaliseSequenceLogo'. + */ + public boolean isNormaliseSequenceLogo() + { + return this._normaliseSequenceLogo; + } + + /** + * Returns the value of field 'showConsensusHistogram'. + * + * @return the value of field 'ShowConsensusHistogram'. + */ + public boolean isShowConsensusHistogram() + { + return this._showConsensusHistogram; + } + + /** + * Returns the value of field 'showSequenceLogo'. + * + * @return the value of field 'ShowSequenceLogo'. + */ + public boolean isShowSequenceLogo() + { + return this._showSequenceLogo; + } + + /** + * Returns the value of field 'showUnconserved'. + * + * @return the value of field 'ShowUnconserved'. + */ + public boolean isShowUnconserved() + { + return this._showUnconserved; + } + + /** + * 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 removeAllSeq() + { + this._seqList.clear(); + } + + /** + * Method removeSeq. + * + * @param vSeq + * @return true if the object was removed from the collection. + */ + public boolean removeSeq(final java.lang.String vSeq) + { + boolean removed = _seqList.remove(vSeq); + return removed; + } + + /** + * Method removeSeqAt. + * + * @param index + * @return the element removed from the collection + */ + public java.lang.String removeSeqAt(final int index) + { + java.lang.Object obj = this._seqList.remove(index); + return (java.lang.String) obj; + } + + /** + * Sets the value of field 'annotationColours'. + * + * @param annotationColours + * the value of field 'annotationColours'. + */ + public void setAnnotationColours( + final jalview.schemabinding.version2.AnnotationColours annotationColours) + { + this._annotationColours = annotationColours; + } + + /** + * Sets the value of field 'colour'. + * + * @param colour + * the value of field 'colour'. + */ + public void setColour(final java.lang.String colour) + { + this._colour = colour; + } + + /** + * Sets the value of field 'colourText'. + * + * @param colourText + * the value of field 'colourText'. + */ + public void setColourText(final boolean colourText) + { + this._colourText = colourText; + this._has_colourText = true; + } + + /** + * Sets the value of field 'consThreshold'. + * + * @param consThreshold + * the value of field 'consThreshold'. + */ + public void setConsThreshold(final int consThreshold) + { + this._consThreshold = consThreshold; + this._has_consThreshold = true; + } + + /** + * Sets the value of field 'displayBoxes'. + * + * @param displayBoxes + * the value of field 'displayBoxes'. + */ + public void setDisplayBoxes(final boolean displayBoxes) + { + this._displayBoxes = displayBoxes; + this._has_displayBoxes = true; + } + + /** + * Sets the value of field 'displayText'. + * + * @param displayText + * the value of field 'displayText'. + */ + public void setDisplayText(final boolean displayText) + { + this._displayText = displayText; + this._has_displayText = true; + } + + /** + * Sets the value of field 'end'. + * + * @param end + * the value of field 'end'. + */ + public void setEnd(final int end) + { + this._end = end; + this._has_end = true; + } + + /** + * Sets the value of field 'id'. The field 'id' has the following description: + * Optional sequence group ID (only needs to be unique for this alignment) + * + * + * @param id + * the value of field 'id'. + */ + public void setId(final java.lang.String id) + { + this._id = id; + } + + /** + * Sets the value of field 'ignoreGapsinConsensus'. + * + * @param ignoreGapsinConsensus + * the value of field 'ignoreGapsinConsensus'. + */ + public void setIgnoreGapsinConsensus(final boolean ignoreGapsinConsensus) + { + this._ignoreGapsinConsensus = ignoreGapsinConsensus; + this._has_ignoreGapsinConsensus = true; + } + + /** + * Sets the value of field 'name'. + * + * @param name + * the value of field 'name'. + */ + public void setName(final java.lang.String name) + { + this._name = name; + } + + /** + * Sets the value of field 'normaliseSequenceLogo'. + * + * @param normaliseSequenceLogo + * the value of field 'normaliseSequenceLogo'. + */ + public void setNormaliseSequenceLogo(final boolean normaliseSequenceLogo) + { + this._normaliseSequenceLogo = normaliseSequenceLogo; + this._has_normaliseSequenceLogo = true; + } + + /** + * Sets the value of field 'outlineColour'. + * + * @param outlineColour + * the value of field 'outlineColour'. + */ + public void setOutlineColour(final int outlineColour) + { + this._outlineColour = outlineColour; + this._has_outlineColour = true; + } + + /** + * Sets the value of field 'pidThreshold'. + * + * @param pidThreshold + * the value of field 'pidThreshold'. + */ + public void setPidThreshold(final int pidThreshold) + { + this._pidThreshold = pidThreshold; + this._has_pidThreshold = true; + } + + /** + * + * + * @param index + * @param vSeq + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setSeq(final int index, final java.lang.String vSeq) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._seqList.size()) + { + throw new IndexOutOfBoundsException("setSeq: Index value '" + index + + "' not in range [0.." + (this._seqList.size() - 1) + "]"); + } + + this._seqList.set(index, vSeq); + } + + /** + * + * + * @param vSeqArray + */ + public void setSeq(final java.lang.String[] vSeqArray) + { + // -- copy array + _seqList.clear(); + + for (int i = 0; i < vSeqArray.length; i++) + { + this._seqList.add(vSeqArray[i]); + } + } + + /** + * Sets the value of field 'showConsensusHistogram'. + * + * @param showConsensusHistogram + * the value of field 'showConsensusHistogram'. + */ + public void setShowConsensusHistogram(final boolean showConsensusHistogram) + { + this._showConsensusHistogram = showConsensusHistogram; + this._has_showConsensusHistogram = true; + } + + /** + * Sets the value of field 'showSequenceLogo'. + * + * @param showSequenceLogo + * the value of field 'showSequenceLogo' + */ + public void setShowSequenceLogo(final boolean showSequenceLogo) + { + this._showSequenceLogo = showSequenceLogo; + this._has_showSequenceLogo = true; + } + + /** + * Sets the value of field 'showUnconserved'. + * + * @param showUnconserved + * the value of field 'showUnconserved'. + */ + public void setShowUnconserved(final boolean showUnconserved) + { + this._showUnconserved = showUnconserved; + this._has_showUnconserved = true; + } + + /** + * Sets the value of field 'start'. + * + * @param start + * the value of field 'start'. + */ + public void setStart(final int start) + { + this._start = start; + this._has_start = true; + } + + /** + * Sets the value of field 'textCol1'. + * + * @param textCol1 + * the value of field 'textCol1'. + */ + public void setTextCol1(final int textCol1) + { + this._textCol1 = textCol1; + this._has_textCol1 = true; + } + + /** + * Sets the value of field 'textCol2'. + * + * @param textCol2 + * the value of field 'textCol2'. + */ + public void setTextCol2(final int textCol2) + { + this._textCol2 = textCol2; + this._has_textCol2 = true; + } + + /** + * Sets the value of field 'textColThreshold'. + * + * @param textColThreshold + * the value of field 'textColThreshold' + */ + public void setTextColThreshold(final int textColThreshold) + { + this._textColThreshold = textColThreshold; + this._has_textColThreshold = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.schemabinding.version2.JGroup + */ + public static jalview.schemabinding.version2.JGroup unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.JGroup) Unmarshaller.unmarshal( + jalview.schemabinding.version2.JGroup.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/JSeq.java b/src/jalview/schemabinding/version2/JSeq.java index 193b005..9ca6708 100644 --- a/src/jalview/schemabinding/version2/JSeq.java +++ b/src/jalview/schemabinding/version2/JSeq.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,958 +19,1020 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class JSeq implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _colour. - */ - private int _colour; - - /** - * keeps track of state for field: _colour - */ - private boolean _has_colour; - - /** - * Field _start. - */ - private int _start; - - /** - * keeps track of state for field: _start - */ - private boolean _has_start; - - /** - * Field _end. - */ - private int _end; - - /** - * keeps track of state for field: _end - */ - private boolean _has_end; - - /** - * Field _id. - */ - private java.lang.String _id; - - /** - * Field _hidden. - */ - private boolean _hidden; - - /** - * keeps track of state for field: _hidden - */ - private boolean _has_hidden; - - /** - * Field _featuresList. - */ - private java.util.Vector _featuresList; - - /** - * Field _pdbidsList. - */ - private java.util.Vector _pdbidsList; - - /** - * Field _hiddenSequencesList. - */ - private java.util.Vector _hiddenSequencesList; - - /** - * Reference to a viewer showing RNA structure - * for this sequence. Schema supports one viewer showing - * multiple - * annotations for multiple sequences, though currently only - * one - * annotation for one sequence (gapped or trimmed) is used - * - */ - private java.util.Vector _rnaViewerList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public JSeq() { - super(); - this._featuresList = new java.util.Vector(); - this._pdbidsList = new java.util.Vector(); - this._hiddenSequencesList = new java.util.Vector(); - this._rnaViewerList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vFeatures - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addFeatures( - final jalview.schemabinding.version2.Features vFeatures) - throws java.lang.IndexOutOfBoundsException { - this._featuresList.addElement(vFeatures); - } - - /** - * - * - * @param index - * @param vFeatures - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addFeatures( - final int index, - final jalview.schemabinding.version2.Features vFeatures) - throws java.lang.IndexOutOfBoundsException { - this._featuresList.add(index, vFeatures); - } - - /** - * - * - * @param vHiddenSequences - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addHiddenSequences( - final int vHiddenSequences) - throws java.lang.IndexOutOfBoundsException { - this._hiddenSequencesList.addElement(new java.lang.Integer(vHiddenSequences)); - } - - /** - * - * - * @param index - * @param vHiddenSequences - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addHiddenSequences( - final int index, - final int vHiddenSequences) - throws java.lang.IndexOutOfBoundsException { - this._hiddenSequencesList.add(index, new java.lang.Integer(vHiddenSequences)); - } - - /** - * - * - * @param vPdbids - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addPdbids( - final jalview.schemabinding.version2.Pdbids vPdbids) - throws java.lang.IndexOutOfBoundsException { - this._pdbidsList.addElement(vPdbids); - } - - /** - * - * - * @param index - * @param vPdbids - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addPdbids( - final int index, - final jalview.schemabinding.version2.Pdbids vPdbids) - throws java.lang.IndexOutOfBoundsException { - this._pdbidsList.add(index, vPdbids); - } - - /** - * - * - * @param vRnaViewer - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addRnaViewer( - final jalview.schemabinding.version2.RnaViewer vRnaViewer) - throws java.lang.IndexOutOfBoundsException { - this._rnaViewerList.addElement(vRnaViewer); - } - - /** - * - * - * @param index - * @param vRnaViewer - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addRnaViewer( - final int index, - final jalview.schemabinding.version2.RnaViewer vRnaViewer) - throws java.lang.IndexOutOfBoundsException { - this._rnaViewerList.add(index, vRnaViewer); - } - - /** - */ - public void deleteColour( - ) { - this._has_colour= false; - } - - /** - */ - public void deleteEnd( - ) { - this._has_end= false; - } - - /** - */ - public void deleteHidden( - ) { - this._has_hidden= false; - } - - /** - */ - public void deleteStart( - ) { - this._has_start= false; - } - - /** - * Method enumerateFeatures. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.Features elements - */ - public java.util.Enumeration enumerateFeatures( - ) { - return this._featuresList.elements(); - } - - /** - * Method enumerateHiddenSequences. - * - * @return an Enumeration over all int elements - */ - public java.util.Enumeration enumerateHiddenSequences( - ) { - return this._hiddenSequencesList.elements(); - } - - /** - * Method enumeratePdbids. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.Pdbids elements - */ - public java.util.Enumeration enumeratePdbids( - ) { - return this._pdbidsList.elements(); - } - - /** - * Method enumerateRnaViewer. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.RnaViewer elements - */ - public java.util.Enumeration enumerateRnaViewer( - ) { - return this._rnaViewerList.elements(); - } - - /** - * Returns the value of field 'colour'. - * - * @return the value of field 'Colour'. - */ - public int getColour( - ) { - return this._colour; - } - - /** - * Returns the value of field 'end'. - * - * @return the value of field 'End'. - */ - public int getEnd( - ) { - return this._end; - } - - /** - * Method getFeatures. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.Features at the given index - */ - public jalview.schemabinding.version2.Features getFeatures( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._featuresList.size()) { - throw new IndexOutOfBoundsException("getFeatures: Index value '" + index + "' not in range [0.." + (this._featuresList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.Features) _featuresList.get(index); - } - - /** - * Method getFeatures.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 jalview.schemabinding.version2.Features[] getFeatures( - ) { - jalview.schemabinding.version2.Features[] array = new jalview.schemabinding.version2.Features[0]; - return (jalview.schemabinding.version2.Features[]) this._featuresList.toArray(array); - } - - /** - * Method getFeaturesCount. - * - * @return the size of this collection - */ - public int getFeaturesCount( - ) { - return this._featuresList.size(); - } - - /** - * Returns the value of field 'hidden'. - * - * @return the value of field 'Hidden'. - */ - public boolean getHidden( - ) { - return this._hidden; - } - - /** - * Method getHiddenSequences. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the int at the given index - */ - public int getHiddenSequences( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._hiddenSequencesList.size()) { - throw new IndexOutOfBoundsException("getHiddenSequences: Index value '" + index + "' not in range [0.." + (this._hiddenSequencesList.size() - 1) + "]"); - } - - return ((java.lang.Integer) _hiddenSequencesList.get(index)).intValue(); - } - - /** - * Method getHiddenSequences.Returns the contents of the - * collection in an Array. - * - * @return this collection as an Array - */ - public int[] getHiddenSequences( - ) { - int size = this._hiddenSequencesList.size(); - int[] array = new int[size]; - java.util.Iterator iter = _hiddenSequencesList.iterator(); - for (int index = 0; index < size; index++) { - array[index] = ((java.lang.Integer) iter.next()).intValue(); - } - return array; - } - - /** - * Method getHiddenSequencesCount. - * - * @return the size of this collection - */ - public int getHiddenSequencesCount( - ) { - return this._hiddenSequencesList.size(); - } - - /** - * Returns the value of field 'id'. - * - * @return the value of field 'Id'. - */ - public java.lang.String getId( - ) { - return this._id; - } - - /** - * Method getPdbids. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.Pdbids at the given index - */ - public jalview.schemabinding.version2.Pdbids getPdbids( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._pdbidsList.size()) { - throw new IndexOutOfBoundsException("getPdbids: Index value '" + index + "' not in range [0.." + (this._pdbidsList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.Pdbids) _pdbidsList.get(index); - } - - /** - * Method getPdbids.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 jalview.schemabinding.version2.Pdbids[] getPdbids( - ) { - jalview.schemabinding.version2.Pdbids[] array = new jalview.schemabinding.version2.Pdbids[0]; - return (jalview.schemabinding.version2.Pdbids[]) this._pdbidsList.toArray(array); - } - - /** - * Method getPdbidsCount. - * - * @return the size of this collection - */ - public int getPdbidsCount( - ) { - return this._pdbidsList.size(); - } - - /** - * Method getRnaViewer. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.RnaViewer at the given index - */ - public jalview.schemabinding.version2.RnaViewer getRnaViewer( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._rnaViewerList.size()) { - throw new IndexOutOfBoundsException("getRnaViewer: Index value '" + index + "' not in range [0.." + (this._rnaViewerList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.RnaViewer) _rnaViewerList.get(index); - } - - /** - * Method getRnaViewer.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 jalview.schemabinding.version2.RnaViewer[] getRnaViewer( - ) { - jalview.schemabinding.version2.RnaViewer[] array = new jalview.schemabinding.version2.RnaViewer[0]; - return (jalview.schemabinding.version2.RnaViewer[]) this._rnaViewerList.toArray(array); - } - - /** - * Method getRnaViewerCount. - * - * @return the size of this collection - */ - public int getRnaViewerCount( - ) { - return this._rnaViewerList.size(); - } - - /** - * Returns the value of field 'start'. - * - * @return the value of field 'Start'. - */ - public int getStart( - ) { - return this._start; - } - - /** - * Method hasColour. - * - * @return true if at least one Colour has been added - */ - public boolean hasColour( - ) { - return this._has_colour; - } - - /** - * Method hasEnd. - * - * @return true if at least one End has been added - */ - public boolean hasEnd( - ) { - return this._has_end; - } - - /** - * Method hasHidden. - * - * @return true if at least one Hidden has been added - */ - public boolean hasHidden( - ) { - return this._has_hidden; - } - - /** - * Method hasStart. - * - * @return true if at least one Start has been added - */ - public boolean hasStart( - ) { - return this._has_start; - } - - /** - * Returns the value of field 'hidden'. - * - * @return the value of field 'Hidden'. - */ - public boolean isHidden( - ) { - return this._hidden; - } - - /** - * 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 removeAllFeatures( - ) { - this._featuresList.clear(); - } - - /** - */ - public void removeAllHiddenSequences( - ) { - this._hiddenSequencesList.clear(); - } - - /** - */ - public void removeAllPdbids( - ) { - this._pdbidsList.clear(); - } - - /** - */ - public void removeAllRnaViewer( - ) { - this._rnaViewerList.clear(); - } - - /** - * Method removeFeatures. - * - * @param vFeatures - * @return true if the object was removed from the collection. - */ - public boolean removeFeatures( - final jalview.schemabinding.version2.Features vFeatures) { - boolean removed = _featuresList.remove(vFeatures); - return removed; - } - - /** - * Method removeFeaturesAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.Features removeFeaturesAt( - final int index) { - java.lang.Object obj = this._featuresList.remove(index); - return (jalview.schemabinding.version2.Features) obj; - } - - /** - * Method removeHiddenSequences. - * - * @param vHiddenSequences - * @return true if the object was removed from the collection. - */ - public boolean removeHiddenSequences( - final int vHiddenSequences) { - boolean removed = _hiddenSequencesList.remove(new java.lang.Integer(vHiddenSequences)); - return removed; - } - - /** - * Method removeHiddenSequencesAt. - * - * @param index - * @return the element removed from the collection - */ - public int removeHiddenSequencesAt( - final int index) { - java.lang.Object obj = this._hiddenSequencesList.remove(index); - return ((java.lang.Integer) obj).intValue(); - } - - /** - * Method removePdbids. - * - * @param vPdbids - * @return true if the object was removed from the collection. - */ - public boolean removePdbids( - final jalview.schemabinding.version2.Pdbids vPdbids) { - boolean removed = _pdbidsList.remove(vPdbids); - return removed; - } - - /** - * Method removePdbidsAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.Pdbids removePdbidsAt( - final int index) { - java.lang.Object obj = this._pdbidsList.remove(index); - return (jalview.schemabinding.version2.Pdbids) obj; - } - - /** - * Method removeRnaViewer. - * - * @param vRnaViewer - * @return true if the object was removed from the collection. - */ - public boolean removeRnaViewer( - final jalview.schemabinding.version2.RnaViewer vRnaViewer) { - boolean removed = _rnaViewerList.remove(vRnaViewer); - return removed; - } - - /** - * Method removeRnaViewerAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.RnaViewer removeRnaViewerAt( - final int index) { - java.lang.Object obj = this._rnaViewerList.remove(index); - return (jalview.schemabinding.version2.RnaViewer) obj; - } - - /** - * Sets the value of field 'colour'. - * - * @param colour the value of field 'colour'. - */ - public void setColour( - final int colour) { - this._colour = colour; - this._has_colour = true; - } - - /** - * Sets the value of field 'end'. - * - * @param end the value of field 'end'. - */ - public void setEnd( - final int end) { - this._end = end; - this._has_end = true; - } - - /** - * - * - * @param index - * @param vFeatures - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setFeatures( - final int index, - final jalview.schemabinding.version2.Features vFeatures) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._featuresList.size()) { - throw new IndexOutOfBoundsException("setFeatures: Index value '" + index + "' not in range [0.." + (this._featuresList.size() - 1) + "]"); - } - - this._featuresList.set(index, vFeatures); - } - - /** - * - * - * @param vFeaturesArray - */ - public void setFeatures( - final jalview.schemabinding.version2.Features[] vFeaturesArray) { - //-- copy array - _featuresList.clear(); - - for (int i = 0; i < vFeaturesArray.length; i++) { - this._featuresList.add(vFeaturesArray[i]); - } - } - - /** - * Sets the value of field 'hidden'. - * - * @param hidden the value of field 'hidden'. - */ - public void setHidden( - final boolean hidden) { - this._hidden = hidden; - this._has_hidden = true; - } - - /** - * - * - * @param index - * @param vHiddenSequences - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setHiddenSequences( - final int index, - final int vHiddenSequences) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._hiddenSequencesList.size()) { - throw new IndexOutOfBoundsException("setHiddenSequences: Index value '" + index + "' not in range [0.." + (this._hiddenSequencesList.size() - 1) + "]"); - } - - this._hiddenSequencesList.set(index, new java.lang.Integer(vHiddenSequences)); - } - - /** - * - * - * @param vHiddenSequencesArray - */ - public void setHiddenSequences( - final int[] vHiddenSequencesArray) { - //-- copy array - _hiddenSequencesList.clear(); - - for (int i = 0; i < vHiddenSequencesArray.length; i++) { - this._hiddenSequencesList.add(new java.lang.Integer(vHiddenSequencesArray[i])); - } - } - - /** - * Sets the value of field 'id'. - * - * @param id the value of field 'id'. - */ - public void setId( - final java.lang.String id) { - this._id = id; - } - - /** - * - * - * @param index - * @param vPdbids - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setPdbids( - final int index, - final jalview.schemabinding.version2.Pdbids vPdbids) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._pdbidsList.size()) { - throw new IndexOutOfBoundsException("setPdbids: Index value '" + index + "' not in range [0.." + (this._pdbidsList.size() - 1) + "]"); - } - - this._pdbidsList.set(index, vPdbids); - } - - /** - * - * - * @param vPdbidsArray - */ - public void setPdbids( - final jalview.schemabinding.version2.Pdbids[] vPdbidsArray) { - //-- copy array - _pdbidsList.clear(); - - for (int i = 0; i < vPdbidsArray.length; i++) { - this._pdbidsList.add(vPdbidsArray[i]); - } - } - - /** - * - * - * @param index - * @param vRnaViewer - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setRnaViewer( - final int index, - final jalview.schemabinding.version2.RnaViewer vRnaViewer) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._rnaViewerList.size()) { - throw new IndexOutOfBoundsException("setRnaViewer: Index value '" + index + "' not in range [0.." + (this._rnaViewerList.size() - 1) + "]"); - } - - this._rnaViewerList.set(index, vRnaViewer); - } - - /** - * - * - * @param vRnaViewerArray - */ - public void setRnaViewer( - final jalview.schemabinding.version2.RnaViewer[] vRnaViewerArray) { - //-- copy array - _rnaViewerList.clear(); - - for (int i = 0; i < vRnaViewerArray.length; i++) { - this._rnaViewerList.add(vRnaViewerArray[i]); - } - } - - /** - * Sets the value of field 'start'. - * - * @param start the value of field 'start'. - */ - public void setStart( - final int start) { - this._start = start; - this._has_start = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled jalview.schemabinding.version2.JSeq - */ - public static jalview.schemabinding.version2.JSeq unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.JSeq) Unmarshaller.unmarshal(jalview.schemabinding.version2.JSeq.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class JSeq implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _colour. + */ + private int _colour; + + /** + * keeps track of state for field: _colour + */ + private boolean _has_colour; + + /** + * Field _start. + */ + private int _start; + + /** + * keeps track of state for field: _start + */ + private boolean _has_start; + + /** + * Field _end. + */ + private int _end; + + /** + * keeps track of state for field: _end + */ + private boolean _has_end; + + /** + * Field _id. + */ + private java.lang.String _id; + + /** + * Field _hidden. + */ + private boolean _hidden; + + /** + * keeps track of state for field: _hidden + */ + private boolean _has_hidden; + + /** + * Field _featuresList. + */ + private java.util.Vector _featuresList; + + /** + * Field _pdbidsList. + */ + private java.util.Vector _pdbidsList; + + /** + * Field _hiddenSequencesList. + */ + private java.util.Vector _hiddenSequencesList; + + /** + * Reference to a viewer showing RNA structure for this sequence. Schema + * supports one viewer showing multiple annotations for multiple sequences, + * though currently only one annotation for one sequence (gapped or trimmed) + * is used + * + */ + private java.util.Vector _rnaViewerList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public JSeq() + { + super(); + this._featuresList = new java.util.Vector(); + this._pdbidsList = new java.util.Vector(); + this._hiddenSequencesList = new java.util.Vector(); + this._rnaViewerList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vFeatures + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addFeatures( + final jalview.schemabinding.version2.Features vFeatures) + throws java.lang.IndexOutOfBoundsException + { + this._featuresList.addElement(vFeatures); + } + + /** + * + * + * @param index + * @param vFeatures + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addFeatures(final int index, + final jalview.schemabinding.version2.Features vFeatures) + throws java.lang.IndexOutOfBoundsException + { + this._featuresList.add(index, vFeatures); + } + + /** + * + * + * @param vHiddenSequences + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addHiddenSequences(final int vHiddenSequences) + throws java.lang.IndexOutOfBoundsException + { + this._hiddenSequencesList.addElement(new java.lang.Integer( + vHiddenSequences)); + } + + /** + * + * + * @param index + * @param vHiddenSequences + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addHiddenSequences(final int index, final int vHiddenSequences) + throws java.lang.IndexOutOfBoundsException + { + this._hiddenSequencesList.add(index, new java.lang.Integer( + vHiddenSequences)); + } + + /** + * + * + * @param vPdbids + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addPdbids(final jalview.schemabinding.version2.Pdbids vPdbids) + throws java.lang.IndexOutOfBoundsException + { + this._pdbidsList.addElement(vPdbids); + } + + /** + * + * + * @param index + * @param vPdbids + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addPdbids(final int index, + final jalview.schemabinding.version2.Pdbids vPdbids) + throws java.lang.IndexOutOfBoundsException + { + this._pdbidsList.add(index, vPdbids); + } + + /** + * + * + * @param vRnaViewer + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addRnaViewer( + final jalview.schemabinding.version2.RnaViewer vRnaViewer) + throws java.lang.IndexOutOfBoundsException + { + this._rnaViewerList.addElement(vRnaViewer); + } + + /** + * + * + * @param index + * @param vRnaViewer + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addRnaViewer(final int index, + final jalview.schemabinding.version2.RnaViewer vRnaViewer) + throws java.lang.IndexOutOfBoundsException + { + this._rnaViewerList.add(index, vRnaViewer); + } + + /** + */ + public void deleteColour() + { + this._has_colour = false; + } + + /** + */ + public void deleteEnd() + { + this._has_end = false; + } + + /** + */ + public void deleteHidden() + { + this._has_hidden = false; + } + + /** + */ + public void deleteStart() + { + this._has_start = false; + } + + /** + * Method enumerateFeatures. + * + * @return an Enumeration over all jalview.schemabinding.version2.Features + * elements + */ + public java.util.Enumeration enumerateFeatures() + { + return this._featuresList.elements(); + } + + /** + * Method enumerateHiddenSequences. + * + * @return an Enumeration over all int elements + */ + public java.util.Enumeration enumerateHiddenSequences() + { + return this._hiddenSequencesList.elements(); + } + + /** + * Method enumeratePdbids. + * + * @return an Enumeration over all jalview.schemabinding.version2.Pdbids + * elements + */ + public java.util.Enumeration enumeratePdbids() + { + return this._pdbidsList.elements(); + } + + /** + * Method enumerateRnaViewer. + * + * @return an Enumeration over all jalview.schemabinding.version2.RnaViewer + * elements + */ + public java.util.Enumeration enumerateRnaViewer() + { + return this._rnaViewerList.elements(); + } + + /** + * Returns the value of field 'colour'. + * + * @return the value of field 'Colour'. + */ + public int getColour() + { + return this._colour; + } + + /** + * Returns the value of field 'end'. + * + * @return the value of field 'End'. + */ + public int getEnd() + { + return this._end; + } + + /** + * Method getFeatures. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.Features at the + * given index + */ + public jalview.schemabinding.version2.Features getFeatures(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._featuresList.size()) + { + throw new IndexOutOfBoundsException("getFeatures: Index value '" + + index + "' not in range [0.." + + (this._featuresList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.Features) _featuresList + .get(index); + } + + /** + * Method getFeatures.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 jalview.schemabinding.version2.Features[] getFeatures() + { + jalview.schemabinding.version2.Features[] array = new jalview.schemabinding.version2.Features[0]; + return (jalview.schemabinding.version2.Features[]) this._featuresList + .toArray(array); + } + + /** + * Method getFeaturesCount. + * + * @return the size of this collection + */ + public int getFeaturesCount() + { + return this._featuresList.size(); + } + + /** + * Returns the value of field 'hidden'. + * + * @return the value of field 'Hidden'. + */ + public boolean getHidden() + { + return this._hidden; + } + + /** + * Method getHiddenSequences. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the int at the given index + */ + public int getHiddenSequences(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._hiddenSequencesList.size()) + { + throw new IndexOutOfBoundsException( + "getHiddenSequences: Index value '" + index + + "' not in range [0.." + + (this._hiddenSequencesList.size() - 1) + "]"); + } + + return ((java.lang.Integer) _hiddenSequencesList.get(index)).intValue(); + } + + /** + * Method getHiddenSequences.Returns the contents of the collection in an + * Array. + * + * @return this collection as an Array + */ + public int[] getHiddenSequences() + { + int size = this._hiddenSequencesList.size(); + int[] array = new int[size]; + java.util.Iterator iter = _hiddenSequencesList.iterator(); + for (int index = 0; index < size; index++) + { + array[index] = ((java.lang.Integer) iter.next()).intValue(); + } + return array; + } + + /** + * Method getHiddenSequencesCount. + * + * @return the size of this collection + */ + public int getHiddenSequencesCount() + { + return this._hiddenSequencesList.size(); + } + + /** + * Returns the value of field 'id'. + * + * @return the value of field 'Id'. + */ + public java.lang.String getId() + { + return this._id; + } + + /** + * Method getPdbids. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.Pdbids at the given + * index + */ + public jalview.schemabinding.version2.Pdbids getPdbids(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._pdbidsList.size()) + { + throw new IndexOutOfBoundsException("getPdbids: Index value '" + + index + "' not in range [0.." + + (this._pdbidsList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.Pdbids) _pdbidsList.get(index); + } + + /** + * Method getPdbids.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 jalview.schemabinding.version2.Pdbids[] getPdbids() + { + jalview.schemabinding.version2.Pdbids[] array = new jalview.schemabinding.version2.Pdbids[0]; + return (jalview.schemabinding.version2.Pdbids[]) this._pdbidsList + .toArray(array); + } + + /** + * Method getPdbidsCount. + * + * @return the size of this collection + */ + public int getPdbidsCount() + { + return this._pdbidsList.size(); + } + + /** + * Method getRnaViewer. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.RnaViewer at the + * given index + */ + public jalview.schemabinding.version2.RnaViewer getRnaViewer( + final int index) throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._rnaViewerList.size()) + { + throw new IndexOutOfBoundsException("getRnaViewer: Index value '" + + index + "' not in range [0.." + + (this._rnaViewerList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.RnaViewer) _rnaViewerList + .get(index); + } + + /** + * Method getRnaViewer.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 jalview.schemabinding.version2.RnaViewer[] getRnaViewer() + { + jalview.schemabinding.version2.RnaViewer[] array = new jalview.schemabinding.version2.RnaViewer[0]; + return (jalview.schemabinding.version2.RnaViewer[]) this._rnaViewerList + .toArray(array); + } + + /** + * Method getRnaViewerCount. + * + * @return the size of this collection + */ + public int getRnaViewerCount() + { + return this._rnaViewerList.size(); + } + + /** + * Returns the value of field 'start'. + * + * @return the value of field 'Start'. + */ + public int getStart() + { + return this._start; + } + + /** + * Method hasColour. + * + * @return true if at least one Colour has been added + */ + public boolean hasColour() + { + return this._has_colour; + } + + /** + * Method hasEnd. + * + * @return true if at least one End has been added + */ + public boolean hasEnd() + { + return this._has_end; + } + + /** + * Method hasHidden. + * + * @return true if at least one Hidden has been added + */ + public boolean hasHidden() + { + return this._has_hidden; + } + + /** + * Method hasStart. + * + * @return true if at least one Start has been added + */ + public boolean hasStart() + { + return this._has_start; + } + + /** + * Returns the value of field 'hidden'. + * + * @return the value of field 'Hidden'. + */ + public boolean isHidden() + { + return this._hidden; + } + + /** + * 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 removeAllFeatures() + { + this._featuresList.clear(); + } + + /** + */ + public void removeAllHiddenSequences() + { + this._hiddenSequencesList.clear(); + } + + /** + */ + public void removeAllPdbids() + { + this._pdbidsList.clear(); + } + + /** + */ + public void removeAllRnaViewer() + { + this._rnaViewerList.clear(); + } + + /** + * Method removeFeatures. + * + * @param vFeatures + * @return true if the object was removed from the collection. + */ + public boolean removeFeatures( + final jalview.schemabinding.version2.Features vFeatures) + { + boolean removed = _featuresList.remove(vFeatures); + return removed; + } + + /** + * Method removeFeaturesAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.Features removeFeaturesAt( + final int index) + { + java.lang.Object obj = this._featuresList.remove(index); + return (jalview.schemabinding.version2.Features) obj; + } + + /** + * Method removeHiddenSequences. + * + * @param vHiddenSequences + * @return true if the object was removed from the collection. + */ + public boolean removeHiddenSequences(final int vHiddenSequences) + { + boolean removed = _hiddenSequencesList.remove(new java.lang.Integer( + vHiddenSequences)); + return removed; + } + + /** + * Method removeHiddenSequencesAt. + * + * @param index + * @return the element removed from the collection + */ + public int removeHiddenSequencesAt(final int index) + { + java.lang.Object obj = this._hiddenSequencesList.remove(index); + return ((java.lang.Integer) obj).intValue(); + } + + /** + * Method removePdbids. + * + * @param vPdbids + * @return true if the object was removed from the collection. + */ + public boolean removePdbids( + final jalview.schemabinding.version2.Pdbids vPdbids) + { + boolean removed = _pdbidsList.remove(vPdbids); + return removed; + } + + /** + * Method removePdbidsAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.Pdbids removePdbidsAt( + final int index) + { + java.lang.Object obj = this._pdbidsList.remove(index); + return (jalview.schemabinding.version2.Pdbids) obj; + } + + /** + * Method removeRnaViewer. + * + * @param vRnaViewer + * @return true if the object was removed from the collection. + */ + public boolean removeRnaViewer( + final jalview.schemabinding.version2.RnaViewer vRnaViewer) + { + boolean removed = _rnaViewerList.remove(vRnaViewer); + return removed; + } + + /** + * Method removeRnaViewerAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.RnaViewer removeRnaViewerAt( + final int index) + { + java.lang.Object obj = this._rnaViewerList.remove(index); + return (jalview.schemabinding.version2.RnaViewer) obj; + } + + /** + * Sets the value of field 'colour'. + * + * @param colour + * the value of field 'colour'. + */ + public void setColour(final int colour) + { + this._colour = colour; + this._has_colour = true; + } + + /** + * Sets the value of field 'end'. + * + * @param end + * the value of field 'end'. + */ + public void setEnd(final int end) + { + this._end = end; + this._has_end = true; + } + + /** + * + * + * @param index + * @param vFeatures + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setFeatures(final int index, + final jalview.schemabinding.version2.Features vFeatures) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._featuresList.size()) + { + throw new IndexOutOfBoundsException("setFeatures: Index value '" + + index + "' not in range [0.." + + (this._featuresList.size() - 1) + "]"); + } + + this._featuresList.set(index, vFeatures); + } + + /** + * + * + * @param vFeaturesArray + */ + public void setFeatures( + final jalview.schemabinding.version2.Features[] vFeaturesArray) + { + // -- copy array + _featuresList.clear(); + + for (int i = 0; i < vFeaturesArray.length; i++) + { + this._featuresList.add(vFeaturesArray[i]); + } + } + + /** + * Sets the value of field 'hidden'. + * + * @param hidden + * the value of field 'hidden'. + */ + public void setHidden(final boolean hidden) + { + this._hidden = hidden; + this._has_hidden = true; + } + + /** + * + * + * @param index + * @param vHiddenSequences + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setHiddenSequences(final int index, final int vHiddenSequences) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._hiddenSequencesList.size()) + { + throw new IndexOutOfBoundsException( + "setHiddenSequences: Index value '" + index + + "' not in range [0.." + + (this._hiddenSequencesList.size() - 1) + "]"); + } + + this._hiddenSequencesList.set(index, new java.lang.Integer( + vHiddenSequences)); + } + + /** + * + * + * @param vHiddenSequencesArray + */ + public void setHiddenSequences(final int[] vHiddenSequencesArray) + { + // -- copy array + _hiddenSequencesList.clear(); + + for (int i = 0; i < vHiddenSequencesArray.length; i++) + { + this._hiddenSequencesList.add(new java.lang.Integer( + vHiddenSequencesArray[i])); + } + } + + /** + * Sets the value of field 'id'. + * + * @param id + * the value of field 'id'. + */ + public void setId(final java.lang.String id) + { + this._id = id; + } + + /** + * + * + * @param index + * @param vPdbids + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setPdbids(final int index, + final jalview.schemabinding.version2.Pdbids vPdbids) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._pdbidsList.size()) + { + throw new IndexOutOfBoundsException("setPdbids: Index value '" + + index + "' not in range [0.." + + (this._pdbidsList.size() - 1) + "]"); + } + + this._pdbidsList.set(index, vPdbids); + } + + /** + * + * + * @param vPdbidsArray + */ + public void setPdbids( + final jalview.schemabinding.version2.Pdbids[] vPdbidsArray) + { + // -- copy array + _pdbidsList.clear(); + + for (int i = 0; i < vPdbidsArray.length; i++) + { + this._pdbidsList.add(vPdbidsArray[i]); + } + } + + /** + * + * + * @param index + * @param vRnaViewer + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setRnaViewer(final int index, + final jalview.schemabinding.version2.RnaViewer vRnaViewer) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._rnaViewerList.size()) + { + throw new IndexOutOfBoundsException("setRnaViewer: Index value '" + + index + "' not in range [0.." + + (this._rnaViewerList.size() - 1) + "]"); + } + + this._rnaViewerList.set(index, vRnaViewer); + } + + /** + * + * + * @param vRnaViewerArray + */ + public void setRnaViewer( + final jalview.schemabinding.version2.RnaViewer[] vRnaViewerArray) + { + // -- copy array + _rnaViewerList.clear(); + + for (int i = 0; i < vRnaViewerArray.length; i++) + { + this._rnaViewerList.add(vRnaViewerArray[i]); + } + } + + /** + * Sets the value of field 'start'. + * + * @param start + * the value of field 'start'. + */ + public void setStart(final int start) + { + this._start = start; + this._has_start = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.schemabinding.version2.JSeq + */ + public static jalview.schemabinding.version2.JSeq unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.JSeq) Unmarshaller.unmarshal( + jalview.schemabinding.version2.JSeq.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/JalviewModel.java b/src/jalview/schemabinding/version2/JalviewModel.java index eec356c..c13ef64 100644 --- a/src/jalview/schemabinding/version2/JalviewModel.java +++ b/src/jalview/schemabinding/version2/JalviewModel.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,203 +19,217 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class JalviewModel implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _creationDate. - */ - private java.util.Date _creationDate; - - /** - * Field _version. - */ - private java.lang.String _version; - - /** - * Field _vamsasModel. - */ - private jalview.schemabinding.version2.VamsasModel _vamsasModel; - - /** - * Field _jalviewModelSequence. - */ - private jalview.schemabinding.version2.JalviewModelSequence _jalviewModelSequence; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public JalviewModel() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Returns the value of field 'creationDate'. - * - * @return the value of field 'CreationDate'. - */ - public java.util.Date getCreationDate( - ) { - return this._creationDate; - } - - /** - * Returns the value of field 'jalviewModelSequence'. - * - * @return the value of field 'JalviewModelSequence'. - */ - public jalview.schemabinding.version2.JalviewModelSequence getJalviewModelSequence( - ) { - return this._jalviewModelSequence; - } - - /** - * Returns the value of field 'vamsasModel'. - * - * @return the value of field 'VamsasModel'. - */ - public jalview.schemabinding.version2.VamsasModel getVamsasModel( - ) { - return this._vamsasModel; - } - - /** - * Returns the value of field 'version'. - * - * @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; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'creationDate'. - * - * @param creationDate the value of field 'creationDate'. - */ - public void setCreationDate( - final java.util.Date creationDate) { - this._creationDate = creationDate; - } - - /** - * Sets the value of field 'jalviewModelSequence'. - * - * @param jalviewModelSequence the value of field - * 'jalviewModelSequence'. - */ - public void setJalviewModelSequence( - final jalview.schemabinding.version2.JalviewModelSequence jalviewModelSequence) { - this._jalviewModelSequence = jalviewModelSequence; - } - - /** - * Sets the value of field 'vamsasModel'. - * - * @param vamsasModel the value of field 'vamsasModel'. - */ - public void setVamsasModel( - final jalview.schemabinding.version2.VamsasModel vamsasModel) { - this._vamsasModel = vamsasModel; - } - - /** - * Sets the value of field 'version'. - * - * @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.JalviewModel - */ - public static jalview.schemabinding.version2.JalviewModel unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.JalviewModel) Unmarshaller.unmarshal(jalview.schemabinding.version2.JalviewModel.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); +public class JalviewModel implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _creationDate. + */ + private java.util.Date _creationDate; + + /** + * Field _version. + */ + private java.lang.String _version; + + /** + * Field _vamsasModel. + */ + private jalview.schemabinding.version2.VamsasModel _vamsasModel; + + /** + * Field _jalviewModelSequence. + */ + private jalview.schemabinding.version2.JalviewModelSequence _jalviewModelSequence; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public JalviewModel() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Returns the value of field 'creationDate'. + * + * @return the value of field 'CreationDate'. + */ + public java.util.Date getCreationDate() + { + return this._creationDate; + } + + /** + * Returns the value of field 'jalviewModelSequence'. + * + * @return the value of field 'JalviewModelSequence'. + */ + public jalview.schemabinding.version2.JalviewModelSequence getJalviewModelSequence() + { + return this._jalviewModelSequence; + } + + /** + * Returns the value of field 'vamsasModel'. + * + * @return the value of field 'VamsasModel'. + */ + public jalview.schemabinding.version2.VamsasModel getVamsasModel() + { + return this._vamsasModel; + } + + /** + * Returns the value of field 'version'. + * + * @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; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'creationDate'. + * + * @param creationDate + * the value of field 'creationDate'. + */ + public void setCreationDate(final java.util.Date creationDate) + { + this._creationDate = creationDate; + } + + /** + * Sets the value of field 'jalviewModelSequence'. + * + * @param jalviewModelSequence + * the value of field 'jalviewModelSequence'. + */ + public void setJalviewModelSequence( + final jalview.schemabinding.version2.JalviewModelSequence jalviewModelSequence) + { + this._jalviewModelSequence = jalviewModelSequence; + } + + /** + * Sets the value of field 'vamsasModel'. + * + * @param vamsasModel + * the value of field 'vamsasModel'. + */ + public void setVamsasModel( + final jalview.schemabinding.version2.VamsasModel vamsasModel) + { + this._vamsasModel = vamsasModel; + } + + /** + * Sets the value of field 'version'. + * + * @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.JalviewModel + */ + public static jalview.schemabinding.version2.JalviewModel unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.JalviewModel) Unmarshaller + .unmarshal(jalview.schemabinding.version2.JalviewModel.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/JalviewModelSequence.java b/src/jalview/schemabinding/version2/JalviewModelSequence.java index cf69934..c7c02c5 100644 --- a/src/jalview/schemabinding/version2/JalviewModelSequence.java +++ b/src/jalview/schemabinding/version2/JalviewModelSequence.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,907 +19,968 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class JalviewModelSequence implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _JSeqList. - */ - private java.util.Vector _JSeqList; - - /** - * Field _JGroupList. - */ - private java.util.Vector _JGroupList; - - /** - * Field _viewportList. - */ - private java.util.Vector _viewportList; - - /** - * Field _userColoursList. - */ - private java.util.Vector _userColoursList; - - /** - * Field _treeList. - */ - private java.util.Vector _treeList; - - /** - * Field _featureSettings. - */ - private jalview.schemabinding.version2.FeatureSettings _featureSettings; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public JalviewModelSequence() { - super(); - this._JSeqList = new java.util.Vector(); - this._JGroupList = new java.util.Vector(); - this._viewportList = new java.util.Vector(); - this._userColoursList = new java.util.Vector(); - this._treeList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vJGroup - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addJGroup( - final jalview.schemabinding.version2.JGroup vJGroup) - throws java.lang.IndexOutOfBoundsException { - this._JGroupList.addElement(vJGroup); - } - - /** - * - * - * @param index - * @param vJGroup - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addJGroup( - final int index, - final jalview.schemabinding.version2.JGroup vJGroup) - throws java.lang.IndexOutOfBoundsException { - this._JGroupList.add(index, vJGroup); - } - - /** - * - * - * @param vJSeq - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addJSeq( - final jalview.schemabinding.version2.JSeq vJSeq) - throws java.lang.IndexOutOfBoundsException { - this._JSeqList.addElement(vJSeq); - } - - /** - * - * - * @param index - * @param vJSeq - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addJSeq( - final int index, - final jalview.schemabinding.version2.JSeq vJSeq) - throws java.lang.IndexOutOfBoundsException { - this._JSeqList.add(index, vJSeq); - } - - /** - * - * - * @param vTree - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addTree( - final jalview.schemabinding.version2.Tree vTree) - throws java.lang.IndexOutOfBoundsException { - this._treeList.addElement(vTree); - } - - /** - * - * - * @param index - * @param vTree - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addTree( - final int index, - final jalview.schemabinding.version2.Tree vTree) - throws java.lang.IndexOutOfBoundsException { - this._treeList.add(index, vTree); - } - - /** - * - * - * @param vUserColours - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addUserColours( - final jalview.schemabinding.version2.UserColours vUserColours) - throws java.lang.IndexOutOfBoundsException { - this._userColoursList.addElement(vUserColours); - } - - /** - * - * - * @param index - * @param vUserColours - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addUserColours( - final int index, - final jalview.schemabinding.version2.UserColours vUserColours) - throws java.lang.IndexOutOfBoundsException { - this._userColoursList.add(index, vUserColours); - } - - /** - * - * - * @param vViewport - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addViewport( - final jalview.schemabinding.version2.Viewport vViewport) - throws java.lang.IndexOutOfBoundsException { - this._viewportList.addElement(vViewport); - } - - /** - * - * - * @param index - * @param vViewport - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addViewport( - final int index, - final jalview.schemabinding.version2.Viewport vViewport) - throws java.lang.IndexOutOfBoundsException { - this._viewportList.add(index, vViewport); - } - - /** - * Method enumerateJGroup. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.JGroup elements - */ - public java.util.Enumeration enumerateJGroup( - ) { - return this._JGroupList.elements(); - } - - /** - * Method enumerateJSeq. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.JSeq elements - */ - public java.util.Enumeration enumerateJSeq( - ) { - return this._JSeqList.elements(); - } - - /** - * Method enumerateTree. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.Tree elements - */ - public java.util.Enumeration enumerateTree( - ) { - return this._treeList.elements(); - } - - /** - * Method enumerateUserColours. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.UserColours elements - */ - public java.util.Enumeration enumerateUserColours( - ) { - return this._userColoursList.elements(); - } - - /** - * Method enumerateViewport. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.Viewport elements - */ - public java.util.Enumeration enumerateViewport( - ) { - return this._viewportList.elements(); - } - - /** - * Returns the value of field 'featureSettings'. - * - * @return the value of field 'FeatureSettings'. - */ - public jalview.schemabinding.version2.FeatureSettings getFeatureSettings( - ) { - return this._featureSettings; - } - - /** - * Method getJGroup. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.JGroup at the given index - */ - public jalview.schemabinding.version2.JGroup getJGroup( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._JGroupList.size()) { - throw new IndexOutOfBoundsException("getJGroup: Index value '" + index + "' not in range [0.." + (this._JGroupList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.JGroup) _JGroupList.get(index); - } - - /** - * Method getJGroup.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 jalview.schemabinding.version2.JGroup[] getJGroup( - ) { - jalview.schemabinding.version2.JGroup[] array = new jalview.schemabinding.version2.JGroup[0]; - return (jalview.schemabinding.version2.JGroup[]) this._JGroupList.toArray(array); - } - - /** - * Method getJGroupCount. - * - * @return the size of this collection - */ - public int getJGroupCount( - ) { - return this._JGroupList.size(); - } - - /** - * Method getJSeq. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the jalview.schemabinding.version2.JSeq - * at the given index - */ - public jalview.schemabinding.version2.JSeq getJSeq( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._JSeqList.size()) { - throw new IndexOutOfBoundsException("getJSeq: Index value '" + index + "' not in range [0.." + (this._JSeqList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.JSeq) _JSeqList.get(index); - } - - /** - * Method getJSeq.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 jalview.schemabinding.version2.JSeq[] getJSeq( - ) { - jalview.schemabinding.version2.JSeq[] array = new jalview.schemabinding.version2.JSeq[0]; - return (jalview.schemabinding.version2.JSeq[]) this._JSeqList.toArray(array); - } - - /** - * Method getJSeqCount. - * - * @return the size of this collection - */ - public int getJSeqCount( - ) { - return this._JSeqList.size(); - } - - /** - * Method getTree. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the jalview.schemabinding.version2.Tree - * at the given index - */ - public jalview.schemabinding.version2.Tree getTree( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._treeList.size()) { - throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.Tree) _treeList.get(index); - } - - /** - * Method getTree.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 jalview.schemabinding.version2.Tree[] getTree( - ) { - jalview.schemabinding.version2.Tree[] array = new jalview.schemabinding.version2.Tree[0]; - return (jalview.schemabinding.version2.Tree[]) this._treeList.toArray(array); - } - - /** - * Method getTreeCount. - * - * @return the size of this collection - */ - public int getTreeCount( - ) { - return this._treeList.size(); - } - - /** - * Method getUserColours. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.UserColours at the given index - */ - public jalview.schemabinding.version2.UserColours getUserColours( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._userColoursList.size()) { - throw new IndexOutOfBoundsException("getUserColours: Index value '" + index + "' not in range [0.." + (this._userColoursList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.UserColours) _userColoursList.get(index); - } - - /** - * Method getUserColours.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 jalview.schemabinding.version2.UserColours[] getUserColours( - ) { - jalview.schemabinding.version2.UserColours[] array = new jalview.schemabinding.version2.UserColours[0]; - return (jalview.schemabinding.version2.UserColours[]) this._userColoursList.toArray(array); - } - - /** - * Method getUserColoursCount. - * - * @return the size of this collection - */ - public int getUserColoursCount( - ) { - return this._userColoursList.size(); - } - - /** - * Method getViewport. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.Viewport at the given index - */ - public jalview.schemabinding.version2.Viewport getViewport( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._viewportList.size()) { - throw new IndexOutOfBoundsException("getViewport: Index value '" + index + "' not in range [0.." + (this._viewportList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.Viewport) _viewportList.get(index); - } - - /** - * Method getViewport.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 jalview.schemabinding.version2.Viewport[] getViewport( - ) { - jalview.schemabinding.version2.Viewport[] array = new jalview.schemabinding.version2.Viewport[0]; - return (jalview.schemabinding.version2.Viewport[]) this._viewportList.toArray(array); - } - - /** - * Method getViewportCount. - * - * @return the size of this collection - */ - public int getViewportCount( - ) { - return this._viewportList.size(); - } - - /** - * 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 removeAllJGroup( - ) { - this._JGroupList.clear(); - } - - /** - */ - public void removeAllJSeq( - ) { - this._JSeqList.clear(); - } - - /** - */ - public void removeAllTree( - ) { - this._treeList.clear(); - } - - /** - */ - public void removeAllUserColours( - ) { - this._userColoursList.clear(); - } - - /** - */ - public void removeAllViewport( - ) { - this._viewportList.clear(); - } - - /** - * Method removeJGroup. - * - * @param vJGroup - * @return true if the object was removed from the collection. - */ - public boolean removeJGroup( - final jalview.schemabinding.version2.JGroup vJGroup) { - boolean removed = _JGroupList.remove(vJGroup); - return removed; - } - - /** - * Method removeJGroupAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.JGroup removeJGroupAt( - final int index) { - java.lang.Object obj = this._JGroupList.remove(index); - return (jalview.schemabinding.version2.JGroup) obj; - } - - /** - * Method removeJSeq. - * - * @param vJSeq - * @return true if the object was removed from the collection. - */ - public boolean removeJSeq( - final jalview.schemabinding.version2.JSeq vJSeq) { - boolean removed = _JSeqList.remove(vJSeq); - return removed; - } - - /** - * Method removeJSeqAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.JSeq removeJSeqAt( - final int index) { - java.lang.Object obj = this._JSeqList.remove(index); - return (jalview.schemabinding.version2.JSeq) obj; - } - - /** - * Method removeTree. - * - * @param vTree - * @return true if the object was removed from the collection. - */ - public boolean removeTree( - final jalview.schemabinding.version2.Tree vTree) { - boolean removed = _treeList.remove(vTree); - return removed; - } - - /** - * Method removeTreeAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.Tree removeTreeAt( - final int index) { - java.lang.Object obj = this._treeList.remove(index); - return (jalview.schemabinding.version2.Tree) obj; - } - - /** - * Method removeUserColours. - * - * @param vUserColours - * @return true if the object was removed from the collection. - */ - public boolean removeUserColours( - final jalview.schemabinding.version2.UserColours vUserColours) { - boolean removed = _userColoursList.remove(vUserColours); - return removed; - } - - /** - * Method removeUserColoursAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.UserColours removeUserColoursAt( - final int index) { - java.lang.Object obj = this._userColoursList.remove(index); - return (jalview.schemabinding.version2.UserColours) obj; - } - - /** - * Method removeViewport. - * - * @param vViewport - * @return true if the object was removed from the collection. - */ - public boolean removeViewport( - final jalview.schemabinding.version2.Viewport vViewport) { - boolean removed = _viewportList.remove(vViewport); - return removed; - } - - /** - * Method removeViewportAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.Viewport removeViewportAt( - final int index) { - java.lang.Object obj = this._viewportList.remove(index); - return (jalview.schemabinding.version2.Viewport) obj; - } - - /** - * Sets the value of field 'featureSettings'. - * - * @param featureSettings the value of field 'featureSettings'. - */ - public void setFeatureSettings( - final jalview.schemabinding.version2.FeatureSettings featureSettings) { - this._featureSettings = featureSettings; - } - - /** - * - * - * @param index - * @param vJGroup - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setJGroup( - final int index, - final jalview.schemabinding.version2.JGroup vJGroup) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._JGroupList.size()) { - throw new IndexOutOfBoundsException("setJGroup: Index value '" + index + "' not in range [0.." + (this._JGroupList.size() - 1) + "]"); - } - - this._JGroupList.set(index, vJGroup); - } - - /** - * - * - * @param vJGroupArray - */ - public void setJGroup( - final jalview.schemabinding.version2.JGroup[] vJGroupArray) { - //-- copy array - _JGroupList.clear(); - - for (int i = 0; i < vJGroupArray.length; i++) { - this._JGroupList.add(vJGroupArray[i]); - } - } - - /** - * - * - * @param index - * @param vJSeq - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setJSeq( - final int index, - final jalview.schemabinding.version2.JSeq vJSeq) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._JSeqList.size()) { - throw new IndexOutOfBoundsException("setJSeq: Index value '" + index + "' not in range [0.." + (this._JSeqList.size() - 1) + "]"); - } - - this._JSeqList.set(index, vJSeq); - } - - /** - * - * - * @param vJSeqArray - */ - public void setJSeq( - final jalview.schemabinding.version2.JSeq[] vJSeqArray) { - //-- copy array - _JSeqList.clear(); - - for (int i = 0; i < vJSeqArray.length; i++) { - this._JSeqList.add(vJSeqArray[i]); - } - } - - /** - * - * - * @param index - * @param vTree - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setTree( - final int index, - final jalview.schemabinding.version2.Tree vTree) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._treeList.size()) { - throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]"); - } - - this._treeList.set(index, vTree); - } - - /** - * - * - * @param vTreeArray - */ - public void setTree( - final jalview.schemabinding.version2.Tree[] vTreeArray) { - //-- copy array - _treeList.clear(); - - for (int i = 0; i < vTreeArray.length; i++) { - this._treeList.add(vTreeArray[i]); - } - } - - /** - * - * - * @param index - * @param vUserColours - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setUserColours( - final int index, - final jalview.schemabinding.version2.UserColours vUserColours) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._userColoursList.size()) { - throw new IndexOutOfBoundsException("setUserColours: Index value '" + index + "' not in range [0.." + (this._userColoursList.size() - 1) + "]"); - } - - this._userColoursList.set(index, vUserColours); - } - - /** - * - * - * @param vUserColoursArray - */ - public void setUserColours( - final jalview.schemabinding.version2.UserColours[] vUserColoursArray) { - //-- copy array - _userColoursList.clear(); - - for (int i = 0; i < vUserColoursArray.length; i++) { - this._userColoursList.add(vUserColoursArray[i]); - } - } - - /** - * - * - * @param index - * @param vViewport - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setViewport( - final int index, - final jalview.schemabinding.version2.Viewport vViewport) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._viewportList.size()) { - throw new IndexOutOfBoundsException("setViewport: Index value '" + index + "' not in range [0.." + (this._viewportList.size() - 1) + "]"); - } - - this._viewportList.set(index, vViewport); - } - - /** - * - * - * @param vViewportArray - */ - public void setViewport( - final jalview.schemabinding.version2.Viewport[] vViewportArray) { - //-- copy array - _viewportList.clear(); - - for (int i = 0; i < vViewportArray.length; i++) { - this._viewportList.add(vViewportArray[i]); - } - } - - /** - * 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.JalviewModelSequence - */ - public static jalview.schemabinding.version2.JalviewModelSequence unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.JalviewModelSequence) Unmarshaller.unmarshal(jalview.schemabinding.version2.JalviewModelSequence.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class JalviewModelSequence implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _JSeqList. + */ + private java.util.Vector _JSeqList; + + /** + * Field _JGroupList. + */ + private java.util.Vector _JGroupList; + + /** + * Field _viewportList. + */ + private java.util.Vector _viewportList; + + /** + * Field _userColoursList. + */ + private java.util.Vector _userColoursList; + + /** + * Field _treeList. + */ + private java.util.Vector _treeList; + + /** + * Field _featureSettings. + */ + private jalview.schemabinding.version2.FeatureSettings _featureSettings; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public JalviewModelSequence() + { + super(); + this._JSeqList = new java.util.Vector(); + this._JGroupList = new java.util.Vector(); + this._viewportList = new java.util.Vector(); + this._userColoursList = new java.util.Vector(); + this._treeList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vJGroup + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addJGroup(final jalview.schemabinding.version2.JGroup vJGroup) + throws java.lang.IndexOutOfBoundsException + { + this._JGroupList.addElement(vJGroup); + } + + /** + * + * + * @param index + * @param vJGroup + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addJGroup(final int index, + final jalview.schemabinding.version2.JGroup vJGroup) + throws java.lang.IndexOutOfBoundsException + { + this._JGroupList.add(index, vJGroup); + } + + /** + * + * + * @param vJSeq + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addJSeq(final jalview.schemabinding.version2.JSeq vJSeq) + throws java.lang.IndexOutOfBoundsException + { + this._JSeqList.addElement(vJSeq); + } + + /** + * + * + * @param index + * @param vJSeq + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addJSeq(final int index, + final jalview.schemabinding.version2.JSeq vJSeq) + throws java.lang.IndexOutOfBoundsException + { + this._JSeqList.add(index, vJSeq); + } + + /** + * + * + * @param vTree + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addTree(final jalview.schemabinding.version2.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + this._treeList.addElement(vTree); + } + + /** + * + * + * @param index + * @param vTree + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addTree(final int index, + final jalview.schemabinding.version2.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + this._treeList.add(index, vTree); + } + + /** + * + * + * @param vUserColours + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addUserColours( + final jalview.schemabinding.version2.UserColours vUserColours) + throws java.lang.IndexOutOfBoundsException + { + this._userColoursList.addElement(vUserColours); + } + + /** + * + * + * @param index + * @param vUserColours + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addUserColours(final int index, + final jalview.schemabinding.version2.UserColours vUserColours) + throws java.lang.IndexOutOfBoundsException + { + this._userColoursList.add(index, vUserColours); + } + + /** + * + * + * @param vViewport + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addViewport( + final jalview.schemabinding.version2.Viewport vViewport) + throws java.lang.IndexOutOfBoundsException + { + this._viewportList.addElement(vViewport); + } + + /** + * + * + * @param index + * @param vViewport + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addViewport(final int index, + final jalview.schemabinding.version2.Viewport vViewport) + throws java.lang.IndexOutOfBoundsException + { + this._viewportList.add(index, vViewport); + } + + /** + * Method enumerateJGroup. + * + * @return an Enumeration over all jalview.schemabinding.version2.JGroup + * elements + */ + public java.util.Enumeration enumerateJGroup() + { + return this._JGroupList.elements(); + } + + /** + * Method enumerateJSeq. + * + * @return an Enumeration over all jalview.schemabinding.version2.JSeq + * elements + */ + public java.util.Enumeration enumerateJSeq() + { + return this._JSeqList.elements(); + } + + /** + * Method enumerateTree. + * + * @return an Enumeration over all jalview.schemabinding.version2.Tree + * elements + */ + public java.util.Enumeration enumerateTree() + { + return this._treeList.elements(); + } + + /** + * Method enumerateUserColours. + * + * @return an Enumeration over all jalview.schemabinding.version2.UserColours + * elements + */ + public java.util.Enumeration enumerateUserColours() + { + return this._userColoursList.elements(); + } + + /** + * Method enumerateViewport. + * + * @return an Enumeration over all jalview.schemabinding.version2.Viewport + * elements + */ + public java.util.Enumeration enumerateViewport() + { + return this._viewportList.elements(); + } + + /** + * Returns the value of field 'featureSettings'. + * + * @return the value of field 'FeatureSettings'. + */ + public jalview.schemabinding.version2.FeatureSettings getFeatureSettings() + { + return this._featureSettings; + } + + /** + * Method getJGroup. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.JGroup at the given + * index + */ + public jalview.schemabinding.version2.JGroup getJGroup(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._JGroupList.size()) + { + throw new IndexOutOfBoundsException("getJGroup: Index value '" + + index + "' not in range [0.." + + (this._JGroupList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.JGroup) _JGroupList.get(index); + } + + /** + * Method getJGroup.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 jalview.schemabinding.version2.JGroup[] getJGroup() + { + jalview.schemabinding.version2.JGroup[] array = new jalview.schemabinding.version2.JGroup[0]; + return (jalview.schemabinding.version2.JGroup[]) this._JGroupList + .toArray(array); + } + + /** + * Method getJGroupCount. + * + * @return the size of this collection + */ + public int getJGroupCount() + { + return this._JGroupList.size(); + } + + /** + * Method getJSeq. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.JSeq at the given + * index + */ + public jalview.schemabinding.version2.JSeq getJSeq(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._JSeqList.size()) + { + throw new IndexOutOfBoundsException("getJSeq: Index value '" + index + + "' not in range [0.." + (this._JSeqList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.JSeq) _JSeqList.get(index); + } + + /** + * Method getJSeq.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 jalview.schemabinding.version2.JSeq[] getJSeq() + { + jalview.schemabinding.version2.JSeq[] array = new jalview.schemabinding.version2.JSeq[0]; + return (jalview.schemabinding.version2.JSeq[]) this._JSeqList + .toArray(array); + } + + /** + * Method getJSeqCount. + * + * @return the size of this collection + */ + public int getJSeqCount() + { + return this._JSeqList.size(); + } + + /** + * Method getTree. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.Tree at the given + * index + */ + public jalview.schemabinding.version2.Tree getTree(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._treeList.size()) + { + throw new IndexOutOfBoundsException("getTree: Index value '" + index + + "' not in range [0.." + (this._treeList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.Tree) _treeList.get(index); + } + + /** + * Method getTree.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 jalview.schemabinding.version2.Tree[] getTree() + { + jalview.schemabinding.version2.Tree[] array = new jalview.schemabinding.version2.Tree[0]; + return (jalview.schemabinding.version2.Tree[]) this._treeList + .toArray(array); + } + + /** + * Method getTreeCount. + * + * @return the size of this collection + */ + public int getTreeCount() + { + return this._treeList.size(); + } + + /** + * Method getUserColours. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.UserColours at the + * given index + */ + public jalview.schemabinding.version2.UserColours getUserColours( + final int index) throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._userColoursList.size()) + { + throw new IndexOutOfBoundsException("getUserColours: Index value '" + + index + "' not in range [0.." + + (this._userColoursList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.UserColours) _userColoursList + .get(index); + } + + /** + * Method getUserColours.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 jalview.schemabinding.version2.UserColours[] getUserColours() + { + jalview.schemabinding.version2.UserColours[] array = new jalview.schemabinding.version2.UserColours[0]; + return (jalview.schemabinding.version2.UserColours[]) this._userColoursList + .toArray(array); + } + + /** + * Method getUserColoursCount. + * + * @return the size of this collection + */ + public int getUserColoursCount() + { + return this._userColoursList.size(); + } + + /** + * Method getViewport. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.Viewport at the + * given index + */ + public jalview.schemabinding.version2.Viewport getViewport(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._viewportList.size()) + { + throw new IndexOutOfBoundsException("getViewport: Index value '" + + index + "' not in range [0.." + + (this._viewportList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.Viewport) _viewportList + .get(index); + } + + /** + * Method getViewport.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 jalview.schemabinding.version2.Viewport[] getViewport() + { + jalview.schemabinding.version2.Viewport[] array = new jalview.schemabinding.version2.Viewport[0]; + return (jalview.schemabinding.version2.Viewport[]) this._viewportList + .toArray(array); + } + + /** + * Method getViewportCount. + * + * @return the size of this collection + */ + public int getViewportCount() + { + return this._viewportList.size(); + } + + /** + * 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 removeAllJGroup() + { + this._JGroupList.clear(); + } + + /** + */ + public void removeAllJSeq() + { + this._JSeqList.clear(); + } + + /** + */ + public void removeAllTree() + { + this._treeList.clear(); + } + + /** + */ + public void removeAllUserColours() + { + this._userColoursList.clear(); + } + + /** + */ + public void removeAllViewport() + { + this._viewportList.clear(); + } + + /** + * Method removeJGroup. + * + * @param vJGroup + * @return true if the object was removed from the collection. + */ + public boolean removeJGroup( + final jalview.schemabinding.version2.JGroup vJGroup) + { + boolean removed = _JGroupList.remove(vJGroup); + return removed; + } + + /** + * Method removeJGroupAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.JGroup removeJGroupAt( + final int index) + { + java.lang.Object obj = this._JGroupList.remove(index); + return (jalview.schemabinding.version2.JGroup) obj; + } + + /** + * Method removeJSeq. + * + * @param vJSeq + * @return true if the object was removed from the collection. + */ + public boolean removeJSeq(final jalview.schemabinding.version2.JSeq vJSeq) + { + boolean removed = _JSeqList.remove(vJSeq); + return removed; + } + + /** + * Method removeJSeqAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.JSeq removeJSeqAt(final int index) + { + java.lang.Object obj = this._JSeqList.remove(index); + return (jalview.schemabinding.version2.JSeq) obj; + } + + /** + * Method removeTree. + * + * @param vTree + * @return true if the object was removed from the collection. + */ + public boolean removeTree(final jalview.schemabinding.version2.Tree vTree) + { + boolean removed = _treeList.remove(vTree); + return removed; + } + + /** + * Method removeTreeAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.Tree removeTreeAt(final int index) + { + java.lang.Object obj = this._treeList.remove(index); + return (jalview.schemabinding.version2.Tree) obj; + } + + /** + * Method removeUserColours. + * + * @param vUserColours + * @return true if the object was removed from the collection. + */ + public boolean removeUserColours( + final jalview.schemabinding.version2.UserColours vUserColours) + { + boolean removed = _userColoursList.remove(vUserColours); + return removed; + } + + /** + * Method removeUserColoursAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.UserColours removeUserColoursAt( + final int index) + { + java.lang.Object obj = this._userColoursList.remove(index); + return (jalview.schemabinding.version2.UserColours) obj; + } + + /** + * Method removeViewport. + * + * @param vViewport + * @return true if the object was removed from the collection. + */ + public boolean removeViewport( + final jalview.schemabinding.version2.Viewport vViewport) + { + boolean removed = _viewportList.remove(vViewport); + return removed; + } + + /** + * Method removeViewportAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.Viewport removeViewportAt( + final int index) + { + java.lang.Object obj = this._viewportList.remove(index); + return (jalview.schemabinding.version2.Viewport) obj; + } + + /** + * Sets the value of field 'featureSettings'. + * + * @param featureSettings + * the value of field 'featureSettings'. + */ + public void setFeatureSettings( + final jalview.schemabinding.version2.FeatureSettings featureSettings) + { + this._featureSettings = featureSettings; + } + + /** + * + * + * @param index + * @param vJGroup + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setJGroup(final int index, + final jalview.schemabinding.version2.JGroup vJGroup) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._JGroupList.size()) + { + throw new IndexOutOfBoundsException("setJGroup: Index value '" + + index + "' not in range [0.." + + (this._JGroupList.size() - 1) + "]"); + } + + this._JGroupList.set(index, vJGroup); + } + + /** + * + * + * @param vJGroupArray + */ + public void setJGroup( + final jalview.schemabinding.version2.JGroup[] vJGroupArray) + { + // -- copy array + _JGroupList.clear(); + + for (int i = 0; i < vJGroupArray.length; i++) + { + this._JGroupList.add(vJGroupArray[i]); + } + } + + /** + * + * + * @param index + * @param vJSeq + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setJSeq(final int index, + final jalview.schemabinding.version2.JSeq vJSeq) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._JSeqList.size()) + { + throw new IndexOutOfBoundsException("setJSeq: Index value '" + index + + "' not in range [0.." + (this._JSeqList.size() - 1) + "]"); + } + + this._JSeqList.set(index, vJSeq); + } + + /** + * + * + * @param vJSeqArray + */ + public void setJSeq(final jalview.schemabinding.version2.JSeq[] vJSeqArray) + { + // -- copy array + _JSeqList.clear(); + + for (int i = 0; i < vJSeqArray.length; i++) + { + this._JSeqList.add(vJSeqArray[i]); + } + } + + /** + * + * + * @param index + * @param vTree + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setTree(final int index, + final jalview.schemabinding.version2.Tree vTree) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._treeList.size()) + { + throw new IndexOutOfBoundsException("setTree: Index value '" + index + + "' not in range [0.." + (this._treeList.size() - 1) + "]"); + } + + this._treeList.set(index, vTree); + } + + /** + * + * + * @param vTreeArray + */ + public void setTree(final jalview.schemabinding.version2.Tree[] vTreeArray) + { + // -- copy array + _treeList.clear(); + + for (int i = 0; i < vTreeArray.length; i++) + { + this._treeList.add(vTreeArray[i]); + } + } + + /** + * + * + * @param index + * @param vUserColours + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setUserColours(final int index, + final jalview.schemabinding.version2.UserColours vUserColours) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._userColoursList.size()) + { + throw new IndexOutOfBoundsException("setUserColours: Index value '" + + index + "' not in range [0.." + + (this._userColoursList.size() - 1) + "]"); + } + + this._userColoursList.set(index, vUserColours); + } + + /** + * + * + * @param vUserColoursArray + */ + public void setUserColours( + final jalview.schemabinding.version2.UserColours[] vUserColoursArray) + { + // -- copy array + _userColoursList.clear(); + + for (int i = 0; i < vUserColoursArray.length; i++) + { + this._userColoursList.add(vUserColoursArray[i]); + } + } + + /** + * + * + * @param index + * @param vViewport + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setViewport(final int index, + final jalview.schemabinding.version2.Viewport vViewport) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._viewportList.size()) + { + throw new IndexOutOfBoundsException("setViewport: Index value '" + + index + "' not in range [0.." + + (this._viewportList.size() - 1) + "]"); + } + + this._viewportList.set(index, vViewport); + } + + /** + * + * + * @param vViewportArray + */ + public void setViewport( + final jalview.schemabinding.version2.Viewport[] vViewportArray) + { + // -- copy array + _viewportList.clear(); + + for (int i = 0; i < vViewportArray.length; i++) + { + this._viewportList.add(vViewportArray[i]); + } + } + + /** + * 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.JalviewModelSequence + */ + public static jalview.schemabinding.version2.JalviewModelSequence unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.JalviewModelSequence) Unmarshaller + .unmarshal( + jalview.schemabinding.version2.JalviewModelSequence.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/JalviewUserColours.java b/src/jalview/schemabinding/version2/JalviewUserColours.java index e1f1a19..042f092 100644 --- a/src/jalview/schemabinding/version2/JalviewUserColours.java +++ b/src/jalview/schemabinding/version2/JalviewUserColours.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,313 +19,328 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class JalviewUserColours implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _schemeName. - */ - private java.lang.String _schemeName; - - /** - * Jalview colour scheme document version. - * - */ - private java.lang.String _version; - - /** - * Field _colourList. - */ - private java.util.Vector _colourList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public JalviewUserColours() { - super(); - this._colourList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vColour - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addColour( - final Colour vColour) - throws java.lang.IndexOutOfBoundsException { - this._colourList.addElement(vColour); - } - - /** - * - * - * @param index - * @param vColour - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addColour( - final int index, - final Colour vColour) - throws java.lang.IndexOutOfBoundsException { - this._colourList.add(index, vColour); - } - - /** - * Method enumerateColour. - * - * @return an Enumeration over all Colour elements - */ - public java.util.Enumeration enumerateColour( - ) { - return this._colourList.elements(); - } - - /** - * Method getColour. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the Colour at the given index - */ - public Colour getColour( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._colourList.size()) { - throw new IndexOutOfBoundsException("getColour: Index value '" + index + "' not in range [0.." + (this._colourList.size() - 1) + "]"); - } - - return (Colour) _colourList.get(index); - } - - /** - * Method getColour.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 Colour[] getColour( - ) { - Colour[] array = new Colour[0]; - return (Colour[]) this._colourList.toArray(array); - } - - /** - * Method getColourCount. - * - * @return the size of this collection - */ - public int getColourCount( - ) { - return this._colourList.size(); - } - - /** - * Returns the value of field 'schemeName'. - * - * @return the value of field 'SchemeName'. - */ - public java.lang.String getSchemeName( - ) { - return this._schemeName; - } - - /** - * Returns the value of field 'version'. The field 'version' - * has the following description: Jalview colour scheme - * document version. - * - * - * @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; - } - 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 removeAllColour( - ) { - this._colourList.clear(); - } - - /** - * Method removeColour. - * - * @param vColour - * @return true if the object was removed from the collection. - */ - public boolean removeColour( - final Colour vColour) { - boolean removed = _colourList.remove(vColour); - return removed; +public class JalviewUserColours implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _schemeName. + */ + private java.lang.String _schemeName; + + /** + * Jalview colour scheme document version. + * + */ + private java.lang.String _version; + + /** + * Field _colourList. + */ + private java.util.Vector _colourList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public JalviewUserColours() + { + super(); + this._colourList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vColour + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addColour(final Colour vColour) + throws java.lang.IndexOutOfBoundsException + { + this._colourList.addElement(vColour); + } + + /** + * + * + * @param index + * @param vColour + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addColour(final int index, final Colour vColour) + throws java.lang.IndexOutOfBoundsException + { + this._colourList.add(index, vColour); + } + + /** + * Method enumerateColour. + * + * @return an Enumeration over all Colour elements + */ + public java.util.Enumeration enumerateColour() + { + return this._colourList.elements(); + } + + /** + * Method getColour. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the Colour at the given index + */ + public Colour getColour(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._colourList.size()) + { + throw new IndexOutOfBoundsException("getColour: Index value '" + + index + "' not in range [0.." + + (this._colourList.size() - 1) + "]"); } - /** - * Method removeColourAt. - * - * @param index - * @return the element removed from the collection - */ - public Colour removeColourAt( - final int index) { - java.lang.Object obj = this._colourList.remove(index); - return (Colour) obj; + return (Colour) _colourList.get(index); + } + + /** + * Method getColour.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 Colour[] getColour() + { + Colour[] array = new Colour[0]; + return (Colour[]) this._colourList.toArray(array); + } + + /** + * Method getColourCount. + * + * @return the size of this collection + */ + public int getColourCount() + { + return this._colourList.size(); + } + + /** + * Returns the value of field 'schemeName'. + * + * @return the value of field 'SchemeName'. + */ + public java.lang.String getSchemeName() + { + return this._schemeName; + } + + /** + * Returns the value of field 'version'. The field 'version' has the following + * description: Jalview colour scheme document version. + * + * + * @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; } - - /** - * - * - * @param index - * @param vColour - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection + 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 setColour( - final int index, - final Colour vColour) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._colourList.size()) { - throw new IndexOutOfBoundsException("setColour: Index value '" + index + "' not in range [0.." + (this._colourList.size() - 1) + "]"); - } - - this._colourList.set(index, vColour); + public void removeAllColour() + { + this._colourList.clear(); + } + + /** + * Method removeColour. + * + * @param vColour + * @return true if the object was removed from the collection. + */ + public boolean removeColour(final Colour vColour) + { + boolean removed = _colourList.remove(vColour); + return removed; + } + + /** + * Method removeColourAt. + * + * @param index + * @return the element removed from the collection + */ + public Colour removeColourAt(final int index) + { + java.lang.Object obj = this._colourList.remove(index); + return (Colour) obj; + } + + /** + * + * + * @param index + * @param vColour + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setColour(final int index, final Colour vColour) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._colourList.size()) + { + throw new IndexOutOfBoundsException("setColour: Index value '" + + index + "' not in range [0.." + + (this._colourList.size() - 1) + "]"); } - /** - * - * - * @param vColourArray - */ - public void setColour( - final Colour[] vColourArray) { - //-- copy array - _colourList.clear(); - - for (int i = 0; i < vColourArray.length; i++) { - this._colourList.add(vColourArray[i]); - } - } - - /** - * Sets the value of field 'schemeName'. - * - * @param schemeName the value of field 'schemeName'. - */ - public void setSchemeName( - final java.lang.String schemeName) { - this._schemeName = schemeName; - } - - /** - * Sets the value of field 'version'. The field 'version' has - * the following description: Jalview colour scheme document - * version. - * - * - * @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.JalviewUserColours - */ - public static jalview.schemabinding.version2.JalviewUserColours unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.JalviewUserColours) Unmarshaller.unmarshal(jalview.schemabinding.version2.JalviewUserColours.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._colourList.set(index, vColour); + } + + /** + * + * + * @param vColourArray + */ + public void setColour(final Colour[] vColourArray) + { + // -- copy array + _colourList.clear(); + + for (int i = 0; i < vColourArray.length; i++) + { + this._colourList.add(vColourArray[i]); } + } + + /** + * Sets the value of field 'schemeName'. + * + * @param schemeName + * the value of field 'schemeName'. + */ + public void setSchemeName(final java.lang.String schemeName) + { + this._schemeName = schemeName; + } + + /** + * Sets the value of field 'version'. The field 'version' has the following + * description: Jalview colour scheme document version. + * + * + * @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.JalviewUserColours + */ + public static jalview.schemabinding.version2.JalviewUserColours unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.JalviewUserColours) Unmarshaller + .unmarshal( + jalview.schemabinding.version2.JalviewUserColours.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/MapListFrom.java b/src/jalview/schemabinding/version2/MapListFrom.java index eaa86c2..67bf1dc 100644 --- a/src/jalview/schemabinding/version2/MapListFrom.java +++ b/src/jalview/schemabinding/version2/MapListFrom.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,198 +19,209 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class MapListFrom implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _start. - */ - private int _start; - - /** - * keeps track of state for field: _start - */ - private boolean _has_start; - - /** - * Field _end. - */ - private int _end; - - /** - * keeps track of state for field: _end - */ - private boolean _has_end; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public MapListFrom() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deleteEnd( - ) { - this._has_end= false; - } - - /** - */ - public void deleteStart( - ) { - this._has_start= false; - } - - /** - * Returns the value of field 'end'. - * - * @return the value of field 'End'. - */ - public int getEnd( - ) { - return this._end; - } - - /** - * Returns the value of field 'start'. - * - * @return the value of field 'Start'. - */ - public int getStart( - ) { - return this._start; - } - - /** - * Method hasEnd. - * - * @return true if at least one End has been added - */ - public boolean hasEnd( - ) { - return this._has_end; - } - - /** - * Method hasStart. - * - * @return true if at least one Start has been added - */ - public boolean hasStart( - ) { - return this._has_start; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'end'. - * - * @param end the value of field 'end'. - */ - public void setEnd( - final int end) { - this._end = end; - this._has_end = true; - } - - /** - * Sets the value of field 'start'. - * - * @param start the value of field 'start'. - */ - public void setStart( - final int start) { - this._start = start; - this._has_start = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled - * jalview.schemabinding.version2.MapListFrom - */ - public static jalview.schemabinding.version2.MapListFrom unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.MapListFrom) Unmarshaller.unmarshal(jalview.schemabinding.version2.MapListFrom.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); +public class MapListFrom implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _start. + */ + private int _start; + + /** + * keeps track of state for field: _start + */ + private boolean _has_start; + + /** + * Field _end. + */ + private int _end; + + /** + * keeps track of state for field: _end + */ + private boolean _has_end; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public MapListFrom() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + */ + public void deleteEnd() + { + this._has_end = false; + } + + /** + */ + public void deleteStart() + { + this._has_start = false; + } + + /** + * Returns the value of field 'end'. + * + * @return the value of field 'End'. + */ + public int getEnd() + { + return this._end; + } + + /** + * Returns the value of field 'start'. + * + * @return the value of field 'Start'. + */ + public int getStart() + { + return this._start; + } + + /** + * Method hasEnd. + * + * @return true if at least one End has been added + */ + public boolean hasEnd() + { + return this._has_end; + } + + /** + * Method hasStart. + * + * @return true if at least one Start has been added + */ + public boolean hasStart() + { + return this._has_start; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'end'. + * + * @param end + * the value of field 'end'. + */ + public void setEnd(final int end) + { + this._end = end; + this._has_end = true; + } + + /** + * Sets the value of field 'start'. + * + * @param start + * the value of field 'start'. + */ + public void setStart(final int start) + { + this._start = start; + this._has_start = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.schemabinding.version2.MapListFrom + */ + public static jalview.schemabinding.version2.MapListFrom unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.MapListFrom) Unmarshaller + .unmarshal(jalview.schemabinding.version2.MapListFrom.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/MapListTo.java b/src/jalview/schemabinding/version2/MapListTo.java index c60750a..e59baf8 100644 --- a/src/jalview/schemabinding/version2/MapListTo.java +++ b/src/jalview/schemabinding/version2/MapListTo.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,198 +19,209 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class MapListTo implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _start. - */ - private int _start; - - /** - * keeps track of state for field: _start - */ - private boolean _has_start; - - /** - * Field _end. - */ - private int _end; - - /** - * keeps track of state for field: _end - */ - private boolean _has_end; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public MapListTo() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deleteEnd( - ) { - this._has_end= false; - } - - /** - */ - public void deleteStart( - ) { - this._has_start= false; - } - - /** - * Returns the value of field 'end'. - * - * @return the value of field 'End'. - */ - public int getEnd( - ) { - return this._end; - } - - /** - * Returns the value of field 'start'. - * - * @return the value of field 'Start'. - */ - public int getStart( - ) { - return this._start; - } - - /** - * Method hasEnd. - * - * @return true if at least one End has been added - */ - public boolean hasEnd( - ) { - return this._has_end; - } - - /** - * Method hasStart. - * - * @return true if at least one Start has been added - */ - public boolean hasStart( - ) { - return this._has_start; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'end'. - * - * @param end the value of field 'end'. - */ - public void setEnd( - final int end) { - this._end = end; - this._has_end = true; - } - - /** - * Sets the value of field 'start'. - * - * @param start the value of field 'start'. - */ - public void setStart( - final int start) { - this._start = start; - this._has_start = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled - * jalview.schemabinding.version2.MapListTo - */ - public static jalview.schemabinding.version2.MapListTo unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.MapListTo) Unmarshaller.unmarshal(jalview.schemabinding.version2.MapListTo.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); +public class MapListTo implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _start. + */ + private int _start; + + /** + * keeps track of state for field: _start + */ + private boolean _has_start; + + /** + * Field _end. + */ + private int _end; + + /** + * keeps track of state for field: _end + */ + private boolean _has_end; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public MapListTo() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + */ + public void deleteEnd() + { + this._has_end = false; + } + + /** + */ + public void deleteStart() + { + this._has_start = false; + } + + /** + * Returns the value of field 'end'. + * + * @return the value of field 'End'. + */ + public int getEnd() + { + return this._end; + } + + /** + * Returns the value of field 'start'. + * + * @return the value of field 'Start'. + */ + public int getStart() + { + return this._start; + } + + /** + * Method hasEnd. + * + * @return true if at least one End has been added + */ + public boolean hasEnd() + { + return this._has_end; + } + + /** + * Method hasStart. + * + * @return true if at least one Start has been added + */ + public boolean hasStart() + { + return this._has_start; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'end'. + * + * @param end + * the value of field 'end'. + */ + public void setEnd(final int end) + { + this._end = end; + this._has_end = true; + } + + /** + * Sets the value of field 'start'. + * + * @param start + * the value of field 'start'. + */ + public void setStart(final int start) + { + this._start = start; + this._has_start = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.schemabinding.version2.MapListTo + */ + public static jalview.schemabinding.version2.MapListTo unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.MapListTo) Unmarshaller + .unmarshal(jalview.schemabinding.version2.MapListTo.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/MapListType.java b/src/jalview/schemabinding/version2/MapListType.java index 3efc950..cfb0752 100644 --- a/src/jalview/schemabinding/version2/MapListType.java +++ b/src/jalview/schemabinding/version2/MapListType.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -17,566 +17,581 @@ import org.exolab.castor.xml.Unmarshaller; /** * developed after mapRangeType from * http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes - * - * This effectively represents a java.util.MapList object - * + * + * This effectively represents a java.util.MapList object + * * * @version $Revision$ $Date$ */ -public class MapListType implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * number of dictionary symbol widths involved in each - * mapped position on this sequence (for example, 3 for a dna - * sequence exon - * region that is being mapped to a protein sequence). This is - * optional, - * since the unit can be usually be inferred from the - * dictionary type of - * each sequence involved in the mapping. - */ - private long _mapFromUnit; - - /** - * keeps track of state for field: _mapFromUnit - */ - private boolean _has_mapFromUnit; - - /** - * number of dictionary symbol widths involved in each - * mapped position on this sequence (for example, 3 for a dna - * sequence exon - * region that is being mapped to a protein sequence). This is - * optional, - * since the unit can be usually be inferred from the - * dictionary type of - * each sequence involved in the mapping. - */ - private long _mapToUnit; - - /** - * keeps track of state for field: _mapToUnit - */ - private boolean _has_mapToUnit; - - /** - * a region from start to end inclusive - */ - private java.util.Vector _mapListFromList; - - /** - * a region from start to end inclusive - */ - private java.util.Vector _mapListToList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public MapListType() { - super(); - this._mapListFromList = new java.util.Vector(); - this._mapListToList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vMapListFrom - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addMapListFrom( - final jalview.schemabinding.version2.MapListFrom vMapListFrom) - throws java.lang.IndexOutOfBoundsException { - this._mapListFromList.addElement(vMapListFrom); - } - - /** - * - * - * @param index - * @param vMapListFrom - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addMapListFrom( - final int index, - final jalview.schemabinding.version2.MapListFrom vMapListFrom) - throws java.lang.IndexOutOfBoundsException { - this._mapListFromList.add(index, vMapListFrom); - } - - /** - * - * - * @param vMapListTo - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addMapListTo( - final jalview.schemabinding.version2.MapListTo vMapListTo) - throws java.lang.IndexOutOfBoundsException { - this._mapListToList.addElement(vMapListTo); - } - - /** - * - * - * @param index - * @param vMapListTo - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addMapListTo( - final int index, - final jalview.schemabinding.version2.MapListTo vMapListTo) - throws java.lang.IndexOutOfBoundsException { - this._mapListToList.add(index, vMapListTo); - } - - /** - */ - public void deleteMapFromUnit( - ) { - this._has_mapFromUnit= false; - } - - /** - */ - public void deleteMapToUnit( - ) { - this._has_mapToUnit= false; - } - - /** - * Method enumerateMapListFrom. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.MapListFrom elements - */ - public java.util.Enumeration enumerateMapListFrom( - ) { - return this._mapListFromList.elements(); - } - - /** - * Method enumerateMapListTo. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.MapListTo elements - */ - public java.util.Enumeration enumerateMapListTo( - ) { - return this._mapListToList.elements(); - } - - /** - * Returns the value of field 'mapFromUnit'. The field - * 'mapFromUnit' has the following description: number of - * dictionary symbol widths involved in each - * mapped position on this sequence (for example, 3 for a dna - * sequence exon - * region that is being mapped to a protein sequence). This is - * optional, - * since the unit can be usually be inferred from the - * dictionary type of - * each sequence involved in the mapping. - * - * @return the value of field 'MapFromUnit'. - */ - public long getMapFromUnit( - ) { - return this._mapFromUnit; - } - - /** - * Method getMapListFrom. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.MapListFrom at the given index - */ - public jalview.schemabinding.version2.MapListFrom getMapListFrom( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._mapListFromList.size()) { - throw new IndexOutOfBoundsException("getMapListFrom: Index value '" + index + "' not in range [0.." + (this._mapListFromList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.MapListFrom) _mapListFromList.get(index); - } - - /** - * Method getMapListFrom.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 jalview.schemabinding.version2.MapListFrom[] getMapListFrom( - ) { - jalview.schemabinding.version2.MapListFrom[] array = new jalview.schemabinding.version2.MapListFrom[0]; - return (jalview.schemabinding.version2.MapListFrom[]) this._mapListFromList.toArray(array); - } - - /** - * Method getMapListFromCount. - * - * @return the size of this collection - */ - public int getMapListFromCount( - ) { - return this._mapListFromList.size(); - } - - /** - * Method getMapListTo. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.MapListTo at the given index - */ - public jalview.schemabinding.version2.MapListTo getMapListTo( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._mapListToList.size()) { - throw new IndexOutOfBoundsException("getMapListTo: Index value '" + index + "' not in range [0.." + (this._mapListToList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.MapListTo) _mapListToList.get(index); - } - - /** - * Method getMapListTo.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 jalview.schemabinding.version2.MapListTo[] getMapListTo( - ) { - jalview.schemabinding.version2.MapListTo[] array = new jalview.schemabinding.version2.MapListTo[0]; - return (jalview.schemabinding.version2.MapListTo[]) this._mapListToList.toArray(array); - } - - /** - * Method getMapListToCount. - * - * @return the size of this collection - */ - public int getMapListToCount( - ) { - return this._mapListToList.size(); - } - - /** - * Returns the value of field 'mapToUnit'. The field - * 'mapToUnit' has the following description: number of - * dictionary symbol widths involved in each - * mapped position on this sequence (for example, 3 for a dna - * sequence exon - * region that is being mapped to a protein sequence). This is - * optional, - * since the unit can be usually be inferred from the - * dictionary type of - * each sequence involved in the mapping. - * - * @return the value of field 'MapToUnit'. - */ - public long getMapToUnit( - ) { - return this._mapToUnit; - } - - /** - * Method hasMapFromUnit. - * - * @return true if at least one MapFromUnit has been added - */ - public boolean hasMapFromUnit( - ) { - return this._has_mapFromUnit; - } - - /** - * Method hasMapToUnit. - * - * @return true if at least one MapToUnit has been added - */ - public boolean hasMapToUnit( - ) { - return this._has_mapToUnit; - } - - /** - * 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 removeAllMapListFrom( - ) { - this._mapListFromList.clear(); - } - - /** - */ - public void removeAllMapListTo( - ) { - this._mapListToList.clear(); - } - - /** - * Method removeMapListFrom. - * - * @param vMapListFrom - * @return true if the object was removed from the collection. - */ - public boolean removeMapListFrom( - final jalview.schemabinding.version2.MapListFrom vMapListFrom) { - boolean removed = _mapListFromList.remove(vMapListFrom); - return removed; - } - - /** - * Method removeMapListFromAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.MapListFrom removeMapListFromAt( - final int index) { - java.lang.Object obj = this._mapListFromList.remove(index); - return (jalview.schemabinding.version2.MapListFrom) obj; - } - - /** - * Method removeMapListTo. - * - * @param vMapListTo - * @return true if the object was removed from the collection. - */ - public boolean removeMapListTo( - final jalview.schemabinding.version2.MapListTo vMapListTo) { - boolean removed = _mapListToList.remove(vMapListTo); - return removed; - } - - /** - * Method removeMapListToAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.MapListTo removeMapListToAt( - final int index) { - java.lang.Object obj = this._mapListToList.remove(index); - return (jalview.schemabinding.version2.MapListTo) obj; - } - - /** - * Sets the value of field 'mapFromUnit'. The field - * 'mapFromUnit' has the following description: number of - * dictionary symbol widths involved in each - * mapped position on this sequence (for example, 3 for a dna - * sequence exon - * region that is being mapped to a protein sequence). This is - * optional, - * since the unit can be usually be inferred from the - * dictionary type of - * each sequence involved in the mapping. - * - * @param mapFromUnit the value of field 'mapFromUnit'. - */ - public void setMapFromUnit( - final long mapFromUnit) { - this._mapFromUnit = mapFromUnit; - this._has_mapFromUnit = true; - } - - /** - * - * - * @param index - * @param vMapListFrom - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setMapListFrom( - final int index, - final jalview.schemabinding.version2.MapListFrom vMapListFrom) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._mapListFromList.size()) { - throw new IndexOutOfBoundsException("setMapListFrom: Index value '" + index + "' not in range [0.." + (this._mapListFromList.size() - 1) + "]"); - } - - this._mapListFromList.set(index, vMapListFrom); - } - - /** - * - * - * @param vMapListFromArray - */ - public void setMapListFrom( - final jalview.schemabinding.version2.MapListFrom[] vMapListFromArray) { - //-- copy array - _mapListFromList.clear(); - - for (int i = 0; i < vMapListFromArray.length; i++) { - this._mapListFromList.add(vMapListFromArray[i]); - } - } - - /** - * - * - * @param index - * @param vMapListTo - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setMapListTo( - final int index, - final jalview.schemabinding.version2.MapListTo vMapListTo) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._mapListToList.size()) { - throw new IndexOutOfBoundsException("setMapListTo: Index value '" + index + "' not in range [0.." + (this._mapListToList.size() - 1) + "]"); - } - - this._mapListToList.set(index, vMapListTo); - } - - /** - * - * - * @param vMapListToArray - */ - public void setMapListTo( - final jalview.schemabinding.version2.MapListTo[] vMapListToArray) { - //-- copy array - _mapListToList.clear(); - - for (int i = 0; i < vMapListToArray.length; i++) { - this._mapListToList.add(vMapListToArray[i]); - } - } - - /** - * Sets the value of field 'mapToUnit'. The field 'mapToUnit' - * has the following description: number of dictionary symbol - * widths involved in each - * mapped position on this sequence (for example, 3 for a dna - * sequence exon - * region that is being mapped to a protein sequence). This is - * optional, - * since the unit can be usually be inferred from the - * dictionary type of - * each sequence involved in the mapping. - * - * @param mapToUnit the value of field 'mapToUnit'. - */ - public void setMapToUnit( - final long mapToUnit) { - this._mapToUnit = mapToUnit; - this._has_mapToUnit = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled - * jalview.schemabinding.version2.MapListType - */ - public static jalview.schemabinding.version2.MapListType unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.MapListType) Unmarshaller.unmarshal(jalview.schemabinding.version2.MapListType.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class MapListType implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * number of dictionary symbol widths involved in each mapped position on this + * sequence (for example, 3 for a dna sequence exon region that is being + * mapped to a protein sequence). This is optional, since the unit can be + * usually be inferred from the dictionary type of each sequence involved in + * the mapping. + */ + private long _mapFromUnit; + + /** + * keeps track of state for field: _mapFromUnit + */ + private boolean _has_mapFromUnit; + + /** + * number of dictionary symbol widths involved in each mapped position on this + * sequence (for example, 3 for a dna sequence exon region that is being + * mapped to a protein sequence). This is optional, since the unit can be + * usually be inferred from the dictionary type of each sequence involved in + * the mapping. + */ + private long _mapToUnit; + + /** + * keeps track of state for field: _mapToUnit + */ + private boolean _has_mapToUnit; + + /** + * a region from start to end inclusive + */ + private java.util.Vector _mapListFromList; + + /** + * a region from start to end inclusive + */ + private java.util.Vector _mapListToList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public MapListType() + { + super(); + this._mapListFromList = new java.util.Vector(); + this._mapListToList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vMapListFrom + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addMapListFrom( + final jalview.schemabinding.version2.MapListFrom vMapListFrom) + throws java.lang.IndexOutOfBoundsException + { + this._mapListFromList.addElement(vMapListFrom); + } + + /** + * + * + * @param index + * @param vMapListFrom + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addMapListFrom(final int index, + final jalview.schemabinding.version2.MapListFrom vMapListFrom) + throws java.lang.IndexOutOfBoundsException + { + this._mapListFromList.add(index, vMapListFrom); + } + + /** + * + * + * @param vMapListTo + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addMapListTo( + final jalview.schemabinding.version2.MapListTo vMapListTo) + throws java.lang.IndexOutOfBoundsException + { + this._mapListToList.addElement(vMapListTo); + } + + /** + * + * + * @param index + * @param vMapListTo + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addMapListTo(final int index, + final jalview.schemabinding.version2.MapListTo vMapListTo) + throws java.lang.IndexOutOfBoundsException + { + this._mapListToList.add(index, vMapListTo); + } + + /** + */ + public void deleteMapFromUnit() + { + this._has_mapFromUnit = false; + } + + /** + */ + public void deleteMapToUnit() + { + this._has_mapToUnit = false; + } + + /** + * Method enumerateMapListFrom. + * + * @return an Enumeration over all jalview.schemabinding.version2.MapListFrom + * elements + */ + public java.util.Enumeration enumerateMapListFrom() + { + return this._mapListFromList.elements(); + } + + /** + * Method enumerateMapListTo. + * + * @return an Enumeration over all jalview.schemabinding.version2.MapListTo + * elements + */ + public java.util.Enumeration enumerateMapListTo() + { + return this._mapListToList.elements(); + } + + /** + * Returns the value of field 'mapFromUnit'. The field 'mapFromUnit' has the + * following description: number of dictionary symbol widths involved in each + * mapped position on this sequence (for example, 3 for a dna sequence exon + * region that is being mapped to a protein sequence). This is optional, since + * the unit can be usually be inferred from the dictionary type of each + * sequence involved in the mapping. + * + * @return the value of field 'MapFromUnit'. + */ + public long getMapFromUnit() + { + return this._mapFromUnit; + } + + /** + * Method getMapListFrom. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.MapListFrom at the + * given index + */ + public jalview.schemabinding.version2.MapListFrom getMapListFrom( + final int index) throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._mapListFromList.size()) + { + throw new IndexOutOfBoundsException("getMapListFrom: Index value '" + + index + "' not in range [0.." + + (this._mapListFromList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.MapListFrom) _mapListFromList + .get(index); + } + + /** + * Method getMapListFrom.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 jalview.schemabinding.version2.MapListFrom[] getMapListFrom() + { + jalview.schemabinding.version2.MapListFrom[] array = new jalview.schemabinding.version2.MapListFrom[0]; + return (jalview.schemabinding.version2.MapListFrom[]) this._mapListFromList + .toArray(array); + } + + /** + * Method getMapListFromCount. + * + * @return the size of this collection + */ + public int getMapListFromCount() + { + return this._mapListFromList.size(); + } + + /** + * Method getMapListTo. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.MapListTo at the + * given index + */ + public jalview.schemabinding.version2.MapListTo getMapListTo( + final int index) throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._mapListToList.size()) + { + throw new IndexOutOfBoundsException("getMapListTo: Index value '" + + index + "' not in range [0.." + + (this._mapListToList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.MapListTo) _mapListToList + .get(index); + } + + /** + * Method getMapListTo.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 jalview.schemabinding.version2.MapListTo[] getMapListTo() + { + jalview.schemabinding.version2.MapListTo[] array = new jalview.schemabinding.version2.MapListTo[0]; + return (jalview.schemabinding.version2.MapListTo[]) this._mapListToList + .toArray(array); + } + + /** + * Method getMapListToCount. + * + * @return the size of this collection + */ + public int getMapListToCount() + { + return this._mapListToList.size(); + } + + /** + * Returns the value of field 'mapToUnit'. The field 'mapToUnit' has the + * following description: number of dictionary symbol widths involved in each + * mapped position on this sequence (for example, 3 for a dna sequence exon + * region that is being mapped to a protein sequence). This is optional, since + * the unit can be usually be inferred from the dictionary type of each + * sequence involved in the mapping. + * + * @return the value of field 'MapToUnit'. + */ + public long getMapToUnit() + { + return this._mapToUnit; + } + + /** + * Method hasMapFromUnit. + * + * @return true if at least one MapFromUnit has been added + */ + public boolean hasMapFromUnit() + { + return this._has_mapFromUnit; + } + + /** + * Method hasMapToUnit. + * + * @return true if at least one MapToUnit has been added + */ + public boolean hasMapToUnit() + { + return this._has_mapToUnit; + } + + /** + * 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 removeAllMapListFrom() + { + this._mapListFromList.clear(); + } + + /** + */ + public void removeAllMapListTo() + { + this._mapListToList.clear(); + } + + /** + * Method removeMapListFrom. + * + * @param vMapListFrom + * @return true if the object was removed from the collection. + */ + public boolean removeMapListFrom( + final jalview.schemabinding.version2.MapListFrom vMapListFrom) + { + boolean removed = _mapListFromList.remove(vMapListFrom); + return removed; + } + + /** + * Method removeMapListFromAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.MapListFrom removeMapListFromAt( + final int index) + { + java.lang.Object obj = this._mapListFromList.remove(index); + return (jalview.schemabinding.version2.MapListFrom) obj; + } + + /** + * Method removeMapListTo. + * + * @param vMapListTo + * @return true if the object was removed from the collection. + */ + public boolean removeMapListTo( + final jalview.schemabinding.version2.MapListTo vMapListTo) + { + boolean removed = _mapListToList.remove(vMapListTo); + return removed; + } + + /** + * Method removeMapListToAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.MapListTo removeMapListToAt( + final int index) + { + java.lang.Object obj = this._mapListToList.remove(index); + return (jalview.schemabinding.version2.MapListTo) obj; + } + + /** + * Sets the value of field 'mapFromUnit'. The field 'mapFromUnit' has the + * following description: number of dictionary symbol widths involved in each + * mapped position on this sequence (for example, 3 for a dna sequence exon + * region that is being mapped to a protein sequence). This is optional, since + * the unit can be usually be inferred from the dictionary type of each + * sequence involved in the mapping. + * + * @param mapFromUnit + * the value of field 'mapFromUnit'. + */ + public void setMapFromUnit(final long mapFromUnit) + { + this._mapFromUnit = mapFromUnit; + this._has_mapFromUnit = true; + } + + /** + * + * + * @param index + * @param vMapListFrom + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setMapListFrom(final int index, + final jalview.schemabinding.version2.MapListFrom vMapListFrom) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._mapListFromList.size()) + { + throw new IndexOutOfBoundsException("setMapListFrom: Index value '" + + index + "' not in range [0.." + + (this._mapListFromList.size() - 1) + "]"); + } + + this._mapListFromList.set(index, vMapListFrom); + } + + /** + * + * + * @param vMapListFromArray + */ + public void setMapListFrom( + final jalview.schemabinding.version2.MapListFrom[] vMapListFromArray) + { + // -- copy array + _mapListFromList.clear(); + + for (int i = 0; i < vMapListFromArray.length; i++) + { + this._mapListFromList.add(vMapListFromArray[i]); + } + } + + /** + * + * + * @param index + * @param vMapListTo + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setMapListTo(final int index, + final jalview.schemabinding.version2.MapListTo vMapListTo) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._mapListToList.size()) + { + throw new IndexOutOfBoundsException("setMapListTo: Index value '" + + index + "' not in range [0.." + + (this._mapListToList.size() - 1) + "]"); + } + + this._mapListToList.set(index, vMapListTo); + } + + /** + * + * + * @param vMapListToArray + */ + public void setMapListTo( + final jalview.schemabinding.version2.MapListTo[] vMapListToArray) + { + // -- copy array + _mapListToList.clear(); + + for (int i = 0; i < vMapListToArray.length; i++) + { + this._mapListToList.add(vMapListToArray[i]); + } + } + + /** + * Sets the value of field 'mapToUnit'. The field 'mapToUnit' has the + * following description: number of dictionary symbol widths involved in each + * mapped position on this sequence (for example, 3 for a dna sequence exon + * region that is being mapped to a protein sequence). This is optional, since + * the unit can be usually be inferred from the dictionary type of each + * sequence involved in the mapping. + * + * @param mapToUnit + * the value of field 'mapToUnit'. + */ + public void setMapToUnit(final long mapToUnit) + { + this._mapToUnit = mapToUnit; + this._has_mapToUnit = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.schemabinding.version2.MapListType + */ + public static jalview.schemabinding.version2.MapListType unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.MapListType) Unmarshaller + .unmarshal(jalview.schemabinding.version2.MapListType.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/Mapping.java b/src/jalview/schemabinding/version2/Mapping.java index 068fd9f..9d71e1d 100644 --- a/src/jalview/schemabinding/version2/Mapping.java +++ b/src/jalview/schemabinding/version2/Mapping.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,147 +19,155 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Mapping extends jalview.schemabinding.version2.MapListType -implements java.io.Serializable +public class Mapping extends jalview.schemabinding.version2.MapListType + implements java.io.Serializable { - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Internal choice value storage - */ - private java.lang.Object _choiceValue; - - /** - * Field _mappingChoice. - */ - private jalview.schemabinding.version2.MappingChoice _mappingChoice; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Mapping() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Returns the value of field 'choiceValue'. The field - * 'choiceValue' has the following description: Internal choice - * value storage - * - * @return the value of field 'ChoiceValue'. - */ - public java.lang.Object getChoiceValue( - ) { - return this._choiceValue; - } - - /** - * Returns the value of field 'mappingChoice'. - * - * @return the value of field 'MappingChoice'. - */ - public jalview.schemabinding.version2.MappingChoice getMappingChoice( - ) { - return this._mappingChoice; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'mappingChoice'. - * - * @param mappingChoice the value of field 'mappingChoice'. - */ - public void setMappingChoice( - final jalview.schemabinding.version2.MappingChoice mappingChoice) { - this._mappingChoice = mappingChoice; - this._choiceValue = mappingChoice; - } - - /** - * 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.MapListType - */ - public static jalview.schemabinding.version2.MapListType unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.MapListType) Unmarshaller.unmarshal(jalview.schemabinding.version2.Mapping.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); + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Internal choice value storage + */ + private java.lang.Object _choiceValue; + + /** + * Field _mappingChoice. + */ + private jalview.schemabinding.version2.MappingChoice _mappingChoice; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Mapping() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Returns the value of field 'choiceValue'. The field 'choiceValue' has the + * following description: Internal choice value storage + * + * @return the value of field 'ChoiceValue'. + */ + public java.lang.Object getChoiceValue() + { + return this._choiceValue; + } + + /** + * Returns the value of field 'mappingChoice'. + * + * @return the value of field 'MappingChoice'. + */ + public jalview.schemabinding.version2.MappingChoice getMappingChoice() + { + return this._mappingChoice; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'mappingChoice'. + * + * @param mappingChoice + * the value of field 'mappingChoice'. + */ + public void setMappingChoice( + final jalview.schemabinding.version2.MappingChoice mappingChoice) + { + this._mappingChoice = mappingChoice; + this._choiceValue = mappingChoice; + } + + /** + * 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.MapListType + */ + public static jalview.schemabinding.version2.MapListType unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.MapListType) Unmarshaller + .unmarshal(jalview.schemabinding.version2.Mapping.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/MappingChoice.java b/src/jalview/schemabinding/version2/MappingChoice.java index 297ed89..e50efa7 100644 --- a/src/jalview/schemabinding/version2/MappingChoice.java +++ b/src/jalview/schemabinding/version2/MappingChoice.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,152 +19,164 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class MappingChoice implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _sequence. - */ - private jalview.schemabinding.version2.Sequence _sequence; - - /** - * Field _dseqFor. - */ - private java.lang.String _dseqFor; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public MappingChoice() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Returns the value of field 'dseqFor'. - * - * @return the value of field 'DseqFor'. - */ - public java.lang.String getDseqFor( - ) { - return this._dseqFor; - } - - /** - * Returns the value of field 'sequence'. - * - * @return the value of field 'Sequence'. - */ - public jalview.schemabinding.version2.Sequence getSequence( - ) { - return this._sequence; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'dseqFor'. - * - * @param dseqFor the value of field 'dseqFor'. - */ - public void setDseqFor( - final java.lang.String dseqFor) { - this._dseqFor = dseqFor; - } - - /** - * Sets the value of field 'sequence'. - * - * @param sequence the value of field 'sequence'. - */ - public void setSequence( - final jalview.schemabinding.version2.Sequence sequence) { - this._sequence = sequence; - } - - /** - * 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.MappingChoice - */ - public static jalview.schemabinding.version2.MappingChoice unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.MappingChoice) Unmarshaller.unmarshal(jalview.schemabinding.version2.MappingChoice.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); +public class MappingChoice implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _sequence. + */ + private jalview.schemabinding.version2.Sequence _sequence; + + /** + * Field _dseqFor. + */ + private java.lang.String _dseqFor; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public MappingChoice() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Returns the value of field 'dseqFor'. + * + * @return the value of field 'DseqFor'. + */ + public java.lang.String getDseqFor() + { + return this._dseqFor; + } + + /** + * Returns the value of field 'sequence'. + * + * @return the value of field 'Sequence'. + */ + public jalview.schemabinding.version2.Sequence getSequence() + { + return this._sequence; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'dseqFor'. + * + * @param dseqFor + * the value of field 'dseqFor'. + */ + public void setDseqFor(final java.lang.String dseqFor) + { + this._dseqFor = dseqFor; + } + + /** + * Sets the value of field 'sequence'. + * + * @param sequence + * the value of field 'sequence'. + */ + public void setSequence( + final jalview.schemabinding.version2.Sequence sequence) + { + this._sequence = sequence; + } + + /** + * 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.MappingChoice + */ + public static jalview.schemabinding.version2.MappingChoice unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.MappingChoice) Unmarshaller + .unmarshal(jalview.schemabinding.version2.MappingChoice.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/OtherData.java b/src/jalview/schemabinding/version2/OtherData.java index 3cdd86e..fb6b276 100644 --- a/src/jalview/schemabinding/version2/OtherData.java +++ b/src/jalview/schemabinding/version2/OtherData.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,152 +19,163 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class OtherData implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _key. - */ - private java.lang.String _key; - - /** - * Field _value. - */ - private java.lang.String _value; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public OtherData() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Returns the value of field 'key'. - * - * @return the value of field 'Key'. - */ - public java.lang.String getKey( - ) { - return this._key; - } - - /** - * Returns the value of field 'value'. - * - * @return the value of field 'Value'. - */ - public java.lang.String getValue( - ) { - return this._value; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'key'. - * - * @param key the value of field 'key'. - */ - public void setKey( - final java.lang.String key) { - this._key = key; - } - - /** - * Sets the value of field 'value'. - * - * @param value the value of field 'value'. - */ - public void setValue( - final java.lang.String value) { - this._value = value; - } - - /** - * 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.OtherData - */ - public static jalview.schemabinding.version2.OtherData unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.OtherData) Unmarshaller.unmarshal(jalview.schemabinding.version2.OtherData.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); +public class OtherData implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _key. + */ + private java.lang.String _key; + + /** + * Field _value. + */ + private java.lang.String _value; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public OtherData() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Returns the value of field 'key'. + * + * @return the value of field 'Key'. + */ + public java.lang.String getKey() + { + return this._key; + } + + /** + * Returns the value of field 'value'. + * + * @return the value of field 'Value'. + */ + public java.lang.String getValue() + { + return this._value; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'key'. + * + * @param key + * the value of field 'key'. + */ + public void setKey(final java.lang.String key) + { + this._key = key; + } + + /** + * Sets the value of field 'value'. + * + * @param value + * the value of field 'value'. + */ + public void setValue(final java.lang.String value) + { + this._value = value; + } + + /** + * 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.OtherData + */ + public static jalview.schemabinding.version2.OtherData unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.OtherData) Unmarshaller + .unmarshal(jalview.schemabinding.version2.OtherData.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/Pdbentry.java b/src/jalview/schemabinding/version2/Pdbentry.java index b5acfbd..65de364 100644 --- a/src/jalview/schemabinding/version2/Pdbentry.java +++ b/src/jalview/schemabinding/version2/Pdbentry.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,334 +19,357 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Pdbentry implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _id. - */ - private java.lang.String _id; - - /** - * Field _type. - */ - private java.lang.String _type; - - /** - * Field _file. - */ - private java.lang.String _file; - - /** - * Field _items. - */ - private java.util.Vector _items; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Pdbentry() { - super(); - this._items = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vPdbentryItem - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addPdbentryItem( - final jalview.schemabinding.version2.PdbentryItem vPdbentryItem) - throws java.lang.IndexOutOfBoundsException { - this._items.addElement(vPdbentryItem); - } - - /** - * - * - * @param index - * @param vPdbentryItem - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addPdbentryItem( - final int index, - final jalview.schemabinding.version2.PdbentryItem vPdbentryItem) - throws java.lang.IndexOutOfBoundsException { - this._items.add(index, vPdbentryItem); - } - - /** - * Method enumeratePdbentryItem. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.PdbentryItem elements - */ - public java.util.Enumeration enumeratePdbentryItem( - ) { - return this._items.elements(); - } - - /** - * Returns the value of field 'file'. - * - * @return the value of field 'File'. - */ - public java.lang.String getFile( - ) { - return this._file; - } - - /** - * Returns the value of field 'id'. - * - * @return the value of field 'Id'. - */ - public java.lang.String getId( - ) { - return this._id; - } - - /** - * Method getPdbentryItem. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.PdbentryItem at the given inde - */ - public jalview.schemabinding.version2.PdbentryItem getPdbentryItem( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._items.size()) { - throw new IndexOutOfBoundsException("getPdbentryItem: Index value '" + index + "' not in range [0.." + (this._items.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.PdbentryItem) _items.get(index); - } - - /** - * Method getPdbentryItem.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 jalview.schemabinding.version2.PdbentryItem[] getPdbentryItem( - ) { - jalview.schemabinding.version2.PdbentryItem[] array = new jalview.schemabinding.version2.PdbentryItem[0]; - return (jalview.schemabinding.version2.PdbentryItem[]) this._items.toArray(array); - } - - /** - * Method getPdbentryItemCount. - * - * @return the size of this collection - */ - public int getPdbentryItemCount( - ) { - return this._items.size(); - } - - /** - * Returns the value of field 'type'. - * - * @return the value of field 'Type'. - */ - public java.lang.String getType( - ) { - return this._type; - } - - /** - * 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 removeAllPdbentryItem( - ) { - this._items.clear(); - } - - /** - * Method removePdbentryItem. - * - * @param vPdbentryItem - * @return true if the object was removed from the collection. - */ - public boolean removePdbentryItem( - final jalview.schemabinding.version2.PdbentryItem vPdbentryItem) { - boolean removed = _items.remove(vPdbentryItem); - return removed; - } - - /** - * Method removePdbentryItemAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.PdbentryItem removePdbentryItemAt( - final int index) { - java.lang.Object obj = this._items.remove(index); - return (jalview.schemabinding.version2.PdbentryItem) obj; - } - - /** - * Sets the value of field 'file'. - * - * @param file the value of field 'file'. - */ - public void setFile( - final java.lang.String file) { - this._file = file; +public class Pdbentry implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _id. + */ + private java.lang.String _id; + + /** + * Field _type. + */ + private java.lang.String _type; + + /** + * Field _file. + */ + private java.lang.String _file; + + /** + * Field _items. + */ + private java.util.Vector _items; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Pdbentry() + { + super(); + this._items = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vPdbentryItem + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addPdbentryItem( + final jalview.schemabinding.version2.PdbentryItem vPdbentryItem) + throws java.lang.IndexOutOfBoundsException + { + this._items.addElement(vPdbentryItem); + } + + /** + * + * + * @param index + * @param vPdbentryItem + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addPdbentryItem(final int index, + final jalview.schemabinding.version2.PdbentryItem vPdbentryItem) + throws java.lang.IndexOutOfBoundsException + { + this._items.add(index, vPdbentryItem); + } + + /** + * Method enumeratePdbentryItem. + * + * @return an Enumeration over all jalview.schemabinding.version2.PdbentryItem + * elements + */ + public java.util.Enumeration enumeratePdbentryItem() + { + return this._items.elements(); + } + + /** + * Returns the value of field 'file'. + * + * @return the value of field 'File'. + */ + public java.lang.String getFile() + { + return this._file; + } + + /** + * Returns the value of field 'id'. + * + * @return the value of field 'Id'. + */ + public java.lang.String getId() + { + return this._id; + } + + /** + * Method getPdbentryItem. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.PdbentryItem at the + * given inde + */ + public jalview.schemabinding.version2.PdbentryItem getPdbentryItem( + final int index) throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._items.size()) + { + throw new IndexOutOfBoundsException("getPdbentryItem: Index value '" + + index + "' not in range [0.." + (this._items.size() - 1) + + "]"); } - /** - * Sets the value of field 'id'. - * - * @param id the value of field 'id'. - */ - public void setId( - final java.lang.String id) { - this._id = id; + return (jalview.schemabinding.version2.PdbentryItem) _items.get(index); + } + + /** + * Method getPdbentryItem.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 jalview.schemabinding.version2.PdbentryItem[] getPdbentryItem() + { + jalview.schemabinding.version2.PdbentryItem[] array = new jalview.schemabinding.version2.PdbentryItem[0]; + return (jalview.schemabinding.version2.PdbentryItem[]) this._items + .toArray(array); + } + + /** + * Method getPdbentryItemCount. + * + * @return the size of this collection + */ + public int getPdbentryItemCount() + { + return this._items.size(); + } + + /** + * Returns the value of field 'type'. + * + * @return the value of field 'Type'. + */ + public java.lang.String getType() + { + return this._type; + } + + /** + * 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; } - - /** - * - * - * @param index - * @param vPdbentryItem - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection + 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 setPdbentryItem( - final int index, - final jalview.schemabinding.version2.PdbentryItem vPdbentryItem) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._items.size()) { - throw new IndexOutOfBoundsException("setPdbentryItem: Index value '" + index + "' not in range [0.." + (this._items.size() - 1) + "]"); - } - - this._items.set(index, vPdbentryItem); + public void removeAllPdbentryItem() + { + this._items.clear(); + } + + /** + * Method removePdbentryItem. + * + * @param vPdbentryItem + * @return true if the object was removed from the collection. + */ + public boolean removePdbentryItem( + final jalview.schemabinding.version2.PdbentryItem vPdbentryItem) + { + boolean removed = _items.remove(vPdbentryItem); + return removed; + } + + /** + * Method removePdbentryItemAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.PdbentryItem removePdbentryItemAt( + final int index) + { + java.lang.Object obj = this._items.remove(index); + return (jalview.schemabinding.version2.PdbentryItem) obj; + } + + /** + * Sets the value of field 'file'. + * + * @param file + * the value of field 'file'. + */ + public void setFile(final java.lang.String file) + { + this._file = file; + } + + /** + * Sets the value of field 'id'. + * + * @param id + * the value of field 'id'. + */ + public void setId(final java.lang.String id) + { + this._id = id; + } + + /** + * + * + * @param index + * @param vPdbentryItem + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setPdbentryItem(final int index, + final jalview.schemabinding.version2.PdbentryItem vPdbentryItem) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._items.size()) + { + throw new IndexOutOfBoundsException("setPdbentryItem: Index value '" + + index + "' not in range [0.." + (this._items.size() - 1) + + "]"); } - /** - * - * - * @param vPdbentryItemArray - */ - public void setPdbentryItem( - final jalview.schemabinding.version2.PdbentryItem[] vPdbentryItemArray) { - //-- copy array - _items.clear(); - - for (int i = 0; i < vPdbentryItemArray.length; i++) { - this._items.add(vPdbentryItemArray[i]); - } - } - - /** - * Sets the value of field 'type'. - * - * @param type the value of field 'type'. - */ - public void setType( - final java.lang.String type) { - this._type = type; - } - - /** - * 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.Pdbentry - */ - public static jalview.schemabinding.version2.Pdbentry unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.Pdbentry) Unmarshaller.unmarshal(jalview.schemabinding.version2.Pdbentry.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._items.set(index, vPdbentryItem); + } + + /** + * + * + * @param vPdbentryItemArray + */ + public void setPdbentryItem( + final jalview.schemabinding.version2.PdbentryItem[] vPdbentryItemArray) + { + // -- copy array + _items.clear(); + + for (int i = 0; i < vPdbentryItemArray.length; i++) + { + this._items.add(vPdbentryItemArray[i]); } + } + + /** + * Sets the value of field 'type'. + * + * @param type + * the value of field 'type'. + */ + public void setType(final java.lang.String type) + { + this._type = type; + } + + /** + * 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.Pdbentry + */ + public static jalview.schemabinding.version2.Pdbentry unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Pdbentry) Unmarshaller + .unmarshal(jalview.schemabinding.version2.Pdbentry.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/PdbentryItem.java b/src/jalview/schemabinding/version2/PdbentryItem.java index 129bcc7..5554b49 100644 --- a/src/jalview/schemabinding/version2/PdbentryItem.java +++ b/src/jalview/schemabinding/version2/PdbentryItem.java @@ -12,181 +12,193 @@ package jalview.schemabinding.version2; * * @version $Revision$ $Date$ */ -public class PdbentryItem implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _propertyList. - */ - private java.util.Vector _propertyList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public PdbentryItem() { - super(); - this._propertyList = new java.util.Vector(); +public class PdbentryItem implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _propertyList. + */ + private java.util.Vector _propertyList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public PdbentryItem() + { + super(); + this._propertyList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vProperty + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addProperty( + final jalview.schemabinding.version2.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + this._propertyList.addElement(vProperty); + } + + /** + * + * + * @param index + * @param vProperty + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addProperty(final int index, + final jalview.schemabinding.version2.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + this._propertyList.add(index, vProperty); + } + + /** + * Method enumerateProperty. + * + * @return an Enumeration over all jalview.schemabinding.version2.Property + * elements + */ + public java.util.Enumeration enumerateProperty() + { + return this._propertyList.elements(); + } + + /** + * Method getProperty. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.Property at the + * given index + */ + public jalview.schemabinding.version2.Property getProperty(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) + { + throw new IndexOutOfBoundsException("getProperty: Index value '" + + index + "' not in range [0.." + + (this._propertyList.size() - 1) + "]"); } - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vProperty - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection + return (jalview.schemabinding.version2.Property) _propertyList + .get(index); + } + + /** + * Method getProperty.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 jalview.schemabinding.version2.Property[] getProperty() + { + jalview.schemabinding.version2.Property[] array = new jalview.schemabinding.version2.Property[0]; + return (jalview.schemabinding.version2.Property[]) this._propertyList + .toArray(array); + } + + /** + * Method getPropertyCount. + * + * @return the size of this collection + */ + public int getPropertyCount() + { + return this._propertyList.size(); + } + + /** */ - public void addProperty( - final jalview.schemabinding.version2.Property vProperty) - throws java.lang.IndexOutOfBoundsException { - this._propertyList.addElement(vProperty); + public void removeAllProperty() + { + this._propertyList.clear(); + } + + /** + * Method removeProperty. + * + * @param vProperty + * @return true if the object was removed from the collection. + */ + public boolean removeProperty( + final jalview.schemabinding.version2.Property vProperty) + { + boolean removed = _propertyList.remove(vProperty); + return removed; + } + + /** + * Method removePropertyAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.Property removePropertyAt( + final int index) + { + java.lang.Object obj = this._propertyList.remove(index); + return (jalview.schemabinding.version2.Property) obj; + } + + /** + * + * + * @param index + * @param vProperty + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setProperty(final int index, + final jalview.schemabinding.version2.Property vProperty) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._propertyList.size()) + { + throw new IndexOutOfBoundsException("setProperty: Index value '" + + index + "' not in range [0.." + + (this._propertyList.size() - 1) + "]"); } - /** - * - * - * @param index - * @param vProperty - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addProperty( - final int index, - final jalview.schemabinding.version2.Property vProperty) - throws java.lang.IndexOutOfBoundsException { - this._propertyList.add(index, vProperty); - } - - /** - * Method enumerateProperty. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.Property elements - */ - public java.util.Enumeration enumerateProperty( - ) { - return this._propertyList.elements(); - } - - /** - * Method getProperty. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.Property at the given index - */ - public jalview.schemabinding.version2.Property getProperty( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._propertyList.size()) { - throw new IndexOutOfBoundsException("getProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.Property) _propertyList.get(index); - } - - /** - * Method getProperty.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 jalview.schemabinding.version2.Property[] getProperty( - ) { - jalview.schemabinding.version2.Property[] array = new jalview.schemabinding.version2.Property[0]; - return (jalview.schemabinding.version2.Property[]) this._propertyList.toArray(array); - } - - /** - * Method getPropertyCount. - * - * @return the size of this collection - */ - public int getPropertyCount( - ) { - return this._propertyList.size(); - } - - /** - */ - public void removeAllProperty( - ) { - this._propertyList.clear(); - } - - /** - * Method removeProperty. - * - * @param vProperty - * @return true if the object was removed from the collection. - */ - public boolean removeProperty( - final jalview.schemabinding.version2.Property vProperty) { - boolean removed = _propertyList.remove(vProperty); - return removed; - } - - /** - * Method removePropertyAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.Property removePropertyAt( - final int index) { - java.lang.Object obj = this._propertyList.remove(index); - return (jalview.schemabinding.version2.Property) obj; - } - - /** - * - * - * @param index - * @param vProperty - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setProperty( - final int index, - final jalview.schemabinding.version2.Property vProperty) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._propertyList.size()) { - throw new IndexOutOfBoundsException("setProperty: Index value '" + index + "' not in range [0.." + (this._propertyList.size() - 1) + "]"); - } - - this._propertyList.set(index, vProperty); - } - - /** - * - * - * @param vPropertyArray - */ - public void setProperty( - final jalview.schemabinding.version2.Property[] vPropertyArray) { - //-- copy array - _propertyList.clear(); - - for (int i = 0; i < vPropertyArray.length; i++) { - this._propertyList.add(vPropertyArray[i]); - } + this._propertyList.set(index, vProperty); + } + + /** + * + * + * @param vPropertyArray + */ + public void setProperty( + final jalview.schemabinding.version2.Property[] vPropertyArray) + { + // -- copy array + _propertyList.clear(); + + for (int i = 0; i < vPropertyArray.length; i++) + { + this._propertyList.add(vPropertyArray[i]); } + } } diff --git a/src/jalview/schemabinding/version2/Pdbids.java b/src/jalview/schemabinding/version2/Pdbids.java index 5266b99..978df5b 100644 --- a/src/jalview/schemabinding/version2/Pdbids.java +++ b/src/jalview/schemabinding/version2/Pdbids.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,262 +19,285 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Pdbids extends jalview.schemabinding.version2.Pdbentry -implements java.io.Serializable +public class Pdbids extends jalview.schemabinding.version2.Pdbentry + implements java.io.Serializable { + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ + /** + * Field _structureStateList. + */ + private java.util.Vector _structureStateList; - /** - * Field _structureStateList. - */ - private java.util.Vector _structureStateList; + // ----------------/ + // - Constructors -/ + // ----------------/ + public Pdbids() + { + super(); + this._structureStateList = new java.util.Vector(); + } - //----------------/ - //- Constructors -/ - //----------------/ + // -----------/ + // - Methods -/ + // -----------/ - public Pdbids() { - super(); - this._structureStateList = new java.util.Vector(); - } + /** + * + * + * @param vStructureState + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addStructureState( + final jalview.schemabinding.version2.StructureState vStructureState) + throws java.lang.IndexOutOfBoundsException + { + this._structureStateList.addElement(vStructureState); + } + /** + * + * + * @param index + * @param vStructureState + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addStructureState( + final int index, + final jalview.schemabinding.version2.StructureState vStructureState) + throws java.lang.IndexOutOfBoundsException + { + this._structureStateList.add(index, vStructureState); + } - //-----------/ - //- Methods -/ - //-----------/ + /** + * Method enumerateStructureState. + * + * @return an Enumeration over all + * jalview.schemabinding.version2.StructureState elements + */ + public java.util.Enumeration enumerateStructureState() + { + return this._structureStateList.elements(); + } - /** - * - * - * @param vStructureState - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addStructureState( - final jalview.schemabinding.version2.StructureState vStructureState) - throws java.lang.IndexOutOfBoundsException { - this._structureStateList.addElement(vStructureState); + /** + * Method getStructureState. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.StructureState at + * the given index + */ + public jalview.schemabinding.version2.StructureState getStructureState( + final int index) throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._structureStateList.size()) + { + throw new IndexOutOfBoundsException( + "getStructureState: Index value '" + index + + "' not in range [0.." + + (this._structureStateList.size() - 1) + "]"); } - /** - * - * - * @param index - * @param vStructureState - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addStructureState( - final int index, - final jalview.schemabinding.version2.StructureState vStructureState) - throws java.lang.IndexOutOfBoundsException { - this._structureStateList.add(index, vStructureState); - } + return (jalview.schemabinding.version2.StructureState) _structureStateList + .get(index); + } - /** - * Method enumerateStructureState. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.StructureState elements - */ - public java.util.Enumeration enumerateStructureState( - ) { - return this._structureStateList.elements(); - } + /** + * Method getStructureState.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 jalview.schemabinding.version2.StructureState[] getStructureState() + { + jalview.schemabinding.version2.StructureState[] array = new jalview.schemabinding.version2.StructureState[0]; + return (jalview.schemabinding.version2.StructureState[]) this._structureStateList + .toArray(array); + } - /** - * Method getStructureState. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.StructureState at the given - * index - */ - public jalview.schemabinding.version2.StructureState getStructureState( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._structureStateList.size()) { - throw new IndexOutOfBoundsException("getStructureState: Index value '" + index + "' not in range [0.." + (this._structureStateList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.StructureState) _structureStateList.get(index); - } + /** + * Method getStructureStateCount. + * + * @return the size of this collection + */ + public int getStructureStateCount() + { + return this._structureStateList.size(); + } - /** - * Method getStructureState.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 jalview.schemabinding.version2.StructureState[] getStructureState( - ) { - jalview.schemabinding.version2.StructureState[] array = new jalview.schemabinding.version2.StructureState[0]; - return (jalview.schemabinding.version2.StructureState[]) this._structureStateList.toArray(array); + /** + * 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; + } - /** - * Method getStructureStateCount. - * - * @return the size of this collection - */ - public int getStructureStateCount( - ) { - return this._structureStateList.size(); - } + /** + * + * + * @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); + } - /** - * 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 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); + } - /** - * - * - * @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); - } + public void removeAllStructureState() + { + this._structureStateList.clear(); + } - /** - * - * - * @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); - } + /** + * Method removeStructureState. + * + * @param vStructureState + * @return true if the object was removed from the collection. + */ + public boolean removeStructureState( + final jalview.schemabinding.version2.StructureState vStructureState) + { + boolean removed = _structureStateList.remove(vStructureState); + return removed; + } - /** - */ - public void removeAllStructureState( - ) { - this._structureStateList.clear(); - } + /** + * Method removeStructureStateAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.StructureState removeStructureStateAt( + final int index) + { + java.lang.Object obj = this._structureStateList.remove(index); + return (jalview.schemabinding.version2.StructureState) obj; + } - /** - * Method removeStructureState. - * - * @param vStructureState - * @return true if the object was removed from the collection. - */ - public boolean removeStructureState( - final jalview.schemabinding.version2.StructureState vStructureState) { - boolean removed = _structureStateList.remove(vStructureState); - return removed; + /** + * + * + * @param index + * @param vStructureState + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setStructureState( + final int index, + final jalview.schemabinding.version2.StructureState vStructureState) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._structureStateList.size()) + { + throw new IndexOutOfBoundsException( + "setStructureState: Index value '" + index + + "' not in range [0.." + + (this._structureStateList.size() - 1) + "]"); } - /** - * Method removeStructureStateAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.StructureState removeStructureStateAt( - final int index) { - java.lang.Object obj = this._structureStateList.remove(index); - return (jalview.schemabinding.version2.StructureState) obj; - } + this._structureStateList.set(index, vStructureState); + } - /** - * - * - * @param index - * @param vStructureState - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setStructureState( - final int index, - final jalview.schemabinding.version2.StructureState vStructureState) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._structureStateList.size()) { - throw new IndexOutOfBoundsException("setStructureState: Index value '" + index + "' not in range [0.." + (this._structureStateList.size() - 1) + "]"); - } - - this._structureStateList.set(index, vStructureState); - } + /** + * + * + * @param vStructureStateArray + */ + public void setStructureState( + final jalview.schemabinding.version2.StructureState[] vStructureStateArray) + { + // -- copy array + _structureStateList.clear(); - /** - * - * - * @param vStructureStateArray - */ - public void setStructureState( - final jalview.schemabinding.version2.StructureState[] vStructureStateArray) { - //-- copy array - _structureStateList.clear(); - - for (int i = 0; i < vStructureStateArray.length; i++) { - this._structureStateList.add(vStructureStateArray[i]); - } + for (int i = 0; i < vStructureStateArray.length; i++) + { + this._structureStateList.add(vStructureStateArray[i]); } + } - /** - * 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.Pdbentry - */ - public static jalview.schemabinding.version2.Pdbentry unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.Pdbentry) Unmarshaller.unmarshal(jalview.schemabinding.version2.Pdbids.class, reader); - } + /** + * 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.Pdbentry + */ + public static jalview.schemabinding.version2.Pdbentry unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Pdbentry) Unmarshaller + .unmarshal(jalview.schemabinding.version2.Pdbids.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); - } + /** + * + * + * @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/Property.java b/src/jalview/schemabinding/version2/Property.java index 714544d..dbf96bf 100644 --- a/src/jalview/schemabinding/version2/Property.java +++ b/src/jalview/schemabinding/version2/Property.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,152 +19,163 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Property implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _name. - */ - private java.lang.String _name; - - /** - * Field _value. - */ - private java.lang.String _value; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Property() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Returns the value of field 'name'. - * - * @return the value of field 'Name'. - */ - public java.lang.String getName( - ) { - return this._name; - } - - /** - * Returns the value of field 'value'. - * - * @return the value of field 'Value'. - */ - public java.lang.String getValue( - ) { - return this._value; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'name'. - * - * @param name the value of field 'name'. - */ - public void setName( - final java.lang.String name) { - this._name = name; - } - - /** - * Sets the value of field 'value'. - * - * @param value the value of field 'value'. - */ - public void setValue( - final java.lang.String value) { - this._value = value; - } - - /** - * 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.Property - */ - public static jalview.schemabinding.version2.Property unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.Property) Unmarshaller.unmarshal(jalview.schemabinding.version2.Property.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); +public class Property implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _name. + */ + private java.lang.String _name; + + /** + * Field _value. + */ + private java.lang.String _value; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Property() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Returns the value of field 'name'. + * + * @return the value of field 'Name'. + */ + public java.lang.String getName() + { + return this._name; + } + + /** + * Returns the value of field 'value'. + * + * @return the value of field 'Value'. + */ + public java.lang.String getValue() + { + return this._value; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'name'. + * + * @param name + * the value of field 'name'. + */ + public void setName(final java.lang.String name) + { + this._name = name; + } + + /** + * Sets the value of field 'value'. + * + * @param value + * the value of field 'value'. + */ + public void setValue(final java.lang.String value) + { + this._value = value; + } + + /** + * 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.Property + */ + public static jalview.schemabinding.version2.Property unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Property) Unmarshaller + .unmarshal(jalview.schemabinding.version2.Property.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/RnaViewer.java b/src/jalview/schemabinding/version2/RnaViewer.java index 96c4195..543d053 100644 --- a/src/jalview/schemabinding/version2/RnaViewer.java +++ b/src/jalview/schemabinding/version2/RnaViewer.java @@ -7,637 +7,662 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; /** - * Reference to a viewer showing RNA structure - * for this sequence. Schema supports one viewer showing multiple - * annotations for multiple sequences, though currently only one - * annotation for one sequence (gapped or trimmed) is used - * + * Reference to a viewer showing RNA structure for this sequence. Schema + * supports one viewer showing multiple annotations for multiple sequences, + * though currently only one annotation for one sequence (gapped or trimmed) is + * used + * * * @version $Revision$ $Date$ */ -public class RnaViewer implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _title. - */ - private java.lang.String _title; - - /** - * An id unique to the RNA viewer panel - * - */ - private java.lang.String _viewId; - - /** - * horizontal position of split pane divider - * - */ - private int _dividerLocation; - - /** - * keeps track of state for field: _dividerLocation - */ - private boolean _has_dividerLocation; - - /** - * Index of the selected structure in the - * viewer panel - * - */ - private int _selectedRna; - - /** - * keeps track of state for field: _selectedRna - */ - private boolean _has_selectedRna; - - /** - * Field _width. - */ - private int _width; - - /** - * keeps track of state for field: _width - */ - private boolean _has_width; - - /** - * Field _height. - */ - private int _height; - - /** - * keeps track of state for field: _height - */ - private boolean _has_height; - - /** - * Field _xpos. - */ - private int _xpos; - - /** - * keeps track of state for field: _xpos - */ - private boolean _has_xpos; - - /** - * Field _ypos. - */ - private int _ypos; - - /** - * keeps track of state for field: _ypos - */ - private boolean _has_ypos; - - /** - * Field _secondaryStructureList. - */ - private java.util.Vector _secondaryStructureList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public RnaViewer() { - super(); - this._secondaryStructureList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vSecondaryStructure - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSecondaryStructure( - final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure) - throws java.lang.IndexOutOfBoundsException { - this._secondaryStructureList.addElement(vSecondaryStructure); - } - - /** - * - * - * @param index - * @param vSecondaryStructure - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSecondaryStructure( - final int index, - final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure) - throws java.lang.IndexOutOfBoundsException { - this._secondaryStructureList.add(index, vSecondaryStructure); - } - - /** - */ - public void deleteDividerLocation( - ) { - this._has_dividerLocation= false; - } - - /** - */ - public void deleteHeight( - ) { - this._has_height= false; - } - - /** - */ - public void deleteSelectedRna( - ) { - this._has_selectedRna= false; - } - - /** - */ - public void deleteWidth( - ) { - this._has_width= false; - } - - /** - */ - public void deleteXpos( - ) { - this._has_xpos= false; - } - - /** - */ - public void deleteYpos( - ) { - this._has_ypos= false; - } - - /** - * Method enumerateSecondaryStructure. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.SecondaryStructure elements - */ - public java.util.Enumeration enumerateSecondaryStructure( - ) { - return this._secondaryStructureList.elements(); - } - - /** - * Returns the value of field 'dividerLocation'. The field - * 'dividerLocation' has the following description: horizontal - * position of split pane divider - * - * - * @return the value of field 'DividerLocation'. - */ - public int getDividerLocation( - ) { - return this._dividerLocation; - } - - /** - * Returns the value of field 'height'. - * - * @return the value of field 'Height'. - */ - public int getHeight( - ) { - return this._height; - } - - /** - * Method getSecondaryStructure. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.SecondaryStructure at the - * given index - */ - public jalview.schemabinding.version2.SecondaryStructure getSecondaryStructure( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._secondaryStructureList.size()) { - throw new IndexOutOfBoundsException("getSecondaryStructure: Index value '" + index + "' not in range [0.." + (this._secondaryStructureList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.SecondaryStructure) _secondaryStructureList.get(index); - } - - /** - * Method getSecondaryStructure.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 jalview.schemabinding.version2.SecondaryStructure[] getSecondaryStructure( - ) { - jalview.schemabinding.version2.SecondaryStructure[] array = new jalview.schemabinding.version2.SecondaryStructure[0]; - return (jalview.schemabinding.version2.SecondaryStructure[]) this._secondaryStructureList.toArray(array); - } - - /** - * Method getSecondaryStructureCount. - * - * @return the size of this collection - */ - public int getSecondaryStructureCount( - ) { - return this._secondaryStructureList.size(); - } - - /** - * Returns the value of field 'selectedRna'. The field - * 'selectedRna' has the following description: Index of the - * selected structure in the - * viewer panel - * - * - * @return the value of field 'SelectedRna'. - */ - public int getSelectedRna( - ) { - return this._selectedRna; - } - - /** - * Returns the value of field 'title'. - * - * @return the value of field 'Title'. - */ - public java.lang.String getTitle( - ) { - return this._title; - } - - /** - * Returns the value of field 'viewId'. The field 'viewId' has - * the following description: An id unique to the RNA viewer - * panel - * - * - * @return the value of field 'ViewId'. - */ - public java.lang.String getViewId( - ) { - return this._viewId; - } - - /** - * Returns the value of field 'width'. - * - * @return the value of field 'Width'. - */ - public int getWidth( - ) { - return this._width; - } - - /** - * Returns the value of field 'xpos'. - * - * @return the value of field 'Xpos'. - */ - public int getXpos( - ) { - return this._xpos; - } - - /** - * Returns the value of field 'ypos'. - * - * @return the value of field 'Ypos'. - */ - public int getYpos( - ) { - return this._ypos; - } - - /** - * Method hasDividerLocation. - * - * @return true if at least one DividerLocation has been added - */ - public boolean hasDividerLocation( - ) { - return this._has_dividerLocation; - } - - /** - * Method hasHeight. - * - * @return true if at least one Height has been added - */ - public boolean hasHeight( - ) { - return this._has_height; - } - - /** - * Method hasSelectedRna. - * - * @return true if at least one SelectedRna has been added - */ - public boolean hasSelectedRna( - ) { - return this._has_selectedRna; - } - - /** - * Method hasWidth. - * - * @return true if at least one Width has been added - */ - public boolean hasWidth( - ) { - return this._has_width; - } - - /** - * Method hasXpos. - * - * @return true if at least one Xpos has been added - */ - public boolean hasXpos( - ) { - return this._has_xpos; - } - - /** - * Method hasYpos. - * - * @return true if at least one Ypos has been added - */ - public boolean hasYpos( - ) { - return this._has_ypos; - } - - /** - * 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 removeAllSecondaryStructure( - ) { - this._secondaryStructureList.clear(); - } - - /** - * Method removeSecondaryStructure. - * - * @param vSecondaryStructure - * @return true if the object was removed from the collection. - */ - public boolean removeSecondaryStructure( - final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure) { - boolean removed = _secondaryStructureList.remove(vSecondaryStructure); - return removed; - } - - /** - * Method removeSecondaryStructureAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.SecondaryStructure removeSecondaryStructureAt( - final int index) { - java.lang.Object obj = this._secondaryStructureList.remove(index); - return (jalview.schemabinding.version2.SecondaryStructure) obj; - } - - /** - * Sets the value of field 'dividerLocation'. The field - * 'dividerLocation' has the following description: horizontal - * position of split pane divider - * - * - * @param dividerLocation the value of field 'dividerLocation'. - */ - public void setDividerLocation( - final int dividerLocation) { - this._dividerLocation = dividerLocation; - this._has_dividerLocation = true; - } - - /** - * Sets the value of field 'height'. - * - * @param height the value of field 'height'. - */ - public void setHeight( - final int height) { - this._height = height; - this._has_height = true; - } - - /** - * - * - * @param index - * @param vSecondaryStructure - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setSecondaryStructure( - final int index, - final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._secondaryStructureList.size()) { - throw new IndexOutOfBoundsException("setSecondaryStructure: Index value '" + index + "' not in range [0.." + (this._secondaryStructureList.size() - 1) + "]"); - } - - this._secondaryStructureList.set(index, vSecondaryStructure); - } - - /** - * - * - * @param vSecondaryStructureArray - */ - public void setSecondaryStructure( - final jalview.schemabinding.version2.SecondaryStructure[] vSecondaryStructureArray) { - //-- copy array - _secondaryStructureList.clear(); - - for (int i = 0; i < vSecondaryStructureArray.length; i++) { - this._secondaryStructureList.add(vSecondaryStructureArray[i]); - } - } - - /** - * Sets the value of field 'selectedRna'. The field - * 'selectedRna' has the following description: Index of the - * selected structure in the - * viewer panel - * - * - * @param selectedRna the value of field 'selectedRna'. - */ - public void setSelectedRna( - final int selectedRna) { - this._selectedRna = selectedRna; - this._has_selectedRna = true; - } - - /** - * Sets the value of field 'title'. - * - * @param title the value of field 'title'. - */ - public void setTitle( - final java.lang.String title) { - this._title = title; - } - - /** - * Sets the value of field 'viewId'. The field 'viewId' has the - * following description: An id unique to the RNA viewer panel - * - * - * @param viewId the value of field 'viewId'. - */ - public void setViewId( - final java.lang.String viewId) { - this._viewId = viewId; - } - - /** - * Sets the value of field 'width'. - * - * @param width the value of field 'width'. - */ - public void setWidth( - final int width) { - this._width = width; - this._has_width = true; - } - - /** - * Sets the value of field 'xpos'. - * - * @param xpos the value of field 'xpos'. - */ - public void setXpos( - final int xpos) { - this._xpos = xpos; - this._has_xpos = true; - } - - /** - * Sets the value of field 'ypos'. - * - * @param ypos the value of field 'ypos'. - */ - public void setYpos( - final int ypos) { - this._ypos = ypos; - this._has_ypos = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled - * jalview.schemabinding.version2.RnaViewer - */ - public static jalview.schemabinding.version2.RnaViewer unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.RnaViewer) Unmarshaller.unmarshal(jalview.schemabinding.version2.RnaViewer.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class RnaViewer implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _title. + */ + private java.lang.String _title; + + /** + * An id unique to the RNA viewer panel + * + */ + private java.lang.String _viewId; + + /** + * horizontal position of split pane divider + * + */ + private int _dividerLocation; + + /** + * keeps track of state for field: _dividerLocation + */ + private boolean _has_dividerLocation; + + /** + * Index of the selected structure in the viewer panel + * + */ + private int _selectedRna; + + /** + * keeps track of state for field: _selectedRna + */ + private boolean _has_selectedRna; + + /** + * Field _width. + */ + private int _width; + + /** + * keeps track of state for field: _width + */ + private boolean _has_width; + + /** + * Field _height. + */ + private int _height; + + /** + * keeps track of state for field: _height + */ + private boolean _has_height; + + /** + * Field _xpos. + */ + private int _xpos; + + /** + * keeps track of state for field: _xpos + */ + private boolean _has_xpos; + + /** + * Field _ypos. + */ + private int _ypos; + + /** + * keeps track of state for field: _ypos + */ + private boolean _has_ypos; + + /** + * Field _secondaryStructureList. + */ + private java.util.Vector _secondaryStructureList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public RnaViewer() + { + super(); + this._secondaryStructureList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vSecondaryStructure + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSecondaryStructure( + final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure) + throws java.lang.IndexOutOfBoundsException + { + this._secondaryStructureList.addElement(vSecondaryStructure); + } + + /** + * + * + * @param index + * @param vSecondaryStructure + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSecondaryStructure( + final int index, + final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure) + throws java.lang.IndexOutOfBoundsException + { + this._secondaryStructureList.add(index, vSecondaryStructure); + } + + /** + */ + public void deleteDividerLocation() + { + this._has_dividerLocation = false; + } + + /** + */ + public void deleteHeight() + { + this._has_height = false; + } + + /** + */ + public void deleteSelectedRna() + { + this._has_selectedRna = false; + } + + /** + */ + public void deleteWidth() + { + this._has_width = false; + } + + /** + */ + public void deleteXpos() + { + this._has_xpos = false; + } + + /** + */ + public void deleteYpos() + { + this._has_ypos = false; + } + + /** + * Method enumerateSecondaryStructure. + * + * @return an Enumeration over all + * jalview.schemabinding.version2.SecondaryStructure elements + */ + public java.util.Enumeration enumerateSecondaryStructure() + { + return this._secondaryStructureList.elements(); + } + + /** + * Returns the value of field 'dividerLocation'. The field 'dividerLocation' + * has the following description: horizontal position of split pane divider + * + * + * @return the value of field 'DividerLocation'. + */ + public int getDividerLocation() + { + return this._dividerLocation; + } + + /** + * Returns the value of field 'height'. + * + * @return the value of field 'Height'. + */ + public int getHeight() + { + return this._height; + } + + /** + * Method getSecondaryStructure. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.SecondaryStructure + * at the given index + */ + public jalview.schemabinding.version2.SecondaryStructure getSecondaryStructure( + final int index) throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._secondaryStructureList.size()) + { + throw new IndexOutOfBoundsException( + "getSecondaryStructure: Index value '" + index + + "' not in range [0.." + + (this._secondaryStructureList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.SecondaryStructure) _secondaryStructureList + .get(index); + } + + /** + * Method getSecondaryStructure.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 jalview.schemabinding.version2.SecondaryStructure[] getSecondaryStructure() + { + jalview.schemabinding.version2.SecondaryStructure[] array = new jalview.schemabinding.version2.SecondaryStructure[0]; + return (jalview.schemabinding.version2.SecondaryStructure[]) this._secondaryStructureList + .toArray(array); + } + + /** + * Method getSecondaryStructureCount. + * + * @return the size of this collection + */ + public int getSecondaryStructureCount() + { + return this._secondaryStructureList.size(); + } + + /** + * Returns the value of field 'selectedRna'. The field 'selectedRna' has the + * following description: Index of the selected structure in the viewer panel + * + * + * @return the value of field 'SelectedRna'. + */ + public int getSelectedRna() + { + return this._selectedRna; + } + + /** + * Returns the value of field 'title'. + * + * @return the value of field 'Title'. + */ + public java.lang.String getTitle() + { + return this._title; + } + + /** + * Returns the value of field 'viewId'. The field 'viewId' has the following + * description: An id unique to the RNA viewer panel + * + * + * @return the value of field 'ViewId'. + */ + public java.lang.String getViewId() + { + return this._viewId; + } + + /** + * Returns the value of field 'width'. + * + * @return the value of field 'Width'. + */ + public int getWidth() + { + return this._width; + } + + /** + * Returns the value of field 'xpos'. + * + * @return the value of field 'Xpos'. + */ + public int getXpos() + { + return this._xpos; + } + + /** + * Returns the value of field 'ypos'. + * + * @return the value of field 'Ypos'. + */ + public int getYpos() + { + return this._ypos; + } + + /** + * Method hasDividerLocation. + * + * @return true if at least one DividerLocation has been added + */ + public boolean hasDividerLocation() + { + return this._has_dividerLocation; + } + + /** + * Method hasHeight. + * + * @return true if at least one Height has been added + */ + public boolean hasHeight() + { + return this._has_height; + } + + /** + * Method hasSelectedRna. + * + * @return true if at least one SelectedRna has been added + */ + public boolean hasSelectedRna() + { + return this._has_selectedRna; + } + + /** + * Method hasWidth. + * + * @return true if at least one Width has been added + */ + public boolean hasWidth() + { + return this._has_width; + } + + /** + * Method hasXpos. + * + * @return true if at least one Xpos has been added + */ + public boolean hasXpos() + { + return this._has_xpos; + } + + /** + * Method hasYpos. + * + * @return true if at least one Ypos has been added + */ + public boolean hasYpos() + { + return this._has_ypos; + } + + /** + * 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 removeAllSecondaryStructure() + { + this._secondaryStructureList.clear(); + } + + /** + * Method removeSecondaryStructure. + * + * @param vSecondaryStructure + * @return true if the object was removed from the collection. + */ + public boolean removeSecondaryStructure( + final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure) + { + boolean removed = _secondaryStructureList.remove(vSecondaryStructure); + return removed; + } + + /** + * Method removeSecondaryStructureAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.SecondaryStructure removeSecondaryStructureAt( + final int index) + { + java.lang.Object obj = this._secondaryStructureList.remove(index); + return (jalview.schemabinding.version2.SecondaryStructure) obj; + } + + /** + * Sets the value of field 'dividerLocation'. The field 'dividerLocation' has + * the following description: horizontal position of split pane divider + * + * + * @param dividerLocation + * the value of field 'dividerLocation'. + */ + public void setDividerLocation(final int dividerLocation) + { + this._dividerLocation = dividerLocation; + this._has_dividerLocation = true; + } + + /** + * Sets the value of field 'height'. + * + * @param height + * the value of field 'height'. + */ + public void setHeight(final int height) + { + this._height = height; + this._has_height = true; + } + + /** + * + * + * @param index + * @param vSecondaryStructure + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setSecondaryStructure( + final int index, + final jalview.schemabinding.version2.SecondaryStructure vSecondaryStructure) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._secondaryStructureList.size()) + { + throw new IndexOutOfBoundsException( + "setSecondaryStructure: Index value '" + index + + "' not in range [0.." + + (this._secondaryStructureList.size() - 1) + "]"); + } + + this._secondaryStructureList.set(index, vSecondaryStructure); + } + + /** + * + * + * @param vSecondaryStructureArray + */ + public void setSecondaryStructure( + final jalview.schemabinding.version2.SecondaryStructure[] vSecondaryStructureArray) + { + // -- copy array + _secondaryStructureList.clear(); + + for (int i = 0; i < vSecondaryStructureArray.length; i++) + { + this._secondaryStructureList.add(vSecondaryStructureArray[i]); + } + } + + /** + * Sets the value of field 'selectedRna'. The field 'selectedRna' has the + * following description: Index of the selected structure in the viewer panel + * + * + * @param selectedRna + * the value of field 'selectedRna'. + */ + public void setSelectedRna(final int selectedRna) + { + this._selectedRna = selectedRna; + this._has_selectedRna = true; + } + + /** + * Sets the value of field 'title'. + * + * @param title + * the value of field 'title'. + */ + public void setTitle(final java.lang.String title) + { + this._title = title; + } + + /** + * Sets the value of field 'viewId'. The field 'viewId' has the following + * description: An id unique to the RNA viewer panel + * + * + * @param viewId + * the value of field 'viewId'. + */ + public void setViewId(final java.lang.String viewId) + { + this._viewId = viewId; + } + + /** + * Sets the value of field 'width'. + * + * @param width + * the value of field 'width'. + */ + public void setWidth(final int width) + { + this._width = width; + this._has_width = true; + } + + /** + * Sets the value of field 'xpos'. + * + * @param xpos + * the value of field 'xpos'. + */ + public void setXpos(final int xpos) + { + this._xpos = xpos; + this._has_xpos = true; + } + + /** + * Sets the value of field 'ypos'. + * + * @param ypos + * the value of field 'ypos'. + */ + public void setYpos(final int ypos) + { + this._ypos = ypos; + this._has_ypos = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.schemabinding.version2.RnaViewer + */ + public static jalview.schemabinding.version2.RnaViewer unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.RnaViewer) Unmarshaller + .unmarshal(jalview.schemabinding.version2.RnaViewer.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/SecondaryStructure.java b/src/jalview/schemabinding/version2/SecondaryStructure.java index d2f97fb..eb88fc4 100644 --- a/src/jalview/schemabinding/version2/SecondaryStructure.java +++ b/src/jalview/schemabinding/version2/SecondaryStructure.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,272 +19,272 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class SecondaryStructure implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _title. - */ - private java.lang.String _title; - - /** - * id attribute of Annotation in - * vamsasModel for - * the secondary structure annotation shown - * in the viewer - * - */ - private java.lang.String _annotationId; - - /** - * if true the RNA structure is shown with gaps, if false - * without - * - */ - private boolean _gapped; - - /** - * keeps track of state for field: _gapped - */ - private boolean _has_gapped; - - /** - * name of the project jar entry that holds - * the VARNA viewer state for the structure - * - */ - private java.lang.String _viewerState; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public SecondaryStructure() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deleteGapped( - ) { - this._has_gapped= false; - } - - /** - * Returns the value of field 'annotationId'. The field - * 'annotationId' has the following description: id attribute - * of Annotation in - * vamsasModel for - * the secondary structure annotation shown - * in the viewer - * - * - * @return the value of field 'AnnotationId'. - */ - public java.lang.String getAnnotationId( - ) { - return this._annotationId; - } - - /** - * Returns the value of field 'gapped'. The field 'gapped' has - * the following description: if true the RNA structure is - * shown with gaps, if false without - * - * - * @return the value of field 'Gapped'. - */ - public boolean getGapped( - ) { - return this._gapped; - } - - /** - * Returns the value of field 'title'. - * - * @return the value of field 'Title'. - */ - public java.lang.String getTitle( - ) { - return this._title; - } - - /** - * Returns the value of field 'viewerState'. The field - * 'viewerState' has the following description: name of the - * project jar entry that holds - * the VARNA viewer state for the structure - * - * - * @return the value of field 'ViewerState'. - */ - public java.lang.String getViewerState( - ) { - return this._viewerState; - } - - /** - * Method hasGapped. - * - * @return true if at least one Gapped has been added - */ - public boolean hasGapped( - ) { - return this._has_gapped; - } - - /** - * Returns the value of field 'gapped'. The field 'gapped' has - * the following description: if true the RNA structure is - * shown with gaps, if false without - * - * - * @return the value of field 'Gapped'. - */ - public boolean isGapped( - ) { - return this._gapped; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'annotationId'. The field - * 'annotationId' has the following description: id attribute - * of Annotation in - * vamsasModel for - * the secondary structure annotation shown - * in the viewer - * - * - * @param annotationId the value of field 'annotationId'. - */ - public void setAnnotationId( - final java.lang.String annotationId) { - this._annotationId = annotationId; - } - - /** - * Sets the value of field 'gapped'. The field 'gapped' has the - * following description: if true the RNA structure is shown - * with gaps, if false without - * - * - * @param gapped the value of field 'gapped'. - */ - public void setGapped( - final boolean gapped) { - this._gapped = gapped; - this._has_gapped = true; - } - - /** - * Sets the value of field 'title'. - * - * @param title the value of field 'title'. - */ - public void setTitle( - final java.lang.String title) { - this._title = title; - } - - /** - * Sets the value of field 'viewerState'. The field - * 'viewerState' has the following description: name of the - * project jar entry that holds - * the VARNA viewer state for the structure - * - * - * @param viewerState the value of field 'viewerState'. - */ - public void setViewerState( - final java.lang.String viewerState) { - this._viewerState = viewerState; - } - - /** - * 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.SecondaryStructure - */ - public static jalview.schemabinding.version2.SecondaryStructure unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.SecondaryStructure) Unmarshaller.unmarshal(jalview.schemabinding.version2.SecondaryStructure.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema +public class SecondaryStructure implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _title. + */ + private java.lang.String _title; + + /** + * id attribute of Annotation in vamsasModel for the secondary structure + * annotation shown in the viewer + * + */ + private java.lang.String _annotationId; + + /** + * if true the RNA structure is shown with gaps, if false without + * + */ + private boolean _gapped; + + /** + * keeps track of state for field: _gapped + */ + private boolean _has_gapped; + + /** + * name of the project jar entry that holds the VARNA viewer state for the + * structure + * + */ + private java.lang.String _viewerState; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public SecondaryStructure() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); + public void deleteGapped() + { + this._has_gapped = false; + } + + /** + * Returns the value of field 'annotationId'. The field 'annotationId' has the + * following description: id attribute of Annotation in vamsasModel for the + * secondary structure annotation shown in the viewer + * + * + * @return the value of field 'AnnotationId'. + */ + public java.lang.String getAnnotationId() + { + return this._annotationId; + } + + /** + * Returns the value of field 'gapped'. The field 'gapped' has the following + * description: if true the RNA structure is shown with gaps, if false without + * + * + * @return the value of field 'Gapped'. + */ + public boolean getGapped() + { + return this._gapped; + } + + /** + * Returns the value of field 'title'. + * + * @return the value of field 'Title'. + */ + public java.lang.String getTitle() + { + return this._title; + } + + /** + * Returns the value of field 'viewerState'. The field 'viewerState' has the + * following description: name of the project jar entry that holds the VARNA + * viewer state for the structure + * + * + * @return the value of field 'ViewerState'. + */ + public java.lang.String getViewerState() + { + return this._viewerState; + } + + /** + * Method hasGapped. + * + * @return true if at least one Gapped has been added + */ + public boolean hasGapped() + { + return this._has_gapped; + } + + /** + * Returns the value of field 'gapped'. The field 'gapped' has the following + * description: if true the RNA structure is shown with gaps, if false without + * + * + * @return the value of field 'Gapped'. + */ + public boolean isGapped() + { + return this._gapped; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'annotationId'. The field 'annotationId' has the + * following description: id attribute of Annotation in vamsasModel for the + * secondary structure annotation shown in the viewer + * + * + * @param annotationId + * the value of field 'annotationId'. + */ + public void setAnnotationId(final java.lang.String annotationId) + { + this._annotationId = annotationId; + } + + /** + * Sets the value of field 'gapped'. The field 'gapped' has the following + * description: if true the RNA structure is shown with gaps, if false without + * + * + * @param gapped + * the value of field 'gapped'. + */ + public void setGapped(final boolean gapped) + { + this._gapped = gapped; + this._has_gapped = true; + } + + /** + * Sets the value of field 'title'. + * + * @param title + * the value of field 'title'. + */ + public void setTitle(final java.lang.String title) + { + this._title = title; + } + + /** + * Sets the value of field 'viewerState'. The field 'viewerState' has the + * following description: name of the project jar entry that holds the VARNA + * viewer state for the structure + * + * + * @param viewerState + * the value of field 'viewerState'. + */ + public void setViewerState(final java.lang.String viewerState) + { + this._viewerState = viewerState; + } + + /** + * 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.SecondaryStructure + */ + public static jalview.schemabinding.version2.SecondaryStructure unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.SecondaryStructure) Unmarshaller + .unmarshal( + jalview.schemabinding.version2.SecondaryStructure.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/Sequence.java b/src/jalview/schemabinding/version2/Sequence.java index 14137d8..531ca66 100644 --- a/src/jalview/schemabinding/version2/Sequence.java +++ b/src/jalview/schemabinding/version2/Sequence.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,293 +19,310 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Sequence extends jalview.schemabinding.version2.SequenceType -implements java.io.Serializable +public class Sequence extends jalview.schemabinding.version2.SequenceType + implements java.io.Serializable { - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * dataset sequence id for this sequence. Will be created as - * union of sequences. - * - */ - private java.lang.String _dsseqid; - - /** - * Field _DBRefList. - */ - private java.util.Vector _DBRefList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Sequence() { - super(); - this._DBRefList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vDBRef - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addDBRef( - final jalview.schemabinding.version2.DBRef vDBRef) - throws java.lang.IndexOutOfBoundsException { - this._DBRefList.addElement(vDBRef); - } - - /** - * - * - * @param index - * @param vDBRef - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addDBRef( - final int index, - final jalview.schemabinding.version2.DBRef vDBRef) - throws java.lang.IndexOutOfBoundsException { - this._DBRefList.add(index, vDBRef); - } - - /** - * Method enumerateDBRef. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.DBRef elements - */ - public java.util.Enumeration enumerateDBRef( - ) { - return this._DBRefList.elements(); + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * dataset sequence id for this sequence. Will be created as union of + * sequences. + * + */ + private java.lang.String _dsseqid; + + /** + * Field _DBRefList. + */ + private java.util.Vector _DBRefList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Sequence() + { + super(); + this._DBRefList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vDBRef + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addDBRef(final jalview.schemabinding.version2.DBRef vDBRef) + throws java.lang.IndexOutOfBoundsException + { + this._DBRefList.addElement(vDBRef); + } + + /** + * + * + * @param index + * @param vDBRef + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addDBRef(final int index, + final jalview.schemabinding.version2.DBRef vDBRef) + throws java.lang.IndexOutOfBoundsException + { + this._DBRefList.add(index, vDBRef); + } + + /** + * Method enumerateDBRef. + * + * @return an Enumeration over all jalview.schemabinding.version2.DBRef + * elements + */ + public java.util.Enumeration enumerateDBRef() + { + return this._DBRefList.elements(); + } + + /** + * Method getDBRef. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.DBRef at the given + * index + */ + public jalview.schemabinding.version2.DBRef getDBRef(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._DBRefList.size()) + { + throw new IndexOutOfBoundsException("getDBRef: Index value '" + index + + "' not in range [0.." + (this._DBRefList.size() - 1) + "]"); } - /** - * Method getDBRef. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.DBRef at the given index - */ - public jalview.schemabinding.version2.DBRef getDBRef( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._DBRefList.size()) { - throw new IndexOutOfBoundsException("getDBRef: Index value '" + index + "' not in range [0.." + (this._DBRefList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.DBRef) _DBRefList.get(index); + return (jalview.schemabinding.version2.DBRef) _DBRefList.get(index); + } + + /** + * Method getDBRef.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 jalview.schemabinding.version2.DBRef[] getDBRef() + { + jalview.schemabinding.version2.DBRef[] array = new jalview.schemabinding.version2.DBRef[0]; + return (jalview.schemabinding.version2.DBRef[]) this._DBRefList + .toArray(array); + } + + /** + * Method getDBRefCount. + * + * @return the size of this collection + */ + public int getDBRefCount() + { + return this._DBRefList.size(); + } + + /** + * Returns the value of field 'dsseqid'. The field 'dsseqid' has the following + * description: dataset sequence id for this sequence. Will be created as + * union of sequences. + * + * + * @return the value of field 'Dsseqid'. + */ + public java.lang.String getDsseqid() + { + return this._dsseqid; + } + + /** + * 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 getDBRef.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 + 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 jalview.schemabinding.version2.DBRef[] getDBRef( - ) { - jalview.schemabinding.version2.DBRef[] array = new jalview.schemabinding.version2.DBRef[0]; - return (jalview.schemabinding.version2.DBRef[]) this._DBRefList.toArray(array); + public void removeAllDBRef() + { + this._DBRefList.clear(); + } + + /** + * Method removeDBRef. + * + * @param vDBRef + * @return true if the object was removed from the collection. + */ + public boolean removeDBRef( + final jalview.schemabinding.version2.DBRef vDBRef) + { + boolean removed = _DBRefList.remove(vDBRef); + return removed; + } + + /** + * Method removeDBRefAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.DBRef removeDBRefAt(final int index) + { + java.lang.Object obj = this._DBRefList.remove(index); + return (jalview.schemabinding.version2.DBRef) obj; + } + + /** + * + * + * @param index + * @param vDBRef + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setDBRef(final int index, + final jalview.schemabinding.version2.DBRef vDBRef) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._DBRefList.size()) + { + throw new IndexOutOfBoundsException("setDBRef: Index value '" + index + + "' not in range [0.." + (this._DBRefList.size() - 1) + "]"); } - /** - * Method getDBRefCount. - * - * @return the size of this collection - */ - public int getDBRefCount( - ) { - return this._DBRefList.size(); - } - - /** - * Returns the value of field 'dsseqid'. The field 'dsseqid' - * has the following description: dataset sequence id for this - * sequence. Will be created as union of sequences. - * - * - * @return the value of field 'Dsseqid'. - */ - public java.lang.String getDsseqid( - ) { - return this._dsseqid; - } - - /** - * 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 removeAllDBRef( - ) { - this._DBRefList.clear(); - } - - /** - * Method removeDBRef. - * - * @param vDBRef - * @return true if the object was removed from the collection. - */ - public boolean removeDBRef( - final jalview.schemabinding.version2.DBRef vDBRef) { - boolean removed = _DBRefList.remove(vDBRef); - return removed; - } - - /** - * Method removeDBRefAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.DBRef removeDBRefAt( - final int index) { - java.lang.Object obj = this._DBRefList.remove(index); - return (jalview.schemabinding.version2.DBRef) obj; - } - - /** - * - * - * @param index - * @param vDBRef - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setDBRef( - final int index, - final jalview.schemabinding.version2.DBRef vDBRef) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._DBRefList.size()) { - throw new IndexOutOfBoundsException("setDBRef: Index value '" + index + "' not in range [0.." + (this._DBRefList.size() - 1) + "]"); - } - - this._DBRefList.set(index, vDBRef); - } - - /** - * - * - * @param vDBRefArray - */ - public void setDBRef( - final jalview.schemabinding.version2.DBRef[] vDBRefArray) { - //-- copy array - _DBRefList.clear(); - - for (int i = 0; i < vDBRefArray.length; i++) { - this._DBRefList.add(vDBRefArray[i]); - } - } - - /** - * Sets the value of field 'dsseqid'. The field 'dsseqid' has - * the following description: dataset sequence id for this - * sequence. Will be created as union of sequences. - * - * - * @param dsseqid the value of field 'dsseqid'. - */ - public void setDsseqid( - final java.lang.String dsseqid) { - this._dsseqid = dsseqid; - } - - /** - * 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.SequenceType - */ - public static jalview.schemabinding.version2.SequenceType unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.SequenceType) Unmarshaller.unmarshal(jalview.schemabinding.version2.Sequence.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._DBRefList.set(index, vDBRef); + } + + /** + * + * + * @param vDBRefArray + */ + public void setDBRef( + final jalview.schemabinding.version2.DBRef[] vDBRefArray) + { + // -- copy array + _DBRefList.clear(); + + for (int i = 0; i < vDBRefArray.length; i++) + { + this._DBRefList.add(vDBRefArray[i]); } + } + + /** + * Sets the value of field 'dsseqid'. The field 'dsseqid' has the following + * description: dataset sequence id for this sequence. Will be created as + * union of sequences. + * + * + * @param dsseqid + * the value of field 'dsseqid'. + */ + public void setDsseqid(final java.lang.String dsseqid) + { + this._dsseqid = dsseqid; + } + + /** + * 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.SequenceType + */ + public static jalview.schemabinding.version2.SequenceType unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.SequenceType) Unmarshaller + .unmarshal(jalview.schemabinding.version2.Sequence.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/SequenceSet.java b/src/jalview/schemabinding/version2/SequenceSet.java index 7b670a5..8be8022 100644 --- a/src/jalview/schemabinding/version2/SequenceSet.java +++ b/src/jalview/schemabinding/version2/SequenceSet.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,789 +19,854 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class SequenceSet implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _gapChar. - */ - private java.lang.String _gapChar; - - /** - * reference to set where jalview will gather the dataset - * sequences for all sequences in the set. - * - */ - private java.lang.String _datasetId; - - /** - * Field _sequenceList. - */ - private java.util.Vector _sequenceList; - - /** - * Field _annotationList. - */ - private java.util.Vector _annotationList; - - /** - * Field _sequenceSetPropertiesList. - */ - private java.util.Vector _sequenceSetPropertiesList; - - /** - * Field _alcodonFrameList. - */ - private java.util.Vector _alcodonFrameList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public SequenceSet() { - super(); - this._sequenceList = new java.util.Vector(); - this._annotationList = new java.util.Vector(); - this._sequenceSetPropertiesList = new java.util.Vector(); - this._alcodonFrameList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vAlcodonFrame - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addAlcodonFrame( - final jalview.schemabinding.version2.AlcodonFrame vAlcodonFrame) - throws java.lang.IndexOutOfBoundsException { - this._alcodonFrameList.addElement(vAlcodonFrame); - } - - /** - * - * - * @param index - * @param vAlcodonFrame - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addAlcodonFrame( - final int index, - final jalview.schemabinding.version2.AlcodonFrame vAlcodonFrame) - throws java.lang.IndexOutOfBoundsException { - this._alcodonFrameList.add(index, vAlcodonFrame); - } - - /** - * - * - * @param vAnnotation - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addAnnotation( - final jalview.schemabinding.version2.Annotation vAnnotation) - throws java.lang.IndexOutOfBoundsException { - this._annotationList.addElement(vAnnotation); - } - - /** - * - * - * @param index - * @param vAnnotation - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addAnnotation( - final int index, - final jalview.schemabinding.version2.Annotation vAnnotation) - throws java.lang.IndexOutOfBoundsException { - this._annotationList.add(index, vAnnotation); - } - - /** - * - * - * @param vSequence - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSequence( - final jalview.schemabinding.version2.Sequence vSequence) - throws java.lang.IndexOutOfBoundsException { - this._sequenceList.addElement(vSequence); - } - - /** - * - * - * @param index - * @param vSequence - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSequence( - final int index, - final jalview.schemabinding.version2.Sequence vSequence) - throws java.lang.IndexOutOfBoundsException { - this._sequenceList.add(index, vSequence); - } - - /** - * - * - * @param vSequenceSetProperties - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSequenceSetProperties( - final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties) - throws java.lang.IndexOutOfBoundsException { - this._sequenceSetPropertiesList.addElement(vSequenceSetProperties); - } - - /** - * - * - * @param index - * @param vSequenceSetProperties - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSequenceSetProperties( - final int index, - final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties) - throws java.lang.IndexOutOfBoundsException { - this._sequenceSetPropertiesList.add(index, vSequenceSetProperties); - } - - /** - * Method enumerateAlcodonFrame. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.AlcodonFrame elements - */ - public java.util.Enumeration enumerateAlcodonFrame( - ) { - return this._alcodonFrameList.elements(); - } - - /** - * Method enumerateAnnotation. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.Annotation elements - */ - public java.util.Enumeration enumerateAnnotation( - ) { - return this._annotationList.elements(); - } - - /** - * Method enumerateSequence. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.Sequence elements - */ - public java.util.Enumeration enumerateSequence( - ) { - return this._sequenceList.elements(); - } - - /** - * Method enumerateSequenceSetProperties. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.SequenceSetProperties elements - */ - public java.util.Enumeration enumerateSequenceSetProperties( - ) { - return this._sequenceSetPropertiesList.elements(); - } - - /** - * Method getAlcodonFrame. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.AlcodonFrame at the given inde - */ - public jalview.schemabinding.version2.AlcodonFrame getAlcodonFrame( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._alcodonFrameList.size()) { - throw new IndexOutOfBoundsException("getAlcodonFrame: Index value '" + index + "' not in range [0.." + (this._alcodonFrameList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.AlcodonFrame) _alcodonFrameList.get(index); - } - - /** - * Method getAlcodonFrame.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 jalview.schemabinding.version2.AlcodonFrame[] getAlcodonFrame( - ) { - jalview.schemabinding.version2.AlcodonFrame[] array = new jalview.schemabinding.version2.AlcodonFrame[0]; - return (jalview.schemabinding.version2.AlcodonFrame[]) this._alcodonFrameList.toArray(array); - } - - /** - * Method getAlcodonFrameCount. - * - * @return the size of this collection - */ - public int getAlcodonFrameCount( - ) { - return this._alcodonFrameList.size(); - } - - /** - * Method getAnnotation. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.Annotation at the given index - */ - public jalview.schemabinding.version2.Annotation getAnnotation( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._annotationList.size()) { - throw new IndexOutOfBoundsException("getAnnotation: Index value '" + index + "' not in range [0.." + (this._annotationList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.Annotation) _annotationList.get(index); - } - - /** - * Method getAnnotation.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 jalview.schemabinding.version2.Annotation[] getAnnotation( - ) { - jalview.schemabinding.version2.Annotation[] array = new jalview.schemabinding.version2.Annotation[0]; - return (jalview.schemabinding.version2.Annotation[]) this._annotationList.toArray(array); - } - - /** - * Method getAnnotationCount. - * - * @return the size of this collection - */ - public int getAnnotationCount( - ) { - return this._annotationList.size(); - } - - /** - * Returns the value of field 'datasetId'. The field - * 'datasetId' has the following description: reference to set - * where jalview will gather the dataset sequences for all - * sequences in the set. - * - * - * @return the value of field 'DatasetId'. - */ - public java.lang.String getDatasetId( - ) { - return this._datasetId; - } - - /** - * Returns the value of field 'gapChar'. - * - * @return the value of field 'GapChar'. - */ - public java.lang.String getGapChar( - ) { - return this._gapChar; - } - - /** - * Method getSequence. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.Sequence at the given index - */ - public jalview.schemabinding.version2.Sequence getSequence( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._sequenceList.size()) { - throw new IndexOutOfBoundsException("getSequence: Index value '" + index + "' not in range [0.." + (this._sequenceList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.Sequence) _sequenceList.get(index); - } - - /** - * Method getSequence.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 jalview.schemabinding.version2.Sequence[] getSequence( - ) { - jalview.schemabinding.version2.Sequence[] array = new jalview.schemabinding.version2.Sequence[0]; - return (jalview.schemabinding.version2.Sequence[]) this._sequenceList.toArray(array); - } - - /** - * Method getSequenceCount. - * - * @return the size of this collection - */ - public int getSequenceCount( - ) { - return this._sequenceList.size(); - } - - /** - * Method getSequenceSetProperties. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.SequenceSetProperties at the - * given index - */ - public jalview.schemabinding.version2.SequenceSetProperties getSequenceSetProperties( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._sequenceSetPropertiesList.size()) { - throw new IndexOutOfBoundsException("getSequenceSetProperties: Index value '" + index + "' not in range [0.." + (this._sequenceSetPropertiesList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.SequenceSetProperties) _sequenceSetPropertiesList.get(index); - } - - /** - * Method getSequenceSetProperties.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 jalview.schemabinding.version2.SequenceSetProperties[] getSequenceSetProperties( - ) { - jalview.schemabinding.version2.SequenceSetProperties[] array = new jalview.schemabinding.version2.SequenceSetProperties[0]; - return (jalview.schemabinding.version2.SequenceSetProperties[]) this._sequenceSetPropertiesList.toArray(array); - } - - /** - * Method getSequenceSetPropertiesCount. - * - * @return the size of this collection - */ - public int getSequenceSetPropertiesCount( - ) { - return this._sequenceSetPropertiesList.size(); - } - - /** - * 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); - } - - /** - * Method removeAlcodonFrame. - * - * @param vAlcodonFrame - * @return true if the object was removed from the collection. - */ - public boolean removeAlcodonFrame( - final jalview.schemabinding.version2.AlcodonFrame vAlcodonFrame) { - boolean removed = _alcodonFrameList.remove(vAlcodonFrame); - return removed; - } - - /** - * Method removeAlcodonFrameAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.AlcodonFrame removeAlcodonFrameAt( - final int index) { - java.lang.Object obj = this._alcodonFrameList.remove(index); - return (jalview.schemabinding.version2.AlcodonFrame) obj; - } - - /** - */ - public void removeAllAlcodonFrame( - ) { - this._alcodonFrameList.clear(); - } - - /** - */ - public void removeAllAnnotation( - ) { - this._annotationList.clear(); - } - - /** - */ - public void removeAllSequence( - ) { - this._sequenceList.clear(); - } - - /** - */ - public void removeAllSequenceSetProperties( - ) { - this._sequenceSetPropertiesList.clear(); - } - - /** - * Method removeAnnotation. - * - * @param vAnnotation - * @return true if the object was removed from the collection. - */ - public boolean removeAnnotation( - final jalview.schemabinding.version2.Annotation vAnnotation) { - boolean removed = _annotationList.remove(vAnnotation); - return removed; - } - - /** - * Method removeAnnotationAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.Annotation removeAnnotationAt( - final int index) { - java.lang.Object obj = this._annotationList.remove(index); - return (jalview.schemabinding.version2.Annotation) obj; - } - - /** - * Method removeSequence. - * - * @param vSequence - * @return true if the object was removed from the collection. - */ - public boolean removeSequence( - final jalview.schemabinding.version2.Sequence vSequence) { - boolean removed = _sequenceList.remove(vSequence); - return removed; - } - - /** - * Method removeSequenceAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.Sequence removeSequenceAt( - final int index) { - java.lang.Object obj = this._sequenceList.remove(index); - return (jalview.schemabinding.version2.Sequence) obj; - } - - /** - * Method removeSequenceSetProperties. - * - * @param vSequenceSetProperties - * @return true if the object was removed from the collection. - */ - public boolean removeSequenceSetProperties( - final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties) { - boolean removed = _sequenceSetPropertiesList.remove(vSequenceSetProperties); - return removed; - } - - /** - * Method removeSequenceSetPropertiesAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.SequenceSetProperties removeSequenceSetPropertiesAt( - final int index) { - java.lang.Object obj = this._sequenceSetPropertiesList.remove(index); - return (jalview.schemabinding.version2.SequenceSetProperties) obj; - } - - /** - * - * - * @param index - * @param vAlcodonFrame - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setAlcodonFrame( - final int index, - final jalview.schemabinding.version2.AlcodonFrame vAlcodonFrame) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._alcodonFrameList.size()) { - throw new IndexOutOfBoundsException("setAlcodonFrame: Index value '" + index + "' not in range [0.." + (this._alcodonFrameList.size() - 1) + "]"); - } - - this._alcodonFrameList.set(index, vAlcodonFrame); - } - - /** - * - * - * @param vAlcodonFrameArray - */ - public void setAlcodonFrame( - final jalview.schemabinding.version2.AlcodonFrame[] vAlcodonFrameArray) { - //-- copy array - _alcodonFrameList.clear(); - - for (int i = 0; i < vAlcodonFrameArray.length; i++) { - this._alcodonFrameList.add(vAlcodonFrameArray[i]); - } - } - - /** - * - * - * @param index - * @param vAnnotation - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setAnnotation( - final int index, - final jalview.schemabinding.version2.Annotation vAnnotation) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._annotationList.size()) { - throw new IndexOutOfBoundsException("setAnnotation: Index value '" + index + "' not in range [0.." + (this._annotationList.size() - 1) + "]"); - } - - this._annotationList.set(index, vAnnotation); - } - - /** - * - * - * @param vAnnotationArray - */ - public void setAnnotation( - final jalview.schemabinding.version2.Annotation[] vAnnotationArray) { - //-- copy array - _annotationList.clear(); - - for (int i = 0; i < vAnnotationArray.length; i++) { - this._annotationList.add(vAnnotationArray[i]); - } - } - - /** - * Sets the value of field 'datasetId'. The field 'datasetId' - * has the following description: reference to set where - * jalview will gather the dataset sequences for all sequences - * in the set. - * - * - * @param datasetId the value of field 'datasetId'. - */ - public void setDatasetId( - final java.lang.String datasetId) { - this._datasetId = datasetId; - } - - /** - * Sets the value of field 'gapChar'. - * - * @param gapChar the value of field 'gapChar'. - */ - public void setGapChar( - final java.lang.String gapChar) { - this._gapChar = gapChar; - } - - /** - * - * - * @param index - * @param vSequence - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setSequence( - final int index, - final jalview.schemabinding.version2.Sequence vSequence) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._sequenceList.size()) { - throw new IndexOutOfBoundsException("setSequence: Index value '" + index + "' not in range [0.." + (this._sequenceList.size() - 1) + "]"); - } - - this._sequenceList.set(index, vSequence); - } - - /** - * - * - * @param vSequenceArray - */ - public void setSequence( - final jalview.schemabinding.version2.Sequence[] vSequenceArray) { - //-- copy array - _sequenceList.clear(); - - for (int i = 0; i < vSequenceArray.length; i++) { - this._sequenceList.add(vSequenceArray[i]); - } - } - - /** - * - * - * @param index - * @param vSequenceSetProperties - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setSequenceSetProperties( - final int index, - final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._sequenceSetPropertiesList.size()) { - throw new IndexOutOfBoundsException("setSequenceSetProperties: Index value '" + index + "' not in range [0.." + (this._sequenceSetPropertiesList.size() - 1) + "]"); - } - - this._sequenceSetPropertiesList.set(index, vSequenceSetProperties); - } - - /** - * - * - * @param vSequenceSetPropertiesArray - */ - public void setSequenceSetProperties( - final jalview.schemabinding.version2.SequenceSetProperties[] vSequenceSetPropertiesArray) { - //-- copy array - _sequenceSetPropertiesList.clear(); - - for (int i = 0; i < vSequenceSetPropertiesArray.length; i++) { - this._sequenceSetPropertiesList.add(vSequenceSetPropertiesArray[i]); - } - } - - /** - * 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.SequenceSet - */ - public static jalview.schemabinding.version2.SequenceSet unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.SequenceSet) Unmarshaller.unmarshal(jalview.schemabinding.version2.SequenceSet.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class SequenceSet implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _gapChar. + */ + private java.lang.String _gapChar; + + /** + * reference to set where jalview will gather the dataset sequences for all + * sequences in the set. + * + */ + private java.lang.String _datasetId; + + /** + * Field _sequenceList. + */ + private java.util.Vector _sequenceList; + + /** + * Field _annotationList. + */ + private java.util.Vector _annotationList; + + /** + * Field _sequenceSetPropertiesList. + */ + private java.util.Vector _sequenceSetPropertiesList; + + /** + * Field _alcodonFrameList. + */ + private java.util.Vector _alcodonFrameList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public SequenceSet() + { + super(); + this._sequenceList = new java.util.Vector(); + this._annotationList = new java.util.Vector(); + this._sequenceSetPropertiesList = new java.util.Vector(); + this._alcodonFrameList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vAlcodonFrame + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addAlcodonFrame( + final jalview.schemabinding.version2.AlcodonFrame vAlcodonFrame) + throws java.lang.IndexOutOfBoundsException + { + this._alcodonFrameList.addElement(vAlcodonFrame); + } + + /** + * + * + * @param index + * @param vAlcodonFrame + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addAlcodonFrame(final int index, + final jalview.schemabinding.version2.AlcodonFrame vAlcodonFrame) + throws java.lang.IndexOutOfBoundsException + { + this._alcodonFrameList.add(index, vAlcodonFrame); + } + + /** + * + * + * @param vAnnotation + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addAnnotation( + final jalview.schemabinding.version2.Annotation vAnnotation) + throws java.lang.IndexOutOfBoundsException + { + this._annotationList.addElement(vAnnotation); + } + + /** + * + * + * @param index + * @param vAnnotation + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addAnnotation(final int index, + final jalview.schemabinding.version2.Annotation vAnnotation) + throws java.lang.IndexOutOfBoundsException + { + this._annotationList.add(index, vAnnotation); + } + + /** + * + * + * @param vSequence + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSequence( + final jalview.schemabinding.version2.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException + { + this._sequenceList.addElement(vSequence); + } + + /** + * + * + * @param index + * @param vSequence + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSequence(final int index, + final jalview.schemabinding.version2.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException + { + this._sequenceList.add(index, vSequence); + } + + /** + * + * + * @param vSequenceSetProperties + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSequenceSetProperties( + final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties) + throws java.lang.IndexOutOfBoundsException + { + this._sequenceSetPropertiesList.addElement(vSequenceSetProperties); + } + + /** + * + * + * @param index + * @param vSequenceSetProperties + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSequenceSetProperties( + final int index, + final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties) + throws java.lang.IndexOutOfBoundsException + { + this._sequenceSetPropertiesList.add(index, vSequenceSetProperties); + } + + /** + * Method enumerateAlcodonFrame. + * + * @return an Enumeration over all jalview.schemabinding.version2.AlcodonFrame + * elements + */ + public java.util.Enumeration enumerateAlcodonFrame() + { + return this._alcodonFrameList.elements(); + } + + /** + * Method enumerateAnnotation. + * + * @return an Enumeration over all jalview.schemabinding.version2.Annotation + * elements + */ + public java.util.Enumeration enumerateAnnotation() + { + return this._annotationList.elements(); + } + + /** + * Method enumerateSequence. + * + * @return an Enumeration over all jalview.schemabinding.version2.Sequence + * elements + */ + public java.util.Enumeration enumerateSequence() + { + return this._sequenceList.elements(); + } + + /** + * Method enumerateSequenceSetProperties. + * + * @return an Enumeration over all + * jalview.schemabinding.version2.SequenceSetProperties elements + */ + public java.util.Enumeration enumerateSequenceSetProperties() + { + return this._sequenceSetPropertiesList.elements(); + } + + /** + * Method getAlcodonFrame. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.AlcodonFrame at the + * given inde + */ + public jalview.schemabinding.version2.AlcodonFrame getAlcodonFrame( + final int index) throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._alcodonFrameList.size()) + { + throw new IndexOutOfBoundsException("getAlcodonFrame: Index value '" + + index + "' not in range [0.." + + (this._alcodonFrameList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.AlcodonFrame) _alcodonFrameList + .get(index); + } + + /** + * Method getAlcodonFrame.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 jalview.schemabinding.version2.AlcodonFrame[] getAlcodonFrame() + { + jalview.schemabinding.version2.AlcodonFrame[] array = new jalview.schemabinding.version2.AlcodonFrame[0]; + return (jalview.schemabinding.version2.AlcodonFrame[]) this._alcodonFrameList + .toArray(array); + } + + /** + * Method getAlcodonFrameCount. + * + * @return the size of this collection + */ + public int getAlcodonFrameCount() + { + return this._alcodonFrameList.size(); + } + + /** + * Method getAnnotation. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.Annotation at the + * given index + */ + public jalview.schemabinding.version2.Annotation getAnnotation( + final int index) throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._annotationList.size()) + { + throw new IndexOutOfBoundsException("getAnnotation: Index value '" + + index + "' not in range [0.." + + (this._annotationList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.Annotation) _annotationList + .get(index); + } + + /** + * Method getAnnotation.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 jalview.schemabinding.version2.Annotation[] getAnnotation() + { + jalview.schemabinding.version2.Annotation[] array = new jalview.schemabinding.version2.Annotation[0]; + return (jalview.schemabinding.version2.Annotation[]) this._annotationList + .toArray(array); + } + + /** + * Method getAnnotationCount. + * + * @return the size of this collection + */ + public int getAnnotationCount() + { + return this._annotationList.size(); + } + + /** + * Returns the value of field 'datasetId'. The field 'datasetId' has the + * following description: reference to set where jalview will gather the + * dataset sequences for all sequences in the set. + * + * + * @return the value of field 'DatasetId'. + */ + public java.lang.String getDatasetId() + { + return this._datasetId; + } + + /** + * Returns the value of field 'gapChar'. + * + * @return the value of field 'GapChar'. + */ + public java.lang.String getGapChar() + { + return this._gapChar; + } + + /** + * Method getSequence. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.Sequence at the + * given index + */ + public jalview.schemabinding.version2.Sequence getSequence(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._sequenceList.size()) + { + throw new IndexOutOfBoundsException("getSequence: Index value '" + + index + "' not in range [0.." + + (this._sequenceList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.Sequence) _sequenceList + .get(index); + } + + /** + * Method getSequence.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 jalview.schemabinding.version2.Sequence[] getSequence() + { + jalview.schemabinding.version2.Sequence[] array = new jalview.schemabinding.version2.Sequence[0]; + return (jalview.schemabinding.version2.Sequence[]) this._sequenceList + .toArray(array); + } + + /** + * Method getSequenceCount. + * + * @return the size of this collection + */ + public int getSequenceCount() + { + return this._sequenceList.size(); + } + + /** + * Method getSequenceSetProperties. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the + * jalview.schemabinding.version2.SequenceSetProperties at the given + * index + */ + public jalview.schemabinding.version2.SequenceSetProperties getSequenceSetProperties( + final int index) throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._sequenceSetPropertiesList.size()) + { + throw new IndexOutOfBoundsException( + "getSequenceSetProperties: Index value '" + index + + "' not in range [0.." + + (this._sequenceSetPropertiesList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.SequenceSetProperties) _sequenceSetPropertiesList + .get(index); + } + + /** + * Method getSequenceSetProperties.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 jalview.schemabinding.version2.SequenceSetProperties[] getSequenceSetProperties() + { + jalview.schemabinding.version2.SequenceSetProperties[] array = new jalview.schemabinding.version2.SequenceSetProperties[0]; + return (jalview.schemabinding.version2.SequenceSetProperties[]) this._sequenceSetPropertiesList + .toArray(array); + } + + /** + * Method getSequenceSetPropertiesCount. + * + * @return the size of this collection + */ + public int getSequenceSetPropertiesCount() + { + return this._sequenceSetPropertiesList.size(); + } + + /** + * 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); + } + + /** + * Method removeAlcodonFrame. + * + * @param vAlcodonFrame + * @return true if the object was removed from the collection. + */ + public boolean removeAlcodonFrame( + final jalview.schemabinding.version2.AlcodonFrame vAlcodonFrame) + { + boolean removed = _alcodonFrameList.remove(vAlcodonFrame); + return removed; + } + + /** + * Method removeAlcodonFrameAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.AlcodonFrame removeAlcodonFrameAt( + final int index) + { + java.lang.Object obj = this._alcodonFrameList.remove(index); + return (jalview.schemabinding.version2.AlcodonFrame) obj; + } + + /** + */ + public void removeAllAlcodonFrame() + { + this._alcodonFrameList.clear(); + } + + /** + */ + public void removeAllAnnotation() + { + this._annotationList.clear(); + } + + /** + */ + public void removeAllSequence() + { + this._sequenceList.clear(); + } + + /** + */ + public void removeAllSequenceSetProperties() + { + this._sequenceSetPropertiesList.clear(); + } + + /** + * Method removeAnnotation. + * + * @param vAnnotation + * @return true if the object was removed from the collection. + */ + public boolean removeAnnotation( + final jalview.schemabinding.version2.Annotation vAnnotation) + { + boolean removed = _annotationList.remove(vAnnotation); + return removed; + } + + /** + * Method removeAnnotationAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.Annotation removeAnnotationAt( + final int index) + { + java.lang.Object obj = this._annotationList.remove(index); + return (jalview.schemabinding.version2.Annotation) obj; + } + + /** + * Method removeSequence. + * + * @param vSequence + * @return true if the object was removed from the collection. + */ + public boolean removeSequence( + final jalview.schemabinding.version2.Sequence vSequence) + { + boolean removed = _sequenceList.remove(vSequence); + return removed; + } + + /** + * Method removeSequenceAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.Sequence removeSequenceAt( + final int index) + { + java.lang.Object obj = this._sequenceList.remove(index); + return (jalview.schemabinding.version2.Sequence) obj; + } + + /** + * Method removeSequenceSetProperties. + * + * @param vSequenceSetProperties + * @return true if the object was removed from the collection. + */ + public boolean removeSequenceSetProperties( + final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties) + { + boolean removed = _sequenceSetPropertiesList + .remove(vSequenceSetProperties); + return removed; + } + + /** + * Method removeSequenceSetPropertiesAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.SequenceSetProperties removeSequenceSetPropertiesAt( + final int index) + { + java.lang.Object obj = this._sequenceSetPropertiesList.remove(index); + return (jalview.schemabinding.version2.SequenceSetProperties) obj; + } + + /** + * + * + * @param index + * @param vAlcodonFrame + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setAlcodonFrame(final int index, + final jalview.schemabinding.version2.AlcodonFrame vAlcodonFrame) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._alcodonFrameList.size()) + { + throw new IndexOutOfBoundsException("setAlcodonFrame: Index value '" + + index + "' not in range [0.." + + (this._alcodonFrameList.size() - 1) + "]"); + } + + this._alcodonFrameList.set(index, vAlcodonFrame); + } + + /** + * + * + * @param vAlcodonFrameArray + */ + public void setAlcodonFrame( + final jalview.schemabinding.version2.AlcodonFrame[] vAlcodonFrameArray) + { + // -- copy array + _alcodonFrameList.clear(); + + for (int i = 0; i < vAlcodonFrameArray.length; i++) + { + this._alcodonFrameList.add(vAlcodonFrameArray[i]); + } + } + + /** + * + * + * @param index + * @param vAnnotation + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setAnnotation(final int index, + final jalview.schemabinding.version2.Annotation vAnnotation) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._annotationList.size()) + { + throw new IndexOutOfBoundsException("setAnnotation: Index value '" + + index + "' not in range [0.." + + (this._annotationList.size() - 1) + "]"); + } + + this._annotationList.set(index, vAnnotation); + } + + /** + * + * + * @param vAnnotationArray + */ + public void setAnnotation( + final jalview.schemabinding.version2.Annotation[] vAnnotationArray) + { + // -- copy array + _annotationList.clear(); + + for (int i = 0; i < vAnnotationArray.length; i++) + { + this._annotationList.add(vAnnotationArray[i]); + } + } + + /** + * Sets the value of field 'datasetId'. The field 'datasetId' has the + * following description: reference to set where jalview will gather the + * dataset sequences for all sequences in the set. + * + * + * @param datasetId + * the value of field 'datasetId'. + */ + public void setDatasetId(final java.lang.String datasetId) + { + this._datasetId = datasetId; + } + + /** + * Sets the value of field 'gapChar'. + * + * @param gapChar + * the value of field 'gapChar'. + */ + public void setGapChar(final java.lang.String gapChar) + { + this._gapChar = gapChar; + } + + /** + * + * + * @param index + * @param vSequence + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setSequence(final int index, + final jalview.schemabinding.version2.Sequence vSequence) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._sequenceList.size()) + { + throw new IndexOutOfBoundsException("setSequence: Index value '" + + index + "' not in range [0.." + + (this._sequenceList.size() - 1) + "]"); + } + + this._sequenceList.set(index, vSequence); + } + + /** + * + * + * @param vSequenceArray + */ + public void setSequence( + final jalview.schemabinding.version2.Sequence[] vSequenceArray) + { + // -- copy array + _sequenceList.clear(); + + for (int i = 0; i < vSequenceArray.length; i++) + { + this._sequenceList.add(vSequenceArray[i]); + } + } + + /** + * + * + * @param index + * @param vSequenceSetProperties + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setSequenceSetProperties( + final int index, + final jalview.schemabinding.version2.SequenceSetProperties vSequenceSetProperties) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._sequenceSetPropertiesList.size()) + { + throw new IndexOutOfBoundsException( + "setSequenceSetProperties: Index value '" + index + + "' not in range [0.." + + (this._sequenceSetPropertiesList.size() - 1) + "]"); + } + + this._sequenceSetPropertiesList.set(index, vSequenceSetProperties); + } + + /** + * + * + * @param vSequenceSetPropertiesArray + */ + public void setSequenceSetProperties( + final jalview.schemabinding.version2.SequenceSetProperties[] vSequenceSetPropertiesArray) + { + // -- copy array + _sequenceSetPropertiesList.clear(); + + for (int i = 0; i < vSequenceSetPropertiesArray.length; i++) + { + this._sequenceSetPropertiesList.add(vSequenceSetPropertiesArray[i]); + } + } + + /** + * 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.SequenceSet + */ + public static jalview.schemabinding.version2.SequenceSet unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.SequenceSet) Unmarshaller + .unmarshal(jalview.schemabinding.version2.SequenceSet.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/SequenceSetProperties.java b/src/jalview/schemabinding/version2/SequenceSetProperties.java index a078c78..3a7d172 100644 --- a/src/jalview/schemabinding/version2/SequenceSetProperties.java +++ b/src/jalview/schemabinding/version2/SequenceSetProperties.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,152 +19,165 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class SequenceSetProperties implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _key. - */ - private java.lang.String _key; - - /** - * Field _value. - */ - private java.lang.String _value; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public SequenceSetProperties() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Returns the value of field 'key'. - * - * @return the value of field 'Key'. - */ - public java.lang.String getKey( - ) { - return this._key; - } - - /** - * Returns the value of field 'value'. - * - * @return the value of field 'Value'. - */ - public java.lang.String getValue( - ) { - return this._value; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'key'. - * - * @param key the value of field 'key'. - */ - public void setKey( - final java.lang.String key) { - this._key = key; - } - - /** - * Sets the value of field 'value'. - * - * @param value the value of field 'value'. - */ - public void setValue( - final java.lang.String value) { - this._value = value; - } - - /** - * 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.SequenceSetProperties - */ - public static jalview.schemabinding.version2.SequenceSetProperties unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.SequenceSetProperties) Unmarshaller.unmarshal(jalview.schemabinding.version2.SequenceSetProperties.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); +public class SequenceSetProperties implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _key. + */ + private java.lang.String _key; + + /** + * Field _value. + */ + private java.lang.String _value; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public SequenceSetProperties() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Returns the value of field 'key'. + * + * @return the value of field 'Key'. + */ + public java.lang.String getKey() + { + return this._key; + } + + /** + * Returns the value of field 'value'. + * + * @return the value of field 'Value'. + */ + public java.lang.String getValue() + { + return this._value; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'key'. + * + * @param key + * the value of field 'key'. + */ + public void setKey(final java.lang.String key) + { + this._key = key; + } + + /** + * Sets the value of field 'value'. + * + * @param value + * the value of field 'value'. + */ + public void setValue(final java.lang.String value) + { + this._value = value; + } + + /** + * 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.SequenceSetProperties + */ + public static jalview.schemabinding.version2.SequenceSetProperties unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.SequenceSetProperties) Unmarshaller + .unmarshal( + jalview.schemabinding.version2.SequenceSetProperties.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/SequenceType.java b/src/jalview/schemabinding/version2/SequenceType.java index 5886fbb..f213ebb 100644 --- a/src/jalview/schemabinding/version2/SequenceType.java +++ b/src/jalview/schemabinding/version2/SequenceType.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,202 +19,215 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class SequenceType implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _id. - */ - private java.lang.String _id; - - /** - * Field _description. - */ - private java.lang.String _description; - - /** - * Field _sequence. - */ - private java.lang.String _sequence; - - /** - * Field _name. - */ - private java.lang.String _name; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public SequenceType() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Returns the value of field 'description'. - * - * @return the value of field 'Description'. - */ - public java.lang.String getDescription( - ) { - return this._description; - } - - /** - * Returns the value of field 'id'. - * - * @return the value of field 'Id'. - */ - public java.lang.String getId( - ) { - return this._id; - } - - /** - * Returns the value of field 'name'. - * - * @return the value of field 'Name'. - */ - public java.lang.String getName( - ) { - return this._name; - } - - /** - * Returns the value of field 'sequence'. - * - * @return the value of field 'Sequence'. - */ - public java.lang.String getSequence( - ) { - return this._sequence; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'description'. - * - * @param description the value of field 'description'. - */ - public void setDescription( - final java.lang.String description) { - this._description = description; - } - - /** - * Sets the value of field 'id'. - * - * @param id the value of field 'id'. - */ - public void setId( - final java.lang.String id) { - this._id = id; - } - - /** - * Sets the value of field 'name'. - * - * @param name the value of field 'name'. - */ - public void setName( - final java.lang.String name) { - this._name = name; - } - - /** - * Sets the value of field 'sequence'. - * - * @param sequence the value of field 'sequence'. - */ - public void setSequence( - final java.lang.String sequence) { - this._sequence = sequence; - } - - /** - * 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.SequenceType - */ - public static jalview.schemabinding.version2.SequenceType unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.SequenceType) Unmarshaller.unmarshal(jalview.schemabinding.version2.SequenceType.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); +public class SequenceType implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _id. + */ + private java.lang.String _id; + + /** + * Field _description. + */ + private java.lang.String _description; + + /** + * Field _sequence. + */ + private java.lang.String _sequence; + + /** + * Field _name. + */ + private java.lang.String _name; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public SequenceType() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Returns the value of field 'description'. + * + * @return the value of field 'Description'. + */ + public java.lang.String getDescription() + { + return this._description; + } + + /** + * Returns the value of field 'id'. + * + * @return the value of field 'Id'. + */ + public java.lang.String getId() + { + return this._id; + } + + /** + * Returns the value of field 'name'. + * + * @return the value of field 'Name'. + */ + public java.lang.String getName() + { + return this._name; + } + + /** + * Returns the value of field 'sequence'. + * + * @return the value of field 'Sequence'. + */ + public java.lang.String getSequence() + { + return this._sequence; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'description'. + * + * @param description + * the value of field 'description'. + */ + public void setDescription(final java.lang.String description) + { + this._description = description; + } + + /** + * Sets the value of field 'id'. + * + * @param id + * the value of field 'id'. + */ + public void setId(final java.lang.String id) + { + this._id = id; + } + + /** + * Sets the value of field 'name'. + * + * @param name + * the value of field 'name'. + */ + public void setName(final java.lang.String name) + { + this._name = name; + } + + /** + * Sets the value of field 'sequence'. + * + * @param sequence + * the value of field 'sequence'. + */ + public void setSequence(final java.lang.String sequence) + { + this._sequence = sequence; + } + + /** + * 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.SequenceType + */ + public static jalview.schemabinding.version2.SequenceType unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.SequenceType) Unmarshaller + .unmarshal(jalview.schemabinding.version2.SequenceType.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/Setting.java b/src/jalview/schemabinding/version2/Setting.java index 2c19f1f..c458971 100644 --- a/src/jalview/schemabinding/version2/Setting.java +++ b/src/jalview/schemabinding/version2/Setting.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,670 +19,671 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Setting implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _type. - */ - private java.lang.String _type; - - /** - * Field _colour. - */ - private int _colour; - - /** - * keeps track of state for field: _colour - */ - private boolean _has_colour; - - /** - * Field _display. - */ - private boolean _display; - - /** - * keeps track of state for field: _display - */ - private boolean _has_display; - - /** - * Field _order. - */ - private float _order; - - /** - * keeps track of state for field: _order - */ - private boolean _has_order; - - /** - * Optional minimum colour - * for graduated - * feature - * colour - * - */ - private int _mincolour; - - /** - * keeps track of state for field: _mincolour - */ - private boolean _has_mincolour; - - /** - * threshold value for - * graduated feature colour - * - */ - private float _threshold; - - /** - * keeps track of state for field: _threshold - */ - private boolean _has_threshold; - - /** - * threshold type for - * graduated feature colour - * - */ - private int _threshstate; - - /** - * keeps track of state for field: _threshstate - */ - private boolean _has_threshstate; - - /** - * Field _max. - */ - private float _max; - - /** - * keeps track of state for field: _max - */ - private boolean _has_max; - - /** - * Field _min. - */ - private float _min; - - /** - * keeps track of state for field: _min - */ - private boolean _has_min; - - /** - * Field _colourByLabel. - */ - private boolean _colourByLabel; - - /** - * keeps track of state for field: _colourByLabel - */ - private boolean _has_colourByLabel; - - /** - * Field _autoScale. - */ - private boolean _autoScale; - - /** - * keeps track of state for field: _autoScale - */ - private boolean _has_autoScale; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Setting() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deleteAutoScale( - ) { - this._has_autoScale= false; - } - - /** - */ - public void deleteColour( - ) { - this._has_colour= false; - } - - /** - */ - public void deleteColourByLabel( - ) { - this._has_colourByLabel= false; - } - - /** - */ - public void deleteDisplay( - ) { - this._has_display= false; - } - - /** - */ - public void deleteMax( - ) { - this._has_max= false; - } - - /** - */ - public void deleteMin( - ) { - this._has_min= false; - } - - /** - */ - public void deleteMincolour( - ) { - this._has_mincolour= false; - } - - /** - */ - public void deleteOrder( - ) { - this._has_order= false; - } - - /** - */ - public void deleteThreshold( - ) { - this._has_threshold= false; - } - - /** - */ - public void deleteThreshstate( - ) { - this._has_threshstate= false; - } - - /** - * Returns the value of field 'autoScale'. - * - * @return the value of field 'AutoScale'. - */ - public boolean getAutoScale( - ) { - return this._autoScale; - } - - /** - * Returns the value of field 'colour'. - * - * @return the value of field 'Colour'. - */ - public int getColour( - ) { - return this._colour; - } - - /** - * Returns the value of field 'colourByLabel'. - * - * @return the value of field 'ColourByLabel'. - */ - public boolean getColourByLabel( - ) { - return this._colourByLabel; - } - - /** - * Returns the value of field 'display'. - * - * @return the value of field 'Display'. - */ - public boolean getDisplay( - ) { - return this._display; - } - - /** - * Returns the value of field 'max'. - * - * @return the value of field 'Max'. - */ - public float getMax( - ) { - return this._max; - } - - /** - * Returns the value of field 'min'. - * - * @return the value of field 'Min'. - */ - public float getMin( - ) { - return this._min; - } - - /** - * Returns the value of field 'mincolour'. The field - * 'mincolour' has the following description: Optional minimum - * colour - * for graduated - * feature - * colour - * - * - * @return the value of field 'Mincolour'. - */ - public int getMincolour( - ) { - return this._mincolour; - } - - /** - * Returns the value of field 'order'. - * - * @return the value of field 'Order'. - */ - public float getOrder( - ) { - return this._order; - } - - /** - * Returns the value of field 'threshold'. The field - * 'threshold' has the following description: threshold value - * for - * graduated feature colour - * - * - * @return the value of field 'Threshold'. - */ - public float getThreshold( - ) { - return this._threshold; - } - - /** - * Returns the value of field 'threshstate'. The field - * 'threshstate' has the following description: threshold type - * for - * graduated feature colour - * - * - * @return the value of field 'Threshstate'. - */ - public int getThreshstate( - ) { - return this._threshstate; - } - - /** - * Returns the value of field 'type'. - * - * @return the value of field 'Type'. - */ - public java.lang.String getType( - ) { - return this._type; - } - - /** - * Method hasAutoScale. - * - * @return true if at least one AutoScale has been added - */ - public boolean hasAutoScale( - ) { - return this._has_autoScale; - } - - /** - * Method hasColour. - * - * @return true if at least one Colour has been added - */ - public boolean hasColour( - ) { - return this._has_colour; - } - - /** - * Method hasColourByLabel. - * - * @return true if at least one ColourByLabel has been added - */ - public boolean hasColourByLabel( - ) { - return this._has_colourByLabel; - } - - /** - * Method hasDisplay. - * - * @return true if at least one Display has been added - */ - public boolean hasDisplay( - ) { - return this._has_display; - } - - /** - * Method hasMax. - * - * @return true if at least one Max has been added - */ - public boolean hasMax( - ) { - return this._has_max; - } - - /** - * Method hasMin. - * - * @return true if at least one Min has been added - */ - public boolean hasMin( - ) { - return this._has_min; - } - - /** - * Method hasMincolour. - * - * @return true if at least one Mincolour has been added - */ - public boolean hasMincolour( - ) { - return this._has_mincolour; - } - - /** - * Method hasOrder. - * - * @return true if at least one Order has been added - */ - public boolean hasOrder( - ) { - return this._has_order; - } - - /** - * Method hasThreshold. - * - * @return true if at least one Threshold has been added - */ - public boolean hasThreshold( - ) { - return this._has_threshold; - } - - /** - * Method hasThreshstate. - * - * @return true if at least one Threshstate has been added - */ - public boolean hasThreshstate( - ) { - return this._has_threshstate; - } - - /** - * Returns the value of field 'autoScale'. - * - * @return the value of field 'AutoScale'. - */ - public boolean isAutoScale( - ) { - return this._autoScale; - } - - /** - * Returns the value of field 'colourByLabel'. - * - * @return the value of field 'ColourByLabel'. - */ - public boolean isColourByLabel( - ) { - return this._colourByLabel; - } - - /** - * Returns the value of field 'display'. - * - * @return the value of field 'Display'. - */ - public boolean isDisplay( - ) { - return this._display; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'autoScale'. - * - * @param autoScale the value of field 'autoScale'. - */ - public void setAutoScale( - final boolean autoScale) { - this._autoScale = autoScale; - this._has_autoScale = true; - } - - /** - * Sets the value of field 'colour'. - * - * @param colour the value of field 'colour'. - */ - public void setColour( - final int colour) { - this._colour = colour; - this._has_colour = true; - } - - /** - * Sets the value of field 'colourByLabel'. - * - * @param colourByLabel the value of field 'colourByLabel'. - */ - public void setColourByLabel( - final boolean colourByLabel) { - this._colourByLabel = colourByLabel; - this._has_colourByLabel = true; - } - - /** - * Sets the value of field 'display'. - * - * @param display the value of field 'display'. - */ - public void setDisplay( - final boolean display) { - this._display = display; - this._has_display = true; - } - - /** - * Sets the value of field 'max'. - * - * @param max the value of field 'max'. - */ - public void setMax( - final float max) { - this._max = max; - this._has_max = true; - } - - /** - * Sets the value of field 'min'. - * - * @param min the value of field 'min'. - */ - public void setMin( - final float min) { - this._min = min; - this._has_min = true; - } - - /** - * Sets the value of field 'mincolour'. The field 'mincolour' - * has the following description: Optional minimum colour - * for graduated - * feature - * colour - * - * - * @param mincolour the value of field 'mincolour'. - */ - public void setMincolour( - final int mincolour) { - this._mincolour = mincolour; - this._has_mincolour = true; - } - - /** - * Sets the value of field 'order'. - * - * @param order the value of field 'order'. - */ - public void setOrder( - final float order) { - this._order = order; - this._has_order = true; - } - - /** - * Sets the value of field 'threshold'. The field 'threshold' - * has the following description: threshold value for - * graduated feature colour - * - * - * @param threshold the value of field 'threshold'. - */ - public void setThreshold( - final float threshold) { - this._threshold = threshold; - this._has_threshold = true; - } - - /** - * Sets the value of field 'threshstate'. The field - * 'threshstate' has the following description: threshold type - * for - * graduated feature colour - * - * - * @param threshstate the value of field 'threshstate'. - */ - public void setThreshstate( - final int threshstate) { - this._threshstate = threshstate; - this._has_threshstate = true; - } - - /** - * Sets the value of field 'type'. - * - * @param type the value of field 'type'. - */ - public void setType( - final java.lang.String type) { - this._type = type; - } - - /** - * 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.Settin - */ - public static jalview.schemabinding.version2.Setting unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.Setting) Unmarshaller.unmarshal(jalview.schemabinding.version2.Setting.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class Setting implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _type. + */ + private java.lang.String _type; + + /** + * Field _colour. + */ + private int _colour; + + /** + * keeps track of state for field: _colour + */ + private boolean _has_colour; + + /** + * Field _display. + */ + private boolean _display; + + /** + * keeps track of state for field: _display + */ + private boolean _has_display; + + /** + * Field _order. + */ + private float _order; + + /** + * keeps track of state for field: _order + */ + private boolean _has_order; + + /** + * Optional minimum colour for graduated feature colour + * + */ + private int _mincolour; + + /** + * keeps track of state for field: _mincolour + */ + private boolean _has_mincolour; + + /** + * threshold value for graduated feature colour + * + */ + private float _threshold; + + /** + * keeps track of state for field: _threshold + */ + private boolean _has_threshold; + + /** + * threshold type for graduated feature colour + * + */ + private int _threshstate; + + /** + * keeps track of state for field: _threshstate + */ + private boolean _has_threshstate; + + /** + * Field _max. + */ + private float _max; + + /** + * keeps track of state for field: _max + */ + private boolean _has_max; + + /** + * Field _min. + */ + private float _min; + + /** + * keeps track of state for field: _min + */ + private boolean _has_min; + + /** + * Field _colourByLabel. + */ + private boolean _colourByLabel; + + /** + * keeps track of state for field: _colourByLabel + */ + private boolean _has_colourByLabel; + + /** + * Field _autoScale. + */ + private boolean _autoScale; + + /** + * keeps track of state for field: _autoScale + */ + private boolean _has_autoScale; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Setting() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + */ + public void deleteAutoScale() + { + this._has_autoScale = false; + } + + /** + */ + public void deleteColour() + { + this._has_colour = false; + } + + /** + */ + public void deleteColourByLabel() + { + this._has_colourByLabel = false; + } + + /** + */ + public void deleteDisplay() + { + this._has_display = false; + } + + /** + */ + public void deleteMax() + { + this._has_max = false; + } + + /** + */ + public void deleteMin() + { + this._has_min = false; + } + + /** + */ + public void deleteMincolour() + { + this._has_mincolour = false; + } + + /** + */ + public void deleteOrder() + { + this._has_order = false; + } + + /** + */ + public void deleteThreshold() + { + this._has_threshold = false; + } + + /** + */ + public void deleteThreshstate() + { + this._has_threshstate = false; + } + + /** + * Returns the value of field 'autoScale'. + * + * @return the value of field 'AutoScale'. + */ + public boolean getAutoScale() + { + return this._autoScale; + } + + /** + * Returns the value of field 'colour'. + * + * @return the value of field 'Colour'. + */ + public int getColour() + { + return this._colour; + } + + /** + * Returns the value of field 'colourByLabel'. + * + * @return the value of field 'ColourByLabel'. + */ + public boolean getColourByLabel() + { + return this._colourByLabel; + } + + /** + * Returns the value of field 'display'. + * + * @return the value of field 'Display'. + */ + public boolean getDisplay() + { + return this._display; + } + + /** + * Returns the value of field 'max'. + * + * @return the value of field 'Max'. + */ + public float getMax() + { + return this._max; + } + + /** + * Returns the value of field 'min'. + * + * @return the value of field 'Min'. + */ + public float getMin() + { + return this._min; + } + + /** + * Returns the value of field 'mincolour'. The field 'mincolour' has the + * following description: Optional minimum colour for graduated feature colour + * + * + * @return the value of field 'Mincolour'. + */ + public int getMincolour() + { + return this._mincolour; + } + + /** + * Returns the value of field 'order'. + * + * @return the value of field 'Order'. + */ + public float getOrder() + { + return this._order; + } + + /** + * Returns the value of field 'threshold'. The field 'threshold' has the + * following description: threshold value for graduated feature colour + * + * + * @return the value of field 'Threshold'. + */ + public float getThreshold() + { + return this._threshold; + } + + /** + * Returns the value of field 'threshstate'. The field 'threshstate' has the + * following description: threshold type for graduated feature colour + * + * + * @return the value of field 'Threshstate'. + */ + public int getThreshstate() + { + return this._threshstate; + } + + /** + * Returns the value of field 'type'. + * + * @return the value of field 'Type'. + */ + public java.lang.String getType() + { + return this._type; + } + + /** + * Method hasAutoScale. + * + * @return true if at least one AutoScale has been added + */ + public boolean hasAutoScale() + { + return this._has_autoScale; + } + + /** + * Method hasColour. + * + * @return true if at least one Colour has been added + */ + public boolean hasColour() + { + return this._has_colour; + } + + /** + * Method hasColourByLabel. + * + * @return true if at least one ColourByLabel has been added + */ + public boolean hasColourByLabel() + { + return this._has_colourByLabel; + } + + /** + * Method hasDisplay. + * + * @return true if at least one Display has been added + */ + public boolean hasDisplay() + { + return this._has_display; + } + + /** + * Method hasMax. + * + * @return true if at least one Max has been added + */ + public boolean hasMax() + { + return this._has_max; + } + + /** + * Method hasMin. + * + * @return true if at least one Min has been added + */ + public boolean hasMin() + { + return this._has_min; + } + + /** + * Method hasMincolour. + * + * @return true if at least one Mincolour has been added + */ + public boolean hasMincolour() + { + return this._has_mincolour; + } + + /** + * Method hasOrder. + * + * @return true if at least one Order has been added + */ + public boolean hasOrder() + { + return this._has_order; + } + + /** + * Method hasThreshold. + * + * @return true if at least one Threshold has been added + */ + public boolean hasThreshold() + { + return this._has_threshold; + } + + /** + * Method hasThreshstate. + * + * @return true if at least one Threshstate has been added + */ + public boolean hasThreshstate() + { + return this._has_threshstate; + } + + /** + * Returns the value of field 'autoScale'. + * + * @return the value of field 'AutoScale'. + */ + public boolean isAutoScale() + { + return this._autoScale; + } + + /** + * Returns the value of field 'colourByLabel'. + * + * @return the value of field 'ColourByLabel'. + */ + public boolean isColourByLabel() + { + return this._colourByLabel; + } + + /** + * Returns the value of field 'display'. + * + * @return the value of field 'Display'. + */ + public boolean isDisplay() + { + return this._display; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; + } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'autoScale'. + * + * @param autoScale + * the value of field 'autoScale'. + */ + public void setAutoScale(final boolean autoScale) + { + this._autoScale = autoScale; + this._has_autoScale = true; + } + + /** + * Sets the value of field 'colour'. + * + * @param colour + * the value of field 'colour'. + */ + public void setColour(final int colour) + { + this._colour = colour; + this._has_colour = true; + } + + /** + * Sets the value of field 'colourByLabel'. + * + * @param colourByLabel + * the value of field 'colourByLabel'. + */ + public void setColourByLabel(final boolean colourByLabel) + { + this._colourByLabel = colourByLabel; + this._has_colourByLabel = true; + } + + /** + * Sets the value of field 'display'. + * + * @param display + * the value of field 'display'. + */ + public void setDisplay(final boolean display) + { + this._display = display; + this._has_display = true; + } + + /** + * Sets the value of field 'max'. + * + * @param max + * the value of field 'max'. + */ + public void setMax(final float max) + { + this._max = max; + this._has_max = true; + } + + /** + * Sets the value of field 'min'. + * + * @param min + * the value of field 'min'. + */ + public void setMin(final float min) + { + this._min = min; + this._has_min = true; + } + + /** + * Sets the value of field 'mincolour'. The field 'mincolour' has the + * following description: Optional minimum colour for graduated feature colour + * + * + * @param mincolour + * the value of field 'mincolour'. + */ + public void setMincolour(final int mincolour) + { + this._mincolour = mincolour; + this._has_mincolour = true; + } + + /** + * Sets the value of field 'order'. + * + * @param order + * the value of field 'order'. + */ + public void setOrder(final float order) + { + this._order = order; + this._has_order = true; + } + + /** + * Sets the value of field 'threshold'. The field 'threshold' has the + * following description: threshold value for graduated feature colour + * + * + * @param threshold + * the value of field 'threshold'. + */ + public void setThreshold(final float threshold) + { + this._threshold = threshold; + this._has_threshold = true; + } + + /** + * Sets the value of field 'threshstate'. The field 'threshstate' has the + * following description: threshold type for graduated feature colour + * + * + * @param threshstate + * the value of field 'threshstate'. + */ + public void setThreshstate(final int threshstate) + { + this._threshstate = threshstate; + this._has_threshstate = true; + } + + /** + * Sets the value of field 'type'. + * + * @param type + * the value of field 'type'. + */ + public void setType(final java.lang.String type) + { + this._type = type; + } + + /** + * 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.Settin + */ + public static jalview.schemabinding.version2.Setting unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Setting) Unmarshaller.unmarshal( + jalview.schemabinding.version2.Setting.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/StructureState.java b/src/jalview/schemabinding/version2/StructureState.java index fe7c95d..186e4e6 100644 --- a/src/jalview/schemabinding/version2/StructureState.java +++ b/src/jalview/schemabinding/version2/StructureState.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,1089 +19,688 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class StructureState implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * internal content storage - */ - private java.lang.String _content = ""; - - /** - * Field _visible. - */ - private boolean _visible; - - /** - * keeps track of state for field: _visible - */ - private boolean _has_visible; - - /** - * additional - * identifier - * which - * properly - * disambiguates - * the - * structure - * view - * from - * any - * other - * view - * with - * the - * same - * attributes. - * This - * is - * not - * an - * ID, - * because - * it - * is - * possible - * to - * have - * many - * references - * to - * the - * same - * physical - * structure - * view - * from - * different - * sequences - * in - * an - * alignment. - * A - * structureState - * element - * citing - * the - * same - * viewId - * will - * appear - * for - * each - * instance. - * - */ - private java.lang.String _viewId; - - /** - * Flag - * set - * if - * the - * alignment - * panel - * containing - * this - * JSeq - * should - * be - * included - * in - * those - * used - * to - * perform - * a - * structure - * superposition - * (since - * Jalview - * 2.7). - * - */ - private boolean _alignwithAlignPanel = true; - - /** - * keeps track of state for field: _alignwithAlignPanel - */ - private boolean _has_alignwithAlignPanel; - - /** - * Flag - * set - * if - * the - * alignment - * panel - * containing - * this - * JSeq - * should - * be - * included - * in - * those - * used - * to - * colour - * its - * associated - * sequences - * in - * this - * structureState(since - * Jalview - * 2.7). - * - */ - private boolean _colourwithAlignPanel = false; - - /** - * keeps track of state for field: _colourwithAlignPanel - */ - private boolean _has_colourwithAlignPanel; - - /** - * Flag - * set - * if - * the - * structure - * display - * is - * coloured - * by - * the - * Jmol - * state, - * rather - * than - * by - * one - * or - * more - * linked - * alignment - * views. - * - */ - private boolean _colourByJmol = true; - - /** - * keeps track of state for field: _colourByJmol - */ - private boolean _has_colourByJmol; - - /** - * An - * identifier - * for - * the - * viewer - * type, - * currently - * either - * JMOL - * or - * CHIMERA - * - */ - private java.lang.String _type; - - /** - * Field _width. - */ - private int _width; - - /** - * keeps track of state for field: _width - */ - private boolean _has_width; - - /** - * Field _height. - */ - private int _height; - - /** - * keeps track of state for field: _height - */ - private boolean _has_height; - - /** - * Field _xpos. - */ - private int _xpos; - - /** - * keeps track of state for field: _xpos - */ - private boolean _has_xpos; - - /** - * Field _ypos. - */ - private int _ypos; - - /** - * keeps track of state for field: _ypos - */ - private boolean _has_ypos; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public StructureState() { - super(); - setContent(""); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deleteAlignwithAlignPanel( - ) { - this._has_alignwithAlignPanel= false; - } - - /** - */ - public void deleteColourByJmol( - ) { - this._has_colourByJmol= false; - } - - /** - */ - public void deleteColourwithAlignPanel( - ) { - this._has_colourwithAlignPanel= false; - } - - /** - */ - public void deleteHeight( - ) { - this._has_height= false; - } - - /** - */ - public void deleteVisible( - ) { - this._has_visible= false; - } - - /** - */ - public void deleteWidth( - ) { - this._has_width= false; - } - - /** - */ - public void deleteXpos( - ) { - this._has_xpos= false; - } - - /** - */ - public void deleteYpos( - ) { - this._has_ypos= false; - } - - /** - * Returns the value of field 'alignwithAlignPanel'. The field - * 'alignwithAlignPanel' has the following description: Flag - * set - * if - * the - * alignment - * panel - * containing - * this - * JSeq - * should - * be - * included - * in - * those - * used - * to - * perform - * a - * structure - * superposition - * (since - * Jalview - * 2.7). - * - * - * @return the value of field 'AlignwithAlignPanel'. - */ - public boolean getAlignwithAlignPanel( - ) { - return this._alignwithAlignPanel; - } - - /** - * Returns the value of field 'colourByJmol'. The field - * 'colourByJmol' has the following description: Flag - * set - * if - * the - * structure - * display - * is - * coloured - * by - * the - * Jmol - * state, - * rather - * than - * by - * one - * or - * more - * linked - * alignment - * views. - * - * - * @return the value of field 'ColourByJmol'. - */ - public boolean getColourByJmol( - ) { - return this._colourByJmol; - } - - /** - * Returns the value of field 'colourwithAlignPanel'. The field - * 'colourwithAlignPanel' has the following description: Flag - * set - * if - * the - * alignment - * panel - * containing - * this - * JSeq - * should - * be - * included - * in - * those - * used - * to - * colour - * its - * associated - * sequences - * in - * this - * structureState(since - * Jalview - * 2.7). - * - * - * @return the value of field 'ColourwithAlignPanel'. - */ - public boolean getColourwithAlignPanel( - ) { - return this._colourwithAlignPanel; - } - - /** - * Returns the value of field 'content'. The field 'content' - * has the following description: internal content storage - * - * @return the value of field 'Content'. - */ - public java.lang.String getContent( - ) { - return this._content; - } - - /** - * Returns the value of field 'height'. - * - * @return the value of field 'Height'. - */ - public int getHeight( - ) { - return this._height; - } - - /** - * Returns the value of field 'type'. The field 'type' has the - * following description: An - * identifier - * for - * the - * viewer - * type, - * currently - * either - * JMOL - * or - * CHIMERA - * - * - * @return the value of field 'Type'. - */ - public java.lang.String getType( - ) { - return this._type; - } - - /** - * Returns the value of field 'viewId'. The field 'viewId' has - * the following description: additional - * identifier - * which - * properly - * disambiguates - * the - * structure - * view - * from - * any - * other - * view - * with - * the - * same - * attributes. - * This - * is - * not - * an - * ID, - * because - * it - * is - * possible - * to - * have - * many - * references - * to - * the - * same - * physical - * structure - * view - * from - * different - * sequences - * in - * an - * alignment. - * A - * structureState - * element - * citing - * the - * same - * viewId - * will - * appear - * for - * each - * instance. - * - * - * @return the value of field 'ViewId'. - */ - public java.lang.String getViewId( - ) { - return this._viewId; - } - - /** - * Returns the value of field 'visible'. - * - * @return the value of field 'Visible'. - */ - public boolean getVisible( - ) { - return this._visible; - } - - /** - * Returns the value of field 'width'. - * - * @return the value of field 'Width'. - */ - public int getWidth( - ) { - return this._width; - } - - /** - * Returns the value of field 'xpos'. - * - * @return the value of field 'Xpos'. - */ - public int getXpos( - ) { - return this._xpos; - } - - /** - * Returns the value of field 'ypos'. - * - * @return the value of field 'Ypos'. - */ - public int getYpos( - ) { - return this._ypos; - } - - /** - * Method hasAlignwithAlignPanel. - * - * @return true if at least one AlignwithAlignPanel has been - * added - */ - public boolean hasAlignwithAlignPanel( - ) { - return this._has_alignwithAlignPanel; - } - - /** - * Method hasColourByJmol. - * - * @return true if at least one ColourByJmol has been added - */ - public boolean hasColourByJmol( - ) { - return this._has_colourByJmol; - } - - /** - * Method hasColourwithAlignPanel. - * - * @return true if at least one ColourwithAlignPanel has been - * added - */ - public boolean hasColourwithAlignPanel( - ) { - return this._has_colourwithAlignPanel; - } - - /** - * Method hasHeight. - * - * @return true if at least one Height has been added - */ - public boolean hasHeight( - ) { - return this._has_height; - } - - /** - * Method hasVisible. - * - * @return true if at least one Visible has been added - */ - public boolean hasVisible( - ) { - return this._has_visible; - } - - /** - * Method hasWidth. - * - * @return true if at least one Width has been added - */ - public boolean hasWidth( - ) { - return this._has_width; - } - - /** - * Method hasXpos. - * - * @return true if at least one Xpos has been added - */ - public boolean hasXpos( - ) { - return this._has_xpos; - } - - /** - * Method hasYpos. - * - * @return true if at least one Ypos has been added - */ - public boolean hasYpos( - ) { - return this._has_ypos; - } - - /** - * Returns the value of field 'alignwithAlignPanel'. The field - * 'alignwithAlignPanel' has the following description: Flag - * set - * if - * the - * alignment - * panel - * containing - * this - * JSeq - * should - * be - * included - * in - * those - * used - * to - * perform - * a - * structure - * superposition - * (since - * Jalview - * 2.7). - * - * - * @return the value of field 'AlignwithAlignPanel'. - */ - public boolean isAlignwithAlignPanel( - ) { - return this._alignwithAlignPanel; - } - - /** - * Returns the value of field 'colourByJmol'. The field - * 'colourByJmol' has the following description: Flag - * set - * if - * the - * structure - * display - * is - * coloured - * by - * the - * Jmol - * state, - * rather - * than - * by - * one - * or - * more - * linked - * alignment - * views. - * - * - * @return the value of field 'ColourByJmol'. - */ - public boolean isColourByJmol( - ) { - return this._colourByJmol; - } - - /** - * Returns the value of field 'colourwithAlignPanel'. The field - * 'colourwithAlignPanel' has the following description: Flag - * set - * if - * the - * alignment - * panel - * containing - * this - * JSeq - * should - * be - * included - * in - * those - * used - * to - * colour - * its - * associated - * sequences - * in - * this - * structureState(since - * Jalview - * 2.7). - * - * - * @return the value of field 'ColourwithAlignPanel'. - */ - public boolean isColourwithAlignPanel( - ) { - return this._colourwithAlignPanel; - } - - /** - * 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; - } - - /** - * Returns the value of field 'visible'. - * - * @return the value of field 'Visible'. - */ - public boolean isVisible( - ) { - return this._visible; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'alignwithAlignPanel'. The field - * 'alignwithAlignPanel' has the following description: Flag - * set - * if - * the - * alignment - * panel - * containing - * this - * JSeq - * should - * be - * included - * in - * those - * used - * to - * perform - * a - * structure - * superposition - * (since - * Jalview - * 2.7). - * - * - * @param alignwithAlignPanel the value of field - * 'alignwithAlignPanel'. - */ - public void setAlignwithAlignPanel( - final boolean alignwithAlignPanel) { - this._alignwithAlignPanel = alignwithAlignPanel; - this._has_alignwithAlignPanel = true; - } - - /** - * Sets the value of field 'colourByJmol'. The field - * 'colourByJmol' has the following description: Flag - * set - * if - * the - * structure - * display - * is - * coloured - * by - * the - * Jmol - * state, - * rather - * than - * by - * one - * or - * more - * linked - * alignment - * views. - * - * - * @param colourByJmol the value of field 'colourByJmol'. - */ - public void setColourByJmol( - final boolean colourByJmol) { - this._colourByJmol = colourByJmol; - this._has_colourByJmol = true; - } - - /** - * Sets the value of field 'colourwithAlignPanel'. The field - * 'colourwithAlignPanel' has the following description: Flag - * set - * if - * the - * alignment - * panel - * containing - * this - * JSeq - * should - * be - * included - * in - * those - * used - * to - * colour - * its - * associated - * sequences - * in - * this - * structureState(since - * Jalview - * 2.7). - * - * - * @param colourwithAlignPanel the value of field - * 'colourwithAlignPanel'. - */ - public void setColourwithAlignPanel( - final boolean colourwithAlignPanel) { - this._colourwithAlignPanel = colourwithAlignPanel; - this._has_colourwithAlignPanel = true; - } - - /** - * Sets the value of field 'content'. The field 'content' has - * the following description: internal content storage - * - * @param content the value of field 'content'. - */ - public void setContent( - final java.lang.String content) { - this._content = content; - } - - /** - * Sets the value of field 'height'. - * - * @param height the value of field 'height'. - */ - public void setHeight( - final int height) { - this._height = height; - this._has_height = true; - } - - /** - * Sets the value of field 'type'. The field 'type' has the - * following description: An - * identifier - * for - * the - * viewer - * type, - * currently - * either - * JMOL - * or - * CHIMERA - * - * - * @param type the value of field 'type'. - */ - public void setType( - final java.lang.String type) { - this._type = type; - } - - /** - * Sets the value of field 'viewId'. The field 'viewId' has the - * following description: additional - * identifier - * which - * properly - * disambiguates - * the - * structure - * view - * from - * any - * other - * view - * with - * the - * same - * attributes. - * This - * is - * not - * an - * ID, - * because - * it - * is - * possible - * to - * have - * many - * references - * to - * the - * same - * physical - * structure - * view - * from - * different - * sequences - * in - * an - * alignment. - * A - * structureState - * element - * citing - * the - * same - * viewId - * will - * appear - * for - * each - * instance. - * - * - * @param viewId the value of field 'viewId'. - */ - public void setViewId( - final java.lang.String viewId) { - this._viewId = viewId; - } - - /** - * Sets the value of field 'visible'. - * - * @param visible the value of field 'visible'. - */ - public void setVisible( - final boolean visible) { - this._visible = visible; - this._has_visible = true; - } - - /** - * Sets the value of field 'width'. - * - * @param width the value of field 'width'. - */ - public void setWidth( - final int width) { - this._width = width; - this._has_width = true; - } - - /** - * Sets the value of field 'xpos'. - * - * @param xpos the value of field 'xpos'. - */ - public void setXpos( - final int xpos) { - this._xpos = xpos; - this._has_xpos = true; - } - - /** - * Sets the value of field 'ypos'. - * - * @param ypos the value of field 'ypos'. - */ - public void setYpos( - final int ypos) { - this._ypos = ypos; - this._has_ypos = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled - * jalview.schemabinding.version2.StructureState - */ - public static jalview.schemabinding.version2.StructureState unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.StructureState) Unmarshaller.unmarshal(jalview.schemabinding.version2.StructureState.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class StructureState implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * internal content storage + */ + private java.lang.String _content = ""; + + /** + * Field _visible. + */ + private boolean _visible; + + /** + * keeps track of state for field: _visible + */ + private boolean _has_visible; + + /** + * additional identifier which properly disambiguates the structure view from + * any other view with the same attributes. This is not an ID, because it is + * possible to have many references to the same physical structure view from + * different sequences in an alignment. A structureState element citing the + * same viewId will appear for each instance. + * + */ + private java.lang.String _viewId; + + /** + * Flag set if the alignment panel containing this JSeq should be included in + * those used to perform a structure superposition (since Jalview 2.7). + * + */ + private boolean _alignwithAlignPanel = true; + + /** + * keeps track of state for field: _alignwithAlignPanel + */ + private boolean _has_alignwithAlignPanel; + + /** + * Flag set if the alignment panel containing this JSeq should be included in + * those used to colour its associated sequences in this structureState(since + * Jalview 2.7). + * + */ + private boolean _colourwithAlignPanel = false; + + /** + * keeps track of state for field: _colourwithAlignPanel + */ + private boolean _has_colourwithAlignPanel; + + /** + * Flag set if the structure display is coloured by the Jmol state, rather + * than by one or more linked alignment views. + * + */ + private boolean _colourByJmol = true; + + /** + * keeps track of state for field: _colourByJmol + */ + private boolean _has_colourByJmol; + + /** + * An identifier for the viewer type, currently either JMOL or CHIMERA + * + */ + private java.lang.String _type; + + /** + * Field _width. + */ + private int _width; + + /** + * keeps track of state for field: _width + */ + private boolean _has_width; + + /** + * Field _height. + */ + private int _height; + + /** + * keeps track of state for field: _height + */ + private boolean _has_height; + + /** + * Field _xpos. + */ + private int _xpos; + + /** + * keeps track of state for field: _xpos + */ + private boolean _has_xpos; + + /** + * Field _ypos. + */ + private int _ypos; + + /** + * keeps track of state for field: _ypos + */ + private boolean _has_ypos; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public StructureState() + { + super(); + setContent(""); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + */ + public void deleteAlignwithAlignPanel() + { + this._has_alignwithAlignPanel = false; + } + + /** + */ + public void deleteColourByJmol() + { + this._has_colourByJmol = false; + } + + /** + */ + public void deleteColourwithAlignPanel() + { + this._has_colourwithAlignPanel = false; + } + + /** + */ + public void deleteHeight() + { + this._has_height = false; + } + + /** + */ + public void deleteVisible() + { + this._has_visible = false; + } + + /** + */ + public void deleteWidth() + { + this._has_width = false; + } + + /** + */ + public void deleteXpos() + { + this._has_xpos = false; + } + + /** + */ + public void deleteYpos() + { + this._has_ypos = false; + } + + /** + * Returns the value of field 'alignwithAlignPanel'. The field + * 'alignwithAlignPanel' has the following description: Flag set if the + * alignment panel containing this JSeq should be included in those used to + * perform a structure superposition (since Jalview 2.7). + * + * + * @return the value of field 'AlignwithAlignPanel'. + */ + public boolean getAlignwithAlignPanel() + { + return this._alignwithAlignPanel; + } + + /** + * Returns the value of field 'colourByJmol'. The field 'colourByJmol' has the + * following description: Flag set if the structure display is coloured by the + * Jmol state, rather than by one or more linked alignment views. + * + * + * @return the value of field 'ColourByJmol'. + */ + public boolean getColourByJmol() + { + return this._colourByJmol; + } + + /** + * Returns the value of field 'colourwithAlignPanel'. The field + * 'colourwithAlignPanel' has the following description: Flag set if the + * alignment panel containing this JSeq should be included in those used to + * colour its associated sequences in this structureState(since Jalview 2.7). + * + * + * @return the value of field 'ColourwithAlignPanel'. + */ + public boolean getColourwithAlignPanel() + { + return this._colourwithAlignPanel; + } + + /** + * Returns the value of field 'content'. The field 'content' has the following + * description: internal content storage + * + * @return the value of field 'Content'. + */ + public java.lang.String getContent() + { + return this._content; + } + + /** + * Returns the value of field 'height'. + * + * @return the value of field 'Height'. + */ + public int getHeight() + { + return this._height; + } + + /** + * Returns the value of field 'type'. The field 'type' has the following + * description: An identifier for the viewer type, currently either JMOL or + * CHIMERA + * + * + * @return the value of field 'Type'. + */ + public java.lang.String getType() + { + return this._type; + } + + /** + * Returns the value of field 'viewId'. The field 'viewId' has the following + * description: additional identifier which properly disambiguates the + * structure view from any other view with the same attributes. This is not an + * ID, because it is possible to have many references to the same physical + * structure view from different sequences in an alignment. A structureState + * element citing the same viewId will appear for each instance. + * + * + * @return the value of field 'ViewId'. + */ + public java.lang.String getViewId() + { + return this._viewId; + } + + /** + * Returns the value of field 'visible'. + * + * @return the value of field 'Visible'. + */ + public boolean getVisible() + { + return this._visible; + } + + /** + * Returns the value of field 'width'. + * + * @return the value of field 'Width'. + */ + public int getWidth() + { + return this._width; + } + + /** + * Returns the value of field 'xpos'. + * + * @return the value of field 'Xpos'. + */ + public int getXpos() + { + return this._xpos; + } + + /** + * Returns the value of field 'ypos'. + * + * @return the value of field 'Ypos'. + */ + public int getYpos() + { + return this._ypos; + } + + /** + * Method hasAlignwithAlignPanel. + * + * @return true if at least one AlignwithAlignPanel has been added + */ + public boolean hasAlignwithAlignPanel() + { + return this._has_alignwithAlignPanel; + } + + /** + * Method hasColourByJmol. + * + * @return true if at least one ColourByJmol has been added + */ + public boolean hasColourByJmol() + { + return this._has_colourByJmol; + } + + /** + * Method hasColourwithAlignPanel. + * + * @return true if at least one ColourwithAlignPanel has been added + */ + public boolean hasColourwithAlignPanel() + { + return this._has_colourwithAlignPanel; + } + + /** + * Method hasHeight. + * + * @return true if at least one Height has been added + */ + public boolean hasHeight() + { + return this._has_height; + } + + /** + * Method hasVisible. + * + * @return true if at least one Visible has been added + */ + public boolean hasVisible() + { + return this._has_visible; + } + + /** + * Method hasWidth. + * + * @return true if at least one Width has been added + */ + public boolean hasWidth() + { + return this._has_width; + } + + /** + * Method hasXpos. + * + * @return true if at least one Xpos has been added + */ + public boolean hasXpos() + { + return this._has_xpos; + } + + /** + * Method hasYpos. + * + * @return true if at least one Ypos has been added + */ + public boolean hasYpos() + { + return this._has_ypos; + } + + /** + * Returns the value of field 'alignwithAlignPanel'. The field + * 'alignwithAlignPanel' has the following description: Flag set if the + * alignment panel containing this JSeq should be included in those used to + * perform a structure superposition (since Jalview 2.7). + * + * + * @return the value of field 'AlignwithAlignPanel'. + */ + public boolean isAlignwithAlignPanel() + { + return this._alignwithAlignPanel; + } + + /** + * Returns the value of field 'colourByJmol'. The field 'colourByJmol' has the + * following description: Flag set if the structure display is coloured by the + * Jmol state, rather than by one or more linked alignment views. + * + * + * @return the value of field 'ColourByJmol'. + */ + public boolean isColourByJmol() + { + return this._colourByJmol; + } + + /** + * Returns the value of field 'colourwithAlignPanel'. The field + * 'colourwithAlignPanel' has the following description: Flag set if the + * alignment panel containing this JSeq should be included in those used to + * colour its associated sequences in this structureState(since Jalview 2.7). + * + * + * @return the value of field 'ColourwithAlignPanel'. + */ + public boolean isColourwithAlignPanel() + { + return this._colourwithAlignPanel; + } + + /** + * 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; + } + + /** + * Returns the value of field 'visible'. + * + * @return the value of field 'Visible'. + */ + public boolean isVisible() + { + return this._visible; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'alignwithAlignPanel'. The field + * 'alignwithAlignPanel' has the following description: Flag set if the + * alignment panel containing this JSeq should be included in those used to + * perform a structure superposition (since Jalview 2.7). + * + * + * @param alignwithAlignPanel + * the value of field 'alignwithAlignPanel'. + */ + public void setAlignwithAlignPanel(final boolean alignwithAlignPanel) + { + this._alignwithAlignPanel = alignwithAlignPanel; + this._has_alignwithAlignPanel = true; + } + + /** + * Sets the value of field 'colourByJmol'. The field 'colourByJmol' has the + * following description: Flag set if the structure display is coloured by the + * Jmol state, rather than by one or more linked alignment views. + * + * + * @param colourByJmol + * the value of field 'colourByJmol'. + */ + public void setColourByJmol(final boolean colourByJmol) + { + this._colourByJmol = colourByJmol; + this._has_colourByJmol = true; + } + + /** + * Sets the value of field 'colourwithAlignPanel'. The field + * 'colourwithAlignPanel' has the following description: Flag set if the + * alignment panel containing this JSeq should be included in those used to + * colour its associated sequences in this structureState(since Jalview 2.7). + * + * + * @param colourwithAlignPanel + * the value of field 'colourwithAlignPanel'. + */ + public void setColourwithAlignPanel(final boolean colourwithAlignPanel) + { + this._colourwithAlignPanel = colourwithAlignPanel; + this._has_colourwithAlignPanel = true; + } + + /** + * Sets the value of field 'content'. The field 'content' has the following + * description: internal content storage + * + * @param content + * the value of field 'content'. + */ + public void setContent(final java.lang.String content) + { + this._content = content; + } + + /** + * Sets the value of field 'height'. + * + * @param height + * the value of field 'height'. + */ + public void setHeight(final int height) + { + this._height = height; + this._has_height = true; + } + + /** + * Sets the value of field 'type'. The field 'type' has the following + * description: An identifier for the viewer type, currently either JMOL or + * CHIMERA + * + * + * @param type + * the value of field 'type'. + */ + public void setType(final java.lang.String type) + { + this._type = type; + } + + /** + * Sets the value of field 'viewId'. The field 'viewId' has the following + * description: additional identifier which properly disambiguates the + * structure view from any other view with the same attributes. This is not an + * ID, because it is possible to have many references to the same physical + * structure view from different sequences in an alignment. A structureState + * element citing the same viewId will appear for each instance. + * + * + * @param viewId + * the value of field 'viewId'. + */ + public void setViewId(final java.lang.String viewId) + { + this._viewId = viewId; + } + + /** + * Sets the value of field 'visible'. + * + * @param visible + * the value of field 'visible'. + */ + public void setVisible(final boolean visible) + { + this._visible = visible; + this._has_visible = true; + } + + /** + * Sets the value of field 'width'. + * + * @param width + * the value of field 'width'. + */ + public void setWidth(final int width) + { + this._width = width; + this._has_width = true; + } + + /** + * Sets the value of field 'xpos'. + * + * @param xpos + * the value of field 'xpos'. + */ + public void setXpos(final int xpos) + { + this._xpos = xpos; + this._has_xpos = true; + } + + /** + * Sets the value of field 'ypos'. + * + * @param ypos + * the value of field 'ypos'. + */ + public void setYpos(final int ypos) + { + this._ypos = ypos; + this._has_ypos = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.schemabinding.version2.StructureState + */ + public static jalview.schemabinding.version2.StructureState unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.StructureState) Unmarshaller + .unmarshal(jalview.schemabinding.version2.StructureState.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/ThresholdLine.java b/src/jalview/schemabinding/version2/ThresholdLine.java index 31affa2..d70d855 100644 --- a/src/jalview/schemabinding/version2/ThresholdLine.java +++ b/src/jalview/schemabinding/version2/ThresholdLine.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,223 +19,235 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class ThresholdLine implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _label. - */ - private java.lang.String _label; - - /** - * Field _value. - */ - private float _value; - - /** - * keeps track of state for field: _value - */ - private boolean _has_value; - - /** - * Field _colour. - */ - private int _colour; - - /** - * keeps track of state for field: _colour - */ - private boolean _has_colour; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public ThresholdLine() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deleteColour( - ) { - this._has_colour= false; - } - - /** - */ - public void deleteValue( - ) { - this._has_value= false; - } - - /** - * Returns the value of field 'colour'. - * - * @return the value of field 'Colour'. - */ - public int getColour( - ) { - return this._colour; - } - - /** - * Returns the value of field 'label'. - * - * @return the value of field 'Label'. - */ - public java.lang.String getLabel( - ) { - return this._label; - } - - /** - * Returns the value of field 'value'. - * - * @return the value of field 'Value'. - */ - public float getValue( - ) { - return this._value; - } - - /** - * Method hasColour. - * - * @return true if at least one Colour has been added - */ - public boolean hasColour( - ) { - return this._has_colour; - } - - /** - * Method hasValue. - * - * @return true if at least one Value has been added - */ - public boolean hasValue( - ) { - return this._has_value; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'colour'. - * - * @param colour the value of field 'colour'. - */ - public void setColour( - final int colour) { - this._colour = colour; - this._has_colour = true; - } - - /** - * Sets the value of field 'label'. - * - * @param label the value of field 'label'. - */ - public void setLabel( - final java.lang.String label) { - this._label = label; - } - - /** - * Sets the value of field 'value'. - * - * @param value the value of field 'value'. - */ - public void setValue( - final float value) { - this._value = value; - this._has_value = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled - * jalview.schemabinding.version2.ThresholdLine - */ - public static jalview.schemabinding.version2.ThresholdLine unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.ThresholdLine) Unmarshaller.unmarshal(jalview.schemabinding.version2.ThresholdLine.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class ThresholdLine implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _label. + */ + private java.lang.String _label; + + /** + * Field _value. + */ + private float _value; + + /** + * keeps track of state for field: _value + */ + private boolean _has_value; + + /** + * Field _colour. + */ + private int _colour; + + /** + * keeps track of state for field: _colour + */ + private boolean _has_colour; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public ThresholdLine() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + */ + public void deleteColour() + { + this._has_colour = false; + } + + /** + */ + public void deleteValue() + { + this._has_value = false; + } + + /** + * Returns the value of field 'colour'. + * + * @return the value of field 'Colour'. + */ + public int getColour() + { + return this._colour; + } + + /** + * Returns the value of field 'label'. + * + * @return the value of field 'Label'. + */ + public java.lang.String getLabel() + { + return this._label; + } + + /** + * Returns the value of field 'value'. + * + * @return the value of field 'Value'. + */ + public float getValue() + { + return this._value; + } + + /** + * Method hasColour. + * + * @return true if at least one Colour has been added + */ + public boolean hasColour() + { + return this._has_colour; + } + + /** + * Method hasValue. + * + * @return true if at least one Value has been added + */ + public boolean hasValue() + { + return this._has_value; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; + } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'colour'. + * + * @param colour + * the value of field 'colour'. + */ + public void setColour(final int colour) + { + this._colour = colour; + this._has_colour = true; + } + + /** + * Sets the value of field 'label'. + * + * @param label + * the value of field 'label'. + */ + public void setLabel(final java.lang.String label) + { + this._label = label; + } + + /** + * Sets the value of field 'value'. + * + * @param value + * the value of field 'value'. + */ + public void setValue(final float value) + { + this._value = value; + this._has_value = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.schemabinding.version2.ThresholdLine + */ + public static jalview.schemabinding.version2.ThresholdLine unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.ThresholdLine) Unmarshaller + .unmarshal(jalview.schemabinding.version2.ThresholdLine.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/Tree.java b/src/jalview/schemabinding/version2/Tree.java index b147498..19b3eb1 100644 --- a/src/jalview/schemabinding/version2/Tree.java +++ b/src/jalview/schemabinding/version2/Tree.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,841 +19,860 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Tree implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _fontName. - */ - private java.lang.String _fontName; - - /** - * Field _fontSize. - */ - private int _fontSize; - - /** - * keeps track of state for field: _fontSize - */ - private boolean _has_fontSize; - - /** - * Field _fontStyle. - */ - private int _fontStyle; - - /** - * keeps track of state for field: _fontStyle - */ - private boolean _has_fontStyle; - - /** - * Field _threshold. - */ - private float _threshold; - - /** - * keeps track of state for field: _threshold - */ - private boolean _has_threshold; - - /** - * Field _showBootstrap. - */ - private boolean _showBootstrap; - - /** - * keeps track of state for field: _showBootstrap - */ - private boolean _has_showBootstrap; - - /** - * Field _showDistances. - */ - private boolean _showDistances; - - /** - * keeps track of state for field: _showDistances - */ - private boolean _has_showDistances; - - /** - * Field _markUnlinked. - */ - private boolean _markUnlinked; - - /** - * keeps track of state for field: _markUnlinked - */ - private boolean _has_markUnlinked; - - /** - * Field _fitToWindow. - */ - private boolean _fitToWindow; - - /** - * keeps track of state for field: _fitToWindow - */ - private boolean _has_fitToWindow; - - /** - * Field _currentTree. - */ - private boolean _currentTree; - - /** - * keeps track of state for field: _currentTree - */ - private boolean _has_currentTree; - - /** - * Tree ID added for binding tree - * visualization - * settings to vamsas - * document trees in jalview 2.4.1 - * - */ - private java.lang.String _id; - - /** - * Field _width. - */ - private int _width; - - /** - * keeps track of state for field: _width - */ - private boolean _has_width; - - /** - * Field _height. - */ - private int _height; - - /** - * keeps track of state for field: _height - */ - private boolean _has_height; - - /** - * Field _xpos. - */ - private int _xpos; - - /** - * keeps track of state for field: _xpos - */ - private boolean _has_xpos; - - /** - * Field _ypos. - */ - private int _ypos; - - /** - * keeps track of state for field: _ypos - */ - private boolean _has_ypos; - - /** - * Field _title. - */ - private java.lang.String _title; - - /** - * Field _newick. - */ - private java.lang.String _newick; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Tree() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - */ - public void deleteCurrentTree( - ) { - this._has_currentTree= false; - } - - /** - */ - public void deleteFitToWindow( - ) { - this._has_fitToWindow= false; - } - - /** - */ - public void deleteFontSize( - ) { - this._has_fontSize= false; - } - - /** - */ - public void deleteFontStyle( - ) { - this._has_fontStyle= false; - } - - /** - */ - public void deleteHeight( - ) { - this._has_height= false; - } - - /** - */ - public void deleteMarkUnlinked( - ) { - this._has_markUnlinked= false; - } - - /** - */ - public void deleteShowBootstrap( - ) { - this._has_showBootstrap= false; - } - - /** - */ - public void deleteShowDistances( - ) { - this._has_showDistances= false; - } - - /** - */ - public void deleteThreshold( - ) { - this._has_threshold= false; - } - - /** - */ - public void deleteWidth( - ) { - this._has_width= false; - } - - /** - */ - public void deleteXpos( - ) { - this._has_xpos= false; - } - - /** - */ - public void deleteYpos( - ) { - this._has_ypos= false; - } - - /** - * Returns the value of field 'currentTree'. - * - * @return the value of field 'CurrentTree'. - */ - public boolean getCurrentTree( - ) { - return this._currentTree; - } - - /** - * Returns the value of field 'fitToWindow'. - * - * @return the value of field 'FitToWindow'. - */ - public boolean getFitToWindow( - ) { - return this._fitToWindow; - } - - /** - * Returns the value of field 'fontName'. - * - * @return the value of field 'FontName'. - */ - public java.lang.String getFontName( - ) { - return this._fontName; - } - - /** - * Returns the value of field 'fontSize'. - * - * @return the value of field 'FontSize'. - */ - public int getFontSize( - ) { - return this._fontSize; - } - - /** - * Returns the value of field 'fontStyle'. - * - * @return the value of field 'FontStyle'. - */ - public int getFontStyle( - ) { - return this._fontStyle; - } - - /** - * Returns the value of field 'height'. - * - * @return the value of field 'Height'. - */ - public int getHeight( - ) { - return this._height; - } - - /** - * Returns the value of field 'id'. The field 'id' has the - * following description: Tree ID added for binding tree - * visualization - * settings to vamsas - * document trees in jalview 2.4.1 - * - * - * @return the value of field 'Id'. - */ - public java.lang.String getId( - ) { - return this._id; - } - - /** - * Returns the value of field 'markUnlinked'. - * - * @return the value of field 'MarkUnlinked'. - */ - public boolean getMarkUnlinked( - ) { - return this._markUnlinked; - } - - /** - * Returns the value of field 'newick'. - * - * @return the value of field 'Newick'. - */ - public java.lang.String getNewick( - ) { - return this._newick; - } - - /** - * Returns the value of field 'showBootstrap'. - * - * @return the value of field 'ShowBootstrap'. - */ - public boolean getShowBootstrap( - ) { - return this._showBootstrap; - } - - /** - * Returns the value of field 'showDistances'. - * - * @return the value of field 'ShowDistances'. - */ - public boolean getShowDistances( - ) { - return this._showDistances; - } - - /** - * Returns the value of field 'threshold'. - * - * @return the value of field 'Threshold'. - */ - public float getThreshold( - ) { - return this._threshold; - } - - /** - * Returns the value of field 'title'. - * - * @return the value of field 'Title'. - */ - public java.lang.String getTitle( - ) { - return this._title; - } - - /** - * Returns the value of field 'width'. - * - * @return the value of field 'Width'. - */ - public int getWidth( - ) { - return this._width; - } - - /** - * Returns the value of field 'xpos'. - * - * @return the value of field 'Xpos'. - */ - public int getXpos( - ) { - return this._xpos; - } - - /** - * Returns the value of field 'ypos'. - * - * @return the value of field 'Ypos'. - */ - public int getYpos( - ) { - return this._ypos; - } - - /** - * Method hasCurrentTree. - * - * @return true if at least one CurrentTree has been added - */ - public boolean hasCurrentTree( - ) { - return this._has_currentTree; - } - - /** - * Method hasFitToWindow. - * - * @return true if at least one FitToWindow has been added - */ - public boolean hasFitToWindow( - ) { - return this._has_fitToWindow; - } - - /** - * Method hasFontSize. - * - * @return true if at least one FontSize has been added - */ - public boolean hasFontSize( - ) { - return this._has_fontSize; - } - - /** - * Method hasFontStyle. - * - * @return true if at least one FontStyle has been added - */ - public boolean hasFontStyle( - ) { - return this._has_fontStyle; - } - - /** - * Method hasHeight. - * - * @return true if at least one Height has been added - */ - public boolean hasHeight( - ) { - return this._has_height; - } - - /** - * Method hasMarkUnlinked. - * - * @return true if at least one MarkUnlinked has been added - */ - public boolean hasMarkUnlinked( - ) { - return this._has_markUnlinked; - } - - /** - * Method hasShowBootstrap. - * - * @return true if at least one ShowBootstrap has been added - */ - public boolean hasShowBootstrap( - ) { - return this._has_showBootstrap; - } - - /** - * Method hasShowDistances. - * - * @return true if at least one ShowDistances has been added - */ - public boolean hasShowDistances( - ) { - return this._has_showDistances; - } - - /** - * Method hasThreshold. - * - * @return true if at least one Threshold has been added - */ - public boolean hasThreshold( - ) { - return this._has_threshold; - } - - /** - * Method hasWidth. - * - * @return true if at least one Width has been added - */ - public boolean hasWidth( - ) { - return this._has_width; - } - - /** - * Method hasXpos. - * - * @return true if at least one Xpos has been added - */ - public boolean hasXpos( - ) { - return this._has_xpos; - } - - /** - * Method hasYpos. - * - * @return true if at least one Ypos has been added - */ - public boolean hasYpos( - ) { - return this._has_ypos; - } - - /** - * Returns the value of field 'currentTree'. - * - * @return the value of field 'CurrentTree'. - */ - public boolean isCurrentTree( - ) { - return this._currentTree; - } - - /** - * Returns the value of field 'fitToWindow'. - * - * @return the value of field 'FitToWindow'. - */ - public boolean isFitToWindow( - ) { - return this._fitToWindow; - } - - /** - * Returns the value of field 'markUnlinked'. - * - * @return the value of field 'MarkUnlinked'. - */ - public boolean isMarkUnlinked( - ) { - return this._markUnlinked; - } - - /** - * Returns the value of field 'showBootstrap'. - * - * @return the value of field 'ShowBootstrap'. - */ - public boolean isShowBootstrap( - ) { - return this._showBootstrap; - } - - /** - * Returns the value of field 'showDistances'. - * - * @return the value of field 'ShowDistances'. - */ - public boolean isShowDistances( - ) { - return this._showDistances; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'currentTree'. - * - * @param currentTree the value of field 'currentTree'. - */ - public void setCurrentTree( - final boolean currentTree) { - this._currentTree = currentTree; - this._has_currentTree = true; - } - - /** - * Sets the value of field 'fitToWindow'. - * - * @param fitToWindow the value of field 'fitToWindow'. - */ - public void setFitToWindow( - final boolean fitToWindow) { - this._fitToWindow = fitToWindow; - this._has_fitToWindow = true; - } - - /** - * Sets the value of field 'fontName'. - * - * @param fontName the value of field 'fontName'. - */ - public void setFontName( - final java.lang.String fontName) { - this._fontName = fontName; - } - - /** - * Sets the value of field 'fontSize'. - * - * @param fontSize the value of field 'fontSize'. - */ - public void setFontSize( - final int fontSize) { - this._fontSize = fontSize; - this._has_fontSize = true; - } - - /** - * Sets the value of field 'fontStyle'. - * - * @param fontStyle the value of field 'fontStyle'. - */ - public void setFontStyle( - final int fontStyle) { - this._fontStyle = fontStyle; - this._has_fontStyle = true; - } - - /** - * Sets the value of field 'height'. - * - * @param height the value of field 'height'. - */ - public void setHeight( - final int height) { - this._height = height; - this._has_height = true; - } - - /** - * Sets the value of field 'id'. The field 'id' has the - * following description: Tree ID added for binding tree - * visualization - * settings to vamsas - * document trees in jalview 2.4.1 - * - * - * @param id the value of field 'id'. - */ - public void setId( - final java.lang.String id) { - this._id = id; - } - - /** - * Sets the value of field 'markUnlinked'. - * - * @param markUnlinked the value of field 'markUnlinked'. - */ - public void setMarkUnlinked( - final boolean markUnlinked) { - this._markUnlinked = markUnlinked; - this._has_markUnlinked = true; - } - - /** - * Sets the value of field 'newick'. - * - * @param newick the value of field 'newick'. - */ - public void setNewick( - final java.lang.String newick) { - this._newick = newick; - } - - /** - * Sets the value of field 'showBootstrap'. - * - * @param showBootstrap the value of field 'showBootstrap'. - */ - public void setShowBootstrap( - final boolean showBootstrap) { - this._showBootstrap = showBootstrap; - this._has_showBootstrap = true; - } - - /** - * Sets the value of field 'showDistances'. - * - * @param showDistances the value of field 'showDistances'. - */ - public void setShowDistances( - final boolean showDistances) { - this._showDistances = showDistances; - this._has_showDistances = true; - } - - /** - * Sets the value of field 'threshold'. - * - * @param threshold the value of field 'threshold'. - */ - public void setThreshold( - final float threshold) { - this._threshold = threshold; - this._has_threshold = true; - } - - /** - * Sets the value of field 'title'. - * - * @param title the value of field 'title'. - */ - public void setTitle( - final java.lang.String title) { - this._title = title; - } - - /** - * Sets the value of field 'width'. - * - * @param width the value of field 'width'. - */ - public void setWidth( - final int width) { - this._width = width; - this._has_width = true; - } - - /** - * Sets the value of field 'xpos'. - * - * @param xpos the value of field 'xpos'. - */ - public void setXpos( - final int xpos) { - this._xpos = xpos; - this._has_xpos = true; - } - - /** - * Sets the value of field 'ypos'. - * - * @param ypos the value of field 'ypos'. - */ - public void setYpos( - final int ypos) { - this._ypos = ypos; - this._has_ypos = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled jalview.schemabinding.version2.Tree - */ - public static jalview.schemabinding.version2.Tree unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.Tree) Unmarshaller.unmarshal(jalview.schemabinding.version2.Tree.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } +public class Tree implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _fontName. + */ + private java.lang.String _fontName; + + /** + * Field _fontSize. + */ + private int _fontSize; + + /** + * keeps track of state for field: _fontSize + */ + private boolean _has_fontSize; + + /** + * Field _fontStyle. + */ + private int _fontStyle; + + /** + * keeps track of state for field: _fontStyle + */ + private boolean _has_fontStyle; + + /** + * Field _threshold. + */ + private float _threshold; + + /** + * keeps track of state for field: _threshold + */ + private boolean _has_threshold; + + /** + * Field _showBootstrap. + */ + private boolean _showBootstrap; + + /** + * keeps track of state for field: _showBootstrap + */ + private boolean _has_showBootstrap; + + /** + * Field _showDistances. + */ + private boolean _showDistances; + + /** + * keeps track of state for field: _showDistances + */ + private boolean _has_showDistances; + + /** + * Field _markUnlinked. + */ + private boolean _markUnlinked; + + /** + * keeps track of state for field: _markUnlinked + */ + private boolean _has_markUnlinked; + + /** + * Field _fitToWindow. + */ + private boolean _fitToWindow; + + /** + * keeps track of state for field: _fitToWindow + */ + private boolean _has_fitToWindow; + + /** + * Field _currentTree. + */ + private boolean _currentTree; + + /** + * keeps track of state for field: _currentTree + */ + private boolean _has_currentTree; + + /** + * Tree ID added for binding tree visualization settings to vamsas document + * trees in jalview 2.4.1 + * + */ + private java.lang.String _id; + + /** + * Field _width. + */ + private int _width; + + /** + * keeps track of state for field: _width + */ + private boolean _has_width; + + /** + * Field _height. + */ + private int _height; + + /** + * keeps track of state for field: _height + */ + private boolean _has_height; + + /** + * Field _xpos. + */ + private int _xpos; + + /** + * keeps track of state for field: _xpos + */ + private boolean _has_xpos; + + /** + * Field _ypos. + */ + private int _ypos; + + /** + * keeps track of state for field: _ypos + */ + private boolean _has_ypos; + + /** + * Field _title. + */ + private java.lang.String _title; + + /** + * Field _newick. + */ + private java.lang.String _newick; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Tree() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + */ + public void deleteCurrentTree() + { + this._has_currentTree = false; + } + + /** + */ + public void deleteFitToWindow() + { + this._has_fitToWindow = false; + } + + /** + */ + public void deleteFontSize() + { + this._has_fontSize = false; + } + + /** + */ + public void deleteFontStyle() + { + this._has_fontStyle = false; + } + + /** + */ + public void deleteHeight() + { + this._has_height = false; + } + + /** + */ + public void deleteMarkUnlinked() + { + this._has_markUnlinked = false; + } + + /** + */ + public void deleteShowBootstrap() + { + this._has_showBootstrap = false; + } + + /** + */ + public void deleteShowDistances() + { + this._has_showDistances = false; + } + + /** + */ + public void deleteThreshold() + { + this._has_threshold = false; + } + + /** + */ + public void deleteWidth() + { + this._has_width = false; + } + + /** + */ + public void deleteXpos() + { + this._has_xpos = false; + } + + /** + */ + public void deleteYpos() + { + this._has_ypos = false; + } + + /** + * Returns the value of field 'currentTree'. + * + * @return the value of field 'CurrentTree'. + */ + public boolean getCurrentTree() + { + return this._currentTree; + } + + /** + * Returns the value of field 'fitToWindow'. + * + * @return the value of field 'FitToWindow'. + */ + public boolean getFitToWindow() + { + return this._fitToWindow; + } + + /** + * Returns the value of field 'fontName'. + * + * @return the value of field 'FontName'. + */ + public java.lang.String getFontName() + { + return this._fontName; + } + + /** + * Returns the value of field 'fontSize'. + * + * @return the value of field 'FontSize'. + */ + public int getFontSize() + { + return this._fontSize; + } + + /** + * Returns the value of field 'fontStyle'. + * + * @return the value of field 'FontStyle'. + */ + public int getFontStyle() + { + return this._fontStyle; + } + + /** + * Returns the value of field 'height'. + * + * @return the value of field 'Height'. + */ + public int getHeight() + { + return this._height; + } + + /** + * Returns the value of field 'id'. The field 'id' has the following + * description: Tree ID added for binding tree visualization settings to + * vamsas document trees in jalview 2.4.1 + * + * + * @return the value of field 'Id'. + */ + public java.lang.String getId() + { + return this._id; + } + + /** + * Returns the value of field 'markUnlinked'. + * + * @return the value of field 'MarkUnlinked'. + */ + public boolean getMarkUnlinked() + { + return this._markUnlinked; + } + + /** + * Returns the value of field 'newick'. + * + * @return the value of field 'Newick'. + */ + public java.lang.String getNewick() + { + return this._newick; + } + + /** + * Returns the value of field 'showBootstrap'. + * + * @return the value of field 'ShowBootstrap'. + */ + public boolean getShowBootstrap() + { + return this._showBootstrap; + } + + /** + * Returns the value of field 'showDistances'. + * + * @return the value of field 'ShowDistances'. + */ + public boolean getShowDistances() + { + return this._showDistances; + } + + /** + * Returns the value of field 'threshold'. + * + * @return the value of field 'Threshold'. + */ + public float getThreshold() + { + return this._threshold; + } + + /** + * Returns the value of field 'title'. + * + * @return the value of field 'Title'. + */ + public java.lang.String getTitle() + { + return this._title; + } + + /** + * Returns the value of field 'width'. + * + * @return the value of field 'Width'. + */ + public int getWidth() + { + return this._width; + } + + /** + * Returns the value of field 'xpos'. + * + * @return the value of field 'Xpos'. + */ + public int getXpos() + { + return this._xpos; + } + + /** + * Returns the value of field 'ypos'. + * + * @return the value of field 'Ypos'. + */ + public int getYpos() + { + return this._ypos; + } + + /** + * Method hasCurrentTree. + * + * @return true if at least one CurrentTree has been added + */ + public boolean hasCurrentTree() + { + return this._has_currentTree; + } + + /** + * Method hasFitToWindow. + * + * @return true if at least one FitToWindow has been added + */ + public boolean hasFitToWindow() + { + return this._has_fitToWindow; + } + + /** + * Method hasFontSize. + * + * @return true if at least one FontSize has been added + */ + public boolean hasFontSize() + { + return this._has_fontSize; + } + + /** + * Method hasFontStyle. + * + * @return true if at least one FontStyle has been added + */ + public boolean hasFontStyle() + { + return this._has_fontStyle; + } + + /** + * Method hasHeight. + * + * @return true if at least one Height has been added + */ + public boolean hasHeight() + { + return this._has_height; + } + + /** + * Method hasMarkUnlinked. + * + * @return true if at least one MarkUnlinked has been added + */ + public boolean hasMarkUnlinked() + { + return this._has_markUnlinked; + } + + /** + * Method hasShowBootstrap. + * + * @return true if at least one ShowBootstrap has been added + */ + public boolean hasShowBootstrap() + { + return this._has_showBootstrap; + } + + /** + * Method hasShowDistances. + * + * @return true if at least one ShowDistances has been added + */ + public boolean hasShowDistances() + { + return this._has_showDistances; + } + + /** + * Method hasThreshold. + * + * @return true if at least one Threshold has been added + */ + public boolean hasThreshold() + { + return this._has_threshold; + } + + /** + * Method hasWidth. + * + * @return true if at least one Width has been added + */ + public boolean hasWidth() + { + return this._has_width; + } + + /** + * Method hasXpos. + * + * @return true if at least one Xpos has been added + */ + public boolean hasXpos() + { + return this._has_xpos; + } + + /** + * Method hasYpos. + * + * @return true if at least one Ypos has been added + */ + public boolean hasYpos() + { + return this._has_ypos; + } + + /** + * Returns the value of field 'currentTree'. + * + * @return the value of field 'CurrentTree'. + */ + public boolean isCurrentTree() + { + return this._currentTree; + } + + /** + * Returns the value of field 'fitToWindow'. + * + * @return the value of field 'FitToWindow'. + */ + public boolean isFitToWindow() + { + return this._fitToWindow; + } + + /** + * Returns the value of field 'markUnlinked'. + * + * @return the value of field 'MarkUnlinked'. + */ + public boolean isMarkUnlinked() + { + return this._markUnlinked; + } + + /** + * Returns the value of field 'showBootstrap'. + * + * @return the value of field 'ShowBootstrap'. + */ + public boolean isShowBootstrap() + { + return this._showBootstrap; + } + + /** + * Returns the value of field 'showDistances'. + * + * @return the value of field 'ShowDistances'. + */ + public boolean isShowDistances() + { + return this._showDistances; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; + } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'currentTree'. + * + * @param currentTree + * the value of field 'currentTree'. + */ + public void setCurrentTree(final boolean currentTree) + { + this._currentTree = currentTree; + this._has_currentTree = true; + } + + /** + * Sets the value of field 'fitToWindow'. + * + * @param fitToWindow + * the value of field 'fitToWindow'. + */ + public void setFitToWindow(final boolean fitToWindow) + { + this._fitToWindow = fitToWindow; + this._has_fitToWindow = true; + } + + /** + * Sets the value of field 'fontName'. + * + * @param fontName + * the value of field 'fontName'. + */ + public void setFontName(final java.lang.String fontName) + { + this._fontName = fontName; + } + + /** + * Sets the value of field 'fontSize'. + * + * @param fontSize + * the value of field 'fontSize'. + */ + public void setFontSize(final int fontSize) + { + this._fontSize = fontSize; + this._has_fontSize = true; + } + + /** + * Sets the value of field 'fontStyle'. + * + * @param fontStyle + * the value of field 'fontStyle'. + */ + public void setFontStyle(final int fontStyle) + { + this._fontStyle = fontStyle; + this._has_fontStyle = true; + } + + /** + * Sets the value of field 'height'. + * + * @param height + * the value of field 'height'. + */ + public void setHeight(final int height) + { + this._height = height; + this._has_height = true; + } + + /** + * Sets the value of field 'id'. The field 'id' has the following description: + * Tree ID added for binding tree visualization settings to vamsas document + * trees in jalview 2.4.1 + * + * + * @param id + * the value of field 'id'. + */ + public void setId(final java.lang.String id) + { + this._id = id; + } + + /** + * Sets the value of field 'markUnlinked'. + * + * @param markUnlinked + * the value of field 'markUnlinked'. + */ + public void setMarkUnlinked(final boolean markUnlinked) + { + this._markUnlinked = markUnlinked; + this._has_markUnlinked = true; + } + + /** + * Sets the value of field 'newick'. + * + * @param newick + * the value of field 'newick'. + */ + public void setNewick(final java.lang.String newick) + { + this._newick = newick; + } + + /** + * Sets the value of field 'showBootstrap'. + * + * @param showBootstrap + * the value of field 'showBootstrap'. + */ + public void setShowBootstrap(final boolean showBootstrap) + { + this._showBootstrap = showBootstrap; + this._has_showBootstrap = true; + } + + /** + * Sets the value of field 'showDistances'. + * + * @param showDistances + * the value of field 'showDistances'. + */ + public void setShowDistances(final boolean showDistances) + { + this._showDistances = showDistances; + this._has_showDistances = true; + } + + /** + * Sets the value of field 'threshold'. + * + * @param threshold + * the value of field 'threshold'. + */ + public void setThreshold(final float threshold) + { + this._threshold = threshold; + this._has_threshold = true; + } + + /** + * Sets the value of field 'title'. + * + * @param title + * the value of field 'title'. + */ + public void setTitle(final java.lang.String title) + { + this._title = title; + } + + /** + * Sets the value of field 'width'. + * + * @param width + * the value of field 'width'. + */ + public void setWidth(final int width) + { + this._width = width; + this._has_width = true; + } + + /** + * Sets the value of field 'xpos'. + * + * @param xpos + * the value of field 'xpos'. + */ + public void setXpos(final int xpos) + { + this._xpos = xpos; + this._has_xpos = true; + } + + /** + * Sets the value of field 'ypos'. + * + * @param ypos + * the value of field 'ypos'. + */ + public void setYpos(final int ypos) + { + this._ypos = ypos; + this._has_ypos = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.schemabinding.version2.Tree + */ + public static jalview.schemabinding.version2.Tree unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Tree) Unmarshaller.unmarshal( + jalview.schemabinding.version2.Tree.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/UserColourScheme.java b/src/jalview/schemabinding/version2/UserColourScheme.java index de531a8..e4983bd 100644 --- a/src/jalview/schemabinding/version2/UserColourScheme.java +++ b/src/jalview/schemabinding/version2/UserColourScheme.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,99 +19,109 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class UserColourScheme extends JalviewUserColours -implements java.io.Serializable +public class UserColourScheme extends JalviewUserColours implements + java.io.Serializable { + // ----------------/ + // - Constructors -/ + // ----------------/ - //----------------/ - //- Constructors -/ - //----------------/ - - public UserColourScheme() { - super(); - } - + public UserColourScheme() + { + super(); + } - //-----------/ - //- Methods -/ - //-----------/ + // -----------/ + // - Methods -/ + // -----------/ - /** - * 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; + /** + * 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 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); - } + /** + * + * + * @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); + } - /** - * 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.JalviewUserColours - */ - public static jalview.schemabinding.version2.JalviewUserColours unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.JalviewUserColours) Unmarshaller.unmarshal(jalview.schemabinding.version2.UserColourScheme.class, reader); - } + /** + * 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.JalviewUserColours + */ + public static jalview.schemabinding.version2.JalviewUserColours unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.JalviewUserColours) Unmarshaller + .unmarshal( + jalview.schemabinding.version2.UserColourScheme.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); - } + /** + * + * + * @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/UserColours.java b/src/jalview/schemabinding/version2/UserColours.java index 8c56e0c..b02d0cd 100644 --- a/src/jalview/schemabinding/version2/UserColours.java +++ b/src/jalview/schemabinding/version2/UserColours.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,152 +19,164 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class UserColours implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _id. - */ - private java.lang.String _id; - - /** - * Field _userColourScheme. - */ - private jalview.schemabinding.version2.UserColourScheme _userColourScheme; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public UserColours() { - super(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * Returns the value of field 'id'. - * - * @return the value of field 'Id'. - */ - public java.lang.String getId( - ) { - return this._id; - } - - /** - * Returns the value of field 'userColourScheme'. - * - * @return the value of field 'UserColourScheme'. - */ - public jalview.schemabinding.version2.UserColourScheme getUserColourScheme( - ) { - return this._userColourScheme; - } - - /** - * Method isValid. - * - * @return true if this object is valid according to the schema - */ - public boolean isValid( - ) { - try { - validate(); - } catch (org.exolab.castor.xml.ValidationException vex) { - return false; - } - return true; - } - - /** - * - * - * @param out - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void marshal( - final java.io.Writer out) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, out); - } - - /** - * - * - * @param handler - * @throws java.io.IOException if an IOException occurs during - * marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - */ - public void marshal( - final org.xml.sax.ContentHandler handler) - throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - Marshaller.marshal(this, handler); - } - - /** - * Sets the value of field 'id'. - * - * @param id the value of field 'id'. - */ - public void setId( - final java.lang.String id) { - this._id = id; - } - - /** - * Sets the value of field 'userColourScheme'. - * - * @param userColourScheme the value of field 'userColourScheme' - */ - public void setUserColourScheme( - final jalview.schemabinding.version2.UserColourScheme userColourScheme) { - this._userColourScheme = userColourScheme; - } - - /** - * 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.UserColours - */ - public static jalview.schemabinding.version2.UserColours unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.UserColours) Unmarshaller.unmarshal(jalview.schemabinding.version2.UserColours.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); +public class UserColours implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _id. + */ + private java.lang.String _id; + + /** + * Field _userColourScheme. + */ + private jalview.schemabinding.version2.UserColourScheme _userColourScheme; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public UserColours() + { + super(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Returns the value of field 'id'. + * + * @return the value of field 'Id'. + */ + public java.lang.String getId() + { + return this._id; + } + + /** + * Returns the value of field 'userColourScheme'. + * + * @return the value of field 'UserColourScheme'. + */ + public jalview.schemabinding.version2.UserColourScheme getUserColourScheme() + { + return this._userColourScheme; + } + + /** + * Method isValid. + * + * @return true if this object is valid according to the schema + */ + public boolean isValid() + { + try + { + validate(); + } catch (org.exolab.castor.xml.ValidationException vex) + { + return false; } + return true; + } + + /** + * + * + * @param out + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + */ + public void marshal(final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, out); + } + + /** + * + * + * @param handler + * @throws java.io.IOException + * if an IOException occurs during marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + */ + public void marshal(final org.xml.sax.ContentHandler handler) + throws java.io.IOException, + org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + Marshaller.marshal(this, handler); + } + + /** + * Sets the value of field 'id'. + * + * @param id + * the value of field 'id'. + */ + public void setId(final java.lang.String id) + { + this._id = id; + } + + /** + * Sets the value of field 'userColourScheme'. + * + * @param userColourScheme + * the value of field 'userColourScheme' + */ + public void setUserColourScheme( + final jalview.schemabinding.version2.UserColourScheme userColourScheme) + { + this._userColourScheme = userColourScheme; + } + + /** + * 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.UserColours + */ + public static jalview.schemabinding.version2.UserColours unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.UserColours) Unmarshaller + .unmarshal(jalview.schemabinding.version2.UserColours.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/VAMSAS.java b/src/jalview/schemabinding/version2/VAMSAS.java index 8605dc5..d025824 100644 --- a/src/jalview/schemabinding/version2/VAMSAS.java +++ b/src/jalview/schemabinding/version2/VAMSAS.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,411 +19,436 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class VAMSAS implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _treeList. - */ - private java.util.Vector _treeList; - - /** - * Field _sequenceSetList. - */ - private java.util.Vector _sequenceSetList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public VAMSAS() { - super(); - this._treeList = new java.util.Vector(); - this._sequenceSetList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vSequenceSet - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSequenceSet( - final jalview.schemabinding.version2.SequenceSet vSequenceSet) - throws java.lang.IndexOutOfBoundsException { - this._sequenceSetList.addElement(vSequenceSet); - } - - /** - * - * - * @param index - * @param vSequenceSet - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addSequenceSet( - final int index, - final jalview.schemabinding.version2.SequenceSet vSequenceSet) - throws java.lang.IndexOutOfBoundsException { - this._sequenceSetList.add(index, vSequenceSet); - } - - /** - * - * - * @param vTree - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addTree( - final java.lang.String vTree) - throws java.lang.IndexOutOfBoundsException { - this._treeList.addElement(vTree); - } - - /** - * - * - * @param index - * @param vTree - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addTree( - final int index, - final java.lang.String vTree) - throws java.lang.IndexOutOfBoundsException { - this._treeList.add(index, vTree); - } - - /** - * Method enumerateSequenceSet. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.SequenceSet elements - */ - public java.util.Enumeration enumerateSequenceSet( - ) { - return this._sequenceSetList.elements(); - } - - /** - * Method enumerateTree. - * - * @return an Enumeration over all java.lang.String elements - */ - public java.util.Enumeration enumerateTree( - ) { - return this._treeList.elements(); - } - - /** - * Method getSequenceSet. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.SequenceSet at the given index - */ - public jalview.schemabinding.version2.SequenceSet getSequenceSet( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._sequenceSetList.size()) { - throw new IndexOutOfBoundsException("getSequenceSet: Index value '" + index + "' not in range [0.." + (this._sequenceSetList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.SequenceSet) _sequenceSetList.get(index); - } - - /** - * Method getSequenceSet.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 jalview.schemabinding.version2.SequenceSet[] getSequenceSet( - ) { - jalview.schemabinding.version2.SequenceSet[] array = new jalview.schemabinding.version2.SequenceSet[0]; - return (jalview.schemabinding.version2.SequenceSet[]) this._sequenceSetList.toArray(array); - } - - /** - * Method getSequenceSetCount. - * - * @return the size of this collection - */ - public int getSequenceSetCount( - ) { - return this._sequenceSetList.size(); - } - - /** - * Method getTree. - * - * @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 getTree( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._treeList.size()) { - throw new IndexOutOfBoundsException("getTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]"); - } - - return (java.lang.String) _treeList.get(index); - } - - /** - * Method getTree.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[] getTree( - ) { - java.lang.String[] array = new java.lang.String[0]; - return (java.lang.String[]) this._treeList.toArray(array); - } - - /** - * Method getTreeCount. - * - * @return the size of this collection - */ - public int getTreeCount( - ) { - return this._treeList.size(); - } - - /** - * 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 removeAllSequenceSet( - ) { - this._sequenceSetList.clear(); +public class VAMSAS implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _treeList. + */ + private java.util.Vector _treeList; + + /** + * Field _sequenceSetList. + */ + private java.util.Vector _sequenceSetList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public VAMSAS() + { + super(); + this._treeList = new java.util.Vector(); + this._sequenceSetList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vSequenceSet + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSequenceSet( + final jalview.schemabinding.version2.SequenceSet vSequenceSet) + throws java.lang.IndexOutOfBoundsException + { + this._sequenceSetList.addElement(vSequenceSet); + } + + /** + * + * + * @param index + * @param vSequenceSet + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addSequenceSet(final int index, + final jalview.schemabinding.version2.SequenceSet vSequenceSet) + throws java.lang.IndexOutOfBoundsException + { + this._sequenceSetList.add(index, vSequenceSet); + } + + /** + * + * + * @param vTree + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addTree(final java.lang.String vTree) + throws java.lang.IndexOutOfBoundsException + { + this._treeList.addElement(vTree); + } + + /** + * + * + * @param index + * @param vTree + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addTree(final int index, final java.lang.String vTree) + throws java.lang.IndexOutOfBoundsException + { + this._treeList.add(index, vTree); + } + + /** + * Method enumerateSequenceSet. + * + * @return an Enumeration over all jalview.schemabinding.version2.SequenceSet + * elements + */ + public java.util.Enumeration enumerateSequenceSet() + { + return this._sequenceSetList.elements(); + } + + /** + * Method enumerateTree. + * + * @return an Enumeration over all java.lang.String elements + */ + public java.util.Enumeration enumerateTree() + { + return this._treeList.elements(); + } + + /** + * Method getSequenceSet. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.SequenceSet at the + * given index + */ + public jalview.schemabinding.version2.SequenceSet getSequenceSet( + final int index) throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._sequenceSetList.size()) + { + throw new IndexOutOfBoundsException("getSequenceSet: Index value '" + + index + "' not in range [0.." + + (this._sequenceSetList.size() - 1) + "]"); } - /** - */ - public void removeAllTree( - ) { - this._treeList.clear(); - } - - /** - * Method removeSequenceSet. - * - * @param vSequenceSet - * @return true if the object was removed from the collection. - */ - public boolean removeSequenceSet( - final jalview.schemabinding.version2.SequenceSet vSequenceSet) { - boolean removed = _sequenceSetList.remove(vSequenceSet); - return removed; - } - - /** - * Method removeSequenceSetAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.SequenceSet removeSequenceSetAt( - final int index) { - java.lang.Object obj = this._sequenceSetList.remove(index); - return (jalview.schemabinding.version2.SequenceSet) obj; - } - - /** - * Method removeTree. - * - * @param vTree - * @return true if the object was removed from the collection. - */ - public boolean removeTree( - final java.lang.String vTree) { - boolean removed = _treeList.remove(vTree); - return removed; + return (jalview.schemabinding.version2.SequenceSet) _sequenceSetList + .get(index); + } + + /** + * Method getSequenceSet.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 jalview.schemabinding.version2.SequenceSet[] getSequenceSet() + { + jalview.schemabinding.version2.SequenceSet[] array = new jalview.schemabinding.version2.SequenceSet[0]; + return (jalview.schemabinding.version2.SequenceSet[]) this._sequenceSetList + .toArray(array); + } + + /** + * Method getSequenceSetCount. + * + * @return the size of this collection + */ + public int getSequenceSetCount() + { + return this._sequenceSetList.size(); + } + + /** + * Method getTree. + * + * @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 getTree(final int index) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._treeList.size()) + { + throw new IndexOutOfBoundsException("getTree: Index value '" + index + + "' not in range [0.." + (this._treeList.size() - 1) + "]"); } - /** - * Method removeTreeAt. - * - * @param index - * @return the element removed from the collection - */ - public java.lang.String removeTreeAt( - final int index) { - java.lang.Object obj = this._treeList.remove(index); - return (java.lang.String) obj; + return (java.lang.String) _treeList.get(index); + } + + /** + * Method getTree.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[] getTree() + { + java.lang.String[] array = new java.lang.String[0]; + return (java.lang.String[]) this._treeList.toArray(array); + } + + /** + * Method getTreeCount. + * + * @return the size of this collection + */ + public int getTreeCount() + { + return this._treeList.size(); + } + + /** + * 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; } - - /** - * - * - * @param index - * @param vSequenceSet - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setSequenceSet( - final int index, - final jalview.schemabinding.version2.SequenceSet vSequenceSet) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._sequenceSetList.size()) { - throw new IndexOutOfBoundsException("setSequenceSet: Index value '" + index + "' not in range [0.." + (this._sequenceSetList.size() - 1) + "]"); - } - - this._sequenceSetList.set(index, vSequenceSet); - } - - /** - * - * - * @param vSequenceSetArray + 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 setSequenceSet( - final jalview.schemabinding.version2.SequenceSet[] vSequenceSetArray) { - //-- copy array - _sequenceSetList.clear(); - - for (int i = 0; i < vSequenceSetArray.length; i++) { - this._sequenceSetList.add(vSequenceSetArray[i]); - } - } + public void removeAllSequenceSet() + { + this._sequenceSetList.clear(); + } - /** - * - * - * @param index - * @param vTree - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection + /** */ - public void setTree( - final int index, - final java.lang.String vTree) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._treeList.size()) { - throw new IndexOutOfBoundsException("setTree: Index value '" + index + "' not in range [0.." + (this._treeList.size() - 1) + "]"); - } - - this._treeList.set(index, vTree); + public void removeAllTree() + { + this._treeList.clear(); + } + + /** + * Method removeSequenceSet. + * + * @param vSequenceSet + * @return true if the object was removed from the collection. + */ + public boolean removeSequenceSet( + final jalview.schemabinding.version2.SequenceSet vSequenceSet) + { + boolean removed = _sequenceSetList.remove(vSequenceSet); + return removed; + } + + /** + * Method removeSequenceSetAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.SequenceSet removeSequenceSetAt( + final int index) + { + java.lang.Object obj = this._sequenceSetList.remove(index); + return (jalview.schemabinding.version2.SequenceSet) obj; + } + + /** + * Method removeTree. + * + * @param vTree + * @return true if the object was removed from the collection. + */ + public boolean removeTree(final java.lang.String vTree) + { + boolean removed = _treeList.remove(vTree); + return removed; + } + + /** + * Method removeTreeAt. + * + * @param index + * @return the element removed from the collection + */ + public java.lang.String removeTreeAt(final int index) + { + java.lang.Object obj = this._treeList.remove(index); + return (java.lang.String) obj; + } + + /** + * + * + * @param index + * @param vSequenceSet + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setSequenceSet(final int index, + final jalview.schemabinding.version2.SequenceSet vSequenceSet) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._sequenceSetList.size()) + { + throw new IndexOutOfBoundsException("setSequenceSet: Index value '" + + index + "' not in range [0.." + + (this._sequenceSetList.size() - 1) + "]"); } - /** - * - * - * @param vTreeArray - */ - public void setTree( - final java.lang.String[] vTreeArray) { - //-- copy array - _treeList.clear(); - - for (int i = 0; i < vTreeArray.length; i++) { - this._treeList.add(vTreeArray[i]); - } + this._sequenceSetList.set(index, vSequenceSet); + } + + /** + * + * + * @param vSequenceSetArray + */ + public void setSequenceSet( + final jalview.schemabinding.version2.SequenceSet[] vSequenceSetArray) + { + // -- copy array + _sequenceSetList.clear(); + + for (int i = 0; i < vSequenceSetArray.length; i++) + { + this._sequenceSetList.add(vSequenceSetArray[i]); } - - /** - * 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.VAMSAS - */ - public static jalview.schemabinding.version2.VAMSAS unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.VAMSAS) Unmarshaller.unmarshal(jalview.schemabinding.version2.VAMSAS.class, reader); + } + + /** + * + * + * @param index + * @param vTree + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setTree(final int index, final java.lang.String vTree) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._treeList.size()) + { + throw new IndexOutOfBoundsException("setTree: Index value '" + index + + "' not in range [0.." + (this._treeList.size() - 1) + "]"); } - /** - * - * - * @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._treeList.set(index, vTree); + } + + /** + * + * + * @param vTreeArray + */ + public void setTree(final java.lang.String[] vTreeArray) + { + // -- copy array + _treeList.clear(); + + for (int i = 0; i < vTreeArray.length; i++) + { + this._treeList.add(vTreeArray[i]); } + } + + /** + * 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.VAMSAS + */ + public static jalview.schemabinding.version2.VAMSAS unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.VAMSAS) Unmarshaller.unmarshal( + jalview.schemabinding.version2.VAMSAS.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/VamsasModel.java b/src/jalview/schemabinding/version2/VamsasModel.java index 245bd3d..d3fe796 100644 --- a/src/jalview/schemabinding/version2/VamsasModel.java +++ b/src/jalview/schemabinding/version2/VamsasModel.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,98 +19,106 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class VamsasModel extends VAMSAS -implements java.io.Serializable +public class VamsasModel extends VAMSAS implements java.io.Serializable { + // ----------------/ + // - Constructors -/ + // ----------------/ - //----------------/ - //- Constructors -/ - //----------------/ - - public VamsasModel() { - super(); - } - + public VamsasModel() + { + super(); + } - //-----------/ - //- Methods -/ - //-----------/ + // -----------/ + // - Methods -/ + // -----------/ - /** - * 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; + /** + * 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 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); - } + /** + * + * + * @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); + } - /** - * 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.VAMSAS - */ - public static jalview.schemabinding.version2.VAMSAS unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.VAMSAS) Unmarshaller.unmarshal(jalview.schemabinding.version2.VamsasModel.class, reader); - } + /** + * 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.VAMSAS + */ + public static jalview.schemabinding.version2.VAMSAS unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.VAMSAS) Unmarshaller.unmarshal( + jalview.schemabinding.version2.VamsasModel.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); - } + /** + * + * + * @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/Viewport.java b/src/jalview/schemabinding/version2/Viewport.java index e3a19de..159f7ae 100644 --- a/src/jalview/schemabinding/version2/Viewport.java +++ b/src/jalview/schemabinding/version2/Viewport.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,2732 +19,2785 @@ import org.exolab.castor.xml.Unmarshaller; * * @version $Revision$ $Date$ */ -public class Viewport implements java.io.Serializable { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _conservationSelected. - */ - private boolean _conservationSelected; - - /** - * keeps track of state for field: _conservationSelected - */ - private boolean _has_conservationSelected; - - /** - * Field _pidSelected. - */ - private boolean _pidSelected; - - /** - * keeps track of state for field: _pidSelected - */ - private boolean _has_pidSelected; - - /** - * Field _bgColour. - */ - private java.lang.String _bgColour; - - /** - * Field _consThreshold. - */ - private int _consThreshold; - - /** - * keeps track of state for field: _consThreshold - */ - private boolean _has_consThreshold; - - /** - * Field _pidThreshold. - */ - private int _pidThreshold; - - /** - * keeps track of state for field: _pidThreshold - */ - private boolean _has_pidThreshold; - - /** - * Field _title. - */ - private java.lang.String _title; - - /** - * Field _showFullId. - */ - private boolean _showFullId; - - /** - * keeps track of state for field: _showFullId - */ - private boolean _has_showFullId; - - /** - * Field _rightAlignIds. - */ - private boolean _rightAlignIds; - - /** - * keeps track of state for field: _rightAlignIds - */ - private boolean _has_rightAlignIds; - - /** - * Field _showText. - */ - private boolean _showText; - - /** - * keeps track of state for field: _showText - */ - private boolean _has_showText; - - /** - * Field _showColourText. - */ - private boolean _showColourText; - - /** - * keeps track of state for field: _showColourText - */ - private boolean _has_showColourText; - - /** - * Field _showUnconserved. - */ - private boolean _showUnconserved = false; - - /** - * keeps track of state for field: _showUnconserved - */ - private boolean _has_showUnconserved; - - /** - * Field _showBoxes. - */ - private boolean _showBoxes; - - /** - * keeps track of state for field: _showBoxes - */ - private boolean _has_showBoxes; - - /** - * Field _wrapAlignment. - */ - private boolean _wrapAlignment; - - /** - * keeps track of state for field: _wrapAlignment - */ - private boolean _has_wrapAlignment; - - /** - * Field _renderGaps. - */ - private boolean _renderGaps; - - /** - * keeps track of state for field: _renderGaps - */ - private boolean _has_renderGaps; - - /** - * Field _showSequenceFeatures. - */ - private boolean _showSequenceFeatures; - - /** - * keeps track of state for field: _showSequenceFeatures - */ - private boolean _has_showSequenceFeatures; - - /** - * Field _showNPfeatureTooltip. - */ - private boolean _showNPfeatureTooltip; - - /** - * keeps track of state for field: _showNPfeatureTooltip - */ - private boolean _has_showNPfeatureTooltip; - - /** - * Field _showDbRefTooltip. - */ - private boolean _showDbRefTooltip; - - /** - * keeps track of state for field: _showDbRefTooltip - */ - private boolean _has_showDbRefTooltip; - - /** - * Field _followHighlight. - */ - private boolean _followHighlight = true; - - /** - * keeps track of state for field: _followHighlight - */ - private boolean _has_followHighlight; - - /** - * Field _followSelection. - */ - private boolean _followSelection = true; - - /** - * keeps track of state for field: _followSelection - */ - private boolean _has_followSelection; - - /** - * Field _showAnnotation. - */ - private boolean _showAnnotation; - - /** - * keeps track of state for field: _showAnnotation - */ - private boolean _has_showAnnotation; - - /** - * Field _centreColumnLabels. - */ - private boolean _centreColumnLabels = false; - - /** - * keeps track of state for field: _centreColumnLabels - */ - private boolean _has_centreColumnLabels; - - /** - * Field _showGroupConservation. - */ - private boolean _showGroupConservation = false; - - /** - * keeps track of state for field: _showGroupConservation - */ - private boolean _has_showGroupConservation; - - /** - * Field _showGroupConsensus. - */ - private boolean _showGroupConsensus = false; - - /** - * keeps track of state for field: _showGroupConsensus - */ - private boolean _has_showGroupConsensus; - - /** - * Field _showConsensusHistogram. - */ - private boolean _showConsensusHistogram = true; - - /** - * keeps track of state for field: _showConsensusHistogram - */ - private boolean _has_showConsensusHistogram; - - /** - * Field _showSequenceLogo. - */ - private boolean _showSequenceLogo = false; - - /** - * keeps track of state for field: _showSequenceLogo - */ - private boolean _has_showSequenceLogo; - - /** - * Field _normaliseSequenceLogo. - */ - private boolean _normaliseSequenceLogo = false; - - /** - * keeps track of state for field: _normaliseSequenceLogo - */ - private boolean _has_normaliseSequenceLogo; - - /** - * Field _ignoreGapsinConsensus. - */ - private boolean _ignoreGapsinConsensus = true; - - /** - * keeps track of state for field: _ignoreGapsinConsensus - */ - private boolean _has_ignoreGapsinConsensus; - - /** - * Field _startRes. - */ - private int _startRes; - - /** - * keeps track of state for field: _startRes - */ - private boolean _has_startRes; - - /** - * Field _startSeq. - */ - private int _startSeq; - - /** - * keeps track of state for field: _startSeq - */ - private boolean _has_startSeq; - - /** - * Field _fontName. - */ - private java.lang.String _fontName; - - /** - * Field _fontSize. - */ - private int _fontSize; - - /** - * keeps track of state for field: _fontSize - */ - private boolean _has_fontSize; - - /** - * Field _fontStyle. - */ - private int _fontStyle; - - /** - * keeps track of state for field: _fontStyle - */ - private boolean _has_fontStyle; - - /** - * Field _scaleProteinAsCdna. - */ - private boolean _scaleProteinAsCdna = true; - - /** - * keeps track of state for field: _scaleProteinAsCdna - */ - private boolean _has_scaleProteinAsCdna; - - /** - * Field _viewName. - */ - private java.lang.String _viewName; - - /** - * Field _sequenceSetId. - */ - private java.lang.String _sequenceSetId; - - /** - * Field _gatheredViews. - */ - private boolean _gatheredViews; - - /** - * keeps track of state for field: _gatheredViews - */ - private boolean _has_gatheredViews; - - /** - * Field _textCol1. - */ - private int _textCol1; - - /** - * keeps track of state for field: _textCol1 - */ - private boolean _has_textCol1; - - /** - * Field _textCol2. - */ - private int _textCol2; - - /** - * keeps track of state for field: _textCol2 - */ - private boolean _has_textCol2; - - /** - * Field _textColThreshold. - */ - private int _textColThreshold; - - /** - * keeps track of state for field: _textColThreshold - */ - private boolean _has_textColThreshold; - - /** - * unique id used by jalview to - * synchronize - * between stored and - * instantiated views - * - */ - private java.lang.String _id; - - /** - * The viewport id of this viewport's - * (cdna/protein) coding complement, if any - * - */ - private java.lang.String _complementId; - - /** - * Field _width. - */ - private int _width; - - /** - * keeps track of state for field: _width - */ - private boolean _has_width; - - /** - * Field _height. - */ - private int _height; - - /** - * keeps track of state for field: _height - */ - private boolean _has_height; - - /** - * Field _xpos. - */ - private int _xpos; - - /** - * keeps track of state for field: _xpos - */ - private boolean _has_xpos; - - /** - * Field _ypos. - */ - private int _ypos; - - /** - * keeps track of state for field: _ypos - */ - private boolean _has_ypos; - - /** - * Field _annotationColours. - */ - private jalview.schemabinding.version2.AnnotationColours _annotationColours; - - /** - * Field _hiddenColumnsList. - */ - private java.util.Vector _hiddenColumnsList; - - /** - * Field _calcIdParamList. - */ - private java.util.Vector _calcIdParamList; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public Viewport() { - super(); - this._hiddenColumnsList = new java.util.Vector(); - this._calcIdParamList = new java.util.Vector(); - } - - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * - * - * @param vCalcIdParam - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addCalcIdParam( - final jalview.schemabinding.version2.CalcIdParam vCalcIdParam) - throws java.lang.IndexOutOfBoundsException { - this._calcIdParamList.addElement(vCalcIdParam); - } - - /** - * - * - * @param index - * @param vCalcIdParam - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addCalcIdParam( - final int index, - final jalview.schemabinding.version2.CalcIdParam vCalcIdParam) - throws java.lang.IndexOutOfBoundsException { - this._calcIdParamList.add(index, vCalcIdParam); - } - - /** - * - * - * @param vHiddenColumns - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addHiddenColumns( - final jalview.schemabinding.version2.HiddenColumns vHiddenColumns) - throws java.lang.IndexOutOfBoundsException { - this._hiddenColumnsList.addElement(vHiddenColumns); - } - - /** - * - * - * @param index - * @param vHiddenColumns - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void addHiddenColumns( - final int index, - final jalview.schemabinding.version2.HiddenColumns vHiddenColumns) - throws java.lang.IndexOutOfBoundsException { - this._hiddenColumnsList.add(index, vHiddenColumns); - } +public class Viewport implements java.io.Serializable +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _conservationSelected. + */ + private boolean _conservationSelected; + + /** + * keeps track of state for field: _conservationSelected + */ + private boolean _has_conservationSelected; + + /** + * Field _pidSelected. + */ + private boolean _pidSelected; + + /** + * keeps track of state for field: _pidSelected + */ + private boolean _has_pidSelected; + + /** + * Field _bgColour. + */ + private java.lang.String _bgColour; + + /** + * Field _consThreshold. + */ + private int _consThreshold; + + /** + * keeps track of state for field: _consThreshold + */ + private boolean _has_consThreshold; + + /** + * Field _pidThreshold. + */ + private int _pidThreshold; + + /** + * keeps track of state for field: _pidThreshold + */ + private boolean _has_pidThreshold; + + /** + * Field _title. + */ + private java.lang.String _title; + + /** + * Field _showFullId. + */ + private boolean _showFullId; + + /** + * keeps track of state for field: _showFullId + */ + private boolean _has_showFullId; + + /** + * Field _rightAlignIds. + */ + private boolean _rightAlignIds; + + /** + * keeps track of state for field: _rightAlignIds + */ + private boolean _has_rightAlignIds; + + /** + * Field _showText. + */ + private boolean _showText; + + /** + * keeps track of state for field: _showText + */ + private boolean _has_showText; + + /** + * Field _showColourText. + */ + private boolean _showColourText; + + /** + * keeps track of state for field: _showColourText + */ + private boolean _has_showColourText; + + /** + * Field _showUnconserved. + */ + private boolean _showUnconserved = false; + + /** + * keeps track of state for field: _showUnconserved + */ + private boolean _has_showUnconserved; + + /** + * Field _showBoxes. + */ + private boolean _showBoxes; + + /** + * keeps track of state for field: _showBoxes + */ + private boolean _has_showBoxes; + + /** + * Field _wrapAlignment. + */ + private boolean _wrapAlignment; + + /** + * keeps track of state for field: _wrapAlignment + */ + private boolean _has_wrapAlignment; + + /** + * Field _renderGaps. + */ + private boolean _renderGaps; + + /** + * keeps track of state for field: _renderGaps + */ + private boolean _has_renderGaps; + + /** + * Field _showSequenceFeatures. + */ + private boolean _showSequenceFeatures; + + /** + * keeps track of state for field: _showSequenceFeatures + */ + private boolean _has_showSequenceFeatures; + + /** + * Field _showNPfeatureTooltip. + */ + private boolean _showNPfeatureTooltip; + + /** + * keeps track of state for field: _showNPfeatureTooltip + */ + private boolean _has_showNPfeatureTooltip; + + /** + * Field _showDbRefTooltip. + */ + private boolean _showDbRefTooltip; + + /** + * keeps track of state for field: _showDbRefTooltip + */ + private boolean _has_showDbRefTooltip; + + /** + * Field _followHighlight. + */ + private boolean _followHighlight = true; + + /** + * keeps track of state for field: _followHighlight + */ + private boolean _has_followHighlight; + + /** + * Field _followSelection. + */ + private boolean _followSelection = true; + + /** + * keeps track of state for field: _followSelection + */ + private boolean _has_followSelection; + + /** + * Field _showAnnotation. + */ + private boolean _showAnnotation; + + /** + * keeps track of state for field: _showAnnotation + */ + private boolean _has_showAnnotation; + + /** + * Field _centreColumnLabels. + */ + private boolean _centreColumnLabels = false; + + /** + * keeps track of state for field: _centreColumnLabels + */ + private boolean _has_centreColumnLabels; + + /** + * Field _showGroupConservation. + */ + private boolean _showGroupConservation = false; + + /** + * keeps track of state for field: _showGroupConservation + */ + private boolean _has_showGroupConservation; + + /** + * Field _showGroupConsensus. + */ + private boolean _showGroupConsensus = false; + + /** + * keeps track of state for field: _showGroupConsensus + */ + private boolean _has_showGroupConsensus; + + /** + * Field _showConsensusHistogram. + */ + private boolean _showConsensusHistogram = true; + + /** + * keeps track of state for field: _showConsensusHistogram + */ + private boolean _has_showConsensusHistogram; + + /** + * Field _showSequenceLogo. + */ + private boolean _showSequenceLogo = false; + + /** + * keeps track of state for field: _showSequenceLogo + */ + private boolean _has_showSequenceLogo; + + /** + * Field _normaliseSequenceLogo. + */ + private boolean _normaliseSequenceLogo = false; + + /** + * keeps track of state for field: _normaliseSequenceLogo + */ + private boolean _has_normaliseSequenceLogo; + + /** + * Field _ignoreGapsinConsensus. + */ + private boolean _ignoreGapsinConsensus = true; + + /** + * keeps track of state for field: _ignoreGapsinConsensus + */ + private boolean _has_ignoreGapsinConsensus; + + /** + * Field _startRes. + */ + private int _startRes; + + /** + * keeps track of state for field: _startRes + */ + private boolean _has_startRes; + + /** + * Field _startSeq. + */ + private int _startSeq; + + /** + * keeps track of state for field: _startSeq + */ + private boolean _has_startSeq; + + /** + * Field _fontName. + */ + private java.lang.String _fontName; + + /** + * Field _fontSize. + */ + private int _fontSize; + + /** + * keeps track of state for field: _fontSize + */ + private boolean _has_fontSize; + + /** + * Field _fontStyle. + */ + private int _fontStyle; + + /** + * keeps track of state for field: _fontStyle + */ + private boolean _has_fontStyle; + + /** + * Field _scaleProteinAsCdna. + */ + private boolean _scaleProteinAsCdna = true; + + /** + * keeps track of state for field: _scaleProteinAsCdna + */ + private boolean _has_scaleProteinAsCdna; + + /** + * Field _viewName. + */ + private java.lang.String _viewName; + + /** + * Field _sequenceSetId. + */ + private java.lang.String _sequenceSetId; + + /** + * Field _gatheredViews. + */ + private boolean _gatheredViews; + + /** + * keeps track of state for field: _gatheredViews + */ + private boolean _has_gatheredViews; + + /** + * Field _textCol1. + */ + private int _textCol1; + + /** + * keeps track of state for field: _textCol1 + */ + private boolean _has_textCol1; + + /** + * Field _textCol2. + */ + private int _textCol2; + + /** + * keeps track of state for field: _textCol2 + */ + private boolean _has_textCol2; + + /** + * Field _textColThreshold. + */ + private int _textColThreshold; + + /** + * keeps track of state for field: _textColThreshold + */ + private boolean _has_textColThreshold; + + /** + * unique id used by jalview to synchronize between stored and instantiated + * views + * + */ + private java.lang.String _id; + + /** + * The viewport id of this viewport's (cdna/protein) coding complement, if any + * + */ + private java.lang.String _complementId; + + /** + * Field _width. + */ + private int _width; + + /** + * keeps track of state for field: _width + */ + private boolean _has_width; + + /** + * Field _height. + */ + private int _height; + + /** + * keeps track of state for field: _height + */ + private boolean _has_height; + + /** + * Field _xpos. + */ + private int _xpos; + + /** + * keeps track of state for field: _xpos + */ + private boolean _has_xpos; + + /** + * Field _ypos. + */ + private int _ypos; + + /** + * keeps track of state for field: _ypos + */ + private boolean _has_ypos; + + /** + * Field _annotationColours. + */ + private jalview.schemabinding.version2.AnnotationColours _annotationColours; + + /** + * Field _hiddenColumnsList. + */ + private java.util.Vector _hiddenColumnsList; + + /** + * Field _calcIdParamList. + */ + private java.util.Vector _calcIdParamList; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public Viewport() + { + super(); + this._hiddenColumnsList = new java.util.Vector(); + this._calcIdParamList = new java.util.Vector(); + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * + * + * @param vCalcIdParam + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addCalcIdParam( + final jalview.schemabinding.version2.CalcIdParam vCalcIdParam) + throws java.lang.IndexOutOfBoundsException + { + this._calcIdParamList.addElement(vCalcIdParam); + } + + /** + * + * + * @param index + * @param vCalcIdParam + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addCalcIdParam(final int index, + final jalview.schemabinding.version2.CalcIdParam vCalcIdParam) + throws java.lang.IndexOutOfBoundsException + { + this._calcIdParamList.add(index, vCalcIdParam); + } + + /** + * + * + * @param vHiddenColumns + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addHiddenColumns( + final jalview.schemabinding.version2.HiddenColumns vHiddenColumns) + throws java.lang.IndexOutOfBoundsException + { + this._hiddenColumnsList.addElement(vHiddenColumns); + } + + /** + * + * + * @param index + * @param vHiddenColumns + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void addHiddenColumns(final int index, + final jalview.schemabinding.version2.HiddenColumns vHiddenColumns) + throws java.lang.IndexOutOfBoundsException + { + this._hiddenColumnsList.add(index, vHiddenColumns); + } + + /** + */ + public void deleteCentreColumnLabels() + { + this._has_centreColumnLabels = false; + } + + /** + */ + public void deleteConsThreshold() + { + this._has_consThreshold = false; + } + + /** + */ + public void deleteConservationSelected() + { + this._has_conservationSelected = false; + } + + /** + */ + public void deleteFollowHighlight() + { + this._has_followHighlight = false; + } + + /** + */ + public void deleteFollowSelection() + { + this._has_followSelection = false; + } + + /** + */ + public void deleteFontSize() + { + this._has_fontSize = false; + } + + /** + */ + public void deleteFontStyle() + { + this._has_fontStyle = false; + } + + /** + */ + public void deleteGatheredViews() + { + this._has_gatheredViews = false; + } + + /** + */ + public void deleteHeight() + { + this._has_height = false; + } - /** + /** */ - public void deleteCentreColumnLabels( - ) { - this._has_centreColumnLabels= false; - } - - /** - */ - public void deleteConsThreshold( - ) { - this._has_consThreshold= false; - } - - /** - */ - public void deleteConservationSelected( - ) { - this._has_conservationSelected= false; - } - - /** - */ - public void deleteFollowHighlight( - ) { - this._has_followHighlight= false; - } - - /** - */ - public void deleteFollowSelection( - ) { - this._has_followSelection= false; - } - - /** - */ - public void deleteFontSize( - ) { - this._has_fontSize= false; - } - - /** - */ - public void deleteFontStyle( - ) { - this._has_fontStyle= false; - } - - /** - */ - public void deleteGatheredViews( - ) { - this._has_gatheredViews= false; - } - - /** - */ - public void deleteHeight( - ) { - this._has_height= false; - } - - /** - */ - public void deleteIgnoreGapsinConsensus( - ) { - this._has_ignoreGapsinConsensus= false; - } - - /** - */ - public void deleteNormaliseSequenceLogo( - ) { - this._has_normaliseSequenceLogo= false; - } - - /** - */ - public void deletePidSelected( - ) { - this._has_pidSelected= false; - } - - /** - */ - public void deletePidThreshold( - ) { - this._has_pidThreshold= false; - } - - /** - */ - public void deleteRenderGaps( - ) { - this._has_renderGaps= false; - } + public void deleteIgnoreGapsinConsensus() + { + this._has_ignoreGapsinConsensus = false; + } - /** + /** */ - public void deleteRightAlignIds( - ) { - this._has_rightAlignIds= false; - } - - /** - */ - public void deleteScaleProteinAsCdna( - ) { - this._has_scaleProteinAsCdna= false; - } + public void deleteNormaliseSequenceLogo() + { + this._has_normaliseSequenceLogo = false; + } - /** + /** */ - public void deleteShowAnnotation( - ) { - this._has_showAnnotation= false; - } + public void deletePidSelected() + { + this._has_pidSelected = false; + } - /** + /** */ - public void deleteShowBoxes( - ) { - this._has_showBoxes= false; - } + public void deletePidThreshold() + { + this._has_pidThreshold = false; + } - /** + /** */ - public void deleteShowColourText( - ) { - this._has_showColourText= false; - } + public void deleteRenderGaps() + { + this._has_renderGaps = false; + } - /** + /** */ - public void deleteShowConsensusHistogram( - ) { - this._has_showConsensusHistogram= false; - } + public void deleteRightAlignIds() + { + this._has_rightAlignIds = false; + } - /** + /** */ - public void deleteShowDbRefTooltip( - ) { - this._has_showDbRefTooltip= false; - } + public void deleteScaleProteinAsCdna() + { + this._has_scaleProteinAsCdna = false; + } - /** + /** */ - public void deleteShowFullId( - ) { - this._has_showFullId= false; - } + public void deleteShowAnnotation() + { + this._has_showAnnotation = false; + } - /** + /** */ - public void deleteShowGroupConsensus( - ) { - this._has_showGroupConsensus= false; - } + public void deleteShowBoxes() + { + this._has_showBoxes = false; + } - /** + /** */ - public void deleteShowGroupConservation( - ) { - this._has_showGroupConservation= false; - } + public void deleteShowColourText() + { + this._has_showColourText = false; + } - /** + /** */ - public void deleteShowNPfeatureTooltip( - ) { - this._has_showNPfeatureTooltip= false; - } + public void deleteShowConsensusHistogram() + { + this._has_showConsensusHistogram = false; + } - /** + /** */ - public void deleteShowSequenceFeatures( - ) { - this._has_showSequenceFeatures= false; - } + public void deleteShowDbRefTooltip() + { + this._has_showDbRefTooltip = false; + } - /** + /** */ - public void deleteShowSequenceLogo( - ) { - this._has_showSequenceLogo= false; - } + public void deleteShowFullId() + { + this._has_showFullId = false; + } - /** + /** */ - public void deleteShowText( - ) { - this._has_showText= false; - } + public void deleteShowGroupConsensus() + { + this._has_showGroupConsensus = false; + } - /** + /** */ - public void deleteShowUnconserved( - ) { - this._has_showUnconserved= false; - } + public void deleteShowGroupConservation() + { + this._has_showGroupConservation = false; + } - /** + /** */ - public void deleteStartRes( - ) { - this._has_startRes= false; - } + public void deleteShowNPfeatureTooltip() + { + this._has_showNPfeatureTooltip = false; + } - /** + /** */ - public void deleteStartSeq( - ) { - this._has_startSeq= false; - } + public void deleteShowSequenceFeatures() + { + this._has_showSequenceFeatures = false; + } - /** + /** */ - public void deleteTextCol1( - ) { - this._has_textCol1= false; - } + public void deleteShowSequenceLogo() + { + this._has_showSequenceLogo = false; + } - /** + /** */ - public void deleteTextCol2( - ) { - this._has_textCol2= false; - } + public void deleteShowText() + { + this._has_showText = false; + } - /** + /** */ - public void deleteTextColThreshold( - ) { - this._has_textColThreshold= false; - } + public void deleteShowUnconserved() + { + this._has_showUnconserved = false; + } - /** + /** */ - public void deleteWidth( - ) { - this._has_width= false; - } - - /** - */ - public void deleteWrapAlignment( - ) { - this._has_wrapAlignment= false; - } - - /** - */ - public void deleteXpos( - ) { - this._has_xpos= false; - } - - /** - */ - public void deleteYpos( - ) { - this._has_ypos= false; - } - - /** - * Method enumerateCalcIdParam. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.CalcIdParam elements - */ - public java.util.Enumeration enumerateCalcIdParam( - ) { - return this._calcIdParamList.elements(); - } - - /** - * Method enumerateHiddenColumns. - * - * @return an Enumeration over all - * jalview.schemabinding.version2.HiddenColumns elements - */ - public java.util.Enumeration enumerateHiddenColumns( - ) { - return this._hiddenColumnsList.elements(); - } - - /** - * Returns the value of field 'annotationColours'. - * - * @return the value of field 'AnnotationColours'. - */ - public jalview.schemabinding.version2.AnnotationColours getAnnotationColours( - ) { - return this._annotationColours; - } - - /** - * Returns the value of field 'bgColour'. - * - * @return the value of field 'BgColour'. - */ - public java.lang.String getBgColour( - ) { - return this._bgColour; - } - - /** - * Method getCalcIdParam. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.CalcIdParam at the given index - */ - public jalview.schemabinding.version2.CalcIdParam getCalcIdParam( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._calcIdParamList.size()) { - throw new IndexOutOfBoundsException("getCalcIdParam: Index value '" + index + "' not in range [0.." + (this._calcIdParamList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.CalcIdParam) _calcIdParamList.get(index); - } - - /** - * Method getCalcIdParam.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 jalview.schemabinding.version2.CalcIdParam[] getCalcIdParam( - ) { - jalview.schemabinding.version2.CalcIdParam[] array = new jalview.schemabinding.version2.CalcIdParam[0]; - return (jalview.schemabinding.version2.CalcIdParam[]) this._calcIdParamList.toArray(array); - } - - /** - * Method getCalcIdParamCount. - * - * @return the size of this collection - */ - public int getCalcIdParamCount( - ) { - return this._calcIdParamList.size(); - } - - /** - * Returns the value of field 'centreColumnLabels'. - * - * @return the value of field 'CentreColumnLabels'. - */ - public boolean getCentreColumnLabels( - ) { - return this._centreColumnLabels; - } - - /** - * Returns the value of field 'complementId'. The field - * 'complementId' has the following description: The viewport - * id of this viewport's - * (cdna/protein) coding complement, if any - * - * - * @return the value of field 'ComplementId'. - */ - public java.lang.String getComplementId( - ) { - return this._complementId; - } - - /** - * Returns the value of field 'consThreshold'. - * - * @return the value of field 'ConsThreshold'. - */ - public int getConsThreshold( - ) { - return this._consThreshold; - } - - /** - * Returns the value of field 'conservationSelected'. - * - * @return the value of field 'ConservationSelected'. - */ - public boolean getConservationSelected( - ) { - return this._conservationSelected; - } - - /** - * Returns the value of field 'followHighlight'. - * - * @return the value of field 'FollowHighlight'. - */ - public boolean getFollowHighlight( - ) { - return this._followHighlight; - } - - /** - * Returns the value of field 'followSelection'. - * - * @return the value of field 'FollowSelection'. - */ - public boolean getFollowSelection( - ) { - return this._followSelection; - } - - /** - * Returns the value of field 'fontName'. - * - * @return the value of field 'FontName'. - */ - public java.lang.String getFontName( - ) { - return this._fontName; - } - - /** - * Returns the value of field 'fontSize'. - * - * @return the value of field 'FontSize'. - */ - public int getFontSize( - ) { - return this._fontSize; - } - - /** - * Returns the value of field 'fontStyle'. - * - * @return the value of field 'FontStyle'. - */ - public int getFontStyle( - ) { - return this._fontStyle; - } - - /** - * Returns the value of field 'gatheredViews'. - * - * @return the value of field 'GatheredViews'. - */ - public boolean getGatheredViews( - ) { - return this._gatheredViews; - } - - /** - * Returns the value of field 'height'. - * - * @return the value of field 'Height'. - */ - public int getHeight( - ) { - return this._height; - } - - /** - * Method getHiddenColumns. - * - * @param index - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - * @return the value of the - * jalview.schemabinding.version2.HiddenColumns at the given - * index - */ - public jalview.schemabinding.version2.HiddenColumns getHiddenColumns( - final int index) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._hiddenColumnsList.size()) { - throw new IndexOutOfBoundsException("getHiddenColumns: Index value '" + index + "' not in range [0.." + (this._hiddenColumnsList.size() - 1) + "]"); - } - - return (jalview.schemabinding.version2.HiddenColumns) _hiddenColumnsList.get(index); - } - - /** - * Method getHiddenColumns.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 jalview.schemabinding.version2.HiddenColumns[] getHiddenColumns( - ) { - jalview.schemabinding.version2.HiddenColumns[] array = new jalview.schemabinding.version2.HiddenColumns[0]; - return (jalview.schemabinding.version2.HiddenColumns[]) this._hiddenColumnsList.toArray(array); - } - - /** - * Method getHiddenColumnsCount. - * - * @return the size of this collection - */ - public int getHiddenColumnsCount( - ) { - return this._hiddenColumnsList.size(); - } - - /** - * Returns the value of field 'id'. The field 'id' has the - * following description: unique id used by jalview to - * synchronize - * between stored and - * instantiated views - * - * - * @return the value of field 'Id'. - */ - public java.lang.String getId( - ) { - return this._id; - } - - /** - * Returns the value of field 'ignoreGapsinConsensus'. - * - * @return the value of field 'IgnoreGapsinConsensus'. - */ - public boolean getIgnoreGapsinConsensus( - ) { - return this._ignoreGapsinConsensus; - } - - /** - * Returns the value of field 'normaliseSequenceLogo'. - * - * @return the value of field 'NormaliseSequenceLogo'. - */ - public boolean getNormaliseSequenceLogo( - ) { - return this._normaliseSequenceLogo; - } - - /** - * Returns the value of field 'pidSelected'. - * - * @return the value of field 'PidSelected'. - */ - public boolean getPidSelected( - ) { - return this._pidSelected; - } - - /** - * Returns the value of field 'pidThreshold'. - * - * @return the value of field 'PidThreshold'. - */ - public int getPidThreshold( - ) { - return this._pidThreshold; - } - - /** - * Returns the value of field 'renderGaps'. - * - * @return the value of field 'RenderGaps'. - */ - public boolean getRenderGaps( - ) { - return this._renderGaps; - } - - /** - * Returns the value of field 'rightAlignIds'. - * - * @return the value of field 'RightAlignIds'. - */ - public boolean getRightAlignIds( - ) { - return this._rightAlignIds; - } - - /** - * Returns the value of field 'scaleProteinAsCdna'. - * - * @return the value of field 'ScaleProteinAsCdna'. - */ - public boolean getScaleProteinAsCdna( - ) { - return this._scaleProteinAsCdna; - } - - /** - * Returns the value of field 'sequenceSetId'. - * - * @return the value of field 'SequenceSetId'. - */ - public java.lang.String getSequenceSetId( - ) { - return this._sequenceSetId; - } - - /** - * Returns the value of field 'showAnnotation'. - * - * @return the value of field 'ShowAnnotation'. - */ - public boolean getShowAnnotation( - ) { - return this._showAnnotation; - } - - /** - * Returns the value of field 'showBoxes'. - * - * @return the value of field 'ShowBoxes'. - */ - public boolean getShowBoxes( - ) { - return this._showBoxes; - } - - /** - * Returns the value of field 'showColourText'. - * - * @return the value of field 'ShowColourText'. - */ - public boolean getShowColourText( - ) { - return this._showColourText; - } - - /** - * Returns the value of field 'showConsensusHistogram'. - * - * @return the value of field 'ShowConsensusHistogram'. - */ - public boolean getShowConsensusHistogram( - ) { - return this._showConsensusHistogram; - } - - /** - * Returns the value of field 'showDbRefTooltip'. - * - * @return the value of field 'ShowDbRefTooltip'. - */ - public boolean getShowDbRefTooltip( - ) { - return this._showDbRefTooltip; - } - - /** - * Returns the value of field 'showFullId'. - * - * @return the value of field 'ShowFullId'. - */ - public boolean getShowFullId( - ) { - return this._showFullId; - } - - /** - * Returns the value of field 'showGroupConsensus'. - * - * @return the value of field 'ShowGroupConsensus'. - */ - public boolean getShowGroupConsensus( - ) { - return this._showGroupConsensus; - } - - /** - * Returns the value of field 'showGroupConservation'. - * - * @return the value of field 'ShowGroupConservation'. - */ - public boolean getShowGroupConservation( - ) { - return this._showGroupConservation; - } - - /** - * Returns the value of field 'showNPfeatureTooltip'. - * - * @return the value of field 'ShowNPfeatureTooltip'. - */ - public boolean getShowNPfeatureTooltip( - ) { - return this._showNPfeatureTooltip; - } - - /** - * Returns the value of field 'showSequenceFeatures'. - * - * @return the value of field 'ShowSequenceFeatures'. - */ - public boolean getShowSequenceFeatures( - ) { - return this._showSequenceFeatures; - } - - /** - * Returns the value of field 'showSequenceLogo'. - * - * @return the value of field 'ShowSequenceLogo'. - */ - public boolean getShowSequenceLogo( - ) { - return this._showSequenceLogo; - } - - /** - * Returns the value of field 'showText'. - * - * @return the value of field 'ShowText'. - */ - public boolean getShowText( - ) { - return this._showText; - } - - /** - * Returns the value of field 'showUnconserved'. - * - * @return the value of field 'ShowUnconserved'. - */ - public boolean getShowUnconserved( - ) { - return this._showUnconserved; - } - - /** - * Returns the value of field 'startRes'. - * - * @return the value of field 'StartRes'. - */ - public int getStartRes( - ) { - return this._startRes; - } - - /** - * Returns the value of field 'startSeq'. - * - * @return the value of field 'StartSeq'. - */ - public int getStartSeq( - ) { - return this._startSeq; - } - - /** - * Returns the value of field 'textCol1'. - * - * @return the value of field 'TextCol1'. - */ - public int getTextCol1( - ) { - return this._textCol1; - } - - /** - * Returns the value of field 'textCol2'. - * - * @return the value of field 'TextCol2'. - */ - public int getTextCol2( - ) { - return this._textCol2; - } - - /** - * Returns the value of field 'textColThreshold'. - * - * @return the value of field 'TextColThreshold'. - */ - public int getTextColThreshold( - ) { - return this._textColThreshold; - } - - /** - * Returns the value of field 'title'. - * - * @return the value of field 'Title'. - */ - public java.lang.String getTitle( - ) { - return this._title; - } - - /** - * Returns the value of field 'viewName'. - * - * @return the value of field 'ViewName'. - */ - public java.lang.String getViewName( - ) { - return this._viewName; - } - - /** - * Returns the value of field 'width'. - * - * @return the value of field 'Width'. - */ - public int getWidth( - ) { - return this._width; - } - - /** - * Returns the value of field 'wrapAlignment'. - * - * @return the value of field 'WrapAlignment'. - */ - public boolean getWrapAlignment( - ) { - return this._wrapAlignment; - } - - /** - * Returns the value of field 'xpos'. - * - * @return the value of field 'Xpos'. - */ - public int getXpos( - ) { - return this._xpos; - } - - /** - * Returns the value of field 'ypos'. - * - * @return the value of field 'Ypos'. - */ - public int getYpos( - ) { - return this._ypos; - } - - /** - * Method hasCentreColumnLabels. - * - * @return true if at least one CentreColumnLabels has been adde - */ - public boolean hasCentreColumnLabels( - ) { - return this._has_centreColumnLabels; - } - - /** - * Method hasConsThreshold. - * - * @return true if at least one ConsThreshold has been added - */ - public boolean hasConsThreshold( - ) { - return this._has_consThreshold; - } - - /** - * Method hasConservationSelected. - * - * @return true if at least one ConservationSelected has been - * added - */ - public boolean hasConservationSelected( - ) { - return this._has_conservationSelected; - } - - /** - * Method hasFollowHighlight. - * - * @return true if at least one FollowHighlight has been added - */ - public boolean hasFollowHighlight( - ) { - return this._has_followHighlight; - } - - /** - * Method hasFollowSelection. - * - * @return true if at least one FollowSelection has been added - */ - public boolean hasFollowSelection( - ) { - return this._has_followSelection; - } - - /** - * Method hasFontSize. - * - * @return true if at least one FontSize has been added - */ - public boolean hasFontSize( - ) { - return this._has_fontSize; - } - - /** - * Method hasFontStyle. - * - * @return true if at least one FontStyle has been added - */ - public boolean hasFontStyle( - ) { - return this._has_fontStyle; - } - - /** - * Method hasGatheredViews. - * - * @return true if at least one GatheredViews has been added - */ - public boolean hasGatheredViews( - ) { - return this._has_gatheredViews; - } - - /** - * Method hasHeight. - * - * @return true if at least one Height has been added - */ - public boolean hasHeight( - ) { - return this._has_height; - } - - /** - * Method hasIgnoreGapsinConsensus. - * - * @return true if at least one IgnoreGapsinConsensus has been - * added - */ - public boolean hasIgnoreGapsinConsensus( - ) { - return this._has_ignoreGapsinConsensus; - } - - /** - * Method hasNormaliseSequenceLogo. - * - * @return true if at least one NormaliseSequenceLogo has been - * added - */ - public boolean hasNormaliseSequenceLogo( - ) { - return this._has_normaliseSequenceLogo; - } - - /** - * Method hasPidSelected. - * - * @return true if at least one PidSelected has been added - */ - public boolean hasPidSelected( - ) { - return this._has_pidSelected; - } - - /** - * Method hasPidThreshold. - * - * @return true if at least one PidThreshold has been added - */ - public boolean hasPidThreshold( - ) { - return this._has_pidThreshold; - } - - /** - * Method hasRenderGaps. - * - * @return true if at least one RenderGaps has been added - */ - public boolean hasRenderGaps( - ) { - return this._has_renderGaps; - } - - /** - * Method hasRightAlignIds. - * - * @return true if at least one RightAlignIds has been added - */ - public boolean hasRightAlignIds( - ) { - return this._has_rightAlignIds; - } - - /** - * Method hasScaleProteinAsCdna. - * - * @return true if at least one ScaleProteinAsCdna has been adde - */ - public boolean hasScaleProteinAsCdna( - ) { - return this._has_scaleProteinAsCdna; - } - - /** - * Method hasShowAnnotation. - * - * @return true if at least one ShowAnnotation has been added - */ - public boolean hasShowAnnotation( - ) { - return this._has_showAnnotation; - } - - /** - * Method hasShowBoxes. - * - * @return true if at least one ShowBoxes has been added - */ - public boolean hasShowBoxes( - ) { - return this._has_showBoxes; - } - - /** - * Method hasShowColourText. - * - * @return true if at least one ShowColourText has been added - */ - public boolean hasShowColourText( - ) { - return this._has_showColourText; - } - - /** - * Method hasShowConsensusHistogram. - * - * @return true if at least one ShowConsensusHistogram has been - * added - */ - public boolean hasShowConsensusHistogram( - ) { - return this._has_showConsensusHistogram; - } - - /** - * Method hasShowDbRefTooltip. - * - * @return true if at least one ShowDbRefTooltip has been added - */ - public boolean hasShowDbRefTooltip( - ) { - return this._has_showDbRefTooltip; - } - - /** - * Method hasShowFullId. - * - * @return true if at least one ShowFullId has been added - */ - public boolean hasShowFullId( - ) { - return this._has_showFullId; - } - - /** - * Method hasShowGroupConsensus. - * - * @return true if at least one ShowGroupConsensus has been adde - */ - public boolean hasShowGroupConsensus( - ) { - return this._has_showGroupConsensus; - } - - /** - * Method hasShowGroupConservation. - * - * @return true if at least one ShowGroupConservation has been - * added - */ - public boolean hasShowGroupConservation( - ) { - return this._has_showGroupConservation; - } - - /** - * Method hasShowNPfeatureTooltip. - * - * @return true if at least one ShowNPfeatureTooltip has been - * added - */ - public boolean hasShowNPfeatureTooltip( - ) { - return this._has_showNPfeatureTooltip; - } - - /** - * Method hasShowSequenceFeatures. - * - * @return true if at least one ShowSequenceFeatures has been - * added - */ - public boolean hasShowSequenceFeatures( - ) { - return this._has_showSequenceFeatures; - } - - /** - * Method hasShowSequenceLogo. - * - * @return true if at least one ShowSequenceLogo has been added - */ - public boolean hasShowSequenceLogo( - ) { - return this._has_showSequenceLogo; - } - - /** - * Method hasShowText. - * - * @return true if at least one ShowText has been added - */ - public boolean hasShowText( - ) { - return this._has_showText; - } - - /** - * Method hasShowUnconserved. - * - * @return true if at least one ShowUnconserved has been added - */ - public boolean hasShowUnconserved( - ) { - return this._has_showUnconserved; - } - - /** - * Method hasStartRes. - * - * @return true if at least one StartRes has been added - */ - public boolean hasStartRes( - ) { - return this._has_startRes; - } - - /** - * Method hasStartSeq. - * - * @return true if at least one StartSeq has been added - */ - public boolean hasStartSeq( - ) { - return this._has_startSeq; - } - - /** - * Method hasTextCol1. - * - * @return true if at least one TextCol1 has been added - */ - public boolean hasTextCol1( - ) { - return this._has_textCol1; - } - - /** - * Method hasTextCol2. - * - * @return true if at least one TextCol2 has been added - */ - public boolean hasTextCol2( - ) { - return this._has_textCol2; - } - - /** - * Method hasTextColThreshold. - * - * @return true if at least one TextColThreshold has been added - */ - public boolean hasTextColThreshold( - ) { - return this._has_textColThreshold; - } - - /** - * Method hasWidth. - * - * @return true if at least one Width has been added - */ - public boolean hasWidth( - ) { - return this._has_width; - } - - /** - * Method hasWrapAlignment. - * - * @return true if at least one WrapAlignment has been added - */ - public boolean hasWrapAlignment( - ) { - return this._has_wrapAlignment; - } - - /** - * Method hasXpos. - * - * @return true if at least one Xpos has been added - */ - public boolean hasXpos( - ) { - return this._has_xpos; - } - - /** - * Method hasYpos. - * - * @return true if at least one Ypos has been added - */ - public boolean hasYpos( - ) { - return this._has_ypos; - } - - /** - * Returns the value of field 'centreColumnLabels'. - * - * @return the value of field 'CentreColumnLabels'. - */ - public boolean isCentreColumnLabels( - ) { - return this._centreColumnLabels; - } - - /** - * Returns the value of field 'conservationSelected'. - * - * @return the value of field 'ConservationSelected'. - */ - public boolean isConservationSelected( - ) { - return this._conservationSelected; - } - - /** - * Returns the value of field 'followHighlight'. - * - * @return the value of field 'FollowHighlight'. - */ - public boolean isFollowHighlight( - ) { - return this._followHighlight; - } - - /** - * Returns the value of field 'followSelection'. - * - * @return the value of field 'FollowSelection'. - */ - public boolean isFollowSelection( - ) { - return this._followSelection; - } - - /** - * Returns the value of field 'gatheredViews'. - * - * @return the value of field 'GatheredViews'. - */ - public boolean isGatheredViews( - ) { - return this._gatheredViews; - } - - /** - * Returns the value of field 'ignoreGapsinConsensus'. - * - * @return the value of field 'IgnoreGapsinConsensus'. - */ - public boolean isIgnoreGapsinConsensus( - ) { - return this._ignoreGapsinConsensus; - } - - /** - * Returns the value of field 'normaliseSequenceLogo'. - * - * @return the value of field 'NormaliseSequenceLogo'. - */ - public boolean isNormaliseSequenceLogo( - ) { - return this._normaliseSequenceLogo; - } - - /** - * Returns the value of field 'pidSelected'. - * - * @return the value of field 'PidSelected'. - */ - public boolean isPidSelected( - ) { - return this._pidSelected; - } - - /** - * Returns the value of field 'renderGaps'. - * - * @return the value of field 'RenderGaps'. - */ - public boolean isRenderGaps( - ) { - return this._renderGaps; - } - - /** - * Returns the value of field 'rightAlignIds'. - * - * @return the value of field 'RightAlignIds'. - */ - public boolean isRightAlignIds( - ) { - return this._rightAlignIds; - } - - /** - * Returns the value of field 'scaleProteinAsCdna'. - * - * @return the value of field 'ScaleProteinAsCdna'. - */ - public boolean isScaleProteinAsCdna( - ) { - return this._scaleProteinAsCdna; - } - - /** - * Returns the value of field 'showAnnotation'. - * - * @return the value of field 'ShowAnnotation'. - */ - public boolean isShowAnnotation( - ) { - return this._showAnnotation; - } - - /** - * Returns the value of field 'showBoxes'. - * - * @return the value of field 'ShowBoxes'. - */ - public boolean isShowBoxes( - ) { - return this._showBoxes; - } - - /** - * Returns the value of field 'showColourText'. - * - * @return the value of field 'ShowColourText'. - */ - public boolean isShowColourText( - ) { - return this._showColourText; - } - - /** - * Returns the value of field 'showConsensusHistogram'. - * - * @return the value of field 'ShowConsensusHistogram'. - */ - public boolean isShowConsensusHistogram( - ) { - return this._showConsensusHistogram; - } - - /** - * Returns the value of field 'showDbRefTooltip'. - * - * @return the value of field 'ShowDbRefTooltip'. - */ - public boolean isShowDbRefTooltip( - ) { - return this._showDbRefTooltip; - } - - /** - * Returns the value of field 'showFullId'. - * - * @return the value of field 'ShowFullId'. - */ - public boolean isShowFullId( - ) { - return this._showFullId; - } - - /** - * Returns the value of field 'showGroupConsensus'. - * - * @return the value of field 'ShowGroupConsensus'. - */ - public boolean isShowGroupConsensus( - ) { - return this._showGroupConsensus; - } - - /** - * Returns the value of field 'showGroupConservation'. - * - * @return the value of field 'ShowGroupConservation'. - */ - public boolean isShowGroupConservation( - ) { - return this._showGroupConservation; - } - - /** - * Returns the value of field 'showNPfeatureTooltip'. - * - * @return the value of field 'ShowNPfeatureTooltip'. - */ - public boolean isShowNPfeatureTooltip( - ) { - return this._showNPfeatureTooltip; - } - - /** - * Returns the value of field 'showSequenceFeatures'. - * - * @return the value of field 'ShowSequenceFeatures'. - */ - public boolean isShowSequenceFeatures( - ) { - return this._showSequenceFeatures; - } - - /** - * Returns the value of field 'showSequenceLogo'. - * - * @return the value of field 'ShowSequenceLogo'. - */ - public boolean isShowSequenceLogo( - ) { - return this._showSequenceLogo; - } - - /** - * Returns the value of field 'showText'. - * - * @return the value of field 'ShowText'. - */ - public boolean isShowText( - ) { - return this._showText; - } - - /** - * Returns the value of field 'showUnconserved'. - * - * @return the value of field 'ShowUnconserved'. - */ - public boolean isShowUnconserved( - ) { - return this._showUnconserved; - } - - /** - * 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; - } - - /** - * Returns the value of field 'wrapAlignment'. - * - * @return the value of field 'WrapAlignment'. - */ - public boolean isWrapAlignment( - ) { - return this._wrapAlignment; - } - - /** - * - * - * @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 removeAllCalcIdParam( - ) { - this._calcIdParamList.clear(); - } - - /** - */ - public void removeAllHiddenColumns( - ) { - this._hiddenColumnsList.clear(); - } - - /** - * Method removeCalcIdParam. - * - * @param vCalcIdParam - * @return true if the object was removed from the collection. - */ - public boolean removeCalcIdParam( - final jalview.schemabinding.version2.CalcIdParam vCalcIdParam) { - boolean removed = _calcIdParamList.remove(vCalcIdParam); - return removed; - } - - /** - * Method removeCalcIdParamAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.CalcIdParam removeCalcIdParamAt( - final int index) { - java.lang.Object obj = this._calcIdParamList.remove(index); - return (jalview.schemabinding.version2.CalcIdParam) obj; - } - - /** - * Method removeHiddenColumns. - * - * @param vHiddenColumns - * @return true if the object was removed from the collection. - */ - public boolean removeHiddenColumns( - final jalview.schemabinding.version2.HiddenColumns vHiddenColumns) { - boolean removed = _hiddenColumnsList.remove(vHiddenColumns); - return removed; - } - - /** - * Method removeHiddenColumnsAt. - * - * @param index - * @return the element removed from the collection - */ - public jalview.schemabinding.version2.HiddenColumns removeHiddenColumnsAt( - final int index) { - java.lang.Object obj = this._hiddenColumnsList.remove(index); - return (jalview.schemabinding.version2.HiddenColumns) obj; - } - - /** - * Sets the value of field 'annotationColours'. - * - * @param annotationColours the value of field - * 'annotationColours'. - */ - public void setAnnotationColours( - final jalview.schemabinding.version2.AnnotationColours annotationColours) { - this._annotationColours = annotationColours; - } - - /** - * Sets the value of field 'bgColour'. - * - * @param bgColour the value of field 'bgColour'. - */ - public void setBgColour( - final java.lang.String bgColour) { - this._bgColour = bgColour; - } - - /** - * - * - * @param index - * @param vCalcIdParam - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setCalcIdParam( - final int index, - final jalview.schemabinding.version2.CalcIdParam vCalcIdParam) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._calcIdParamList.size()) { - throw new IndexOutOfBoundsException("setCalcIdParam: Index value '" + index + "' not in range [0.." + (this._calcIdParamList.size() - 1) + "]"); - } - - this._calcIdParamList.set(index, vCalcIdParam); - } - - /** - * - * - * @param vCalcIdParamArray - */ - public void setCalcIdParam( - final jalview.schemabinding.version2.CalcIdParam[] vCalcIdParamArray) { - //-- copy array - _calcIdParamList.clear(); - - for (int i = 0; i < vCalcIdParamArray.length; i++) { - this._calcIdParamList.add(vCalcIdParamArray[i]); - } - } - - /** - * Sets the value of field 'centreColumnLabels'. - * - * @param centreColumnLabels the value of field - * 'centreColumnLabels'. - */ - public void setCentreColumnLabels( - final boolean centreColumnLabels) { - this._centreColumnLabels = centreColumnLabels; - this._has_centreColumnLabels = true; - } - - /** - * Sets the value of field 'complementId'. The field - * 'complementId' has the following description: The viewport - * id of this viewport's - * (cdna/protein) coding complement, if any - * - * - * @param complementId the value of field 'complementId'. - */ - public void setComplementId( - final java.lang.String complementId) { - this._complementId = complementId; - } - - /** - * Sets the value of field 'consThreshold'. - * - * @param consThreshold the value of field 'consThreshold'. - */ - public void setConsThreshold( - final int consThreshold) { - this._consThreshold = consThreshold; - this._has_consThreshold = true; - } - - /** - * Sets the value of field 'conservationSelected'. - * - * @param conservationSelected the value of field - * 'conservationSelected'. - */ - public void setConservationSelected( - final boolean conservationSelected) { - this._conservationSelected = conservationSelected; - this._has_conservationSelected = true; - } - - /** - * Sets the value of field 'followHighlight'. - * - * @param followHighlight the value of field 'followHighlight'. - */ - public void setFollowHighlight( - final boolean followHighlight) { - this._followHighlight = followHighlight; - this._has_followHighlight = true; - } - - /** - * Sets the value of field 'followSelection'. - * - * @param followSelection the value of field 'followSelection'. - */ - public void setFollowSelection( - final boolean followSelection) { - this._followSelection = followSelection; - this._has_followSelection = true; - } - - /** - * Sets the value of field 'fontName'. - * - * @param fontName the value of field 'fontName'. - */ - public void setFontName( - final java.lang.String fontName) { - this._fontName = fontName; - } - - /** - * Sets the value of field 'fontSize'. - * - * @param fontSize the value of field 'fontSize'. - */ - public void setFontSize( - final int fontSize) { - this._fontSize = fontSize; - this._has_fontSize = true; - } - - /** - * Sets the value of field 'fontStyle'. - * - * @param fontStyle the value of field 'fontStyle'. - */ - public void setFontStyle( - final int fontStyle) { - this._fontStyle = fontStyle; - this._has_fontStyle = true; - } - - /** - * Sets the value of field 'gatheredViews'. - * - * @param gatheredViews the value of field 'gatheredViews'. - */ - public void setGatheredViews( - final boolean gatheredViews) { - this._gatheredViews = gatheredViews; - this._has_gatheredViews = true; - } - - /** - * Sets the value of field 'height'. - * - * @param height the value of field 'height'. - */ - public void setHeight( - final int height) { - this._height = height; - this._has_height = true; - } - - /** - * - * - * @param index - * @param vHiddenColumns - * @throws java.lang.IndexOutOfBoundsException if the index - * given is outside the bounds of the collection - */ - public void setHiddenColumns( - final int index, - final jalview.schemabinding.version2.HiddenColumns vHiddenColumns) - throws java.lang.IndexOutOfBoundsException { - // check bounds for index - if (index < 0 || index >= this._hiddenColumnsList.size()) { - throw new IndexOutOfBoundsException("setHiddenColumns: Index value '" + index + "' not in range [0.." + (this._hiddenColumnsList.size() - 1) + "]"); - } - - this._hiddenColumnsList.set(index, vHiddenColumns); - } - - /** - * - * - * @param vHiddenColumnsArray - */ - public void setHiddenColumns( - final jalview.schemabinding.version2.HiddenColumns[] vHiddenColumnsArray) { - //-- copy array - _hiddenColumnsList.clear(); - - for (int i = 0; i < vHiddenColumnsArray.length; i++) { - this._hiddenColumnsList.add(vHiddenColumnsArray[i]); - } - } - - /** - * Sets the value of field 'id'. The field 'id' has the - * following description: unique id used by jalview to - * synchronize - * between stored and - * instantiated views - * - * - * @param id the value of field 'id'. - */ - public void setId( - final java.lang.String id) { - this._id = id; - } - - /** - * Sets the value of field 'ignoreGapsinConsensus'. - * - * @param ignoreGapsinConsensus the value of field - * 'ignoreGapsinConsensus'. - */ - public void setIgnoreGapsinConsensus( - final boolean ignoreGapsinConsensus) { - this._ignoreGapsinConsensus = ignoreGapsinConsensus; - this._has_ignoreGapsinConsensus = true; - } - - /** - * Sets the value of field 'normaliseSequenceLogo'. - * - * @param normaliseSequenceLogo the value of field - * 'normaliseSequenceLogo'. - */ - public void setNormaliseSequenceLogo( - final boolean normaliseSequenceLogo) { - this._normaliseSequenceLogo = normaliseSequenceLogo; - this._has_normaliseSequenceLogo = true; - } - - /** - * Sets the value of field 'pidSelected'. - * - * @param pidSelected the value of field 'pidSelected'. - */ - public void setPidSelected( - final boolean pidSelected) { - this._pidSelected = pidSelected; - this._has_pidSelected = true; - } - - /** - * Sets the value of field 'pidThreshold'. - * - * @param pidThreshold the value of field 'pidThreshold'. - */ - public void setPidThreshold( - final int pidThreshold) { - this._pidThreshold = pidThreshold; - this._has_pidThreshold = true; - } - - /** - * Sets the value of field 'renderGaps'. - * - * @param renderGaps the value of field 'renderGaps'. - */ - public void setRenderGaps( - final boolean renderGaps) { - this._renderGaps = renderGaps; - this._has_renderGaps = true; - } - - /** - * Sets the value of field 'rightAlignIds'. - * - * @param rightAlignIds the value of field 'rightAlignIds'. - */ - public void setRightAlignIds( - final boolean rightAlignIds) { - this._rightAlignIds = rightAlignIds; - this._has_rightAlignIds = true; - } - - /** - * Sets the value of field 'scaleProteinAsCdna'. - * - * @param scaleProteinAsCdna the value of field - * 'scaleProteinAsCdna'. - */ - public void setScaleProteinAsCdna( - final boolean scaleProteinAsCdna) { - this._scaleProteinAsCdna = scaleProteinAsCdna; - this._has_scaleProteinAsCdna = true; - } - - /** - * Sets the value of field 'sequenceSetId'. - * - * @param sequenceSetId the value of field 'sequenceSetId'. - */ - public void setSequenceSetId( - final java.lang.String sequenceSetId) { - this._sequenceSetId = sequenceSetId; - } - - /** - * Sets the value of field 'showAnnotation'. - * - * @param showAnnotation the value of field 'showAnnotation'. - */ - public void setShowAnnotation( - final boolean showAnnotation) { - this._showAnnotation = showAnnotation; - this._has_showAnnotation = true; - } - - /** - * Sets the value of field 'showBoxes'. - * - * @param showBoxes the value of field 'showBoxes'. - */ - public void setShowBoxes( - final boolean showBoxes) { - this._showBoxes = showBoxes; - this._has_showBoxes = true; - } - - /** - * Sets the value of field 'showColourText'. - * - * @param showColourText the value of field 'showColourText'. - */ - public void setShowColourText( - final boolean showColourText) { - this._showColourText = showColourText; - this._has_showColourText = true; - } - - /** - * Sets the value of field 'showConsensusHistogram'. - * - * @param showConsensusHistogram the value of field - * 'showConsensusHistogram'. - */ - public void setShowConsensusHistogram( - final boolean showConsensusHistogram) { - this._showConsensusHistogram = showConsensusHistogram; - this._has_showConsensusHistogram = true; - } - - /** - * Sets the value of field 'showDbRefTooltip'. - * - * @param showDbRefTooltip the value of field 'showDbRefTooltip' - */ - public void setShowDbRefTooltip( - final boolean showDbRefTooltip) { - this._showDbRefTooltip = showDbRefTooltip; - this._has_showDbRefTooltip = true; - } - - /** - * Sets the value of field 'showFullId'. - * - * @param showFullId the value of field 'showFullId'. - */ - public void setShowFullId( - final boolean showFullId) { - this._showFullId = showFullId; - this._has_showFullId = true; - } - - /** - * Sets the value of field 'showGroupConsensus'. - * - * @param showGroupConsensus the value of field - * 'showGroupConsensus'. - */ - public void setShowGroupConsensus( - final boolean showGroupConsensus) { - this._showGroupConsensus = showGroupConsensus; - this._has_showGroupConsensus = true; - } - - /** - * Sets the value of field 'showGroupConservation'. - * - * @param showGroupConservation the value of field - * 'showGroupConservation'. - */ - public void setShowGroupConservation( - final boolean showGroupConservation) { - this._showGroupConservation = showGroupConservation; - this._has_showGroupConservation = true; - } - - /** - * Sets the value of field 'showNPfeatureTooltip'. - * - * @param showNPfeatureTooltip the value of field - * 'showNPfeatureTooltip'. - */ - public void setShowNPfeatureTooltip( - final boolean showNPfeatureTooltip) { - this._showNPfeatureTooltip = showNPfeatureTooltip; - this._has_showNPfeatureTooltip = true; - } - - /** - * Sets the value of field 'showSequenceFeatures'. - * - * @param showSequenceFeatures the value of field - * 'showSequenceFeatures'. - */ - public void setShowSequenceFeatures( - final boolean showSequenceFeatures) { - this._showSequenceFeatures = showSequenceFeatures; - this._has_showSequenceFeatures = true; - } - - /** - * Sets the value of field 'showSequenceLogo'. - * - * @param showSequenceLogo the value of field 'showSequenceLogo' - */ - public void setShowSequenceLogo( - final boolean showSequenceLogo) { - this._showSequenceLogo = showSequenceLogo; - this._has_showSequenceLogo = true; - } - - /** - * Sets the value of field 'showText'. - * - * @param showText the value of field 'showText'. - */ - public void setShowText( - final boolean showText) { - this._showText = showText; - this._has_showText = true; - } - - /** - * Sets the value of field 'showUnconserved'. - * - * @param showUnconserved the value of field 'showUnconserved'. - */ - public void setShowUnconserved( - final boolean showUnconserved) { - this._showUnconserved = showUnconserved; - this._has_showUnconserved = true; - } - - /** - * Sets the value of field 'startRes'. - * - * @param startRes the value of field 'startRes'. - */ - public void setStartRes( - final int startRes) { - this._startRes = startRes; - this._has_startRes = true; - } - - /** - * Sets the value of field 'startSeq'. - * - * @param startSeq the value of field 'startSeq'. - */ - public void setStartSeq( - final int startSeq) { - this._startSeq = startSeq; - this._has_startSeq = true; - } - - /** - * Sets the value of field 'textCol1'. - * - * @param textCol1 the value of field 'textCol1'. - */ - public void setTextCol1( - final int textCol1) { - this._textCol1 = textCol1; - this._has_textCol1 = true; - } - - /** - * Sets the value of field 'textCol2'. - * - * @param textCol2 the value of field 'textCol2'. - */ - public void setTextCol2( - final int textCol2) { - this._textCol2 = textCol2; - this._has_textCol2 = true; - } - - /** - * Sets the value of field 'textColThreshold'. - * - * @param textColThreshold the value of field 'textColThreshold' - */ - public void setTextColThreshold( - final int textColThreshold) { - this._textColThreshold = textColThreshold; - this._has_textColThreshold = true; - } - - /** - * Sets the value of field 'title'. - * - * @param title the value of field 'title'. - */ - public void setTitle( - final java.lang.String title) { - this._title = title; - } - - /** - * Sets the value of field 'viewName'. - * - * @param viewName the value of field 'viewName'. - */ - public void setViewName( - final java.lang.String viewName) { - this._viewName = viewName; - } - - /** - * Sets the value of field 'width'. - * - * @param width the value of field 'width'. - */ - public void setWidth( - final int width) { - this._width = width; - this._has_width = true; - } - - /** - * Sets the value of field 'wrapAlignment'. - * - * @param wrapAlignment the value of field 'wrapAlignment'. - */ - public void setWrapAlignment( - final boolean wrapAlignment) { - this._wrapAlignment = wrapAlignment; - this._has_wrapAlignment = true; - } - - /** - * Sets the value of field 'xpos'. - * - * @param xpos the value of field 'xpos'. - */ - public void setXpos( - final int xpos) { - this._xpos = xpos; - this._has_xpos = true; - } - - /** - * Sets the value of field 'ypos'. - * - * @param ypos the value of field 'ypos'. - */ - public void setYpos( - final int ypos) { - this._ypos = ypos; - this._has_ypos = true; - } - - /** - * Method unmarshal. - * - * @param reader - * @throws org.exolab.castor.xml.MarshalException if object is - * null or if any SAXException is thrown during marshaling - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - * @return the unmarshaled - * jalview.schemabinding.version2.Viewport - */ - public static jalview.schemabinding.version2.Viewport unmarshal( - final java.io.Reader reader) - throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { - return (jalview.schemabinding.version2.Viewport) Unmarshaller.unmarshal(jalview.schemabinding.version2.Viewport.class, reader); - } - - /** - * - * - * @throws org.exolab.castor.xml.ValidationException if this - * object is an invalid instance according to the schema - */ - public void validate( - ) - throws org.exolab.castor.xml.ValidationException { - org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); - validator.validate(this); - } + public void deleteStartRes() + { + this._has_startRes = false; + } + + /** + */ + public void deleteStartSeq() + { + this._has_startSeq = false; + } + + /** + */ + public void deleteTextCol1() + { + this._has_textCol1 = false; + } + + /** + */ + public void deleteTextCol2() + { + this._has_textCol2 = false; + } + + /** + */ + public void deleteTextColThreshold() + { + this._has_textColThreshold = false; + } + + /** + */ + public void deleteWidth() + { + this._has_width = false; + } + + /** + */ + public void deleteWrapAlignment() + { + this._has_wrapAlignment = false; + } + + /** + */ + public void deleteXpos() + { + this._has_xpos = false; + } + + /** + */ + public void deleteYpos() + { + this._has_ypos = false; + } + + /** + * Method enumerateCalcIdParam. + * + * @return an Enumeration over all jalview.schemabinding.version2.CalcIdParam + * elements + */ + public java.util.Enumeration enumerateCalcIdParam() + { + return this._calcIdParamList.elements(); + } + + /** + * Method enumerateHiddenColumns. + * + * @return an Enumeration over all + * jalview.schemabinding.version2.HiddenColumns elements + */ + public java.util.Enumeration enumerateHiddenColumns() + { + return this._hiddenColumnsList.elements(); + } + + /** + * Returns the value of field 'annotationColours'. + * + * @return the value of field 'AnnotationColours'. + */ + public jalview.schemabinding.version2.AnnotationColours getAnnotationColours() + { + return this._annotationColours; + } + + /** + * Returns the value of field 'bgColour'. + * + * @return the value of field 'BgColour'. + */ + public java.lang.String getBgColour() + { + return this._bgColour; + } + + /** + * Method getCalcIdParam. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.CalcIdParam at the + * given index + */ + public jalview.schemabinding.version2.CalcIdParam getCalcIdParam( + final int index) throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._calcIdParamList.size()) + { + throw new IndexOutOfBoundsException("getCalcIdParam: Index value '" + + index + "' not in range [0.." + + (this._calcIdParamList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.CalcIdParam) _calcIdParamList + .get(index); + } + + /** + * Method getCalcIdParam.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 jalview.schemabinding.version2.CalcIdParam[] getCalcIdParam() + { + jalview.schemabinding.version2.CalcIdParam[] array = new jalview.schemabinding.version2.CalcIdParam[0]; + return (jalview.schemabinding.version2.CalcIdParam[]) this._calcIdParamList + .toArray(array); + } + + /** + * Method getCalcIdParamCount. + * + * @return the size of this collection + */ + public int getCalcIdParamCount() + { + return this._calcIdParamList.size(); + } + + /** + * Returns the value of field 'centreColumnLabels'. + * + * @return the value of field 'CentreColumnLabels'. + */ + public boolean getCentreColumnLabels() + { + return this._centreColumnLabels; + } + + /** + * Returns the value of field 'complementId'. The field 'complementId' has the + * following description: The viewport id of this viewport's (cdna/protein) + * coding complement, if any + * + * + * @return the value of field 'ComplementId'. + */ + public java.lang.String getComplementId() + { + return this._complementId; + } + + /** + * Returns the value of field 'consThreshold'. + * + * @return the value of field 'ConsThreshold'. + */ + public int getConsThreshold() + { + return this._consThreshold; + } + + /** + * Returns the value of field 'conservationSelected'. + * + * @return the value of field 'ConservationSelected'. + */ + public boolean getConservationSelected() + { + return this._conservationSelected; + } + + /** + * Returns the value of field 'followHighlight'. + * + * @return the value of field 'FollowHighlight'. + */ + public boolean getFollowHighlight() + { + return this._followHighlight; + } + + /** + * Returns the value of field 'followSelection'. + * + * @return the value of field 'FollowSelection'. + */ + public boolean getFollowSelection() + { + return this._followSelection; + } + + /** + * Returns the value of field 'fontName'. + * + * @return the value of field 'FontName'. + */ + public java.lang.String getFontName() + { + return this._fontName; + } + + /** + * Returns the value of field 'fontSize'. + * + * @return the value of field 'FontSize'. + */ + public int getFontSize() + { + return this._fontSize; + } + + /** + * Returns the value of field 'fontStyle'. + * + * @return the value of field 'FontStyle'. + */ + public int getFontStyle() + { + return this._fontStyle; + } + + /** + * Returns the value of field 'gatheredViews'. + * + * @return the value of field 'GatheredViews'. + */ + public boolean getGatheredViews() + { + return this._gatheredViews; + } + + /** + * Returns the value of field 'height'. + * + * @return the value of field 'Height'. + */ + public int getHeight() + { + return this._height; + } + + /** + * Method getHiddenColumns. + * + * @param index + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + * @return the value of the jalview.schemabinding.version2.HiddenColumns at + * the given index + */ + public jalview.schemabinding.version2.HiddenColumns getHiddenColumns( + final int index) throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._hiddenColumnsList.size()) + { + throw new IndexOutOfBoundsException("getHiddenColumns: Index value '" + + index + "' not in range [0.." + + (this._hiddenColumnsList.size() - 1) + "]"); + } + + return (jalview.schemabinding.version2.HiddenColumns) _hiddenColumnsList + .get(index); + } + + /** + * Method getHiddenColumns.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 jalview.schemabinding.version2.HiddenColumns[] getHiddenColumns() + { + jalview.schemabinding.version2.HiddenColumns[] array = new jalview.schemabinding.version2.HiddenColumns[0]; + return (jalview.schemabinding.version2.HiddenColumns[]) this._hiddenColumnsList + .toArray(array); + } + + /** + * Method getHiddenColumnsCount. + * + * @return the size of this collection + */ + public int getHiddenColumnsCount() + { + return this._hiddenColumnsList.size(); + } + + /** + * Returns the value of field 'id'. The field 'id' has the following + * description: unique id used by jalview to synchronize between stored and + * instantiated views + * + * + * @return the value of field 'Id'. + */ + public java.lang.String getId() + { + return this._id; + } + + /** + * Returns the value of field 'ignoreGapsinConsensus'. + * + * @return the value of field 'IgnoreGapsinConsensus'. + */ + public boolean getIgnoreGapsinConsensus() + { + return this._ignoreGapsinConsensus; + } + + /** + * Returns the value of field 'normaliseSequenceLogo'. + * + * @return the value of field 'NormaliseSequenceLogo'. + */ + public boolean getNormaliseSequenceLogo() + { + return this._normaliseSequenceLogo; + } + + /** + * Returns the value of field 'pidSelected'. + * + * @return the value of field 'PidSelected'. + */ + public boolean getPidSelected() + { + return this._pidSelected; + } + + /** + * Returns the value of field 'pidThreshold'. + * + * @return the value of field 'PidThreshold'. + */ + public int getPidThreshold() + { + return this._pidThreshold; + } + + /** + * Returns the value of field 'renderGaps'. + * + * @return the value of field 'RenderGaps'. + */ + public boolean getRenderGaps() + { + return this._renderGaps; + } + + /** + * Returns the value of field 'rightAlignIds'. + * + * @return the value of field 'RightAlignIds'. + */ + public boolean getRightAlignIds() + { + return this._rightAlignIds; + } + + /** + * Returns the value of field 'scaleProteinAsCdna'. + * + * @return the value of field 'ScaleProteinAsCdna'. + */ + public boolean getScaleProteinAsCdna() + { + return this._scaleProteinAsCdna; + } + + /** + * Returns the value of field 'sequenceSetId'. + * + * @return the value of field 'SequenceSetId'. + */ + public java.lang.String getSequenceSetId() + { + return this._sequenceSetId; + } + + /** + * Returns the value of field 'showAnnotation'. + * + * @return the value of field 'ShowAnnotation'. + */ + public boolean getShowAnnotation() + { + return this._showAnnotation; + } + + /** + * Returns the value of field 'showBoxes'. + * + * @return the value of field 'ShowBoxes'. + */ + public boolean getShowBoxes() + { + return this._showBoxes; + } + + /** + * Returns the value of field 'showColourText'. + * + * @return the value of field 'ShowColourText'. + */ + public boolean getShowColourText() + { + return this._showColourText; + } + + /** + * Returns the value of field 'showConsensusHistogram'. + * + * @return the value of field 'ShowConsensusHistogram'. + */ + public boolean getShowConsensusHistogram() + { + return this._showConsensusHistogram; + } + + /** + * Returns the value of field 'showDbRefTooltip'. + * + * @return the value of field 'ShowDbRefTooltip'. + */ + public boolean getShowDbRefTooltip() + { + return this._showDbRefTooltip; + } + + /** + * Returns the value of field 'showFullId'. + * + * @return the value of field 'ShowFullId'. + */ + public boolean getShowFullId() + { + return this._showFullId; + } + + /** + * Returns the value of field 'showGroupConsensus'. + * + * @return the value of field 'ShowGroupConsensus'. + */ + public boolean getShowGroupConsensus() + { + return this._showGroupConsensus; + } + + /** + * Returns the value of field 'showGroupConservation'. + * + * @return the value of field 'ShowGroupConservation'. + */ + public boolean getShowGroupConservation() + { + return this._showGroupConservation; + } + + /** + * Returns the value of field 'showNPfeatureTooltip'. + * + * @return the value of field 'ShowNPfeatureTooltip'. + */ + public boolean getShowNPfeatureTooltip() + { + return this._showNPfeatureTooltip; + } + + /** + * Returns the value of field 'showSequenceFeatures'. + * + * @return the value of field 'ShowSequenceFeatures'. + */ + public boolean getShowSequenceFeatures() + { + return this._showSequenceFeatures; + } + + /** + * Returns the value of field 'showSequenceLogo'. + * + * @return the value of field 'ShowSequenceLogo'. + */ + public boolean getShowSequenceLogo() + { + return this._showSequenceLogo; + } + + /** + * Returns the value of field 'showText'. + * + * @return the value of field 'ShowText'. + */ + public boolean getShowText() + { + return this._showText; + } + + /** + * Returns the value of field 'showUnconserved'. + * + * @return the value of field 'ShowUnconserved'. + */ + public boolean getShowUnconserved() + { + return this._showUnconserved; + } + + /** + * Returns the value of field 'startRes'. + * + * @return the value of field 'StartRes'. + */ + public int getStartRes() + { + return this._startRes; + } + + /** + * Returns the value of field 'startSeq'. + * + * @return the value of field 'StartSeq'. + */ + public int getStartSeq() + { + return this._startSeq; + } + + /** + * Returns the value of field 'textCol1'. + * + * @return the value of field 'TextCol1'. + */ + public int getTextCol1() + { + return this._textCol1; + } + + /** + * Returns the value of field 'textCol2'. + * + * @return the value of field 'TextCol2'. + */ + public int getTextCol2() + { + return this._textCol2; + } + + /** + * Returns the value of field 'textColThreshold'. + * + * @return the value of field 'TextColThreshold'. + */ + public int getTextColThreshold() + { + return this._textColThreshold; + } + + /** + * Returns the value of field 'title'. + * + * @return the value of field 'Title'. + */ + public java.lang.String getTitle() + { + return this._title; + } + + /** + * Returns the value of field 'viewName'. + * + * @return the value of field 'ViewName'. + */ + public java.lang.String getViewName() + { + return this._viewName; + } + + /** + * Returns the value of field 'width'. + * + * @return the value of field 'Width'. + */ + public int getWidth() + { + return this._width; + } + + /** + * Returns the value of field 'wrapAlignment'. + * + * @return the value of field 'WrapAlignment'. + */ + public boolean getWrapAlignment() + { + return this._wrapAlignment; + } + + /** + * Returns the value of field 'xpos'. + * + * @return the value of field 'Xpos'. + */ + public int getXpos() + { + return this._xpos; + } + + /** + * Returns the value of field 'ypos'. + * + * @return the value of field 'Ypos'. + */ + public int getYpos() + { + return this._ypos; + } + + /** + * Method hasCentreColumnLabels. + * + * @return true if at least one CentreColumnLabels has been adde + */ + public boolean hasCentreColumnLabels() + { + return this._has_centreColumnLabels; + } + + /** + * Method hasConsThreshold. + * + * @return true if at least one ConsThreshold has been added + */ + public boolean hasConsThreshold() + { + return this._has_consThreshold; + } + + /** + * Method hasConservationSelected. + * + * @return true if at least one ConservationSelected has been added + */ + public boolean hasConservationSelected() + { + return this._has_conservationSelected; + } + + /** + * Method hasFollowHighlight. + * + * @return true if at least one FollowHighlight has been added + */ + public boolean hasFollowHighlight() + { + return this._has_followHighlight; + } + + /** + * Method hasFollowSelection. + * + * @return true if at least one FollowSelection has been added + */ + public boolean hasFollowSelection() + { + return this._has_followSelection; + } + + /** + * Method hasFontSize. + * + * @return true if at least one FontSize has been added + */ + public boolean hasFontSize() + { + return this._has_fontSize; + } + + /** + * Method hasFontStyle. + * + * @return true if at least one FontStyle has been added + */ + public boolean hasFontStyle() + { + return this._has_fontStyle; + } + + /** + * Method hasGatheredViews. + * + * @return true if at least one GatheredViews has been added + */ + public boolean hasGatheredViews() + { + return this._has_gatheredViews; + } + + /** + * Method hasHeight. + * + * @return true if at least one Height has been added + */ + public boolean hasHeight() + { + return this._has_height; + } + + /** + * Method hasIgnoreGapsinConsensus. + * + * @return true if at least one IgnoreGapsinConsensus has been added + */ + public boolean hasIgnoreGapsinConsensus() + { + return this._has_ignoreGapsinConsensus; + } + + /** + * Method hasNormaliseSequenceLogo. + * + * @return true if at least one NormaliseSequenceLogo has been added + */ + public boolean hasNormaliseSequenceLogo() + { + return this._has_normaliseSequenceLogo; + } + + /** + * Method hasPidSelected. + * + * @return true if at least one PidSelected has been added + */ + public boolean hasPidSelected() + { + return this._has_pidSelected; + } + + /** + * Method hasPidThreshold. + * + * @return true if at least one PidThreshold has been added + */ + public boolean hasPidThreshold() + { + return this._has_pidThreshold; + } + + /** + * Method hasRenderGaps. + * + * @return true if at least one RenderGaps has been added + */ + public boolean hasRenderGaps() + { + return this._has_renderGaps; + } + + /** + * Method hasRightAlignIds. + * + * @return true if at least one RightAlignIds has been added + */ + public boolean hasRightAlignIds() + { + return this._has_rightAlignIds; + } + + /** + * Method hasScaleProteinAsCdna. + * + * @return true if at least one ScaleProteinAsCdna has been adde + */ + public boolean hasScaleProteinAsCdna() + { + return this._has_scaleProteinAsCdna; + } + + /** + * Method hasShowAnnotation. + * + * @return true if at least one ShowAnnotation has been added + */ + public boolean hasShowAnnotation() + { + return this._has_showAnnotation; + } + + /** + * Method hasShowBoxes. + * + * @return true if at least one ShowBoxes has been added + */ + public boolean hasShowBoxes() + { + return this._has_showBoxes; + } + + /** + * Method hasShowColourText. + * + * @return true if at least one ShowColourText has been added + */ + public boolean hasShowColourText() + { + return this._has_showColourText; + } + + /** + * Method hasShowConsensusHistogram. + * + * @return true if at least one ShowConsensusHistogram has been added + */ + public boolean hasShowConsensusHistogram() + { + return this._has_showConsensusHistogram; + } + + /** + * Method hasShowDbRefTooltip. + * + * @return true if at least one ShowDbRefTooltip has been added + */ + public boolean hasShowDbRefTooltip() + { + return this._has_showDbRefTooltip; + } + + /** + * Method hasShowFullId. + * + * @return true if at least one ShowFullId has been added + */ + public boolean hasShowFullId() + { + return this._has_showFullId; + } + + /** + * Method hasShowGroupConsensus. + * + * @return true if at least one ShowGroupConsensus has been adde + */ + public boolean hasShowGroupConsensus() + { + return this._has_showGroupConsensus; + } + + /** + * Method hasShowGroupConservation. + * + * @return true if at least one ShowGroupConservation has been added + */ + public boolean hasShowGroupConservation() + { + return this._has_showGroupConservation; + } + + /** + * Method hasShowNPfeatureTooltip. + * + * @return true if at least one ShowNPfeatureTooltip has been added + */ + public boolean hasShowNPfeatureTooltip() + { + return this._has_showNPfeatureTooltip; + } + + /** + * Method hasShowSequenceFeatures. + * + * @return true if at least one ShowSequenceFeatures has been added + */ + public boolean hasShowSequenceFeatures() + { + return this._has_showSequenceFeatures; + } + + /** + * Method hasShowSequenceLogo. + * + * @return true if at least one ShowSequenceLogo has been added + */ + public boolean hasShowSequenceLogo() + { + return this._has_showSequenceLogo; + } + + /** + * Method hasShowText. + * + * @return true if at least one ShowText has been added + */ + public boolean hasShowText() + { + return this._has_showText; + } + + /** + * Method hasShowUnconserved. + * + * @return true if at least one ShowUnconserved has been added + */ + public boolean hasShowUnconserved() + { + return this._has_showUnconserved; + } + + /** + * Method hasStartRes. + * + * @return true if at least one StartRes has been added + */ + public boolean hasStartRes() + { + return this._has_startRes; + } + + /** + * Method hasStartSeq. + * + * @return true if at least one StartSeq has been added + */ + public boolean hasStartSeq() + { + return this._has_startSeq; + } + + /** + * Method hasTextCol1. + * + * @return true if at least one TextCol1 has been added + */ + public boolean hasTextCol1() + { + return this._has_textCol1; + } + + /** + * Method hasTextCol2. + * + * @return true if at least one TextCol2 has been added + */ + public boolean hasTextCol2() + { + return this._has_textCol2; + } + + /** + * Method hasTextColThreshold. + * + * @return true if at least one TextColThreshold has been added + */ + public boolean hasTextColThreshold() + { + return this._has_textColThreshold; + } + + /** + * Method hasWidth. + * + * @return true if at least one Width has been added + */ + public boolean hasWidth() + { + return this._has_width; + } + + /** + * Method hasWrapAlignment. + * + * @return true if at least one WrapAlignment has been added + */ + public boolean hasWrapAlignment() + { + return this._has_wrapAlignment; + } + + /** + * Method hasXpos. + * + * @return true if at least one Xpos has been added + */ + public boolean hasXpos() + { + return this._has_xpos; + } + + /** + * Method hasYpos. + * + * @return true if at least one Ypos has been added + */ + public boolean hasYpos() + { + return this._has_ypos; + } + + /** + * Returns the value of field 'centreColumnLabels'. + * + * @return the value of field 'CentreColumnLabels'. + */ + public boolean isCentreColumnLabels() + { + return this._centreColumnLabels; + } + + /** + * Returns the value of field 'conservationSelected'. + * + * @return the value of field 'ConservationSelected'. + */ + public boolean isConservationSelected() + { + return this._conservationSelected; + } + + /** + * Returns the value of field 'followHighlight'. + * + * @return the value of field 'FollowHighlight'. + */ + public boolean isFollowHighlight() + { + return this._followHighlight; + } + + /** + * Returns the value of field 'followSelection'. + * + * @return the value of field 'FollowSelection'. + */ + public boolean isFollowSelection() + { + return this._followSelection; + } + + /** + * Returns the value of field 'gatheredViews'. + * + * @return the value of field 'GatheredViews'. + */ + public boolean isGatheredViews() + { + return this._gatheredViews; + } + + /** + * Returns the value of field 'ignoreGapsinConsensus'. + * + * @return the value of field 'IgnoreGapsinConsensus'. + */ + public boolean isIgnoreGapsinConsensus() + { + return this._ignoreGapsinConsensus; + } + + /** + * Returns the value of field 'normaliseSequenceLogo'. + * + * @return the value of field 'NormaliseSequenceLogo'. + */ + public boolean isNormaliseSequenceLogo() + { + return this._normaliseSequenceLogo; + } + + /** + * Returns the value of field 'pidSelected'. + * + * @return the value of field 'PidSelected'. + */ + public boolean isPidSelected() + { + return this._pidSelected; + } + + /** + * Returns the value of field 'renderGaps'. + * + * @return the value of field 'RenderGaps'. + */ + public boolean isRenderGaps() + { + return this._renderGaps; + } + + /** + * Returns the value of field 'rightAlignIds'. + * + * @return the value of field 'RightAlignIds'. + */ + public boolean isRightAlignIds() + { + return this._rightAlignIds; + } + + /** + * Returns the value of field 'scaleProteinAsCdna'. + * + * @return the value of field 'ScaleProteinAsCdna'. + */ + public boolean isScaleProteinAsCdna() + { + return this._scaleProteinAsCdna; + } + + /** + * Returns the value of field 'showAnnotation'. + * + * @return the value of field 'ShowAnnotation'. + */ + public boolean isShowAnnotation() + { + return this._showAnnotation; + } + + /** + * Returns the value of field 'showBoxes'. + * + * @return the value of field 'ShowBoxes'. + */ + public boolean isShowBoxes() + { + return this._showBoxes; + } + + /** + * Returns the value of field 'showColourText'. + * + * @return the value of field 'ShowColourText'. + */ + public boolean isShowColourText() + { + return this._showColourText; + } + + /** + * Returns the value of field 'showConsensusHistogram'. + * + * @return the value of field 'ShowConsensusHistogram'. + */ + public boolean isShowConsensusHistogram() + { + return this._showConsensusHistogram; + } + + /** + * Returns the value of field 'showDbRefTooltip'. + * + * @return the value of field 'ShowDbRefTooltip'. + */ + public boolean isShowDbRefTooltip() + { + return this._showDbRefTooltip; + } + + /** + * Returns the value of field 'showFullId'. + * + * @return the value of field 'ShowFullId'. + */ + public boolean isShowFullId() + { + return this._showFullId; + } + + /** + * Returns the value of field 'showGroupConsensus'. + * + * @return the value of field 'ShowGroupConsensus'. + */ + public boolean isShowGroupConsensus() + { + return this._showGroupConsensus; + } + + /** + * Returns the value of field 'showGroupConservation'. + * + * @return the value of field 'ShowGroupConservation'. + */ + public boolean isShowGroupConservation() + { + return this._showGroupConservation; + } + + /** + * Returns the value of field 'showNPfeatureTooltip'. + * + * @return the value of field 'ShowNPfeatureTooltip'. + */ + public boolean isShowNPfeatureTooltip() + { + return this._showNPfeatureTooltip; + } + + /** + * Returns the value of field 'showSequenceFeatures'. + * + * @return the value of field 'ShowSequenceFeatures'. + */ + public boolean isShowSequenceFeatures() + { + return this._showSequenceFeatures; + } + + /** + * Returns the value of field 'showSequenceLogo'. + * + * @return the value of field 'ShowSequenceLogo'. + */ + public boolean isShowSequenceLogo() + { + return this._showSequenceLogo; + } + + /** + * Returns the value of field 'showText'. + * + * @return the value of field 'ShowText'. + */ + public boolean isShowText() + { + return this._showText; + } + + /** + * Returns the value of field 'showUnconserved'. + * + * @return the value of field 'ShowUnconserved'. + */ + public boolean isShowUnconserved() + { + return this._showUnconserved; + } + + /** + * 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; + } + + /** + * Returns the value of field 'wrapAlignment'. + * + * @return the value of field 'WrapAlignment'. + */ + public boolean isWrapAlignment() + { + return this._wrapAlignment; + } + + /** + * + * + * @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 removeAllCalcIdParam() + { + this._calcIdParamList.clear(); + } + + /** + */ + public void removeAllHiddenColumns() + { + this._hiddenColumnsList.clear(); + } + + /** + * Method removeCalcIdParam. + * + * @param vCalcIdParam + * @return true if the object was removed from the collection. + */ + public boolean removeCalcIdParam( + final jalview.schemabinding.version2.CalcIdParam vCalcIdParam) + { + boolean removed = _calcIdParamList.remove(vCalcIdParam); + return removed; + } + + /** + * Method removeCalcIdParamAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.CalcIdParam removeCalcIdParamAt( + final int index) + { + java.lang.Object obj = this._calcIdParamList.remove(index); + return (jalview.schemabinding.version2.CalcIdParam) obj; + } + + /** + * Method removeHiddenColumns. + * + * @param vHiddenColumns + * @return true if the object was removed from the collection. + */ + public boolean removeHiddenColumns( + final jalview.schemabinding.version2.HiddenColumns vHiddenColumns) + { + boolean removed = _hiddenColumnsList.remove(vHiddenColumns); + return removed; + } + + /** + * Method removeHiddenColumnsAt. + * + * @param index + * @return the element removed from the collection + */ + public jalview.schemabinding.version2.HiddenColumns removeHiddenColumnsAt( + final int index) + { + java.lang.Object obj = this._hiddenColumnsList.remove(index); + return (jalview.schemabinding.version2.HiddenColumns) obj; + } + + /** + * Sets the value of field 'annotationColours'. + * + * @param annotationColours + * the value of field 'annotationColours'. + */ + public void setAnnotationColours( + final jalview.schemabinding.version2.AnnotationColours annotationColours) + { + this._annotationColours = annotationColours; + } + + /** + * Sets the value of field 'bgColour'. + * + * @param bgColour + * the value of field 'bgColour'. + */ + public void setBgColour(final java.lang.String bgColour) + { + this._bgColour = bgColour; + } + + /** + * + * + * @param index + * @param vCalcIdParam + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setCalcIdParam(final int index, + final jalview.schemabinding.version2.CalcIdParam vCalcIdParam) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._calcIdParamList.size()) + { + throw new IndexOutOfBoundsException("setCalcIdParam: Index value '" + + index + "' not in range [0.." + + (this._calcIdParamList.size() - 1) + "]"); + } + + this._calcIdParamList.set(index, vCalcIdParam); + } + + /** + * + * + * @param vCalcIdParamArray + */ + public void setCalcIdParam( + final jalview.schemabinding.version2.CalcIdParam[] vCalcIdParamArray) + { + // -- copy array + _calcIdParamList.clear(); + + for (int i = 0; i < vCalcIdParamArray.length; i++) + { + this._calcIdParamList.add(vCalcIdParamArray[i]); + } + } + + /** + * Sets the value of field 'centreColumnLabels'. + * + * @param centreColumnLabels + * the value of field 'centreColumnLabels'. + */ + public void setCentreColumnLabels(final boolean centreColumnLabels) + { + this._centreColumnLabels = centreColumnLabels; + this._has_centreColumnLabels = true; + } + + /** + * Sets the value of field 'complementId'. The field 'complementId' has the + * following description: The viewport id of this viewport's (cdna/protein) + * coding complement, if any + * + * + * @param complementId + * the value of field 'complementId'. + */ + public void setComplementId(final java.lang.String complementId) + { + this._complementId = complementId; + } + + /** + * Sets the value of field 'consThreshold'. + * + * @param consThreshold + * the value of field 'consThreshold'. + */ + public void setConsThreshold(final int consThreshold) + { + this._consThreshold = consThreshold; + this._has_consThreshold = true; + } + + /** + * Sets the value of field 'conservationSelected'. + * + * @param conservationSelected + * the value of field 'conservationSelected'. + */ + public void setConservationSelected(final boolean conservationSelected) + { + this._conservationSelected = conservationSelected; + this._has_conservationSelected = true; + } + + /** + * Sets the value of field 'followHighlight'. + * + * @param followHighlight + * the value of field 'followHighlight'. + */ + public void setFollowHighlight(final boolean followHighlight) + { + this._followHighlight = followHighlight; + this._has_followHighlight = true; + } + + /** + * Sets the value of field 'followSelection'. + * + * @param followSelection + * the value of field 'followSelection'. + */ + public void setFollowSelection(final boolean followSelection) + { + this._followSelection = followSelection; + this._has_followSelection = true; + } + + /** + * Sets the value of field 'fontName'. + * + * @param fontName + * the value of field 'fontName'. + */ + public void setFontName(final java.lang.String fontName) + { + this._fontName = fontName; + } + + /** + * Sets the value of field 'fontSize'. + * + * @param fontSize + * the value of field 'fontSize'. + */ + public void setFontSize(final int fontSize) + { + this._fontSize = fontSize; + this._has_fontSize = true; + } + + /** + * Sets the value of field 'fontStyle'. + * + * @param fontStyle + * the value of field 'fontStyle'. + */ + public void setFontStyle(final int fontStyle) + { + this._fontStyle = fontStyle; + this._has_fontStyle = true; + } + + /** + * Sets the value of field 'gatheredViews'. + * + * @param gatheredViews + * the value of field 'gatheredViews'. + */ + public void setGatheredViews(final boolean gatheredViews) + { + this._gatheredViews = gatheredViews; + this._has_gatheredViews = true; + } + + /** + * Sets the value of field 'height'. + * + * @param height + * the value of field 'height'. + */ + public void setHeight(final int height) + { + this._height = height; + this._has_height = true; + } + + /** + * + * + * @param index + * @param vHiddenColumns + * @throws java.lang.IndexOutOfBoundsException + * if the index given is outside the bounds of the collection + */ + public void setHiddenColumns(final int index, + final jalview.schemabinding.version2.HiddenColumns vHiddenColumns) + throws java.lang.IndexOutOfBoundsException + { + // check bounds for index + if (index < 0 || index >= this._hiddenColumnsList.size()) + { + throw new IndexOutOfBoundsException("setHiddenColumns: Index value '" + + index + "' not in range [0.." + + (this._hiddenColumnsList.size() - 1) + "]"); + } + + this._hiddenColumnsList.set(index, vHiddenColumns); + } + + /** + * + * + * @param vHiddenColumnsArray + */ + public void setHiddenColumns( + final jalview.schemabinding.version2.HiddenColumns[] vHiddenColumnsArray) + { + // -- copy array + _hiddenColumnsList.clear(); + + for (int i = 0; i < vHiddenColumnsArray.length; i++) + { + this._hiddenColumnsList.add(vHiddenColumnsArray[i]); + } + } + + /** + * Sets the value of field 'id'. The field 'id' has the following description: + * unique id used by jalview to synchronize between stored and instantiated + * views + * + * + * @param id + * the value of field 'id'. + */ + public void setId(final java.lang.String id) + { + this._id = id; + } + + /** + * Sets the value of field 'ignoreGapsinConsensus'. + * + * @param ignoreGapsinConsensus + * the value of field 'ignoreGapsinConsensus'. + */ + public void setIgnoreGapsinConsensus(final boolean ignoreGapsinConsensus) + { + this._ignoreGapsinConsensus = ignoreGapsinConsensus; + this._has_ignoreGapsinConsensus = true; + } + + /** + * Sets the value of field 'normaliseSequenceLogo'. + * + * @param normaliseSequenceLogo + * the value of field 'normaliseSequenceLogo'. + */ + public void setNormaliseSequenceLogo(final boolean normaliseSequenceLogo) + { + this._normaliseSequenceLogo = normaliseSequenceLogo; + this._has_normaliseSequenceLogo = true; + } + + /** + * Sets the value of field 'pidSelected'. + * + * @param pidSelected + * the value of field 'pidSelected'. + */ + public void setPidSelected(final boolean pidSelected) + { + this._pidSelected = pidSelected; + this._has_pidSelected = true; + } + + /** + * Sets the value of field 'pidThreshold'. + * + * @param pidThreshold + * the value of field 'pidThreshold'. + */ + public void setPidThreshold(final int pidThreshold) + { + this._pidThreshold = pidThreshold; + this._has_pidThreshold = true; + } + + /** + * Sets the value of field 'renderGaps'. + * + * @param renderGaps + * the value of field 'renderGaps'. + */ + public void setRenderGaps(final boolean renderGaps) + { + this._renderGaps = renderGaps; + this._has_renderGaps = true; + } + + /** + * Sets the value of field 'rightAlignIds'. + * + * @param rightAlignIds + * the value of field 'rightAlignIds'. + */ + public void setRightAlignIds(final boolean rightAlignIds) + { + this._rightAlignIds = rightAlignIds; + this._has_rightAlignIds = true; + } + + /** + * Sets the value of field 'scaleProteinAsCdna'. + * + * @param scaleProteinAsCdna + * the value of field 'scaleProteinAsCdna'. + */ + public void setScaleProteinAsCdna(final boolean scaleProteinAsCdna) + { + this._scaleProteinAsCdna = scaleProteinAsCdna; + this._has_scaleProteinAsCdna = true; + } + + /** + * Sets the value of field 'sequenceSetId'. + * + * @param sequenceSetId + * the value of field 'sequenceSetId'. + */ + public void setSequenceSetId(final java.lang.String sequenceSetId) + { + this._sequenceSetId = sequenceSetId; + } + + /** + * Sets the value of field 'showAnnotation'. + * + * @param showAnnotation + * the value of field 'showAnnotation'. + */ + public void setShowAnnotation(final boolean showAnnotation) + { + this._showAnnotation = showAnnotation; + this._has_showAnnotation = true; + } + + /** + * Sets the value of field 'showBoxes'. + * + * @param showBoxes + * the value of field 'showBoxes'. + */ + public void setShowBoxes(final boolean showBoxes) + { + this._showBoxes = showBoxes; + this._has_showBoxes = true; + } + + /** + * Sets the value of field 'showColourText'. + * + * @param showColourText + * the value of field 'showColourText'. + */ + public void setShowColourText(final boolean showColourText) + { + this._showColourText = showColourText; + this._has_showColourText = true; + } + + /** + * Sets the value of field 'showConsensusHistogram'. + * + * @param showConsensusHistogram + * the value of field 'showConsensusHistogram'. + */ + public void setShowConsensusHistogram(final boolean showConsensusHistogram) + { + this._showConsensusHistogram = showConsensusHistogram; + this._has_showConsensusHistogram = true; + } + + /** + * Sets the value of field 'showDbRefTooltip'. + * + * @param showDbRefTooltip + * the value of field 'showDbRefTooltip' + */ + public void setShowDbRefTooltip(final boolean showDbRefTooltip) + { + this._showDbRefTooltip = showDbRefTooltip; + this._has_showDbRefTooltip = true; + } + + /** + * Sets the value of field 'showFullId'. + * + * @param showFullId + * the value of field 'showFullId'. + */ + public void setShowFullId(final boolean showFullId) + { + this._showFullId = showFullId; + this._has_showFullId = true; + } + + /** + * Sets the value of field 'showGroupConsensus'. + * + * @param showGroupConsensus + * the value of field 'showGroupConsensus'. + */ + public void setShowGroupConsensus(final boolean showGroupConsensus) + { + this._showGroupConsensus = showGroupConsensus; + this._has_showGroupConsensus = true; + } + + /** + * Sets the value of field 'showGroupConservation'. + * + * @param showGroupConservation + * the value of field 'showGroupConservation'. + */ + public void setShowGroupConservation(final boolean showGroupConservation) + { + this._showGroupConservation = showGroupConservation; + this._has_showGroupConservation = true; + } + + /** + * Sets the value of field 'showNPfeatureTooltip'. + * + * @param showNPfeatureTooltip + * the value of field 'showNPfeatureTooltip'. + */ + public void setShowNPfeatureTooltip(final boolean showNPfeatureTooltip) + { + this._showNPfeatureTooltip = showNPfeatureTooltip; + this._has_showNPfeatureTooltip = true; + } + + /** + * Sets the value of field 'showSequenceFeatures'. + * + * @param showSequenceFeatures + * the value of field 'showSequenceFeatures'. + */ + public void setShowSequenceFeatures(final boolean showSequenceFeatures) + { + this._showSequenceFeatures = showSequenceFeatures; + this._has_showSequenceFeatures = true; + } + + /** + * Sets the value of field 'showSequenceLogo'. + * + * @param showSequenceLogo + * the value of field 'showSequenceLogo' + */ + public void setShowSequenceLogo(final boolean showSequenceLogo) + { + this._showSequenceLogo = showSequenceLogo; + this._has_showSequenceLogo = true; + } + + /** + * Sets the value of field 'showText'. + * + * @param showText + * the value of field 'showText'. + */ + public void setShowText(final boolean showText) + { + this._showText = showText; + this._has_showText = true; + } + + /** + * Sets the value of field 'showUnconserved'. + * + * @param showUnconserved + * the value of field 'showUnconserved'. + */ + public void setShowUnconserved(final boolean showUnconserved) + { + this._showUnconserved = showUnconserved; + this._has_showUnconserved = true; + } + + /** + * Sets the value of field 'startRes'. + * + * @param startRes + * the value of field 'startRes'. + */ + public void setStartRes(final int startRes) + { + this._startRes = startRes; + this._has_startRes = true; + } + + /** + * Sets the value of field 'startSeq'. + * + * @param startSeq + * the value of field 'startSeq'. + */ + public void setStartSeq(final int startSeq) + { + this._startSeq = startSeq; + this._has_startSeq = true; + } + + /** + * Sets the value of field 'textCol1'. + * + * @param textCol1 + * the value of field 'textCol1'. + */ + public void setTextCol1(final int textCol1) + { + this._textCol1 = textCol1; + this._has_textCol1 = true; + } + + /** + * Sets the value of field 'textCol2'. + * + * @param textCol2 + * the value of field 'textCol2'. + */ + public void setTextCol2(final int textCol2) + { + this._textCol2 = textCol2; + this._has_textCol2 = true; + } + + /** + * Sets the value of field 'textColThreshold'. + * + * @param textColThreshold + * the value of field 'textColThreshold' + */ + public void setTextColThreshold(final int textColThreshold) + { + this._textColThreshold = textColThreshold; + this._has_textColThreshold = true; + } + + /** + * Sets the value of field 'title'. + * + * @param title + * the value of field 'title'. + */ + public void setTitle(final java.lang.String title) + { + this._title = title; + } + + /** + * Sets the value of field 'viewName'. + * + * @param viewName + * the value of field 'viewName'. + */ + public void setViewName(final java.lang.String viewName) + { + this._viewName = viewName; + } + + /** + * Sets the value of field 'width'. + * + * @param width + * the value of field 'width'. + */ + public void setWidth(final int width) + { + this._width = width; + this._has_width = true; + } + + /** + * Sets the value of field 'wrapAlignment'. + * + * @param wrapAlignment + * the value of field 'wrapAlignment'. + */ + public void setWrapAlignment(final boolean wrapAlignment) + { + this._wrapAlignment = wrapAlignment; + this._has_wrapAlignment = true; + } + + /** + * Sets the value of field 'xpos'. + * + * @param xpos + * the value of field 'xpos'. + */ + public void setXpos(final int xpos) + { + this._xpos = xpos; + this._has_xpos = true; + } + + /** + * Sets the value of field 'ypos'. + * + * @param ypos + * the value of field 'ypos'. + */ + public void setYpos(final int ypos) + { + this._ypos = ypos; + this._has_ypos = true; + } + + /** + * Method unmarshal. + * + * @param reader + * @throws org.exolab.castor.xml.MarshalException + * if object is null or if any SAXException is thrown during + * marshaling + * @throws org.exolab.castor.xml.ValidationException + * if this object is an invalid instance according to the schema + * @return the unmarshaled jalview.schemabinding.version2.Viewport + */ + public static jalview.schemabinding.version2.Viewport unmarshal( + final java.io.Reader reader) + throws org.exolab.castor.xml.MarshalException, + org.exolab.castor.xml.ValidationException + { + return (jalview.schemabinding.version2.Viewport) Unmarshaller + .unmarshal(jalview.schemabinding.version2.Viewport.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/WebServiceParameterSet.java b/src/jalview/schemabinding/version2/WebServiceParameterSet.java index 611c981..72d2f82 100644 --- a/src/jalview/schemabinding/version2/WebServiceParameterSet.java +++ b/src/jalview/schemabinding/version2/WebServiceParameterSet.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -19,421 +19,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/AlcodMapDescriptor.java b/src/jalview/schemabinding/version2/descriptors/AlcodMapDescriptor.java index 0d95592..1447978 100644 --- a/src/jalview/schemabinding/version2/descriptors/AlcodMapDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/AlcodMapDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.AlcodMap; @@ -18,217 +18,230 @@ import jalview.schemabinding.version2.AlcodMap; * * @version $Revision$ $Date$ */ -public class AlcodMapDescriptor 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 AlcodMapDescriptor() { - super(); - _nsURI = "www.vamsas.ac.uk/jalview/version2"; - _xmlName = "alcodMap"; - _elementDefinition = true; - - //-- 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 - - //-- _dnasq - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_dnasq", "dnasq", 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 - { - AlcodMap target = (AlcodMap) object; - return target.getDnasq(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - AlcodMap target = (AlcodMap) object; - target.setDnasq( (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: _dnasq - 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 - - //-- _mapping - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Mapping.class, "_mapping", "Mapping", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - AlcodMap target = (AlcodMap) object; - return target.getMapping(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - AlcodMap target = (AlcodMap) object; - target.setMapping( (jalview.schemabinding.version2.Mapping) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.Mapping(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _mapping - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope +public class AlcodMapDescriptor 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 AlcodMapDescriptor() + { + super(); + _nsURI = "www.vamsas.ac.uk/jalview/version2"; + _xmlName = "alcodMap"; + _elementDefinition = true; + + // -- 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 + + // -- _dnasq + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_dnasq", "dnasq", + 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 + { + AlcodMap target = (AlcodMap) object; + return target.getDnasq(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + AlcodMap target = (AlcodMap) object; + target.setDnasq((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - } - - - //-----------/ - //- Methods -/ - //-----------/ + } - /** - * 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.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _dnasq + 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"); } - - /** - * 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.AlcodMap.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; + desc.setValidator(fieldValidator); + // -- initialize element descriptors + + // -- _mapping + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.Mapping.class, "_mapping", + "Mapping", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + AlcodMap target = (AlcodMap) object; + return target.getMapping(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + AlcodMap target = (AlcodMap) object; + target.setMapping((jalview.schemabinding.version2.Mapping) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.Mapping(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _mapping + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope } + 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.AlcodMap.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/schemabinding/version2/descriptors/AlcodonDescriptor.java b/src/jalview/schemabinding/version2/descriptors/AlcodonDescriptor.java index c6be168..c1a0eab 100644 --- a/src/jalview/schemabinding/version2/descriptors/AlcodonDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/AlcodonDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.Alcodon; @@ -18,263 +18,296 @@ import jalview.schemabinding.version2.Alcodon; * * @version $Revision$ $Date$ */ -public class AlcodonDescriptor 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 AlcodonDescriptor() { - super(); - _nsURI = "www.vamsas.ac.uk/jalview/version2"; - _xmlName = "alcodon"; - _elementDefinition = true; - org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; - org.exolab.castor.mapping.FieldHandler handler = null; - org.exolab.castor.xml.FieldValidator fieldValidator = null; - //-- initialize attribute descriptors - - //-- _pos1 - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_pos1", "pos1", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Alcodon target = (Alcodon) object; - if (!target.hasPos1()) { return null; } - return new java.lang.Long(target.getPos1()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Alcodon target = (Alcodon) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deletePos1(); - return; - } - target.setPos1( ((java.lang.Long) value).longValue()); - } 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: _pos1 - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.LongValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.LongValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _pos2 - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_pos2", "pos2", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Alcodon target = (Alcodon) object; - if (!target.hasPos2()) { return null; } - return new java.lang.Long(target.getPos2()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Alcodon target = (Alcodon) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deletePos2(); - return; - } - target.setPos2( ((java.lang.Long) value).longValue()); - } 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: _pos2 - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.LongValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.LongValidator(); - fieldValidator.setValidator(typeValidator); +public class AlcodonDescriptor 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 AlcodonDescriptor() + { + super(); + _nsURI = "www.vamsas.ac.uk/jalview/version2"; + _xmlName = "alcodon"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + // -- initialize attribute descriptors + + // -- _pos1 + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Long.TYPE, "_pos1", "pos1", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Alcodon target = (Alcodon) object; + if (!target.hasPos1()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _pos3 - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_pos3", "pos3", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Alcodon target = (Alcodon) object; - if (!target.hasPos3()) { return null; } - return new java.lang.Long(target.getPos3()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Alcodon target = (Alcodon) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deletePos3(); - return; - } - target.setPos3( ((java.lang.Long) value).longValue()); - } 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: _pos3 - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.LongValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.LongValidator(); - fieldValidator.setValidator(typeValidator); + return new java.lang.Long(target.getPos1()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Alcodon target = (Alcodon) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deletePos1(); + return; + } + target.setPos1(((java.lang.Long) value).longValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + // -- validation code for: _pos1 + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.LongValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.LongValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _pos2 + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Long.TYPE, "_pos2", "pos2", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Alcodon target = (Alcodon) object; + if (!target.hasPos2()) + { + return null; + } + return new java.lang.Long(target.getPos2()); + } - //-----------/ - //- Methods -/ - //-----------/ + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Alcodon target = (Alcodon) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deletePos2(); + return; + } + target.setPos2(((java.lang.Long) value).longValue()); + } 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: _pos2 + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.LongValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.LongValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- _pos3 + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Long.TYPE, "_pos3", "pos3", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Alcodon target = (Alcodon) object; + if (!target.hasPos3()) + { + return null; + } + return new java.lang.Long(target.getPos3()); + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.Alcodon.class; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Alcodon target = (Alcodon) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deletePos3(); + return; + } + target.setPos3(((java.lang.Long) value).longValue()); + } 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: _pos3 + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.LongValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.LongValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors - /** - * 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; - } + // -----------/ + // - Methods -/ + // -----------/ - /** - * Method isElementDefinition. - * - * @return true if XML schema definition of this Class is that - * of a global - * element or element with anonymous type definition. - */ - public boolean isElementDefinition( - ) { - return _elementDefinition; - } + /** + * Method 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.Alcodon.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/schemabinding/version2/descriptors/AlcodonFrameDescriptor.java b/src/jalview/schemabinding/version2/descriptors/AlcodonFrameDescriptor.java index 9d9551a..919941e 100644 --- a/src/jalview/schemabinding/version2/descriptors/AlcodonFrameDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/AlcodonFrameDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.AlcodonFrame; @@ -18,227 +18,250 @@ import jalview.schemabinding.version2.AlcodonFrame; * * @version $Revision$ $Date$ */ -public class AlcodonFrameDescriptor 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 AlcodonFrameDescriptor() { - super(); - _nsURI = "www.vamsas.ac.uk/jalview/version2"; - _xmlName = "AlcodonFrame"; - _elementDefinition = true; - - //-- 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 - - //-- initialize element descriptors - - //-- _alcodonList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Alcodon.class, "_alcodonList", "alcodon", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - AlcodonFrame target = (AlcodonFrame) object; - return target.getAlcodon(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - AlcodonFrame target = (AlcodonFrame) object; - target.addAlcodon( (jalview.schemabinding.version2.Alcodon) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - AlcodonFrame target = (AlcodonFrame) object; - target.removeAllAlcodon(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.Alcodon(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _alcodonList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope +public class AlcodonFrameDescriptor 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 AlcodonFrameDescriptor() + { + super(); + _nsURI = "www.vamsas.ac.uk/jalview/version2"; + _xmlName = "AlcodonFrame"; + _elementDefinition = true; + + // -- 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 + + // -- initialize element descriptors + + // -- _alcodonList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.Alcodon.class, "_alcodonList", + "alcodon", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + AlcodonFrame target = (AlcodonFrame) object; + return target.getAlcodon(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + AlcodonFrame target = (AlcodonFrame) object; + target.addAlcodon((jalview.schemabinding.version2.Alcodon) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _alcodMapList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.AlcodMap.class, "_alcodMapList", "alcodMap", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - AlcodonFrame target = (AlcodonFrame) object; - return target.getAlcodMap(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - AlcodonFrame target = (AlcodonFrame) object; - target.addAlcodMap( (jalview.schemabinding.version2.AlcodMap) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - AlcodonFrame target = (AlcodonFrame) object; - target.removeAllAlcodMap(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.AlcodMap(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _alcodMapList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope + } + + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + AlcodonFrame target = (AlcodonFrame) object; + target.removeAllAlcodon(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.Alcodon(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _alcodonList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + desc.setValidator(fieldValidator); + // -- _alcodMapList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.AlcodMap.class, "_alcodMapList", + "alcodMap", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + AlcodonFrame target = (AlcodonFrame) object; + return target.getAlcodMap(); + } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + AlcodonFrame target = (AlcodonFrame) object; + target.addAlcodMap((jalview.schemabinding.version2.AlcodMap) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - //-----------/ - //- Methods -/ - //-----------/ + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + AlcodonFrame target = (AlcodonFrame) object; + target.removeAllAlcodMap(); + } 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( - ) { - return null; - } + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.AlcodMap(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(true); + 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: _alcodMapList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + desc.setValidator(fieldValidator); + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.AlcodonFrame.class; - } + // -----------/ + // - Methods -/ + // -----------/ - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix( - ) { - return _nsPrefix; - } + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; - } + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return super.getIdentity(); + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; - } + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.AlcodonFrame.class; + } - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; - } + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix() + { + return _nsPrefix; + } - /** - * Method isElementDefinition. - * - * @return true if XML schema definition of this Class is that - * of a global - * element or element with anonymous type definition. - */ - public boolean isElementDefinition( - ) { - return _elementDefinition; - } + /** + * Method 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/schemabinding/version2/descriptors/AnnotationColourSchemeDescriptor.java b/src/jalview/schemabinding/version2/descriptors/AnnotationColourSchemeDescriptor.java index e4ab0ca..804b49e 100644 --- a/src/jalview/schemabinding/version2/descriptors/AnnotationColourSchemeDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/AnnotationColourSchemeDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.AnnotationColourScheme; @@ -18,468 +18,556 @@ import jalview.schemabinding.version2.AnnotationColourScheme; * * @version $Revision$ $Date$ */ -public class AnnotationColourSchemeDescriptor 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 AnnotationColourSchemeDescriptor() { - super(); - _nsURI = "www.jalview.org"; - _xmlName = "AnnotationColourScheme"; - _elementDefinition = false; - org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; - org.exolab.castor.mapping.FieldHandler handler = null; - org.exolab.castor.xml.FieldValidator fieldValidator = null; - //-- initialize attribute descriptors - - //-- _aboveThreshold - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_aboveThreshold", "aboveThreshold", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - AnnotationColourScheme target = (AnnotationColourScheme) object; - if (!target.hasAboveThreshold()) { return null; } - return new java.lang.Integer(target.getAboveThreshold()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - AnnotationColourScheme target = (AnnotationColourScheme) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteAboveThreshold(); - return; - } - target.setAboveThreshold( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _aboveThreshold - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); - } - desc.setValidator(fieldValidator); - //-- _annotation - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_annotation", "annotation", org.exolab.castor.xml.NodeType.Attribute); - desc.setImmutable(true); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - AnnotationColourScheme target = (AnnotationColourScheme) object; - return target.getAnnotation(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - AnnotationColourScheme target = (AnnotationColourScheme) object; - target.setAnnotation( (java.lang.String) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _annotation - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); +public class AnnotationColourSchemeDescriptor 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 AnnotationColourSchemeDescriptor() + { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "AnnotationColourScheme"; + _elementDefinition = false; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + // -- initialize attribute descriptors + + // -- _aboveThreshold + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_aboveThreshold", "aboveThreshold", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + AnnotationColourScheme target = (AnnotationColourScheme) object; + if (!target.hasAboveThreshold()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _minColour - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_minColour", "minColour", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - AnnotationColourScheme target = (AnnotationColourScheme) object; - if (!target.hasMinColour()) { return null; } - return new java.lang.Integer(target.getMinColour()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - AnnotationColourScheme target = (AnnotationColourScheme) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteMinColour(); - return; - } - target.setMinColour( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _minColour - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + return new java.lang.Integer(target.getAboveThreshold()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + AnnotationColourScheme target = (AnnotationColourScheme) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteAboveThreshold(); + return; + } + target.setAboveThreshold(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _maxColour - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_maxColour", "maxColour", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - AnnotationColourScheme target = (AnnotationColourScheme) object; - if (!target.hasMaxColour()) { return null; } - return new java.lang.Integer(target.getMaxColour()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - AnnotationColourScheme target = (AnnotationColourScheme) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteMaxColour(); - return; - } - target.setMaxColour( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _maxColour - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _aboveThreshold + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _annotation + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_annotation", "annotation", + org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + AnnotationColourScheme target = (AnnotationColourScheme) object; + return target.getAnnotation(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + AnnotationColourScheme target = (AnnotationColourScheme) object; + target.setAnnotation((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _colourScheme - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_colourScheme", "colourScheme", org.exolab.castor.xml.NodeType.Attribute); - desc.setImmutable(true); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - AnnotationColourScheme target = (AnnotationColourScheme) object; - return target.getColourScheme(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - AnnotationColourScheme target = (AnnotationColourScheme) object; - target.setColourScheme( (java.lang.String) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _colourScheme - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _annotation + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + // -- _minColour + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_minColour", "minColour", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + AnnotationColourScheme target = (AnnotationColourScheme) object; + if (!target.hasMinColour()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _threshold - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_threshold", "threshold", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - AnnotationColourScheme target = (AnnotationColourScheme) object; - if (!target.hasThreshold()) { return null; } - return new java.lang.Float(target.getThreshold()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - AnnotationColourScheme target = (AnnotationColourScheme) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteThreshold(); - return; - } - target.setThreshold( ((java.lang.Float) value).floatValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _threshold - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.FloatValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive((float) -3.4028235E38); - typeValidator.setMaxInclusive((float) 3.4028235E38); + return new java.lang.Integer(target.getMinColour()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + AnnotationColourScheme target = (AnnotationColourScheme) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteMinColour(); + return; + } + target.setMinColour(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _perSequence - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_perSequence", "perSequence", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - AnnotationColourScheme target = (AnnotationColourScheme) object; - if (!target.hasPerSequence()) { return null; } - return (target.getPerSequence() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - AnnotationColourScheme target = (AnnotationColourScheme) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deletePerSequence(); - return; - } - target.setPerSequence( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _perSequence - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _minColour + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _maxColour + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_maxColour", "maxColour", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + AnnotationColourScheme target = (AnnotationColourScheme) object; + if (!target.hasMaxColour()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _predefinedColours - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_predefinedColours", "predefinedColours", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - AnnotationColourScheme target = (AnnotationColourScheme) object; - if (!target.hasPredefinedColours()) { return null; } - return (target.getPredefinedColours() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - AnnotationColourScheme target = (AnnotationColourScheme) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deletePredefinedColours(); - return; - } - target.setPredefinedColours( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _predefinedColours - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + return new java.lang.Integer(target.getMaxColour()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + AnnotationColourScheme target = (AnnotationColourScheme) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteMaxColour(); + return; + } + target.setMaxColour(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - } + } + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - //-----------/ - //- Methods -/ - //-----------/ + // -- validation code for: _maxColour + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _colourScheme + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_colourScheme", "colourScheme", + org.exolab.castor.xml.NodeType.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + AnnotationColourScheme target = (AnnotationColourScheme) object; + return target.getColourScheme(); + } - /** - * Method getAccessMode. - * - * @return the access mode specified for this class. - */ - public org.exolab.castor.mapping.AccessMode getAccessMode( - ) { + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + AnnotationColourScheme target = (AnnotationColourScheme) object; + target.setColourScheme((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { return null; - } + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - /** - * 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: _colourScheme + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); } + desc.setValidator(fieldValidator); + // -- _threshold + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Float.TYPE, "_threshold", "threshold", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + AnnotationColourScheme target = (AnnotationColourScheme) object; + if (!target.hasThreshold()) + { + return null; + } + return new java.lang.Float(target.getThreshold()); + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.AnnotationColourScheme.class; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + AnnotationColourScheme target = (AnnotationColourScheme) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteThreshold(); + return; + } + target.setThreshold(((java.lang.Float) value).floatValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * 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: _threshold + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.FloatValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive((float) -3.4028235E38); + typeValidator.setMaxInclusive((float) 3.4028235E38); } + desc.setValidator(fieldValidator); + // -- _perSequence + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_perSequence", "perSequence", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + AnnotationColourScheme target = (AnnotationColourScheme) object; + if (!target.hasPerSequence()) + { + return null; + } + return (target.getPerSequence() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } - /** - * 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 + { + AnnotationColourScheme target = (AnnotationColourScheme) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deletePerSequence(); + return; + } + target.setPerSequence(((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _perSequence + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- _predefinedColours + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_predefinedColours", + "predefinedColours", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + AnnotationColourScheme target = (AnnotationColourScheme) object; + if (!target.hasPredefinedColours()) + { + return null; + } + return (target.getPredefinedColours() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } - /** - * 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 + { + AnnotationColourScheme target = (AnnotationColourScheme) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deletePredefinedColours(); + return; + } + target.setPredefinedColours(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _predefinedColours + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors + + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return super.getIdentity(); + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.AnnotationColourScheme.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/schemabinding/version2/descriptors/AnnotationColoursDescriptor.java b/src/jalview/schemabinding/version2/descriptors/AnnotationColoursDescriptor.java index aabd971..f269bdf 100644 --- a/src/jalview/schemabinding/version2/descriptors/AnnotationColoursDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/AnnotationColoursDescriptor.java @@ -7,145 +7,142 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ -import jalview.schemabinding.version2.AnnotationColours; /** * Class AnnotationColoursDescriptor. * * @version $Revision$ $Date$ */ -public class AnnotationColoursDescriptor extends jalview.schemabinding.version2.descriptors.AnnotationColourSchemeDescriptor { - - - //--------------------------/ - //- Class/Member Variables -/ - //--------------------------/ - - /** - * Field _elementDefinition. - */ - private boolean _elementDefinition; - - /** - * Field _nsPrefix. - */ - private java.lang.String _nsPrefix; - - /** - * Field _nsURI. - */ - private java.lang.String _nsURI; - - /** - * Field _xmlName. - */ - private java.lang.String _xmlName; - - - //----------------/ - //- Constructors -/ - //----------------/ - - public AnnotationColoursDescriptor() { - super(); - setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.AnnotationColourSchemeDescriptor()); - _nsURI = "www.jalview.org"; - _xmlName = "AnnotationColours"; - _elementDefinition = true; - } - - - //-----------/ - //- 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.AnnotationColours.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; - } +public class AnnotationColoursDescriptor + extends + jalview.schemabinding.version2.descriptors.AnnotationColourSchemeDescriptor +{ + + // --------------------------/ + // - Class/Member Variables -/ + // --------------------------/ + + /** + * Field _elementDefinition. + */ + private boolean _elementDefinition; + + /** + * Field _nsPrefix. + */ + private java.lang.String _nsPrefix; + + /** + * Field _nsURI. + */ + private java.lang.String _nsURI; + + /** + * Field _xmlName. + */ + private java.lang.String _xmlName; + + // ----------------/ + // - Constructors -/ + // ----------------/ + + public AnnotationColoursDescriptor() + { + super(); + setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.AnnotationColourSchemeDescriptor()); + _nsURI = "www.jalview.org"; + _xmlName = "AnnotationColours"; + _elementDefinition = true; + } + + // -----------/ + // - 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.AnnotationColours.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/schemabinding/version2/descriptors/AnnotationDescriptor.java b/src/jalview/schemabinding/version2/descriptors/AnnotationDescriptor.java index e0a2fd2..e2331f4 100644 --- a/src/jalview/schemabinding/version2/descriptors/AnnotationDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/AnnotationDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.Annotation; @@ -18,1029 +18,1281 @@ import jalview.schemabinding.version2.Annotation; * * @version $Revision$ $Date$ */ -public class AnnotationDescriptor 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 AnnotationDescriptor() { - super(); - _nsURI = "www.vamsas.ac.uk/jalview/version2"; - _xmlName = "Annotation"; - _elementDefinition = true; - - //-- 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 - - //-- _graph - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_graph", "graph", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Annotation target = (Annotation) object; - if (!target.hasGraph()) { return null; } - return (target.getGraph() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - // ignore null values for non optional primitives - if (value == null) { return; } - - target.setGraph( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _graph - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); +public class AnnotationDescriptor 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 AnnotationDescriptor() + { + super(); + _nsURI = "www.vamsas.ac.uk/jalview/version2"; + _xmlName = "Annotation"; + _elementDefinition = true; + + // -- 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 + + // -- _graph + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_graph", "graph", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + if (!target.hasGraph()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _graphType - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_graphType", "graphType", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Annotation target = (Annotation) object; - if (!target.hasGraphType()) { return null; } - return new java.lang.Integer(target.getGraphType()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteGraphType(); - return; - } - target.setGraphType( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _graphType - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + return (target.getGraph() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + // ignore null values for non optional primitives + if (value == null) + { + return; + } + + target.setGraph(((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _sequenceRef - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_sequenceRef", "sequenceRef", 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 - { - Annotation target = (Annotation) object; - return target.getSequenceRef(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - target.setSequenceRef( (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: _sequenceRef - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _graph + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _graphType + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_graphType", "graphType", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + if (!target.hasGraphType()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _groupRef - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_groupRef", "groupRef", 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 - { - Annotation target = (Annotation) object; - return target.getGroupRef(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - target.setGroupRef( (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: _groupRef - 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"); + return new java.lang.Integer(target.getGraphType()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteGraphType(); + return; + } + target.setGraphType(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _graphColour - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_graphColour", "graphColour", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Annotation target = (Annotation) object; - if (!target.hasGraphColour()) { return null; } - return new java.lang.Integer(target.getGraphColour()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteGraphColour(); - return; - } - target.setGraphColour( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _graphColour - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _graphType + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _sequenceRef + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_sequenceRef", "sequenceRef", + 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 + { + Annotation target = (Annotation) object; + return target.getSequenceRef(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + target.setSequenceRef((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _graphGroup - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_graphGroup", "graphGroup", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Annotation target = (Annotation) object; - if (!target.hasGraphGroup()) { return null; } - return new java.lang.Integer(target.getGraphGroup()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteGraphGroup(); - return; - } - target.setGraphGroup( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _graphGroup - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _sequenceRef + 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); + // -- _groupRef + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_groupRef", "groupRef", + 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 + { + Annotation target = (Annotation) object; + return target.getGroupRef(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + target.setGroupRef((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _graphHeight - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_graphHeight", "graphHeight", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Annotation target = (Annotation) object; - if (!target.hasGraphHeight()) { return null; } - return new java.lang.Integer(target.getGraphHeight()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteGraphHeight(); - return; - } - target.setGraphHeight( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _graphHeight - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _groupRef + 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); + // -- _graphColour + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_graphColour", "graphColour", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + if (!target.hasGraphColour()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _id - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", 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 - { - Annotation target = (Annotation) object; - return target.getId(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - target.setId( (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: _id - 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"); + return new java.lang.Integer(target.getGraphColour()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteGraphColour(); + return; + } + target.setGraphColour(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _scoreOnly - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_scoreOnly", "scoreOnly", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Annotation target = (Annotation) object; - if (!target.hasScoreOnly()) { return null; } - return (target.getScoreOnly() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteScoreOnly(); - return; - } - target.setScoreOnly( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _scoreOnly - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _graphColour + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _graphGroup + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_graphGroup", "graphGroup", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + if (!target.hasGraphGroup()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _score - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Double.TYPE, "_score", "score", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Annotation target = (Annotation) object; - if (!target.hasScore()) { return null; } - return new java.lang.Double(target.getScore()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteScore(); - return; - } - target.setScore( ((java.lang.Double) value).doubleValue()); - } 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: _score - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.DoubleValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.DoubleValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-1.7976931348623157E308); - typeValidator.setMaxInclusive(1.7976931348623157E308); + return new java.lang.Integer(target.getGraphGroup()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteGraphGroup(); + return; + } + target.setGraphGroup(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _visible - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_visible", "visible", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Annotation target = (Annotation) object; - if (!target.hasVisible()) { return null; } - return (target.getVisible() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteVisible(); - return; - } - target.setVisible( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _visible - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _graphGroup + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _graphHeight + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_graphHeight", "graphHeight", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + if (!target.hasGraphHeight()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _centreColLabels - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_centreColLabels", "centreColLabels", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Annotation target = (Annotation) object; - if (!target.hasCentreColLabels()) { return null; } - return (target.getCentreColLabels() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteCentreColLabels(); - return; - } - target.setCentreColLabels( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _centreColLabels - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + return new java.lang.Integer(target.getGraphHeight()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteGraphHeight(); + return; + } + target.setGraphHeight(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _scaleColLabels - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_scaleColLabels", "scaleColLabels", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Annotation target = (Annotation) object; - if (!target.hasScaleColLabels()) { return null; } - return (target.getScaleColLabels() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteScaleColLabels(); - return; - } - target.setScaleColLabels( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _scaleColLabels - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _graphHeight + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_id", "id", + 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 + { + Annotation target = (Annotation) object; + return target.getId(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + target.setId((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _showAllColLabels - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showAllColLabels", "showAllColLabels", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Annotation target = (Annotation) object; - if (!target.hasShowAllColLabels()) { return null; } - return (target.getShowAllColLabels() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteShowAllColLabels(); - return; - } - target.setShowAllColLabels( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _showAllColLabels - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _id + 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); + // -- _scoreOnly + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_scoreOnly", "scoreOnly", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + if (!target.hasScoreOnly()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _autoCalculated - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_autoCalculated", "autoCalculated", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Annotation target = (Annotation) object; - if (!target.hasAutoCalculated()) { return null; } - return (target.getAutoCalculated() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteAutoCalculated(); - return; - } - target.setAutoCalculated( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _autoCalculated - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + return (target.getScoreOnly() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteScoreOnly(); + return; + } + target.setScoreOnly(((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _belowAlignment - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_belowAlignment", "belowAlignment", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Annotation target = (Annotation) object; - if (!target.hasBelowAlignment()) { return null; } - return (target.getBelowAlignment() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteBelowAlignment(); - return; - } - target.setBelowAlignment( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _belowAlignment - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _scoreOnly + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _score + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Double.TYPE, "_score", "score", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + if (!target.hasScore()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _calcId - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_calcId", "calcId", 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 - { - Annotation target = (Annotation) object; - return target.getCalcId(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - target.setCalcId( (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: _calcId - 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"); + return new java.lang.Double(target.getScore()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteScore(); + return; + } + target.setScore(((java.lang.Double) value).doubleValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - //-- _annotationElementList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.AnnotationElement.class, "_annotationElementList", "annotationElement", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Annotation target = (Annotation) object; - return target.getAnnotationElement(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - target.addAnnotationElement( (jalview.schemabinding.version2.AnnotationElement) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - Annotation target = (Annotation) object; - target.removeAllAnnotationElement(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.AnnotationElement(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _annotationElementList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _score + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.DoubleValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.DoubleValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-1.7976931348623157E308); + typeValidator.setMaxInclusive(1.7976931348623157E308); + } + desc.setValidator(fieldValidator); + // -- _visible + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_visible", "visible", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + if (!target.hasVisible()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _label - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_label", "label", 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 - { - Annotation target = (Annotation) object; - return target.getLabel(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - target.setLabel( (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.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _label - 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"); + return (target.getVisible() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteVisible(); + return; + } + target.setVisible(((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - 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 - { - Annotation target = (Annotation) object; - return target.getDescription(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) 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.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - 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"); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _visible + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _centreColLabels + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_centreColLabels", "centreColLabels", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + if (!target.hasCentreColLabels()) + { + return null; + } + return (target.getCentreColLabels() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteCentreColLabels(); + return; + } + target.setCentreColLabels(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _thresholdLine - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.ThresholdLine.class, "_thresholdLine", "thresholdLine", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Annotation target = (Annotation) object; - return target.getThresholdLine(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - target.setThresholdLine( (jalview.schemabinding.version2.ThresholdLine) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.ThresholdLine(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _thresholdLine - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _centreColLabels + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _scaleColLabels + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_scaleColLabels", "scaleColLabels", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + if (!target.hasScaleColLabels()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _propertyList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Property.class, "_propertyList", "property", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Annotation target = (Annotation) object; - return target.getProperty(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Annotation target = (Annotation) object; - target.addProperty( (jalview.schemabinding.version2.Property) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - Annotation target = (Annotation) object; - target.removeAllProperty(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.Property(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _propertyList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope + return (target.getScaleColLabels() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteScaleColLabels(); + return; + } + target.setScaleColLabels(((java.lang.Boolean) value) + .booleanValue()); + } 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.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _scaleColLabels + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- _showAllColLabels + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showAllColLabels", + "showAllColLabels", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + if (!target.hasShowAllColLabels()) + { + return null; + } + return (target.getShowAllColLabels() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowAllColLabels(); + return; + } + target.setShowAllColLabels(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - //-----------/ - //- Methods -/ - //-----------/ + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - /** - * Method getAccessMode. - * - * @return the access mode specified for this class. - */ - public org.exolab.castor.mapping.AccessMode getAccessMode( - ) { + // -- validation code for: _showAllColLabels + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _autoCalculated + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_autoCalculated", "autoCalculated", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + if (!target.hasAutoCalculated()) + { + return null; + } + return (target.getAutoCalculated() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteAutoCalculated(); + return; + } + target.setAutoCalculated(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _autoCalculated + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- _belowAlignment + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_belowAlignment", "belowAlignment", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + if (!target.hasBelowAlignment()) + { + return null; + } + return (target.getBelowAlignment() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } - /** - * Method getIdentity. - * - * @return the identity field, null if this class has no - * identity. - */ - public org.exolab.castor.mapping.FieldDescriptor getIdentity( - ) { - return super.getIdentity(); + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteBelowAlignment(); + return; + } + target.setBelowAlignment(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _belowAlignment + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- _calcId + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_calcId", "calcId", + 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 + { + Annotation target = (Annotation) object; + return target.getCalcId(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + target.setCalcId((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); - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.Annotation.class; + // -- validation code for: _calcId + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix( - ) { - return _nsPrefix; + // -- _annotationElementList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.AnnotationElement.class, + "_annotationElementList", "annotationElement", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + return target.getAnnotationElement(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + target.addAnnotationElement((jalview.schemabinding.version2.AnnotationElement) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + target.removeAllAnnotationElement(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.AnnotationElement(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _annotationElementList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + desc.setValidator(fieldValidator); + // -- _label + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_label", "label", + 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 + { + Annotation target = (Annotation) object; + return target.getLabel(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + target.setLabel((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _label + 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); + // -- _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 + { + Annotation target = (Annotation) object; + return target.getDescription(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + target.setDescription((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + 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); + // -- _thresholdLine + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.ThresholdLine.class, + "_thresholdLine", "thresholdLine", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + return target.getThresholdLine(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + target.setThresholdLine((jalview.schemabinding.version2.ThresholdLine) 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 java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.ThresholdLine(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _thresholdLine + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope } + desc.setValidator(fieldValidator); + // -- _propertyList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.Property.class, "_propertyList", + "property", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Annotation target = (Annotation) object; + return target.getProperty(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + target.addProperty((jalview.schemabinding.version2.Property) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + Annotation target = (Annotation) object; + target.removeAllProperty(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.Property(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(true); + addFieldDescriptor(desc); - /** - * 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; + // -- validation code for: _propertyList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + 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.Annotation.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/schemabinding/version2/descriptors/AnnotationElementDescriptor.java b/src/jalview/schemabinding/version2/descriptors/AnnotationElementDescriptor.java index abc0041..4416bbf 100644 --- a/src/jalview/schemabinding/version2/descriptors/AnnotationElementDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/AnnotationElementDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.AnnotationElement; @@ -18,388 +18,447 @@ import jalview.schemabinding.version2.AnnotationElement; * * @version $Revision$ $Date$ */ -public class AnnotationElementDescriptor 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 AnnotationElementDescriptor() { - super(); - _nsURI = "www.vamsas.ac.uk/jalview/version2"; - _xmlName = "annotationElement"; - _elementDefinition = true; - - //-- 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 - - //-- _position - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_position", "position", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - AnnotationElement target = (AnnotationElement) object; - if (!target.hasPosition()) { return null; } - return new java.lang.Integer(target.getPosition()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - AnnotationElement target = (AnnotationElement) object; - // ignore null values for non optional primitives - if (value == null) { return; } - - target.setPosition( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _position - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); - } - desc.setValidator(fieldValidator); - //-- _colour - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_colour", "colour", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - AnnotationElement target = (AnnotationElement) object; - if (!target.hasColour()) { return null; } - return new java.lang.Integer(target.getColour()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - AnnotationElement target = (AnnotationElement) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteColour(); - return; - } - target.setColour( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _colour - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); - } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - //-- _displayCharacter - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_displayCharacter", "displayCharacter", 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 - { - AnnotationElement target = (AnnotationElement) object; - return target.getDisplayCharacter(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - AnnotationElement target = (AnnotationElement) object; - target.setDisplayCharacter( (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.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _displayCharacter - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); +public class AnnotationElementDescriptor 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 AnnotationElementDescriptor() + { + super(); + _nsURI = "www.vamsas.ac.uk/jalview/version2"; + _xmlName = "annotationElement"; + _elementDefinition = true; + + // -- 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 + + // -- _position + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_position", "position", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + AnnotationElement target = (AnnotationElement) object; + if (!target.hasPosition()) + { + return null; } - 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 - { - AnnotationElement target = (AnnotationElement) object; - return target.getDescription(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - AnnotationElement target = (AnnotationElement) 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.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - 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"); + return new java.lang.Integer(target.getPosition()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + AnnotationElement target = (AnnotationElement) object; + // ignore null values for non optional primitives + if (value == null) + { + return; + } + + target.setPosition(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _secondaryStructure - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_secondaryStructure", "secondaryStructure", 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 - { - AnnotationElement target = (AnnotationElement) object; - return target.getSecondaryStructure(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - AnnotationElement target = (AnnotationElement) object; - target.setSecondaryStructure( (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.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _secondaryStructure - 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"); - typeValidator.setLength(1); + } + + 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: _position + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _colour + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_colour", "colour", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + AnnotationElement target = (AnnotationElement) object; + if (!target.hasColour()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _value - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_value", "value", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - AnnotationElement target = (AnnotationElement) object; - if (!target.hasValue()) { return null; } - return new java.lang.Float(target.getValue()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - AnnotationElement target = (AnnotationElement) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteValue(); - return; - } - target.setValue( ((java.lang.Float) value).floatValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _value - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.FloatValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive((float) -3.4028235E38); - typeValidator.setMaxInclusive((float) 3.4028235E38); + return new java.lang.Integer(target.getColour()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + AnnotationElement target = (AnnotationElement) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteColour(); + return; + } + target.setColour(((java.lang.Integer) value).intValue()); + } 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.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _colour + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors + // -- _displayCharacter + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_displayCharacter", + "displayCharacter", 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 + { + AnnotationElement target = (AnnotationElement) object; + return target.getDisplayCharacter(); + } - //-----------/ - //- Methods -/ - //-----------/ + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + AnnotationElement target = (AnnotationElement) object; + target.setDisplayCharacter((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.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + 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: _displayCharacter + 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 + { + AnnotationElement target = (AnnotationElement) object; + return target.getDescription(); + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.AnnotationElement.class; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + AnnotationElement target = (AnnotationElement) 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.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + 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); + // -- _secondaryStructure + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_secondaryStructure", + "secondaryStructure", 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 + { + AnnotationElement target = (AnnotationElement) object; + return target.getSecondaryStructure(); + } - /** - * 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 + { + AnnotationElement target = (AnnotationElement) object; + target.setSecondaryStructure((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.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(false); + addFieldDescriptor(desc); - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; + // -- validation code for: _secondaryStructure + 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"); + typeValidator.setLength(1); } + desc.setValidator(fieldValidator); + // -- _value + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Float.TYPE, "_value", "value", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + AnnotationElement target = (AnnotationElement) object; + if (!target.hasValue()) + { + return null; + } + return new java.lang.Float(target.getValue()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + AnnotationElement target = (AnnotationElement) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteValue(); + return; + } + target.setValue(((java.lang.Float) value).floatValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * 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 java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _value + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.FloatValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive((float) -3.4028235E38); + typeValidator.setMaxInclusive((float) 3.4028235E38); } + 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.AnnotationElement.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/schemabinding/version2/descriptors/CalcIdParamDescriptor.java b/src/jalview/schemabinding/version2/descriptors/CalcIdParamDescriptor.java index 46e867c..6dbea24 100644 --- a/src/jalview/schemabinding/version2/descriptors/CalcIdParamDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/CalcIdParamDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.CalcIdParam; @@ -18,262 +18,296 @@ import jalview.schemabinding.version2.CalcIdParam; * * @version $Revision$ $Date$ */ -public class CalcIdParamDescriptor extends jalview.schemabinding.version2.descriptors.WebServiceParameterSetDescriptor { - - - //--------------------------/ - //- 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 CalcIdParamDescriptor() { - super(); - setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.WebServiceParameterSetDescriptor()); - _nsURI = "www.jalview.org"; - _xmlName = "calcIdParam"; - _elementDefinition = true; - org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; - org.exolab.castor.mapping.FieldHandler handler = null; - org.exolab.castor.xml.FieldValidator fieldValidator = null; - //-- initialize attribute descriptors - - //-- _calcId - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_calcId", "calcId", 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 - { - CalcIdParam target = (CalcIdParam) object; - return target.getCalcId(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - CalcIdParam target = (CalcIdParam) object; - target.setCalcId( (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: _calcId - 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 CalcIdParamDescriptor + extends + jalview.schemabinding.version2.descriptors.WebServiceParameterSetDescriptor +{ + + // --------------------------/ + // - 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 CalcIdParamDescriptor() + { + super(); + setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.WebServiceParameterSetDescriptor()); + _nsURI = "www.jalview.org"; + _xmlName = "calcIdParam"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + // -- initialize attribute descriptors + + // -- _calcId + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_calcId", "calcId", + 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 + { + CalcIdParam target = (CalcIdParam) object; + return target.getCalcId(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + CalcIdParam target = (CalcIdParam) object; + target.setCalcId((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _needsUpdate - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_needsUpdate", "needsUpdate", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - CalcIdParam target = (CalcIdParam) object; - if (!target.hasNeedsUpdate()) { return null; } - return (target.getNeedsUpdate() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - CalcIdParam target = (CalcIdParam) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteNeedsUpdate(); - return; - } - target.setNeedsUpdate( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _needsUpdate - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _calcId + 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); + // -- _needsUpdate + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_needsUpdate", "needsUpdate", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + CalcIdParam target = (CalcIdParam) object; + if (!target.hasNeedsUpdate()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _autoUpdate - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_autoUpdate", "autoUpdate", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - CalcIdParam target = (CalcIdParam) object; - if (!target.hasAutoUpdate()) { return null; } - return (target.getAutoUpdate() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - CalcIdParam target = (CalcIdParam) object; - // ignore null values for non optional primitives - if (value == null) { return; } - - target.setAutoUpdate( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _autoUpdate - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + return (target.getNeedsUpdate() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + CalcIdParam target = (CalcIdParam) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteNeedsUpdate(); + return; + } + target.setNeedsUpdate(((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _needsUpdate + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- _autoUpdate + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_autoUpdate", "autoUpdate", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + CalcIdParam target = (CalcIdParam) object; + if (!target.hasAutoUpdate()) + { + return null; + } + return (target.getAutoUpdate() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + CalcIdParam target = (CalcIdParam) object; + // ignore null values for non optional primitives + if (value == null) + { + return; + } - //-----------/ - //- Methods -/ - //-----------/ + target.setAutoUpdate(((java.lang.Boolean) value).booleanValue()); + } 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.setRequired(true); + 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: _autoUpdate + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.CalcIdParam.class; - } + } - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix( - ) { - return _nsPrefix; - } + // -----------/ + // - Methods -/ + // -----------/ - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; - } + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; - } + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return super.getIdentity(); + } - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; - } + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.CalcIdParam.class; + } - /** - * Method isElementDefinition. - * - * @return true if XML schema definition of this Class is that - * of a global - * element or element with anonymous type definition. - */ - public boolean isElementDefinition( - ) { - return _elementDefinition; - } + /** + * Method 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/schemabinding/version2/descriptors/ColourDescriptor.java b/src/jalview/schemabinding/version2/descriptors/ColourDescriptor.java index 3f6ae2d..8b1ae9e 100644 --- a/src/jalview/schemabinding/version2/descriptors/ColourDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/ColourDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.Colour; @@ -18,500 +18,592 @@ import jalview.schemabinding.version2.Colour; * * @version $Revision$ $Date$ */ -public class ColourDescriptor 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 ColourDescriptor() { - super(); - _xmlName = "colour"; - _elementDefinition = true; - org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; - org.exolab.castor.mapping.FieldHandler handler = null; - org.exolab.castor.xml.FieldValidator fieldValidator = null; - //-- initialize attribute descriptors - - //-- _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 - { - Colour target = (Colour) object; - return target.getName(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Colour target = (Colour) 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.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _name - 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); - //-- _RGB - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_RGB", "RGB", 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 - { - Colour target = (Colour) object; - return target.getRGB(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Colour target = (Colour) object; - target.setRGB( (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: _RGB - 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 ColourDescriptor 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 ColourDescriptor() + { + super(); + _xmlName = "colour"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + // -- initialize attribute descriptors + + // -- _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 + { + Colour target = (Colour) object; + return target.getName(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Colour target = (Colour) object; + target.setName((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _minRGB - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_minRGB", "minRGB", 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 - { - Colour target = (Colour) object; - return target.getMinRGB(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Colour target = (Colour) object; - target.setMinRGB( (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: _minRGB - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _name + 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); + // -- _RGB + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_RGB", "RGB", + 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 + { + Colour target = (Colour) object; + return target.getRGB(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Colour target = (Colour) object; + target.setRGB((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _threshType - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_threshType", "threshType", 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 - { - Colour target = (Colour) object; - return target.getThreshType(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Colour target = (Colour) object; - target.setThreshType( (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: _threshType - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _RGB + 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); + // -- _minRGB + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_minRGB", "minRGB", + 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 + { + Colour target = (Colour) object; + return target.getMinRGB(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Colour target = (Colour) object; + target.setMinRGB((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _threshold - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_threshold", "threshold", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Colour target = (Colour) object; - if (!target.hasThreshold()) { return null; } - return new java.lang.Float(target.getThreshold()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Colour target = (Colour) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteThreshold(); - return; - } - target.setThreshold( ((java.lang.Float) value).floatValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _threshold - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.FloatValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive((float) -3.4028235E38); - typeValidator.setMaxInclusive((float) 3.4028235E38); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _minRGB + 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); + // -- _threshType + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_threshType", "threshType", + 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 + { + Colour target = (Colour) object; + return target.getThreshType(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Colour target = (Colour) object; + target.setThreshType((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _max - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_max", "max", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Colour target = (Colour) object; - if (!target.hasMax()) { return null; } - return new java.lang.Float(target.getMax()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Colour target = (Colour) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteMax(); - return; - } - target.setMax( ((java.lang.Float) value).floatValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _max - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.FloatValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive((float) -3.4028235E38); - typeValidator.setMaxInclusive((float) 3.4028235E38); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _threshType + 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); + // -- _threshold + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Float.TYPE, "_threshold", "threshold", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Colour target = (Colour) object; + if (!target.hasThreshold()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _min - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_min", "min", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Colour target = (Colour) object; - if (!target.hasMin()) { return null; } - return new java.lang.Float(target.getMin()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Colour target = (Colour) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteMin(); - return; - } - target.setMin( ((java.lang.Float) value).floatValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _min - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.FloatValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive((float) -3.4028235E38); - typeValidator.setMaxInclusive((float) 3.4028235E38); + return new java.lang.Float(target.getThreshold()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Colour target = (Colour) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteThreshold(); + return; + } + target.setThreshold(((java.lang.Float) value).floatValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _colourByLabel - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_colourByLabel", "colourByLabel", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Colour target = (Colour) object; - if (!target.hasColourByLabel()) { return null; } - return (target.getColourByLabel() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Colour target = (Colour) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteColourByLabel(); - return; - } - target.setColourByLabel( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _colourByLabel - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _threshold + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.FloatValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive((float) -3.4028235E38); + typeValidator.setMaxInclusive((float) 3.4028235E38); + } + desc.setValidator(fieldValidator); + // -- _max + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Float.TYPE, "_max", "max", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Colour target = (Colour) object; + if (!target.hasMax()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _autoScale - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_autoScale", "autoScale", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Colour target = (Colour) object; - if (!target.hasAutoScale()) { return null; } - return (target.getAutoScale() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Colour target = (Colour) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteAutoScale(); - return; - } - target.setAutoScale( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _autoScale - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + return new java.lang.Float(target.getMax()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Colour target = (Colour) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteMax(); + return; + } + target.setMax(((java.lang.Float) value).floatValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + // -- validation code for: _max + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.FloatValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive((float) -3.4028235E38); + typeValidator.setMaxInclusive((float) 3.4028235E38); + } + desc.setValidator(fieldValidator); + // -- _min + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Float.TYPE, "_min", "min", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Colour target = (Colour) object; + if (!target.hasMin()) + { + return null; + } + return new java.lang.Float(target.getMin()); + } - //-----------/ - //- Methods -/ - //-----------/ + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Colour target = (Colour) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteMin(); + return; + } + target.setMin(((java.lang.Float) value).floatValue()); + } 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: _min + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.FloatValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive((float) -3.4028235E38); + typeValidator.setMaxInclusive((float) 3.4028235E38); } + desc.setValidator(fieldValidator); + // -- _colourByLabel + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_colourByLabel", "colourByLabel", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Colour target = (Colour) object; + if (!target.hasColourByLabel()) + { + return null; + } + return (target.getColourByLabel() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.Colour.class; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Colour target = (Colour) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteColourByLabel(); + return; + } + target.setColourByLabel(((java.lang.Boolean) value) + .booleanValue()); + } 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: _colourByLabel + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- _autoScale + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_autoScale", "autoScale", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Colour target = (Colour) object; + if (!target.hasAutoScale()) + { + return null; + } + return (target.getAutoScale() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } - /** - * 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 + { + Colour target = (Colour) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteAutoScale(); + return; + } + target.setAutoScale(((java.lang.Boolean) value).booleanValue()); + } 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 java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - /** - * 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; + // -- validation code for: _autoScale + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors + + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return super.getIdentity(); + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.Colour.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/schemabinding/version2/descriptors/DBRefDescriptor.java b/src/jalview/schemabinding/version2/descriptors/DBRefDescriptor.java index 00f81d2..e896d7a 100644 --- a/src/jalview/schemabinding/version2/descriptors/DBRefDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/DBRefDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.DBRef; @@ -18,287 +18,316 @@ import jalview.schemabinding.version2.DBRef; * * @version $Revision$ $Date$ */ -public class DBRefDescriptor 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 DBRefDescriptor() { - super(); - _nsURI = "www.vamsas.ac.uk/jalview/version2"; - _xmlName = "DBRef"; - _elementDefinition = true; - - //-- 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 - - //-- _source - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_source", "source", 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 - { - DBRef target = (DBRef) object; - return target.getSource(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - DBRef target = (DBRef) object; - target.setSource( (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: _source - 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); - //-- _version - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_version", "version", 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 - { - DBRef target = (DBRef) object; - return target.getVersion(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - DBRef target = (DBRef) 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); - //-- _accessionId - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_accessionId", "accessionId", 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 - { - DBRef target = (DBRef) object; - return target.getAccessionId(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - DBRef target = (DBRef) object; - target.setAccessionId( (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: _accessionId - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); - } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - //-- _mapping - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Mapping.class, "_mapping", "Mapping", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - DBRef target = (DBRef) object; - return target.getMapping(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - DBRef target = (DBRef) object; - target.setMapping( (jalview.schemabinding.version2.Mapping) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.Mapping(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _mapping - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - } - desc.setValidator(fieldValidator); - } +public class DBRefDescriptor 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; - //-----------/ - //- Methods -/ - //-----------/ + // ----------------/ + // - Constructors -/ + // ----------------/ - /** - * Method getAccessMode. - * - * @return the access mode specified for this class. - */ - public org.exolab.castor.mapping.AccessMode getAccessMode( - ) { + public DBRefDescriptor() + { + super(); + _nsURI = "www.vamsas.ac.uk/jalview/version2"; + _xmlName = "DBRef"; + _elementDefinition = true; + + // -- 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 + + // -- _source + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_source", "source", + 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 + { + DBRef target = (DBRef) object; + return target.getSource(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + DBRef target = (DBRef) object; + target.setSource((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); - /** - * 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: _source + 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); + // -- _version + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_version", "version", + 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 + { + DBRef target = (DBRef) object; + return target.getVersion(); + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.DBRef.class; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + DBRef target = (DBRef) object; + target.setVersion((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: _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); + // -- _accessionId + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_accessionId", "accessionId", + 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 + { + DBRef target = (DBRef) object; + return target.getAccessionId(); + } - /** - * 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 + { + DBRef target = (DBRef) object; + target.setAccessionId((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); - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; + // -- validation code for: _accessionId + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors + + // -- _mapping + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.Mapping.class, "_mapping", + "Mapping", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + DBRef target = (DBRef) object; + return target.getMapping(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + DBRef target = (DBRef) object; + target.setMapping((jalview.schemabinding.version2.Mapping) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.Mapping(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(false); + addFieldDescriptor(desc); - /** - * 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; + // -- validation code for: _mapping + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope } + 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.DBRef.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/schemabinding/version2/descriptors/FeatureDescriptor.java b/src/jalview/schemabinding/version2/descriptors/FeatureDescriptor.java index 019c680..64ed3a5 100644 --- a/src/jalview/schemabinding/version2/descriptors/FeatureDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/FeatureDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.Feature; @@ -18,464 +18,547 @@ import jalview.schemabinding.version2.Feature; * * @version $Revision$ $Date$ */ -public class FeatureDescriptor 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 FeatureDescriptor() { - super(); - _nsURI = "www.jalview.org"; - _xmlName = "feature"; - _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 - - //-- _begin - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_begin", "begin", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Feature target = (Feature) object; - if (!target.hasBegin()) { return null; } - return new java.lang.Integer(target.getBegin()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Feature target = (Feature) object; - // ignore null values for non optional primitives - if (value == null) { return; } - - target.setBegin( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _begin - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); - } - desc.setValidator(fieldValidator); - //-- _end - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_end", "end", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Feature target = (Feature) object; - if (!target.hasEnd()) { return null; } - return new java.lang.Integer(target.getEnd()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Feature target = (Feature) object; - // ignore null values for non optional primitives - if (value == null) { return; } - - target.setEnd( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _end - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); - } - desc.setValidator(fieldValidator); - //-- _type - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_type", "type", 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 - { - Feature target = (Feature) object; - return target.getType(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Feature target = (Feature) object; - target.setType( (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: _type - 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); - //-- _description - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_description", "description", 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 - { - Feature target = (Feature) object; - return target.getDescription(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Feature target = (Feature) 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); - //-- _status - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_status", "status", 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 - { - Feature target = (Feature) object; - return target.getStatus(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Feature target = (Feature) object; - target.setStatus( (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: _status - 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); - //-- _featureGroup - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_featureGroup", "featureGroup", 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 - { - Feature target = (Feature) object; - return target.getFeatureGroup(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Feature target = (Feature) object; - target.setFeatureGroup( (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: _featureGroup - 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); - //-- _score - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_score", "score", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Feature target = (Feature) object; - if (!target.hasScore()) { return null; } - return new java.lang.Float(target.getScore()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Feature target = (Feature) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteScore(); - return; - } - target.setScore( ((java.lang.Float) value).floatValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _score - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.FloatValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive((float) -3.4028235E38); - typeValidator.setMaxInclusive((float) 3.4028235E38); +public class FeatureDescriptor 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 FeatureDescriptor() + { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "feature"; + _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 + + // -- _begin + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_begin", "begin", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Feature target = (Feature) object; + if (!target.hasBegin()) + { + return null; } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - //-- _otherDataList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.OtherData.class, "_otherDataList", "otherData", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Feature target = (Feature) object; - return target.getOtherData(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Feature target = (Feature) object; - target.addOtherData( (jalview.schemabinding.version2.OtherData) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - Feature target = (Feature) object; - target.removeAllOtherData(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.OtherData(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _otherDataList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope + return new java.lang.Integer(target.getBegin()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Feature target = (Feature) object; + // ignore null values for non optional primitives + if (value == null) + { + return; + } + + target.setBegin(((java.lang.Integer) value).intValue()); + } 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: _begin + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- _end + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_end", "end", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Feature target = (Feature) object; + if (!target.hasEnd()) + { + return null; + } + return new java.lang.Integer(target.getEnd()); + } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Feature target = (Feature) object; + // ignore null values for non optional primitives + if (value == null) + { + return; + } - //-----------/ - //- Methods -/ - //-----------/ + target.setEnd(((java.lang.Integer) value).intValue()); + } 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.setRequired(true); + 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: _end + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- _type + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_type", "type", + 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 + { + Feature target = (Feature) object; + return target.getType(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Feature target = (Feature) object; + target.setType((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.Feature.class; + 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: _type + 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); + // -- _description + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_description", "description", + 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 + { + Feature target = (Feature) object; + return target.getDescription(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Feature target = (Feature) 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); + + // -- 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); + // -- _status + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_status", "status", + 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 + { + Feature target = (Feature) object; + return target.getStatus(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Feature target = (Feature) object; + target.setStatus((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _status + 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); + // -- _featureGroup + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_featureGroup", "featureGroup", + 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 + { + Feature target = (Feature) object; + return target.getFeatureGroup(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Feature target = (Feature) object; + target.setFeatureGroup((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _featureGroup + 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); + // -- _score + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Float.TYPE, "_score", "score", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Feature target = (Feature) object; + if (!target.hasScore()) + { + return null; + } + return new java.lang.Float(target.getScore()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Feature target = (Feature) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteScore(); + return; + } + target.setScore(((java.lang.Float) value).floatValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; + // -- validation code for: _score + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.FloatValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive((float) -3.4028235E38); + typeValidator.setMaxInclusive((float) 3.4028235E38); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors - /** - * 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; + // -- _otherDataList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.OtherData.class, + "_otherDataList", "otherData", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Feature target = (Feature) object; + return target.getOtherData(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Feature target = (Feature) object; + target.addOtherData((jalview.schemabinding.version2.OtherData) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + Feature target = (Feature) object; + target.removeAllOtherData(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.OtherData(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _otherDataList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + 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.Feature.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/schemabinding/version2/descriptors/FeatureSettingsDescriptor.java b/src/jalview/schemabinding/version2/descriptors/FeatureSettingsDescriptor.java index 69ed769..44bc256 100644 --- a/src/jalview/schemabinding/version2/descriptors/FeatureSettingsDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/FeatureSettingsDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.FeatureSettings; @@ -18,227 +18,250 @@ import jalview.schemabinding.version2.FeatureSettings; * * @version $Revision$ $Date$ */ -public class FeatureSettingsDescriptor 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 FeatureSettingsDescriptor() { - super(); - _nsURI = "www.jalview.org"; - _xmlName = "FeatureSettings"; - _elementDefinition = true; - - //-- 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 - - //-- initialize element descriptors - - //-- _settingList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Setting.class, "_settingList", "setting", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - FeatureSettings target = (FeatureSettings) object; - return target.getSetting(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - FeatureSettings target = (FeatureSettings) object; - target.addSetting( (jalview.schemabinding.version2.Setting) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - FeatureSettings target = (FeatureSettings) object; - target.removeAllSetting(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.Setting(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _settingList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope +public class FeatureSettingsDescriptor 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 FeatureSettingsDescriptor() + { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "FeatureSettings"; + _elementDefinition = true; + + // -- 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 + + // -- initialize element descriptors + + // -- _settingList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.Setting.class, "_settingList", + "setting", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + FeatureSettings target = (FeatureSettings) object; + return target.getSetting(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + FeatureSettings target = (FeatureSettings) object; + target.addSetting((jalview.schemabinding.version2.Setting) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _groupList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Group.class, "_groupList", "group", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - FeatureSettings target = (FeatureSettings) object; - return target.getGroup(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - FeatureSettings target = (FeatureSettings) object; - target.addGroup( (jalview.schemabinding.version2.Group) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - FeatureSettings target = (FeatureSettings) object; - target.removeAllGroup(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.Group(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _groupList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope + } + + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + FeatureSettings target = (FeatureSettings) object; + target.removeAllSetting(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.Setting(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _settingList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + desc.setValidator(fieldValidator); + // -- _groupList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.Group.class, "_groupList", + "group", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + FeatureSettings target = (FeatureSettings) object; + return target.getGroup(); + } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + FeatureSettings target = (FeatureSettings) object; + target.addGroup((jalview.schemabinding.version2.Group) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - //-----------/ - //- Methods -/ - //-----------/ + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + FeatureSettings target = (FeatureSettings) object; + target.removeAllGroup(); + } 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( - ) { - return null; - } + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.Group(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + 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: _groupList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + desc.setValidator(fieldValidator); + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.FeatureSettings.class; - } + // -----------/ + // - Methods -/ + // -----------/ - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix( - ) { - return _nsPrefix; - } + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; - } + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return super.getIdentity(); + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; - } + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.FeatureSettings.class; + } - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; - } + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix() + { + return _nsPrefix; + } - /** - * Method isElementDefinition. - * - * @return true if XML schema definition of this Class is that - * of a global - * element or element with anonymous type definition. - */ - public boolean isElementDefinition( - ) { - return _elementDefinition; - } + /** + * Method 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/schemabinding/version2/descriptors/FeaturesDescriptor.java b/src/jalview/schemabinding/version2/descriptors/FeaturesDescriptor.java index b292135..5a5b4a9 100644 --- a/src/jalview/schemabinding/version2/descriptors/FeaturesDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/FeaturesDescriptor.java @@ -7,145 +7,141 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ -import jalview.schemabinding.version2.Features; /** * Class FeaturesDescriptor. * * @version $Revision$ $Date$ */ -public class FeaturesDescriptor extends jalview.schemabinding.version2.descriptors.FeatureDescriptor { - - - //--------------------------/ - //- 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 FeaturesDescriptor() { - super(); - setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.FeatureDescriptor()); - _nsURI = "www.jalview.org"; - _xmlName = "features"; - _elementDefinition = true; - } - - - //-----------/ - //- 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.Features.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; - } +public class FeaturesDescriptor extends + jalview.schemabinding.version2.descriptors.FeatureDescriptor +{ + + // --------------------------/ + // - 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 FeaturesDescriptor() + { + super(); + setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.FeatureDescriptor()); + _nsURI = "www.jalview.org"; + _xmlName = "features"; + _elementDefinition = true; + } + + // -----------/ + // - 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.Features.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/schemabinding/version2/descriptors/GroupDescriptor.java b/src/jalview/schemabinding/version2/descriptors/GroupDescriptor.java index 8c03e2e..7aa6203 100644 --- a/src/jalview/schemabinding/version2/descriptors/GroupDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/GroupDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.Group; @@ -18,220 +18,240 @@ import jalview.schemabinding.version2.Group; * * @version $Revision$ $Date$ */ -public class GroupDescriptor 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 GroupDescriptor() { - super(); - _nsURI = "www.jalview.org"; - _xmlName = "group"; - _elementDefinition = true; - org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; - org.exolab.castor.mapping.FieldHandler handler = null; - org.exolab.castor.xml.FieldValidator fieldValidator = null; - //-- initialize attribute descriptors - - //-- _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 - { - Group target = (Group) object; - return target.getName(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Group target = (Group) 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); - //-- _display - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_display", "display", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Group target = (Group) object; - if (!target.hasDisplay()) { return null; } - return (target.getDisplay() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Group target = (Group) object; - // ignore null values for non optional primitives - if (value == null) { return; } - - target.setDisplay( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _display - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); +public class GroupDescriptor 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 GroupDescriptor() + { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "group"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + // -- initialize attribute descriptors + + // -- _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 + { + Group target = (Group) object; + return target.getName(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Group target = (Group) object; + target.setName((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - + } + + 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); + // -- _display + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_display", "display", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Group target = (Group) object; + if (!target.hasDisplay()) + { + return null; + } + return (target.getDisplay() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Group target = (Group) object; + // ignore null values for non optional primitives + if (value == null) + { + return; + } - //-----------/ - //- Methods -/ - //-----------/ + target.setDisplay(((java.lang.Boolean) value).booleanValue()); + } 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.setRequired(true); + 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: _display + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.Group.class; - } + } - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix( - ) { - return _nsPrefix; - } + // -----------/ + // - Methods -/ + // -----------/ - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; - } + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; - } + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return super.getIdentity(); + } - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; - } + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.Group.class; + } - /** - * Method isElementDefinition. - * - * @return true if XML schema definition of this Class is that - * of a global - * element or element with anonymous type definition. - */ - public boolean isElementDefinition( - ) { - return _elementDefinition; - } + /** + * Method 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/schemabinding/version2/descriptors/HiddenColumnsDescriptor.java b/src/jalview/schemabinding/version2/descriptors/HiddenColumnsDescriptor.java index 9408f58..a5607b7 100644 --- a/src/jalview/schemabinding/version2/descriptors/HiddenColumnsDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/HiddenColumnsDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.HiddenColumns; @@ -18,226 +18,247 @@ import jalview.schemabinding.version2.HiddenColumns; * * @version $Revision$ $Date$ */ -public class HiddenColumnsDescriptor 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 HiddenColumnsDescriptor() { - super(); - _nsURI = "www.jalview.org"; - _xmlName = "hiddenColumns"; - _elementDefinition = true; - org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; - org.exolab.castor.mapping.FieldHandler handler = null; - org.exolab.castor.xml.FieldValidator fieldValidator = null; - //-- initialize attribute descriptors - - //-- _start - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_start", "start", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - HiddenColumns target = (HiddenColumns) object; - if (!target.hasStart()) { return null; } - return new java.lang.Integer(target.getStart()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - HiddenColumns target = (HiddenColumns) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteStart(); - return; - } - target.setStart( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _start - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); +public class HiddenColumnsDescriptor 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 HiddenColumnsDescriptor() + { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "hiddenColumns"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + // -- initialize attribute descriptors + + // -- _start + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_start", "start", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + HiddenColumns target = (HiddenColumns) object; + if (!target.hasStart()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _end - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_end", "end", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - HiddenColumns target = (HiddenColumns) object; - if (!target.hasEnd()) { return null; } - return new java.lang.Integer(target.getEnd()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - HiddenColumns target = (HiddenColumns) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteEnd(); - return; - } - target.setEnd( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _end - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + return new java.lang.Integer(target.getStart()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + HiddenColumns target = (HiddenColumns) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteStart(); + return; + } + target.setStart(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - } + } + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - //-----------/ - //- Methods -/ - //-----------/ + // -- validation code for: _start + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _end + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_end", "end", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + HiddenColumns target = (HiddenColumns) object; + if (!target.hasEnd()) + { + return null; + } + return new java.lang.Integer(target.getEnd()); + } - /** - * Method getAccessMode. - * - * @return the access mode specified for this class. - */ - public org.exolab.castor.mapping.AccessMode getAccessMode( - ) { + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + HiddenColumns target = (HiddenColumns) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteEnd(); + return; + } + target.setEnd(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { return null; - } + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - /** - * 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: _end + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.HiddenColumns.class; - } + } - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix( - ) { - return _nsPrefix; - } + // -----------/ + // - Methods -/ + // -----------/ - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; - } + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; - } + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return super.getIdentity(); + } - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; - } + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.HiddenColumns.class; + } - /** - * Method isElementDefinition. - * - * @return true if XML schema definition of this Class is that - * of a global - * element or element with anonymous type definition. - */ - public boolean isElementDefinition( - ) { - return _elementDefinition; - } + /** + * Method 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/schemabinding/version2/descriptors/JGroupDescriptor.java b/src/jalview/schemabinding/version2/descriptors/JGroupDescriptor.java index 0a7316b..620432f 100644 --- a/src/jalview/schemabinding/version2/descriptors/JGroupDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/JGroupDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.JGroup; @@ -18,1007 +18,1258 @@ import jalview.schemabinding.version2.JGroup; * * @version $Revision$ $Date$ */ -public class JGroupDescriptor 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 JGroupDescriptor() { - super(); - _nsURI = "www.jalview.org"; - _xmlName = "JGroup"; - _elementDefinition = true; - - //-- 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 - - //-- _start - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_start", "start", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JGroup target = (JGroup) object; - if (!target.hasStart()) { return null; } - return new java.lang.Integer(target.getStart()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteStart(); - return; - } - target.setStart( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _start - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); +public class JGroupDescriptor 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 JGroupDescriptor() + { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "JGroup"; + _elementDefinition = true; + + // -- 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 + + // -- _start + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_start", "start", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if (!target.hasStart()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _end - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_end", "end", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JGroup target = (JGroup) object; - if (!target.hasEnd()) { return null; } - return new java.lang.Integer(target.getEnd()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteEnd(); - return; - } - target.setEnd( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _end - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + return new java.lang.Integer(target.getStart()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteStart(); + return; + } + target.setStart(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _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 - { - JGroup target = (JGroup) object; - return target.getName(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) 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.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _name - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _start + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _end + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_end", "end", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if (!target.hasEnd()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _colour - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_colour", "colour", 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 - { - JGroup target = (JGroup) object; - return target.getColour(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - target.setColour( (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: _colour - 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"); + return new java.lang.Integer(target.getEnd()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteEnd(); + return; + } + target.setEnd(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _consThreshold - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_consThreshold", "consThreshold", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JGroup target = (JGroup) object; - if (!target.hasConsThreshold()) { return null; } - return new java.lang.Integer(target.getConsThreshold()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteConsThreshold(); - return; - } - target.setConsThreshold( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _consThreshold - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _end + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _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 + { + JGroup target = (JGroup) object; + return target.getName(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + target.setName((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _pidThreshold - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_pidThreshold", "pidThreshold", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JGroup target = (JGroup) object; - if (!target.hasPidThreshold()) { return null; } - return new java.lang.Integer(target.getPidThreshold()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deletePidThreshold(); - return; - } - target.setPidThreshold( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _pidThreshold - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _name + 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); + // -- _colour + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_colour", "colour", + 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 + { + JGroup target = (JGroup) object; + return target.getColour(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + target.setColour((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _outlineColour - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_outlineColour", "outlineColour", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JGroup target = (JGroup) object; - if (!target.hasOutlineColour()) { return null; } - return new java.lang.Integer(target.getOutlineColour()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteOutlineColour(); - return; - } - target.setOutlineColour( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _outlineColour - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _colour + 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); + // -- _consThreshold + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_consThreshold", "consThreshold", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if (!target.hasConsThreshold()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _displayBoxes - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_displayBoxes", "displayBoxes", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JGroup target = (JGroup) object; - if (!target.hasDisplayBoxes()) { return null; } - return (target.getDisplayBoxes() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteDisplayBoxes(); - return; - } - target.setDisplayBoxes( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _displayBoxes - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + return new java.lang.Integer(target.getConsThreshold()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteConsThreshold(); + return; + } + target.setConsThreshold(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _displayText - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_displayText", "displayText", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JGroup target = (JGroup) object; - if (!target.hasDisplayText()) { return null; } - return (target.getDisplayText() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteDisplayText(); - return; - } - target.setDisplayText( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _displayText - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _consThreshold + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _pidThreshold + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_pidThreshold", "pidThreshold", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if (!target.hasPidThreshold()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _colourText - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_colourText", "colourText", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JGroup target = (JGroup) object; - if (!target.hasColourText()) { return null; } - return (target.getColourText() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteColourText(); - return; - } - target.setColourText( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _colourText - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + return new java.lang.Integer(target.getPidThreshold()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deletePidThreshold(); + return; + } + target.setPidThreshold(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _textCol1 - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_textCol1", "textCol1", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JGroup target = (JGroup) object; - if (!target.hasTextCol1()) { return null; } - return new java.lang.Integer(target.getTextCol1()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteTextCol1(); - return; - } - target.setTextCol1( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _textCol1 - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _pidThreshold + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _outlineColour + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_outlineColour", "outlineColour", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if (!target.hasOutlineColour()) + { + return null; + } + return new java.lang.Integer(target.getOutlineColour()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteOutlineColour(); + return; + } + target.setOutlineColour(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _textCol2 - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_textCol2", "textCol2", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JGroup target = (JGroup) object; - if (!target.hasTextCol2()) { return null; } - return new java.lang.Integer(target.getTextCol2()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteTextCol2(); - return; - } - target.setTextCol2( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _textCol2 - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _outlineColour + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _displayBoxes + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_displayBoxes", "displayBoxes", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if (!target.hasDisplayBoxes()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _textColThreshold - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_textColThreshold", "textColThreshold", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JGroup target = (JGroup) object; - if (!target.hasTextColThreshold()) { return null; } - return new java.lang.Integer(target.getTextColThreshold()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteTextColThreshold(); - return; - } - target.setTextColThreshold( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _textColThreshold - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + return (target.getDisplayBoxes() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteDisplayBoxes(); + return; + } + target.setDisplayBoxes(((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _showUnconserved - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showUnconserved", "showUnconserved", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JGroup target = (JGroup) object; - if (!target.hasShowUnconserved()) { return null; } - return (target.getShowUnconserved() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteShowUnconserved(); - return; - } - target.setShowUnconserved( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _showUnconserved - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _displayBoxes + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _displayText + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_displayText", "displayText", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if (!target.hasDisplayText()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _ignoreGapsinConsensus - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_ignoreGapsinConsensus", "ignoreGapsinConsensus", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JGroup target = (JGroup) object; - if (!target.hasIgnoreGapsinConsensus()) { return null; } - return (target.getIgnoreGapsinConsensus() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteIgnoreGapsinConsensus(); - return; - } - target.setIgnoreGapsinConsensus( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _ignoreGapsinConsensus - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + return (target.getDisplayText() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteDisplayText(); + return; + } + target.setDisplayText(((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _showConsensusHistogram - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showConsensusHistogram", "showConsensusHistogram", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JGroup target = (JGroup) object; - if (!target.hasShowConsensusHistogram()) { return null; } - return (target.getShowConsensusHistogram() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteShowConsensusHistogram(); - return; - } - target.setShowConsensusHistogram( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _showConsensusHistogram - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _displayText + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _colourText + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_colourText", "colourText", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if (!target.hasColourText()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _showSequenceLogo - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showSequenceLogo", "showSequenceLogo", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JGroup target = (JGroup) object; - if (!target.hasShowSequenceLogo()) { return null; } - return (target.getShowSequenceLogo() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteShowSequenceLogo(); - return; - } - target.setShowSequenceLogo( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _showSequenceLogo - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + return (target.getColourText() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteColourText(); + return; + } + target.setColourText(((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _normaliseSequenceLogo - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_normaliseSequenceLogo", "normaliseSequenceLogo", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JGroup target = (JGroup) object; - if (!target.hasNormaliseSequenceLogo()) { return null; } - return (target.getNormaliseSequenceLogo() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteNormaliseSequenceLogo(); - return; - } - target.setNormaliseSequenceLogo( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _normaliseSequenceLogo - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _colourText + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _textCol1 + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_textCol1", "textCol1", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if (!target.hasTextCol1()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _id - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", 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 - { - JGroup target = (JGroup) object; - return target.getId(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - target.setId( (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: _id - 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"); + return new java.lang.Integer(target.getTextCol1()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteTextCol1(); + return; + } + target.setTextCol1(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - //-- _seqList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_seqList", "seq", 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 - { - JGroup target = (JGroup) object; - return target.getSeq(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - target.addSeq( (java.lang.String) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - JGroup target = (JGroup) object; - target.removeAllSeq(); - } 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.setNameSpaceURI("www.jalview.org"); - desc.setRequired(true); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _seqList - 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 java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _textCol1 + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _textCol2 + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_textCol2", "textCol2", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if (!target.hasTextCol2()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _annotationColours - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.AnnotationColours.class, "_annotationColours", "annotationColours", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JGroup target = (JGroup) object; - return target.getAnnotationColours(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JGroup target = (JGroup) object; - target.setAnnotationColours( (jalview.schemabinding.version2.AnnotationColours) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.AnnotationColours(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _annotationColours - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope + return new java.lang.Integer(target.getTextCol2()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteTextCol2(); + return; + } + target.setTextCol2(((java.lang.Integer) value).intValue()); + } 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.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _textCol2 + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- _textColThreshold + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_textColThreshold", + "textColThreshold", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if (!target.hasTextColThreshold()) + { + return null; + } + return new java.lang.Integer(target.getTextColThreshold()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteTextColThreshold(); + return; + } + target.setTextColThreshold(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - //-----------/ - //- Methods -/ - //-----------/ + // -- validation code for: _textColThreshold + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _showUnconserved + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showUnconserved", "showUnconserved", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if (!target.hasShowUnconserved()) + { + return null; + } + return (target.getShowUnconserved() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } - /** - * Method getAccessMode. - * - * @return the access mode specified for this class. - */ - public org.exolab.castor.mapping.AccessMode getAccessMode( - ) { + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowUnconserved(); + return; + } + target.setShowUnconserved(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _showUnconserved + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- _ignoreGapsinConsensus + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_ignoreGapsinConsensus", + "ignoreGapsinConsensus", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if (!target.hasIgnoreGapsinConsensus()) + { + return null; + } + return (target.getIgnoreGapsinConsensus() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteIgnoreGapsinConsensus(); + return; + } + target.setIgnoreGapsinConsensus(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - /** - * 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: _ignoreGapsinConsensus + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- _showConsensusHistogram + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showConsensusHistogram", + "showConsensusHistogram", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if (!target.hasShowConsensusHistogram()) + { + return null; + } + return (target.getShowConsensusHistogram() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.JGroup.class; + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowConsensusHistogram(); + return; + } + target.setShowConsensusHistogram(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _showConsensusHistogram + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- _showSequenceLogo + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showSequenceLogo", + "showSequenceLogo", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if (!target.hasShowSequenceLogo()) + { + return null; + } + return (target.getShowSequenceLogo() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowSequenceLogo(); + return; + } + target.setShowSequenceLogo(((java.lang.Boolean) value) + .booleanValue()); + } 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); + + // -- validation code for: _showSequenceLogo + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- _normaliseSequenceLogo + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_normaliseSequenceLogo", + "normaliseSequenceLogo", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JGroup target = (JGroup) object; + if (!target.hasNormaliseSequenceLogo()) + { + return null; + } + return (target.getNormaliseSequenceLogo() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteNormaliseSequenceLogo(); + return; + } + target.setNormaliseSequenceLogo(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; + // -- validation code for: _normaliseSequenceLogo + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_id", "id", + 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 + { + JGroup target = (JGroup) object; + return target.getId(); + } - /** - * 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 + { + JGroup target = (JGroup) object; + target.setId((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: _id + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors + + // -- _seqList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_seqList", "seq", + 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 + { + JGroup target = (JGroup) object; + return target.getSeq(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + target.addSeq((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + target.removeAllSeq(); + } 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.setNameSpaceURI("www.jalview.org"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; + // -- validation code for: _seqList + 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); + // -- _annotationColours + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.AnnotationColours.class, + "_annotationColours", "annotationColours", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JGroup target = (JGroup) object; + return target.getAnnotationColours(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JGroup target = (JGroup) object; + target.setAnnotationColours((jalview.schemabinding.version2.AnnotationColours) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.AnnotationColours(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(false); + addFieldDescriptor(desc); - /** - * 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; + // -- validation code for: _annotationColours + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope } + 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.JGroup.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/schemabinding/version2/descriptors/JSeqDescriptor.java b/src/jalview/schemabinding/version2/descriptors/JSeqDescriptor.java index 44c8caf..0f000bb 100644 --- a/src/jalview/schemabinding/version2/descriptors/JSeqDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/JSeqDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.JSeq; @@ -18,528 +18,642 @@ import jalview.schemabinding.version2.JSeq; * * @version $Revision$ $Date$ */ -public class JSeqDescriptor 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 JSeqDescriptor() { - super(); - _nsURI = "www.jalview.org"; - _xmlName = "JSeq"; - _elementDefinition = true; - - //-- 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 - - //-- _colour - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_colour", "colour", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JSeq target = (JSeq) object; - if (!target.hasColour()) { return null; } - return new java.lang.Integer(target.getColour()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JSeq target = (JSeq) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteColour(); - return; - } - target.setColour( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _colour - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); +public class JSeqDescriptor 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 JSeqDescriptor() + { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "JSeq"; + _elementDefinition = true; + + // -- 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 + + // -- _colour + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_colour", "colour", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JSeq target = (JSeq) object; + if (!target.hasColour()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _start - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_start", "start", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JSeq target = (JSeq) object; - if (!target.hasStart()) { return null; } - return new java.lang.Integer(target.getStart()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JSeq target = (JSeq) object; - // ignore null values for non optional primitives - if (value == null) { return; } - - target.setStart( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _start - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + return new java.lang.Integer(target.getColour()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JSeq target = (JSeq) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteColour(); + return; + } + target.setColour(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _end - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_end", "end", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JSeq target = (JSeq) object; - if (!target.hasEnd()) { return null; } - return new java.lang.Integer(target.getEnd()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JSeq target = (JSeq) object; - // ignore null values for non optional primitives - if (value == null) { return; } - - target.setEnd( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _end - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _colour + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _start + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_start", "start", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JSeq target = (JSeq) object; + if (!target.hasStart()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _id - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", 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 - { - JSeq target = (JSeq) object; - return target.getId(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JSeq target = (JSeq) object; - target.setId( (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: _id - 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"); + return new java.lang.Integer(target.getStart()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JSeq target = (JSeq) object; + // ignore null values for non optional primitives + if (value == null) + { + return; + } + + target.setStart(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _hidden - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_hidden", "hidden", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JSeq target = (JSeq) object; - if (!target.hasHidden()) { return null; } - return (target.getHidden() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JSeq target = (JSeq) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteHidden(); - return; - } - target.setHidden( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _hidden - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _start + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _end + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_end", "end", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JSeq target = (JSeq) object; + if (!target.hasEnd()) + { + return null; } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - //-- _featuresList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Features.class, "_featuresList", "features", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JSeq target = (JSeq) object; - return target.getFeatures(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JSeq target = (JSeq) object; - target.addFeatures( (jalview.schemabinding.version2.Features) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - JSeq target = (JSeq) object; - target.removeAllFeatures(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.Features(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _featuresList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope + return new java.lang.Integer(target.getEnd()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JSeq target = (JSeq) object; + // ignore null values for non optional primitives + if (value == null) + { + return; + } + + target.setEnd(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _pdbidsList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Pdbids.class, "_pdbidsList", "pdbids", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JSeq target = (JSeq) object; - return target.getPdbids(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JSeq target = (JSeq) object; - target.addPdbids( (jalview.schemabinding.version2.Pdbids) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - JSeq target = (JSeq) object; - target.removeAllPdbids(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.Pdbids(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _pdbidsList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope + } + + 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: _end + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_id", "id", + 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 + { + JSeq target = (JSeq) object; + return target.getId(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JSeq target = (JSeq) object; + target.setId((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _hiddenSequencesList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_hiddenSequencesList", "hiddenSequences", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JSeq target = (JSeq) object; - return target.getHiddenSequences(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JSeq target = (JSeq) object; - // ignore null values for non optional primitives - if (value == null) { return; } - - target.addHiddenSequences( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - JSeq target = (JSeq) object; - target.removeAllHiddenSequences(); - } 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.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _hiddenSequencesList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _id + 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); + // -- _hidden + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_hidden", "hidden", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JSeq target = (JSeq) object; + if (!target.hasHidden()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _rnaViewerList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.RnaViewer.class, "_rnaViewerList", "rnaViewer", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JSeq target = (JSeq) object; - return target.getRnaViewer(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JSeq target = (JSeq) object; - target.addRnaViewer( (jalview.schemabinding.version2.RnaViewer) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - JSeq target = (JSeq) object; - target.removeAllRnaViewer(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.RnaViewer(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _rnaViewerList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope + return (target.getHidden() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JSeq target = (JSeq) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteHidden(); + return; + } + target.setHidden(((java.lang.Boolean) value).booleanValue()); + } 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.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _hidden + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors + // -- _featuresList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.Features.class, "_featuresList", + "features", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JSeq target = (JSeq) object; + return target.getFeatures(); + } - //-----------/ - //- Methods -/ - //-----------/ + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JSeq target = (JSeq) object; + target.addFeatures((jalview.schemabinding.version2.Features) 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( - ) { - return null; - } + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + JSeq target = (JSeq) object; + target.removeAllFeatures(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getIdentity. - * - * @return the identity field, null if this class has no - * identity. - */ - public org.exolab.castor.mapping.FieldDescriptor getIdentity( - ) { - return super.getIdentity(); - } + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.Features(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.JSeq.class; + // -- validation code for: _featuresList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + desc.setValidator(fieldValidator); + // -- _pdbidsList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.Pdbids.class, "_pdbidsList", + "pdbids", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JSeq target = (JSeq) object; + return target.getPdbids(); + } - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix( - ) { - return _nsPrefix; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JSeq target = (JSeq) object; + target.addPdbids((jalview.schemabinding.version2.Pdbids) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; - } + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + JSeq target = (JSeq) object; + target.removeAllPdbids(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.Pdbids(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _pdbidsList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + desc.setValidator(fieldValidator); + // -- _hiddenSequencesList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_hiddenSequencesList", + "hiddenSequences", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JSeq target = (JSeq) object; + return target.getHiddenSequences(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JSeq target = (JSeq) object; + // ignore null values for non optional primitives + if (value == null) + { + return; + } + + target.addHiddenSequences(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + JSeq target = (JSeq) object; + target.removeAllHiddenSequences(); + } 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 java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _hiddenSequencesList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- _rnaViewerList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.RnaViewer.class, + "_rnaViewerList", "rnaViewer", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JSeq target = (JSeq) object; + return target.getRnaViewer(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JSeq target = (JSeq) object; + target.addRnaViewer((jalview.schemabinding.version2.RnaViewer) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * 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 resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + JSeq target = (JSeq) object; + target.removeAllRnaViewer(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.RnaViewer(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _rnaViewerList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + 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.JSeq.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/schemabinding/version2/descriptors/JalviewModelDescriptor.java b/src/jalview/schemabinding/version2/descriptors/JalviewModelDescriptor.java index d52f02d..f400c2c 100644 --- a/src/jalview/schemabinding/version2/descriptors/JalviewModelDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/JalviewModelDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.JalviewModel; @@ -18,293 +18,324 @@ import jalview.schemabinding.version2.JalviewModel; * * @version $Revision$ $Date$ */ -public class JalviewModelDescriptor 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 JalviewModelDescriptor() { - super(); - _nsURI = "www.jalview.org"; - _xmlName = "JalviewModel"; - _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 - - //-- initialize element descriptors - - //-- _creationDate - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.util.Date.class, "_creationDate", "creationDate", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JalviewModel target = (JalviewModel) object; - return target.getCreationDate(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JalviewModel target = (JalviewModel) object; - target.setCreationDate( (java.util.Date) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new java.util.Date(); - } - }; - handler = new org.exolab.castor.xml.handlers.DateFieldHandler(handler); - desc.setImmutable(true); - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _creationDate - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.DateTimeValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.DateTimeValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _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 - { - JalviewModel target = (JalviewModel) object; - return target.getVersion(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JalviewModel target = (JalviewModel) 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.setNameSpaceURI("www.jalview.org"); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _version - 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); - //-- _vamsasModel - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.VamsasModel.class, "_vamsasModel", "vamsasModel", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JalviewModel target = (JalviewModel) object; - return target.getVamsasModel(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JalviewModel target = (JalviewModel) object; - target.setVamsasModel( (jalview.schemabinding.version2.VamsasModel) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.VamsasModel(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _vamsasModel - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - } - desc.setValidator(fieldValidator); - //-- _jalviewModelSequence - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.JalviewModelSequence.class, "_jalviewModelSequence", "-error-if-this-is-used-", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JalviewModel target = (JalviewModel) object; - return target.getJalviewModelSequence(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JalviewModel target = (JalviewModel) object; - target.setJalviewModelSequence( (jalview.schemabinding.version2.JalviewModelSequence) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.JalviewModelSequence(); - } - }; - desc.setHandler(handler); - desc.setContainer(true); - desc.setClassDescriptor(new jalview.schemabinding.version2.descriptors.JalviewModelSequenceDescriptor()); - desc.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _jalviewModelSequence - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope +public class JalviewModelDescriptor 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 JalviewModelDescriptor() + { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "JalviewModel"; + _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 + + // -- initialize element descriptors + + // -- _creationDate + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.util.Date.class, "_creationDate", "creationDate", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JalviewModel target = (JalviewModel) object; + return target.getCreationDate(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JalviewModel target = (JalviewModel) object; + target.setCreationDate((java.util.Date) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - } + } + public java.lang.Object newInstance(java.lang.Object parent) + { + return new java.util.Date(); + } + }; + handler = new org.exolab.castor.xml.handlers.DateFieldHandler(handler); + desc.setImmutable(true); + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); - //-----------/ - //- Methods -/ - //-----------/ + // -- validation code for: _creationDate + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope + org.exolab.castor.xml.validators.DateTimeValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.DateTimeValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _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 + { + JalviewModel target = (JalviewModel) object; + return target.getVersion(); + } - /** - * Method getAccessMode. - * - * @return the access mode specified for this class. - */ - public org.exolab.castor.mapping.AccessMode getAccessMode( - ) { + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JalviewModel target = (JalviewModel) 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.setNameSpaceURI("www.jalview.org"); + desc.setRequired(true); + 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(); + 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); + // -- _vamsasModel + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.VamsasModel.class, + "_vamsasModel", "vamsasModel", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JalviewModel target = (JalviewModel) object; + return target.getVamsasModel(); + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.JalviewModel.class; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JalviewModel target = (JalviewModel) object; + target.setVamsasModel((jalview.schemabinding.version2.VamsasModel) 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 new jalview.schemabinding.version2.VamsasModel(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setRequired(true); + 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: _vamsasModel + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope } + desc.setValidator(fieldValidator); + // -- _jalviewModelSequence + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.JalviewModelSequence.class, + "_jalviewModelSequence", "-error-if-this-is-used-", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JalviewModel target = (JalviewModel) object; + return target.getJalviewModelSequence(); + } - /** - * 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 + { + JalviewModel target = (JalviewModel) object; + target.setJalviewModelSequence((jalview.schemabinding.version2.JalviewModelSequence) 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 java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.JalviewModelSequence(); + } + }; + desc.setHandler(handler); + desc.setContainer(true); + desc.setClassDescriptor(new jalview.schemabinding.version2.descriptors.JalviewModelSequenceDescriptor()); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(false); + addFieldDescriptor(desc); - /** - * 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; + // -- validation code for: _jalviewModelSequence + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope } + 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.JalviewModel.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/schemabinding/version2/descriptors/JalviewModelSequenceDescriptor.java b/src/jalview/schemabinding/version2/descriptors/JalviewModelSequenceDescriptor.java index e74d8dd..e8c4ef4 100644 --- a/src/jalview/schemabinding/version2/descriptors/JalviewModelSequenceDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/JalviewModelSequenceDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.JalviewModelSequence; @@ -18,385 +18,457 @@ import jalview.schemabinding.version2.JalviewModelSequence; * * @version $Revision$ $Date$ */ -public class JalviewModelSequenceDescriptor 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 JalviewModelSequenceDescriptor() { - super(); - _nsURI = "www.jalview.org"; - _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 - - //-- initialize element descriptors - - //-- _JSeqList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.JSeq.class, "_JSeqList", "JSeq", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JalviewModelSequence target = (JalviewModelSequence) object; - return target.getJSeq(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JalviewModelSequence target = (JalviewModelSequence) object; - target.addJSeq( (jalview.schemabinding.version2.JSeq) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - JalviewModelSequence target = (JalviewModelSequence) object; - target.removeAllJSeq(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.JSeq(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _JSeqList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope +public class JalviewModelSequenceDescriptor 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 JalviewModelSequenceDescriptor() + { + super(); + _nsURI = "www.jalview.org"; + _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 + + // -- initialize element descriptors + + // -- _JSeqList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.JSeq.class, "_JSeqList", "JSeq", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JalviewModelSequence target = (JalviewModelSequence) object; + return target.getJSeq(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JalviewModelSequence target = (JalviewModelSequence) object; + target.addJSeq((jalview.schemabinding.version2.JSeq) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _JGroupList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.JGroup.class, "_JGroupList", "JGroup", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JalviewModelSequence target = (JalviewModelSequence) object; - return target.getJGroup(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JalviewModelSequence target = (JalviewModelSequence) object; - target.addJGroup( (jalview.schemabinding.version2.JGroup) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - JalviewModelSequence target = (JalviewModelSequence) object; - target.removeAllJGroup(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.JGroup(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _JGroupList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope + } + + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + JalviewModelSequence target = (JalviewModelSequence) object; + target.removeAllJSeq(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _viewportList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Viewport.class, "_viewportList", "Viewport", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JalviewModelSequence target = (JalviewModelSequence) object; - return target.getViewport(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JalviewModelSequence target = (JalviewModelSequence) object; - target.addViewport( (jalview.schemabinding.version2.Viewport) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - JalviewModelSequence target = (JalviewModelSequence) object; - target.removeAllViewport(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.Viewport(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _viewportList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.JSeq(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _JSeqList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope + } + desc.setValidator(fieldValidator); + // -- _JGroupList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.JGroup.class, "_JGroupList", + "JGroup", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JalviewModelSequence target = (JalviewModelSequence) object; + return target.getJGroup(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JalviewModelSequence target = (JalviewModelSequence) object; + target.addJGroup((jalview.schemabinding.version2.JGroup) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _userColoursList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.UserColours.class, "_userColoursList", "UserColours", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JalviewModelSequence target = (JalviewModelSequence) object; - return target.getUserColours(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JalviewModelSequence target = (JalviewModelSequence) object; - target.addUserColours( (jalview.schemabinding.version2.UserColours) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - JalviewModelSequence target = (JalviewModelSequence) object; - target.removeAllUserColours(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.UserColours(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _userColoursList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope + } + + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + JalviewModelSequence target = (JalviewModelSequence) object; + target.removeAllJGroup(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _treeList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Tree.class, "_treeList", "tree", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JalviewModelSequence target = (JalviewModelSequence) object; - return target.getTree(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JalviewModelSequence target = (JalviewModelSequence) object; - target.addTree( (jalview.schemabinding.version2.Tree) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - JalviewModelSequence target = (JalviewModelSequence) object; - target.removeAllTree(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.Tree(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _treeList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.JGroup(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _JGroupList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope + } + desc.setValidator(fieldValidator); + // -- _viewportList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.Viewport.class, "_viewportList", + "Viewport", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JalviewModelSequence target = (JalviewModelSequence) object; + return target.getViewport(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JalviewModelSequence target = (JalviewModelSequence) object; + target.addViewport((jalview.schemabinding.version2.Viewport) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _featureSettings - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.FeatureSettings.class, "_featureSettings", "FeatureSettings", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JalviewModelSequence target = (JalviewModelSequence) object; - return target.getFeatureSettings(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JalviewModelSequence target = (JalviewModelSequence) object; - target.setFeatureSettings( (jalview.schemabinding.version2.FeatureSettings) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.FeatureSettings(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _featureSettings - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope + } + + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + JalviewModelSequence target = (JalviewModelSequence) object; + target.removeAllViewport(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.Viewport(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _viewportList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + desc.setValidator(fieldValidator); + // -- _userColoursList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.UserColours.class, + "_userColoursList", "UserColours", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JalviewModelSequence target = (JalviewModelSequence) object; + return target.getUserColours(); + } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JalviewModelSequence target = (JalviewModelSequence) object; + target.addUserColours((jalview.schemabinding.version2.UserColours) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - //-----------/ - //- Methods -/ - //-----------/ + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + JalviewModelSequence target = (JalviewModelSequence) object; + target.removeAllUserColours(); + } 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( - ) { - return null; - } + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.UserColours(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + 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: _userColoursList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + desc.setValidator(fieldValidator); + // -- _treeList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.Tree.class, "_treeList", "tree", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JalviewModelSequence target = (JalviewModelSequence) object; + return target.getTree(); + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.JalviewModelSequence.class; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JalviewModelSequence target = (JalviewModelSequence) object; + target.addTree((jalview.schemabinding.version2.Tree) 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 void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + JalviewModelSequence target = (JalviewModelSequence) object; + target.removeAllTree(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; - } + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.Tree(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; + // -- validation code for: _treeList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + desc.setValidator(fieldValidator); + // -- _featureSettings + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.FeatureSettings.class, + "_featureSettings", "FeatureSettings", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JalviewModelSequence target = (JalviewModelSequence) object; + return target.getFeatureSettings(); + } - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JalviewModelSequence target = (JalviewModelSequence) object; + target.setFeatureSettings((jalview.schemabinding.version2.FeatureSettings) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.FeatureSettings(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(false); + addFieldDescriptor(desc); - /** - * 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; + // -- validation code for: _featureSettings + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope } + 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.JalviewModelSequence.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/schemabinding/version2/descriptors/JalviewUserColoursDescriptor.java b/src/jalview/schemabinding/version2/descriptors/JalviewUserColoursDescriptor.java index 47d0769..77efa7e 100644 --- a/src/jalview/schemabinding/version2/descriptors/JalviewUserColoursDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/JalviewUserColoursDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.Colour; @@ -19,258 +19,284 @@ import jalview.schemabinding.version2.JalviewUserColours; * * @version $Revision$ $Date$ */ -public class JalviewUserColoursDescriptor 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 JalviewUserColoursDescriptor() { - super(); - _nsURI = "www.jalview.org/colours"; - _xmlName = "JalviewUserColours"; - _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 - - //-- _schemeName - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_schemeName", "schemeName", 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 - { - JalviewUserColours target = (JalviewUserColours) object; - return target.getSchemeName(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JalviewUserColours target = (JalviewUserColours) object; - target.setSchemeName( (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: _schemeName - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); - } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - //-- _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 - { - JalviewUserColours target = (JalviewUserColours) object; - return target.getVersion(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JalviewUserColours target = (JalviewUserColours) 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); - //-- _colourList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(Colour.class, "_colourList", "colour", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - JalviewUserColours target = (JalviewUserColours) object; - return target.getColour(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - JalviewUserColours target = (JalviewUserColours) object; - target.addColour( (Colour) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - JalviewUserColours target = (JalviewUserColours) object; - target.removeAllColour(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new Colour(); - } - }; - desc.setHandler(handler); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _colourList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope +public class JalviewUserColoursDescriptor 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 JalviewUserColoursDescriptor() + { + super(); + _nsURI = "www.jalview.org/colours"; + _xmlName = "JalviewUserColours"; + _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 + + // -- _schemeName + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_schemeName", "schemeName", + 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 + { + JalviewUserColours target = (JalviewUserColours) object; + return target.getSchemeName(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JalviewUserColours target = (JalviewUserColours) object; + target.setSchemeName((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.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _schemeName + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors + // -- _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 + { + JalviewUserColours target = (JalviewUserColours) object; + return target.getVersion(); + } - //-----------/ - //- Methods -/ - //-----------/ + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JalviewUserColours target = (JalviewUserColours) 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); + // -- _colourList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + Colour.class, "_colourList", "colour", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + JalviewUserColours target = (JalviewUserColours) object; + return target.getColour(); + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.JalviewUserColours.class; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + JalviewUserColours target = (JalviewUserColours) object; + target.addColour((Colour) 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 void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + JalviewUserColours target = (JalviewUserColours) object; + target.removeAllColour(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; - } + public java.lang.Object newInstance(java.lang.Object parent) + { + return new Colour(); + } + }; + desc.setHandler(handler); + desc.setMultivalued(true); + addFieldDescriptor(desc); - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; + // -- validation code for: _colourList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + desc.setValidator(fieldValidator); + } - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; - } + // -----------/ + // - Methods -/ + // -----------/ - /** - * Method isElementDefinition. - * - * @return true if XML schema definition of this Class is that - * of a global - * element or element with anonymous type definition. - */ - public boolean isElementDefinition( - ) { - return _elementDefinition; - } + /** + * Method 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.JalviewUserColours.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/schemabinding/version2/descriptors/MapListFromDescriptor.java b/src/jalview/schemabinding/version2/descriptors/MapListFromDescriptor.java index 91dffbe..529f477 100644 --- a/src/jalview/schemabinding/version2/descriptors/MapListFromDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/MapListFromDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.MapListFrom; @@ -18,226 +18,251 @@ import jalview.schemabinding.version2.MapListFrom; * * @version $Revision$ $Date$ */ -public class MapListFromDescriptor 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 MapListFromDescriptor() { - super(); - _nsURI = "www.vamsas.ac.uk/jalview/version2"; - _xmlName = "mapListFrom"; - _elementDefinition = true; - org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; - org.exolab.castor.mapping.FieldHandler handler = null; - org.exolab.castor.xml.FieldValidator fieldValidator = null; - //-- initialize attribute descriptors - - //-- _start - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_start", "start", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - MapListFrom target = (MapListFrom) object; - if (!target.hasStart()) { return null; } - return new java.lang.Integer(target.getStart()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - MapListFrom target = (MapListFrom) object; - // ignore null values for non optional primitives - if (value == null) { return; } - - target.setStart( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _start - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); +public class MapListFromDescriptor 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 MapListFromDescriptor() + { + super(); + _nsURI = "www.vamsas.ac.uk/jalview/version2"; + _xmlName = "mapListFrom"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + // -- initialize attribute descriptors + + // -- _start + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_start", "start", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + MapListFrom target = (MapListFrom) object; + if (!target.hasStart()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _end - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_end", "end", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - MapListFrom target = (MapListFrom) object; - if (!target.hasEnd()) { return null; } - return new java.lang.Integer(target.getEnd()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - MapListFrom target = (MapListFrom) object; - // ignore null values for non optional primitives - if (value == null) { return; } - - target.setEnd( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _end - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + return new java.lang.Integer(target.getStart()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + MapListFrom target = (MapListFrom) object; + // ignore null values for non optional primitives + if (value == null) + { + return; + } + + target.setStart(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - + } + + 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: _start + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- _end + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_end", "end", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + MapListFrom target = (MapListFrom) object; + if (!target.hasEnd()) + { + return null; + } + return new java.lang.Integer(target.getEnd()); + } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + MapListFrom target = (MapListFrom) object; + // ignore null values for non optional primitives + if (value == null) + { + return; + } - //-----------/ - //- Methods -/ - //-----------/ + target.setEnd(((java.lang.Integer) value).intValue()); + } 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.setRequired(true); + 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: _end + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.MapListFrom.class; - } + } - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix( - ) { - return _nsPrefix; - } + // -----------/ + // - Methods -/ + // -----------/ - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; - } + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; - } + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return super.getIdentity(); + } - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; - } + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.MapListFrom.class; + } - /** - * Method isElementDefinition. - * - * @return true if XML schema definition of this Class is that - * of a global - * element or element with anonymous type definition. - */ - public boolean isElementDefinition( - ) { - return _elementDefinition; - } + /** + * Method 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/schemabinding/version2/descriptors/MapListToDescriptor.java b/src/jalview/schemabinding/version2/descriptors/MapListToDescriptor.java index 43a4033..bed082a 100644 --- a/src/jalview/schemabinding/version2/descriptors/MapListToDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/MapListToDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.MapListTo; @@ -18,226 +18,251 @@ import jalview.schemabinding.version2.MapListTo; * * @version $Revision$ $Date$ */ -public class MapListToDescriptor 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 MapListToDescriptor() { - super(); - _nsURI = "www.vamsas.ac.uk/jalview/version2"; - _xmlName = "mapListTo"; - _elementDefinition = true; - org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; - org.exolab.castor.mapping.FieldHandler handler = null; - org.exolab.castor.xml.FieldValidator fieldValidator = null; - //-- initialize attribute descriptors - - //-- _start - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_start", "start", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - MapListTo target = (MapListTo) object; - if (!target.hasStart()) { return null; } - return new java.lang.Integer(target.getStart()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - MapListTo target = (MapListTo) object; - // ignore null values for non optional primitives - if (value == null) { return; } - - target.setStart( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _start - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); +public class MapListToDescriptor 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 MapListToDescriptor() + { + super(); + _nsURI = "www.vamsas.ac.uk/jalview/version2"; + _xmlName = "mapListTo"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + // -- initialize attribute descriptors + + // -- _start + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_start", "start", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + MapListTo target = (MapListTo) object; + if (!target.hasStart()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _end - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_end", "end", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - MapListTo target = (MapListTo) object; - if (!target.hasEnd()) { return null; } - return new java.lang.Integer(target.getEnd()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - MapListTo target = (MapListTo) object; - // ignore null values for non optional primitives - if (value == null) { return; } - - target.setEnd( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _end - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + return new java.lang.Integer(target.getStart()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + MapListTo target = (MapListTo) object; + // ignore null values for non optional primitives + if (value == null) + { + return; + } + + target.setStart(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - + } + + 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: _start + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- _end + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_end", "end", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + MapListTo target = (MapListTo) object; + if (!target.hasEnd()) + { + return null; + } + return new java.lang.Integer(target.getEnd()); + } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + MapListTo target = (MapListTo) object; + // ignore null values for non optional primitives + if (value == null) + { + return; + } - //-----------/ - //- Methods -/ - //-----------/ + target.setEnd(((java.lang.Integer) value).intValue()); + } 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.setRequired(true); + 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: _end + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.MapListTo.class; - } + } - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix( - ) { - return _nsPrefix; - } + // -----------/ + // - Methods -/ + // -----------/ - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; - } + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; - } + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return super.getIdentity(); + } - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; - } + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.MapListTo.class; + } - /** - * Method isElementDefinition. - * - * @return true if XML schema definition of this Class is that - * of a global - * element or element with anonymous type definition. - */ - public boolean isElementDefinition( - ) { - return _elementDefinition; - } + /** + * Method 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/schemabinding/version2/descriptors/MapListTypeDescriptor.java b/src/jalview/schemabinding/version2/descriptors/MapListTypeDescriptor.java index 8b92065..fc24a78 100644 --- a/src/jalview/schemabinding/version2/descriptors/MapListTypeDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/MapListTypeDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.MapListType; @@ -18,311 +18,364 @@ import jalview.schemabinding.version2.MapListType; * * @version $Revision$ $Date$ */ -public class MapListTypeDescriptor 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 MapListTypeDescriptor() { - super(); - _nsURI = "www.vamsas.ac.uk/jalview/version2"; - _xmlName = "mapListType"; - _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 - - //-- _mapFromUnit - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_mapFromUnit", "mapFromUnit", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - MapListType target = (MapListType) object; - if (!target.hasMapFromUnit()) { return null; } - return new java.lang.Long(target.getMapFromUnit()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - MapListType target = (MapListType) object; - // ignore null values for non optional primitives - if (value == null) { return; } - - target.setMapFromUnit( ((java.lang.Long) value).longValue()); - } 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: _mapFromUnit - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.LongValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.LongValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(1L); - } - desc.setValidator(fieldValidator); - //-- _mapToUnit - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_mapToUnit", "mapToUnit", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - MapListType target = (MapListType) object; - if (!target.hasMapToUnit()) { return null; } - return new java.lang.Long(target.getMapToUnit()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - MapListType target = (MapListType) object; - // ignore null values for non optional primitives - if (value == null) { return; } - - target.setMapToUnit( ((java.lang.Long) value).longValue()); - } 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: _mapToUnit - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.LongValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.LongValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(1L); - } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - //-- _mapListFromList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.MapListFrom.class, "_mapListFromList", "mapListFrom", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - MapListType target = (MapListType) object; - return target.getMapListFrom(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - MapListType target = (MapListType) object; - target.addMapListFrom( (jalview.schemabinding.version2.MapListFrom) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - MapListType target = (MapListType) object; - target.removeAllMapListFrom(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.MapListFrom(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _mapListFromList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope +public class MapListTypeDescriptor 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 MapListTypeDescriptor() + { + super(); + _nsURI = "www.vamsas.ac.uk/jalview/version2"; + _xmlName = "mapListType"; + _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 + + // -- _mapFromUnit + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Long.TYPE, "_mapFromUnit", "mapFromUnit", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + MapListType target = (MapListType) object; + if (!target.hasMapFromUnit()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _mapListToList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.MapListTo.class, "_mapListToList", "mapListTo", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - MapListType target = (MapListType) object; - return target.getMapListTo(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - MapListType target = (MapListType) object; - target.addMapListTo( (jalview.schemabinding.version2.MapListTo) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - MapListType target = (MapListType) object; - target.removeAllMapListTo(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.MapListTo(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _mapListToList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope + return new java.lang.Long(target.getMapFromUnit()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + MapListType target = (MapListType) object; + // ignore null values for non optional primitives + if (value == null) + { + return; + } + + target.setMapFromUnit(((java.lang.Long) value).longValue()); + } 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: _mapFromUnit + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope + org.exolab.castor.xml.validators.LongValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.LongValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(1L); } + desc.setValidator(fieldValidator); + // -- _mapToUnit + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Long.TYPE, "_mapToUnit", "mapToUnit", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + MapListType target = (MapListType) object; + if (!target.hasMapToUnit()) + { + return null; + } + return new java.lang.Long(target.getMapToUnit()); + } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + MapListType target = (MapListType) object; + // ignore null values for non optional primitives + if (value == null) + { + return; + } - //-----------/ - //- Methods -/ - //-----------/ + target.setMapToUnit(((java.lang.Long) value).longValue()); + } 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.setRequired(true); + 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: _mapToUnit + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope + org.exolab.castor.xml.validators.LongValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.LongValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(1L); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.MapListType.class; - } + // -- _mapListFromList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.MapListFrom.class, + "_mapListFromList", "mapListFrom", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + MapListType target = (MapListType) object; + return target.getMapListFrom(); + } - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix( - ) { - return _nsPrefix; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + MapListType target = (MapListType) object; + target.addMapListFrom((jalview.schemabinding.version2.MapListFrom) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; - } + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + MapListType target = (MapListType) object; + target.removeAllMapListFrom(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; - } + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.MapListFrom(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(true); + addFieldDescriptor(desc); - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; + // -- validation code for: _mapListFromList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + desc.setValidator(fieldValidator); + // -- _mapListToList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.MapListTo.class, + "_mapListToList", "mapListTo", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + MapListType target = (MapListType) object; + return target.getMapListTo(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + MapListType target = (MapListType) object; + target.addMapListTo((jalview.schemabinding.version2.MapListTo) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + MapListType target = (MapListType) object; + target.removeAllMapListTo(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * 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 java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.MapListTo(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _mapListToList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + 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.MapListType.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/schemabinding/version2/descriptors/MappingChoiceDescriptor.java b/src/jalview/schemabinding/version2/descriptors/MappingChoiceDescriptor.java index b0aa8f9..ae460af 100644 --- a/src/jalview/schemabinding/version2/descriptors/MappingChoiceDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/MappingChoiceDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.MappingChoice; @@ -18,213 +18,226 @@ import jalview.schemabinding.version2.MappingChoice; * * @version $Revision$ $Date$ */ -public class MappingChoiceDescriptor 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 MappingChoiceDescriptor() { - super(); - _nsURI = "www.vamsas.ac.uk/jalview/version2"; - _elementDefinition = false; - - //-- set grouping compositor - setCompositorAsChoice(); - 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 - - //-- initialize element descriptors - - //-- _sequence - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Sequence.class, "_sequence", "Sequence", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - MappingChoice target = (MappingChoice) object; - return target.getSequence(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - MappingChoice target = (MappingChoice) object; - target.setSequence( (jalview.schemabinding.version2.Sequence) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.Sequence(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _sequence - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - } - desc.setValidator(fieldValidator); - //-- _dseqFor - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_dseqFor", "dseqFor", 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 - { - MappingChoice target = (MappingChoice) object; - return target.getDseqFor(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - MappingChoice target = (MappingChoice) object; - target.setDseqFor( (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.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _dseqFor - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); +public class MappingChoiceDescriptor 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 MappingChoiceDescriptor() + { + super(); + _nsURI = "www.vamsas.ac.uk/jalview/version2"; + _elementDefinition = false; + + // -- set grouping compositor + setCompositorAsChoice(); + 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 + + // -- initialize element descriptors + + // -- _sequence + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.Sequence.class, "_sequence", + "Sequence", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + MappingChoice target = (MappingChoice) object; + return target.getSequence(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + MappingChoice target = (MappingChoice) object; + target.setSequence((jalview.schemabinding.version2.Sequence) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.Sequence(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _sequence + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope } + desc.setValidator(fieldValidator); + // -- _dseqFor + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_dseqFor", "dseqFor", + 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 + { + MappingChoice target = (MappingChoice) object; + return target.getDseqFor(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + MappingChoice target = (MappingChoice) object; + target.setDseqFor((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - - //-----------/ - //- Methods -/ - //-----------/ - - /** - * 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.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _dseqFor + 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"); } - - /** - * 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.MappingChoice.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; - } + 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.MappingChoice.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/schemabinding/version2/descriptors/MappingDescriptor.java b/src/jalview/schemabinding/version2/descriptors/MappingDescriptor.java index 45157ff..fab0d2e 100644 --- a/src/jalview/schemabinding/version2/descriptors/MappingDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/MappingDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.Mapping; @@ -18,179 +18,185 @@ import jalview.schemabinding.version2.Mapping; * * @version $Revision$ $Date$ */ -public class MappingDescriptor extends jalview.schemabinding.version2.descriptors.MapListTypeDescriptor { - - - //--------------------------/ - //- 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 MappingDescriptor() { - super(); - setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.MapListTypeDescriptor()); - _nsURI = "www.vamsas.ac.uk/jalview/version2"; - _xmlName = "Mapping"; - _elementDefinition = true; - - //-- set grouping compositor - setCompositorAsChoice(); - 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 - - //-- initialize element descriptors - - //-- _mappingChoice - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.MappingChoice.class, "_mappingChoice", "-error-if-this-is-used-", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Mapping target = (Mapping) object; - return target.getMappingChoice(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Mapping target = (Mapping) object; - target.setMappingChoice( (jalview.schemabinding.version2.MappingChoice) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.MappingChoice(); - } - }; - desc.setHandler(handler); - desc.setContainer(true); - desc.setClassDescriptor(new jalview.schemabinding.version2.descriptors.MappingChoiceDescriptor()); - desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _mappingChoice - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope +public class MappingDescriptor extends + jalview.schemabinding.version2.descriptors.MapListTypeDescriptor +{ + + // --------------------------/ + // - 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 MappingDescriptor() + { + super(); + setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.MapListTypeDescriptor()); + _nsURI = "www.vamsas.ac.uk/jalview/version2"; + _xmlName = "Mapping"; + _elementDefinition = true; + + // -- set grouping compositor + setCompositorAsChoice(); + 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 + + // -- initialize element descriptors + + // -- _mappingChoice + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.MappingChoice.class, + "_mappingChoice", "-error-if-this-is-used-", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Mapping target = (Mapping) object; + return target.getMappingChoice(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Mapping target = (Mapping) object; + target.setMappingChoice((jalview.schemabinding.version2.MappingChoice) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - 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.Mapping.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; + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.MappingChoice(); + } + }; + desc.setHandler(handler); + desc.setContainer(true); + desc.setClassDescriptor(new jalview.schemabinding.version2.descriptors.MappingChoiceDescriptor()); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _mappingChoice + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope } + 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.Mapping.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/schemabinding/version2/descriptors/OtherDataDescriptor.java b/src/jalview/schemabinding/version2/descriptors/OtherDataDescriptor.java index 201f4df..f582311 100644 --- a/src/jalview/schemabinding/version2/descriptors/OtherDataDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/OtherDataDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.OtherData; @@ -18,218 +18,231 @@ import jalview.schemabinding.version2.OtherData; * * @version $Revision$ $Date$ */ -public class OtherDataDescriptor 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 OtherDataDescriptor() { - super(); - _nsURI = "www.jalview.org"; - _xmlName = "otherData"; - _elementDefinition = true; - org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; - org.exolab.castor.mapping.FieldHandler handler = null; - org.exolab.castor.xml.FieldValidator fieldValidator = null; - //-- initialize attribute descriptors - - //-- _key - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_key", "key", 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 - { - OtherData target = (OtherData) object; - return target.getKey(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - OtherData target = (OtherData) object; - target.setKey( (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: _key - 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); - //-- _value - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_value", "value", 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 - { - OtherData target = (OtherData) object; - return target.getValue(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - OtherData target = (OtherData) object; - target.setValue( (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: _value - 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 OtherDataDescriptor 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 OtherDataDescriptor() + { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "otherData"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + // -- initialize attribute descriptors + + // -- _key + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_key", "key", + 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 + { + OtherData target = (OtherData) object; + return target.getKey(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + OtherData target = (OtherData) object; + target.setKey((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - } - - - //-----------/ - //- Methods -/ - //-----------/ + } - /** - * 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.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _key + 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); + // -- _value + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_value", "value", + 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 + { + OtherData target = (OtherData) object; + return target.getValue(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + OtherData target = (OtherData) object; + target.setValue((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * 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.OtherData.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; + 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: _value + 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 + + } + + // -----------/ + // - 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.OtherData.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/schemabinding/version2/descriptors/PdbentryDescriptor.java b/src/jalview/schemabinding/version2/descriptors/PdbentryDescriptor.java index 548be45..f19703a 100644 --- a/src/jalview/schemabinding/version2/descriptors/PdbentryDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/PdbentryDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.Pdbentry; @@ -18,295 +18,329 @@ import jalview.schemabinding.version2.Pdbentry; * * @version $Revision$ $Date$ */ -public class PdbentryDescriptor 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 PdbentryDescriptor() { - super(); - _xmlName = "pdbentry"; - _elementDefinition = false; - 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 - - //-- _id - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", 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 - { - Pdbentry target = (Pdbentry) object; - return target.getId(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Pdbentry target = (Pdbentry) object; - target.setId( (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: _id - 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); - //-- _type - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_type", "type", 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 - { - Pdbentry target = (Pdbentry) object; - return target.getType(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Pdbentry target = (Pdbentry) object; - target.setType( (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: _type - 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); - //-- _file - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_file", "file", 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 - { - Pdbentry target = (Pdbentry) object; - return target.getFile(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Pdbentry target = (Pdbentry) object; - target.setFile( (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: _file - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); - } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - //-- _items - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.PdbentryItem.class, "_items", (java.lang.String) null, org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Pdbentry target = (Pdbentry) object; - return target.getPdbentryItem(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Pdbentry target = (Pdbentry) object; - target.addPdbentryItem( (jalview.schemabinding.version2.PdbentryItem) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - Pdbentry target = (Pdbentry) object; - target.removeAllPdbentryItem(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.PdbentryItem(); - } - }; - desc.setHandler(handler); - desc.setContainer(true); - desc.setClassDescriptor(new jalview.schemabinding.version2.descriptors.PdbentryItemDescriptor()); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _items - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope - } - desc.setValidator(fieldValidator); - } +public class PdbentryDescriptor 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; - //-----------/ - //- Methods -/ - //-----------/ + // ----------------/ + // - Constructors -/ + // ----------------/ - /** - * Method getAccessMode. - * - * @return the access mode specified for this class. - */ - public org.exolab.castor.mapping.AccessMode getAccessMode( - ) { + public PdbentryDescriptor() + { + super(); + _xmlName = "pdbentry"; + _elementDefinition = false; + 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 + + // -- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_id", "id", + 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 + { + Pdbentry target = (Pdbentry) object; + return target.getId(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Pdbentry target = (Pdbentry) object; + target.setId((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); - /** - * 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: _id + 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); + // -- _type + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_type", "type", + 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 + { + Pdbentry target = (Pdbentry) object; + return target.getType(); + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.Pdbentry.class; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Pdbentry target = (Pdbentry) object; + target.setType((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: _type + 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); + // -- _file + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_file", "file", + 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 + { + Pdbentry target = (Pdbentry) object; + return target.getFile(); + } - /** - * 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 + { + Pdbentry target = (Pdbentry) object; + target.setFile((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 java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _file + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors + + // -- _items + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.PdbentryItem.class, "_items", + (java.lang.String) null, org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Pdbentry target = (Pdbentry) object; + return target.getPdbentryItem(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Pdbentry target = (Pdbentry) object; + target.addPdbentryItem((jalview.schemabinding.version2.PdbentryItem) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + Pdbentry target = (Pdbentry) object; + target.removeAllPdbentryItem(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.PdbentryItem(); + } + }; + desc.setHandler(handler); + desc.setContainer(true); + desc.setClassDescriptor(new jalview.schemabinding.version2.descriptors.PdbentryItemDescriptor()); + desc.setMultivalued(true); + addFieldDescriptor(desc); - /** - * 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; + // -- validation code for: _items + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + 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.Pdbentry.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/schemabinding/version2/descriptors/PdbentryItemDescriptor.java b/src/jalview/schemabinding/version2/descriptors/PdbentryItemDescriptor.java index cb2b5da..4e2fc87 100644 --- a/src/jalview/schemabinding/version2/descriptors/PdbentryItemDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/PdbentryItemDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.PdbentryItem; @@ -18,185 +18,195 @@ import jalview.schemabinding.version2.PdbentryItem; * * @version $Revision$ $Date$ */ -public class PdbentryItemDescriptor 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 PdbentryItemDescriptor() { - super(); - _nsURI = "www.jalview.org"; - _xmlName = "pdbentry"; - _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 - - //-- initialize element descriptors - - //-- _propertyList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Property.class, "_propertyList", "property", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - PdbentryItem target = (PdbentryItem) object; - return target.getProperty(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - PdbentryItem target = (PdbentryItem) object; - target.addProperty( (jalview.schemabinding.version2.Property) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - PdbentryItem target = (PdbentryItem) object; - target.removeAllProperty(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.Property(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _propertyList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope +public class PdbentryItemDescriptor 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 PdbentryItemDescriptor() + { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "pdbentry"; + _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 + + // -- initialize element descriptors + + // -- _propertyList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.Property.class, "_propertyList", + "property", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + PdbentryItem target = (PdbentryItem) object; + return target.getProperty(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + PdbentryItem target = (PdbentryItem) object; + target.addProperty((jalview.schemabinding.version2.Property) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - 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.PdbentryItem.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; + } + + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + PdbentryItem target = (PdbentryItem) object; + target.removeAllProperty(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.Property(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _propertyList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + 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.PdbentryItem.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/schemabinding/version2/descriptors/PdbidsDescriptor.java b/src/jalview/schemabinding/version2/descriptors/PdbidsDescriptor.java index f005ce6..584607d 100644 --- a/src/jalview/schemabinding/version2/descriptors/PdbidsDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/PdbidsDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.Pdbids; @@ -18,186 +18,197 @@ import jalview.schemabinding.version2.Pdbids; * * @version $Revision$ $Date$ */ -public class PdbidsDescriptor extends jalview.schemabinding.version2.descriptors.PdbentryDescriptor { - - - //--------------------------/ - //- 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 PdbidsDescriptor() { - super(); - setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.PdbentryDescriptor()); - _nsURI = "www.jalview.org"; - _xmlName = "pdbids"; - _elementDefinition = true; - - //-- 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 - - //-- initialize element descriptors - - //-- _structureStateList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.StructureState.class, "_structureStateList", "structureState", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Pdbids target = (Pdbids) object; - return target.getStructureState(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Pdbids target = (Pdbids) object; - target.addStructureState( (jalview.schemabinding.version2.StructureState) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - Pdbids target = (Pdbids) object; - target.removeAllStructureState(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.StructureState(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _structureStateList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope +public class PdbidsDescriptor extends + jalview.schemabinding.version2.descriptors.PdbentryDescriptor +{ + + // --------------------------/ + // - 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 PdbidsDescriptor() + { + super(); + setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.PdbentryDescriptor()); + _nsURI = "www.jalview.org"; + _xmlName = "pdbids"; + _elementDefinition = true; + + // -- 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 + + // -- initialize element descriptors + + // -- _structureStateList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.StructureState.class, + "_structureStateList", "structureState", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Pdbids target = (Pdbids) object; + return target.getStructureState(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Pdbids target = (Pdbids) object; + target.addStructureState((jalview.schemabinding.version2.StructureState) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - 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.Pdbids.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; + } + + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + Pdbids target = (Pdbids) object; + target.removeAllStructureState(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.StructureState(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _structureStateList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + 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.Pdbids.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/schemabinding/version2/descriptors/PropertyDescriptor.java b/src/jalview/schemabinding/version2/descriptors/PropertyDescriptor.java index b7087d2..60d09b4 100644 --- a/src/jalview/schemabinding/version2/descriptors/PropertyDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/PropertyDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.Property; @@ -18,218 +18,231 @@ import jalview.schemabinding.version2.Property; * * @version $Revision$ $Date$ */ -public class PropertyDescriptor 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 PropertyDescriptor() { - super(); - _nsURI = "www.jalview.org"; - _xmlName = "property"; - _elementDefinition = true; - org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; - org.exolab.castor.mapping.FieldHandler handler = null; - org.exolab.castor.xml.FieldValidator fieldValidator = null; - //-- initialize attribute descriptors - - //-- _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 - { - Property target = (Property) object; - return target.getName(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Property target = (Property) 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); - //-- _value - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_value", "value", 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 - { - Property target = (Property) object; - return target.getValue(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Property target = (Property) object; - target.setValue( (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: _value - 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 PropertyDescriptor 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 PropertyDescriptor() + { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "property"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + // -- initialize attribute descriptors + + // -- _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 + { + Property target = (Property) object; + return target.getName(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Property target = (Property) object; + target.setName((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - } - - - //-----------/ - //- Methods -/ - //-----------/ + } - /** - * 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.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); + // -- _value + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_value", "value", + 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 + { + Property target = (Property) object; + return target.getValue(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Property target = (Property) object; + target.setValue((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * 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.Property.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; + 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: _value + 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 + + } + + // -----------/ + // - 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.Property.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/schemabinding/version2/descriptors/RnaViewerDescriptor.java b/src/jalview/schemabinding/version2/descriptors/RnaViewerDescriptor.java index fd824a1..3344050 100644 --- a/src/jalview/schemabinding/version2/descriptors/RnaViewerDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/RnaViewerDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.RnaViewer; @@ -18,518 +18,617 @@ import jalview.schemabinding.version2.RnaViewer; * * @version $Revision$ $Date$ */ -public class RnaViewerDescriptor 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 RnaViewerDescriptor() { - super(); - _nsURI = "www.jalview.org"; - _xmlName = "rnaViewer"; - _elementDefinition = true; - - //-- 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 - - //-- _title - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_title", "title", 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 - { - RnaViewer target = (RnaViewer) object; - return target.getTitle(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - RnaViewer target = (RnaViewer) object; - target.setTitle( (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: _title - 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); - //-- _viewId - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_viewId", "viewId", 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 - { - RnaViewer target = (RnaViewer) object; - return target.getViewId(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - RnaViewer target = (RnaViewer) object; - target.setViewId( (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: _viewId - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); +public class RnaViewerDescriptor 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 RnaViewerDescriptor() + { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "rnaViewer"; + _elementDefinition = true; + + // -- 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 + + // -- _title + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_title", "title", + 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 + { + RnaViewer target = (RnaViewer) object; + return target.getTitle(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + RnaViewer target = (RnaViewer) object; + target.setTitle((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _dividerLocation - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_dividerLocation", "dividerLocation", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - RnaViewer target = (RnaViewer) object; - if (!target.hasDividerLocation()) { return null; } - return new java.lang.Integer(target.getDividerLocation()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - RnaViewer target = (RnaViewer) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteDividerLocation(); - return; - } - target.setDividerLocation( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _dividerLocation - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _title + 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); + // -- _viewId + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_viewId", "viewId", + 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 + { + RnaViewer target = (RnaViewer) object; + return target.getViewId(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + RnaViewer target = (RnaViewer) object; + target.setViewId((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _selectedRna - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_selectedRna", "selectedRna", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - RnaViewer target = (RnaViewer) object; - if (!target.hasSelectedRna()) { return null; } - return new java.lang.Integer(target.getSelectedRna()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - RnaViewer target = (RnaViewer) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteSelectedRna(); - return; - } - target.setSelectedRna( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _selectedRna - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _viewId + 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); + // -- _dividerLocation + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_dividerLocation", "dividerLocation", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + RnaViewer target = (RnaViewer) object; + if (!target.hasDividerLocation()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _width - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_width", "width", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - RnaViewer target = (RnaViewer) object; - if (!target.hasWidth()) { return null; } - return new java.lang.Integer(target.getWidth()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - RnaViewer target = (RnaViewer) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteWidth(); - return; - } - target.setWidth( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _width - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + return new java.lang.Integer(target.getDividerLocation()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + RnaViewer target = (RnaViewer) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteDividerLocation(); + return; + } + target.setDividerLocation(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _height - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_height", "height", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - RnaViewer target = (RnaViewer) object; - if (!target.hasHeight()) { return null; } - return new java.lang.Integer(target.getHeight()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - RnaViewer target = (RnaViewer) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteHeight(); - return; - } - target.setHeight( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _height - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _dividerLocation + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _selectedRna + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_selectedRna", "selectedRna", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + RnaViewer target = (RnaViewer) object; + if (!target.hasSelectedRna()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _xpos - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_xpos", "xpos", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - RnaViewer target = (RnaViewer) object; - if (!target.hasXpos()) { return null; } - return new java.lang.Integer(target.getXpos()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - RnaViewer target = (RnaViewer) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteXpos(); - return; - } - target.setXpos( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _xpos - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + return new java.lang.Integer(target.getSelectedRna()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + RnaViewer target = (RnaViewer) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteSelectedRna(); + return; + } + target.setSelectedRna(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _ypos - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_ypos", "ypos", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - RnaViewer target = (RnaViewer) object; - if (!target.hasYpos()) { return null; } - return new java.lang.Integer(target.getYpos()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - RnaViewer target = (RnaViewer) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteYpos(); - return; - } - target.setYpos( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _ypos - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _selectedRna + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _width + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_width", "width", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + RnaViewer target = (RnaViewer) object; + if (!target.hasWidth()) + { + return null; } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - //-- _secondaryStructureList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.SecondaryStructure.class, "_secondaryStructureList", "secondaryStructure", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - RnaViewer target = (RnaViewer) object; - return target.getSecondaryStructure(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - RnaViewer target = (RnaViewer) object; - target.addSecondaryStructure( (jalview.schemabinding.version2.SecondaryStructure) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - RnaViewer target = (RnaViewer) object; - target.removeAllSecondaryStructure(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.SecondaryStructure(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setRequired(true); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _secondaryStructureList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope + return new java.lang.Integer(target.getWidth()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + RnaViewer target = (RnaViewer) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteWidth(); + return; + } + target.setWidth(((java.lang.Integer) value).intValue()); + } 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.setMultivalued(false); + addFieldDescriptor(desc); + // -- validation code for: _width + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _height + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_height", "height", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + RnaViewer target = (RnaViewer) object; + if (!target.hasHeight()) + { + return null; + } + return new java.lang.Integer(target.getHeight()); + } - //-----------/ - //- Methods -/ - //-----------/ + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + RnaViewer target = (RnaViewer) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteHeight(); + return; + } + target.setHeight(((java.lang.Integer) value).intValue()); + } 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: _height + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- _xpos + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_xpos", "xpos", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + RnaViewer target = (RnaViewer) object; + if (!target.hasXpos()) + { + return null; + } + return new java.lang.Integer(target.getXpos()); + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.RnaViewer.class; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + RnaViewer target = (RnaViewer) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteXpos(); + return; + } + target.setXpos(((java.lang.Integer) value).intValue()); + } 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: _xpos + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- _ypos + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_ypos", "ypos", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + RnaViewer target = (RnaViewer) object; + if (!target.hasYpos()) + { + return null; + } + return new java.lang.Integer(target.getYpos()); + } - /** - * 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 + { + RnaViewer target = (RnaViewer) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteYpos(); + return; + } + target.setYpos(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; + // -- validation code for: _ypos + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors + + // -- _secondaryStructureList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.SecondaryStructure.class, + "_secondaryStructureList", "secondaryStructure", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + RnaViewer target = (RnaViewer) object; + return target.getSecondaryStructure(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + RnaViewer target = (RnaViewer) object; + target.addSecondaryStructure((jalview.schemabinding.version2.SecondaryStructure) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * 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 resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + RnaViewer target = (RnaViewer) object; + target.removeAllSecondaryStructure(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.SecondaryStructure(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setRequired(true); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _secondaryStructureList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope } + 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.RnaViewer.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/schemabinding/version2/descriptors/SecondaryStructureDescriptor.java b/src/jalview/schemabinding/version2/descriptors/SecondaryStructureDescriptor.java index bc7e4ac..c1e46b8 100644 --- a/src/jalview/schemabinding/version2/descriptors/SecondaryStructureDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/SecondaryStructureDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.SecondaryStructure; @@ -18,294 +18,328 @@ import jalview.schemabinding.version2.SecondaryStructure; * * @version $Revision$ $Date$ */ -public class SecondaryStructureDescriptor 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 SecondaryStructureDescriptor() { - super(); - _nsURI = "www.jalview.org"; - _xmlName = "secondaryStructure"; - _elementDefinition = true; - org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; - org.exolab.castor.mapping.FieldHandler handler = null; - org.exolab.castor.xml.FieldValidator fieldValidator = null; - //-- initialize attribute descriptors - - //-- _title - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_title", "title", 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 - { - SecondaryStructure target = (SecondaryStructure) object; - return target.getTitle(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SecondaryStructure target = (SecondaryStructure) object; - target.setTitle( (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: _title - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); +public class SecondaryStructureDescriptor 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 SecondaryStructureDescriptor() + { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "secondaryStructure"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + // -- initialize attribute descriptors + + // -- _title + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_title", "title", + 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 + { + SecondaryStructure target = (SecondaryStructure) object; + return target.getTitle(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + SecondaryStructure target = (SecondaryStructure) object; + target.setTitle((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _annotationId - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_annotationId", "annotationId", 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 - { - SecondaryStructure target = (SecondaryStructure) object; - return target.getAnnotationId(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SecondaryStructure target = (SecondaryStructure) object; - target.setAnnotationId( (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: _annotationId - 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 java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _title + 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); + // -- _annotationId + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_annotationId", "annotationId", + 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 + { + SecondaryStructure target = (SecondaryStructure) object; + return target.getAnnotationId(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + SecondaryStructure target = (SecondaryStructure) object; + target.setAnnotationId((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _gapped - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_gapped", "gapped", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - SecondaryStructure target = (SecondaryStructure) object; - if (!target.hasGapped()) { return null; } - return (target.getGapped() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SecondaryStructure target = (SecondaryStructure) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteGapped(); - return; - } - target.setGapped( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _gapped - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _annotationId + 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); + // -- _gapped + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_gapped", "gapped", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + SecondaryStructure target = (SecondaryStructure) object; + if (!target.hasGapped()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _viewerState - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_viewerState", "viewerState", 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 - { - SecondaryStructure target = (SecondaryStructure) object; - return target.getViewerState(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SecondaryStructure target = (SecondaryStructure) object; - target.setViewerState( (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: _viewerState - 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"); + return (target.getGapped() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + SecondaryStructure target = (SecondaryStructure) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteGapped(); + return; + } + target.setGapped(((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - } + } + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - //-----------/ - //- Methods -/ - //-----------/ + // -- validation code for: _gapped + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _viewerState + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_viewerState", "viewerState", + 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 + { + SecondaryStructure target = (SecondaryStructure) object; + return target.getViewerState(); + } - /** - * Method getAccessMode. - * - * @return the access mode specified for this class. - */ - public org.exolab.castor.mapping.AccessMode getAccessMode( - ) { + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + SecondaryStructure target = (SecondaryStructure) object; + target.setViewerState((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); - /** - * 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: _viewerState + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.SecondaryStructure.class; - } + } - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix( - ) { - return _nsPrefix; - } + // -----------/ + // - Methods -/ + // -----------/ - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; - } + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; - } + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return super.getIdentity(); + } - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; - } + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.SecondaryStructure.class; + } - /** - * Method isElementDefinition. - * - * @return true if XML schema definition of this Class is that - * of a global - * element or element with anonymous type definition. - */ - public boolean isElementDefinition( - ) { - return _elementDefinition; - } + /** + * Method 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/schemabinding/version2/descriptors/SequenceDescriptor.java b/src/jalview/schemabinding/version2/descriptors/SequenceDescriptor.java index 2de6b0a..2303e1b 100644 --- a/src/jalview/schemabinding/version2/descriptors/SequenceDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/SequenceDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.Sequence; @@ -18,223 +18,241 @@ import jalview.schemabinding.version2.Sequence; * * @version $Revision$ $Date$ */ -public class SequenceDescriptor extends jalview.schemabinding.version2.descriptors.SequenceTypeDescriptor { - - - //--------------------------/ - //- 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 SequenceDescriptor() { - super(); - setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.SequenceTypeDescriptor()); - _nsURI = "www.vamsas.ac.uk/jalview/version2"; - _xmlName = "Sequence"; - _elementDefinition = true; - - //-- 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 - - //-- _dsseqid - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_dsseqid", "dsseqid", 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 - { - Sequence target = (Sequence) object; - return target.getDsseqid(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Sequence target = (Sequence) object; - target.setDsseqid( (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: _dsseqid - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); - } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - //-- _DBRefList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.DBRef.class, "_DBRefList", "DBRef", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Sequence target = (Sequence) object; - return target.getDBRef(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Sequence target = (Sequence) object; - target.addDBRef( (jalview.schemabinding.version2.DBRef) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - Sequence target = (Sequence) object; - target.removeAllDBRef(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.DBRef(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _DBRefList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope - } - desc.setValidator(fieldValidator); - } +public class SequenceDescriptor extends + jalview.schemabinding.version2.descriptors.SequenceTypeDescriptor +{ + + // --------------------------/ + // - 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; - //-----------/ - //- Methods -/ - //-----------/ + // ----------------/ + // - Constructors -/ + // ----------------/ - /** - * Method getAccessMode. - * - * @return the access mode specified for this class. - */ - public org.exolab.castor.mapping.AccessMode getAccessMode( - ) { + public SequenceDescriptor() + { + super(); + setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.SequenceTypeDescriptor()); + _nsURI = "www.vamsas.ac.uk/jalview/version2"; + _xmlName = "Sequence"; + _elementDefinition = true; + + // -- 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 + + // -- _dsseqid + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_dsseqid", "dsseqid", + 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 + { + Sequence target = (Sequence) object; + return target.getDsseqid(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Sequence target = (Sequence) object; + target.setDsseqid((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); - /** - * 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: _dsseqid + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.Sequence.class; - } + // -- _DBRefList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.DBRef.class, "_DBRefList", + "DBRef", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Sequence target = (Sequence) object; + return target.getDBRef(); + } - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix( - ) { - return _nsPrefix; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Sequence target = (Sequence) object; + target.addDBRef((jalview.schemabinding.version2.DBRef) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; - } + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + Sequence target = (Sequence) object; + target.removeAllDBRef(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; - } + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.DBRef(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(true); + addFieldDescriptor(desc); - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; + // -- validation code for: _DBRefList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + desc.setValidator(fieldValidator); + } - /** - * 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; - } + // -----------/ + // - 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.Sequence.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/schemabinding/version2/descriptors/SequenceSetDescriptor.java b/src/jalview/schemabinding/version2/descriptors/SequenceSetDescriptor.java index 1542223..cd74c6e 100644 --- a/src/jalview/schemabinding/version2/descriptors/SequenceSetDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/SequenceSetDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.SequenceSet; @@ -18,387 +18,455 @@ import jalview.schemabinding.version2.SequenceSet; * * @version $Revision$ $Date$ */ -public class SequenceSetDescriptor 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 SequenceSetDescriptor() { - super(); - _nsURI = "www.vamsas.ac.uk/jalview/version2"; - _xmlName = "SequenceSet"; - _elementDefinition = true; - - //-- 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 - - //-- _gapChar - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_gapChar", "gapChar", 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 - { - SequenceSet target = (SequenceSet) object; - return target.getGapChar(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SequenceSet target = (SequenceSet) object; - target.setGapChar( (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: _gapChar - 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 SequenceSetDescriptor 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 SequenceSetDescriptor() + { + super(); + _nsURI = "www.vamsas.ac.uk/jalview/version2"; + _xmlName = "SequenceSet"; + _elementDefinition = true; + + // -- 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 + + // -- _gapChar + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_gapChar", "gapChar", + 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 + { + SequenceSet target = (SequenceSet) object; + return target.getGapChar(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + SequenceSet target = (SequenceSet) object; + target.setGapChar((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _datasetId - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_datasetId", "datasetId", 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 - { - SequenceSet target = (SequenceSet) object; - return target.getDatasetId(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SequenceSet target = (SequenceSet) object; - target.setDatasetId( (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: _datasetId - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _gapChar + 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); + // -- _datasetId + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_datasetId", "datasetId", + 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 + { + SequenceSet target = (SequenceSet) object; + return target.getDatasetId(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + SequenceSet target = (SequenceSet) object; + target.setDatasetId((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - //-- _sequenceList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Sequence.class, "_sequenceList", "Sequence", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - SequenceSet target = (SequenceSet) object; - return target.getSequence(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SequenceSet target = (SequenceSet) object; - target.addSequence( (jalview.schemabinding.version2.Sequence) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - SequenceSet target = (SequenceSet) object; - target.removeAllSequence(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.Sequence(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _sequenceList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _datasetId + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + // -- initialize element descriptors + + // -- _sequenceList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.Sequence.class, "_sequenceList", + "Sequence", org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + SequenceSet target = (SequenceSet) object; + return target.getSequence(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + SequenceSet target = (SequenceSet) object; + target.addSequence((jalview.schemabinding.version2.Sequence) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _annotationList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Annotation.class, "_annotationList", "Annotation", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - SequenceSet target = (SequenceSet) object; - return target.getAnnotation(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SequenceSet target = (SequenceSet) object; - target.addAnnotation( (jalview.schemabinding.version2.Annotation) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - SequenceSet target = (SequenceSet) object; - target.removeAllAnnotation(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.Annotation(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _annotationList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope + } + + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + SequenceSet target = (SequenceSet) object; + target.removeAllSequence(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _sequenceSetPropertiesList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.SequenceSetProperties.class, "_sequenceSetPropertiesList", "sequenceSetProperties", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - SequenceSet target = (SequenceSet) object; - return target.getSequenceSetProperties(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SequenceSet target = (SequenceSet) object; - target.addSequenceSetProperties( (jalview.schemabinding.version2.SequenceSetProperties) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - SequenceSet target = (SequenceSet) object; - target.removeAllSequenceSetProperties(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.SequenceSetProperties(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _sequenceSetPropertiesList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.Sequence(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _sequenceList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope + } + desc.setValidator(fieldValidator); + // -- _annotationList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.Annotation.class, + "_annotationList", "Annotation", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + SequenceSet target = (SequenceSet) object; + return target.getAnnotation(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + SequenceSet target = (SequenceSet) object; + target.addAnnotation((jalview.schemabinding.version2.Annotation) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _alcodonFrameList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.AlcodonFrame.class, "_alcodonFrameList", "AlcodonFrame", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - SequenceSet target = (SequenceSet) object; - return target.getAlcodonFrame(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SequenceSet target = (SequenceSet) object; - target.addAlcodonFrame( (jalview.schemabinding.version2.AlcodonFrame) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - SequenceSet target = (SequenceSet) object; - target.removeAllAlcodonFrame(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.AlcodonFrame(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _alcodonFrameList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope + } + + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + SequenceSet target = (SequenceSet) object; + target.removeAllAnnotation(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.Annotation(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _annotationList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + desc.setValidator(fieldValidator); + // -- _sequenceSetPropertiesList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.SequenceSetProperties.class, + "_sequenceSetPropertiesList", "sequenceSetProperties", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + SequenceSet target = (SequenceSet) object; + return target.getSequenceSetProperties(); + } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + SequenceSet target = (SequenceSet) object; + target.addSequenceSetProperties((jalview.schemabinding.version2.SequenceSetProperties) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - //-----------/ - //- Methods -/ - //-----------/ + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + SequenceSet target = (SequenceSet) object; + target.removeAllSequenceSetProperties(); + } 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( - ) { - return null; - } + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.SequenceSetProperties(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(true); + 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: _sequenceSetPropertiesList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + desc.setValidator(fieldValidator); + // -- _alcodonFrameList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.AlcodonFrame.class, + "_alcodonFrameList", "AlcodonFrame", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + SequenceSet target = (SequenceSet) object; + return target.getAlcodonFrame(); + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.SequenceSet.class; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + SequenceSet target = (SequenceSet) object; + target.addAlcodonFrame((jalview.schemabinding.version2.AlcodonFrame) 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 void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + SequenceSet target = (SequenceSet) object; + target.removeAllAlcodonFrame(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; - } + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.AlcodonFrame(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(true); + addFieldDescriptor(desc); - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; + // -- validation code for: _alcodonFrameList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + desc.setValidator(fieldValidator); + } - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; - } + // -----------/ + // - Methods -/ + // -----------/ - /** - * Method isElementDefinition. - * - * @return true if XML schema definition of this Class is that - * of a global - * element or element with anonymous type definition. - */ - public boolean isElementDefinition( - ) { - return _elementDefinition; - } + /** + * Method 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.SequenceSet.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/schemabinding/version2/descriptors/SequenceSetPropertiesDescriptor.java b/src/jalview/schemabinding/version2/descriptors/SequenceSetPropertiesDescriptor.java index 5c8be83..409abdd 100644 --- a/src/jalview/schemabinding/version2/descriptors/SequenceSetPropertiesDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/SequenceSetPropertiesDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.SequenceSetProperties; @@ -18,214 +18,227 @@ import jalview.schemabinding.version2.SequenceSetProperties; * * @version $Revision$ $Date$ */ -public class SequenceSetPropertiesDescriptor 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 SequenceSetPropertiesDescriptor() { - super(); - _nsURI = "www.vamsas.ac.uk/jalview/version2"; - _xmlName = "sequenceSetProperties"; - _elementDefinition = true; - org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; - org.exolab.castor.mapping.FieldHandler handler = null; - org.exolab.castor.xml.FieldValidator fieldValidator = null; - //-- initialize attribute descriptors - - //-- _key - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_key", "key", 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 - { - SequenceSetProperties target = (SequenceSetProperties) object; - return target.getKey(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SequenceSetProperties target = (SequenceSetProperties) object; - target.setKey( (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: _key - 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); - //-- _value - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_value", "value", 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 - { - SequenceSetProperties target = (SequenceSetProperties) object; - return target.getValue(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SequenceSetProperties target = (SequenceSetProperties) object; - target.setValue( (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: _value - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); +public class SequenceSetPropertiesDescriptor 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 SequenceSetPropertiesDescriptor() + { + super(); + _nsURI = "www.vamsas.ac.uk/jalview/version2"; + _xmlName = "sequenceSetProperties"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + // -- initialize attribute descriptors + + // -- _key + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_key", "key", + 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 + { + SequenceSetProperties target = (SequenceSetProperties) object; + return target.getKey(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + SequenceSetProperties target = (SequenceSetProperties) object; + target.setKey((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - } - - - //-----------/ - //- Methods -/ - //-----------/ + } - /** - * 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); + + // -- validation code for: _key + 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); + // -- _value + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_value", "value", + 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 + { + SequenceSetProperties target = (SequenceSetProperties) object; + return target.getValue(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + SequenceSetProperties target = (SequenceSetProperties) object; + target.setValue((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * 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.SequenceSetProperties.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; + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _value + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors + + } + + // -----------/ + // - 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.SequenceSetProperties.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/schemabinding/version2/descriptors/SequenceTypeDescriptor.java b/src/jalview/schemabinding/version2/descriptors/SequenceTypeDescriptor.java index 27305e7..3ee3fa9 100644 --- a/src/jalview/schemabinding/version2/descriptors/SequenceTypeDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/SequenceTypeDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.SequenceType; @@ -18,293 +18,322 @@ import jalview.schemabinding.version2.SequenceType; * * @version $Revision$ $Date$ */ -public class SequenceTypeDescriptor 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 SequenceTypeDescriptor() { - super(); - _nsURI = "www.vamsas.ac.uk/jalview/version2"; - _xmlName = "SequenceType"; - _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 - - //-- _id - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", 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 - { - SequenceType target = (SequenceType) object; - return target.getId(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SequenceType target = (SequenceType) object; - target.setId( (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: _id - 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.Attribute); - desc.setImmutable(true); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - SequenceType target = (SequenceType) object; - return target.getDescription(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SequenceType target = (SequenceType) 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); - //-- initialize element descriptors - - //-- _sequence - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_sequence", "sequence", 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 - { - SequenceType target = (SequenceType) object; - return target.getSequence(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SequenceType target = (SequenceType) object; - target.setSequence( (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.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _sequence - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); +public class SequenceTypeDescriptor 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 SequenceTypeDescriptor() + { + super(); + _nsURI = "www.vamsas.ac.uk/jalview/version2"; + _xmlName = "SequenceType"; + _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 + + // -- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_id", "id", + 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 + { + SequenceType target = (SequenceType) object; + return target.getId(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + SequenceType target = (SequenceType) object; + target.setId((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _name - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", 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 - { - SequenceType target = (SequenceType) object; - return target.getName(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - SequenceType target = (SequenceType) 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.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _name - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _id + 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.Attribute); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + SequenceType target = (SequenceType) object; + return target.getDescription(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + SequenceType target = (SequenceType) object; + target.setDescription((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.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); + // -- initialize element descriptors + // -- _sequence + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_sequence", "sequence", + 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 + { + SequenceType target = (SequenceType) object; + return target.getSequence(); + } - //-----------/ - //- Methods -/ - //-----------/ + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + SequenceType target = (SequenceType) object; + target.setSequence((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.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + 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: _sequence + 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); + // -- _name + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_name", "name", + 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 + { + SequenceType target = (SequenceType) object; + return target.getName(); + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.SequenceType.class; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + SequenceType target = (SequenceType) object; + target.setName((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.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + 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: _name + 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); + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; - } + // -----------/ + // - Methods -/ + // -----------/ - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; - } + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } - /** - * Method isElementDefinition. - * - * @return true if XML schema definition of this Class is that - * of a global - * element or element with anonymous type definition. - */ - public boolean isElementDefinition( - ) { - return _elementDefinition; - } + /** + * Method 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.SequenceType.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/schemabinding/version2/descriptors/SettingDescriptor.java b/src/jalview/schemabinding/version2/descriptors/SettingDescriptor.java index 9c2de5b..4703f46 100644 --- a/src/jalview/schemabinding/version2/descriptors/SettingDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/SettingDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.Setting; @@ -18,603 +18,736 @@ import jalview.schemabinding.version2.Setting; * * @version $Revision$ $Date$ */ -public class SettingDescriptor 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 SettingDescriptor() { - super(); - _nsURI = "www.jalview.org"; - _xmlName = "setting"; - _elementDefinition = true; - org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; - org.exolab.castor.mapping.FieldHandler handler = null; - org.exolab.castor.xml.FieldValidator fieldValidator = null; - //-- initialize attribute descriptors - - //-- _type - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_type", "type", 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 - { - Setting target = (Setting) object; - return target.getType(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Setting target = (Setting) object; - target.setType( (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: _type - 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 SettingDescriptor 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 SettingDescriptor() + { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "setting"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + // -- initialize attribute descriptors + + // -- _type + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_type", "type", + 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 + { + Setting target = (Setting) object; + return target.getType(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Setting target = (Setting) object; + target.setType((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _colour - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_colour", "colour", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Setting target = (Setting) object; - if (!target.hasColour()) { return null; } - return new java.lang.Integer(target.getColour()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Setting target = (Setting) object; - // ignore null values for non optional primitives - if (value == null) { return; } - - target.setColour( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _colour - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _type + 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); + // -- _colour + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_colour", "colour", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Setting target = (Setting) object; + if (!target.hasColour()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _display - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_display", "display", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Setting target = (Setting) object; - if (!target.hasDisplay()) { return null; } - return (target.getDisplay() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Setting target = (Setting) object; - // ignore null values for non optional primitives - if (value == null) { return; } - - target.setDisplay( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _display - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + return new java.lang.Integer(target.getColour()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Setting target = (Setting) object; + // ignore null values for non optional primitives + if (value == null) + { + return; + } + + target.setColour(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _order - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_order", "order", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Setting target = (Setting) object; - if (!target.hasOrder()) { return null; } - return new java.lang.Float(target.getOrder()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Setting target = (Setting) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteOrder(); - return; - } - target.setOrder( ((java.lang.Float) value).floatValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _order - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.FloatValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive((float) -3.4028235E38); - typeValidator.setMaxInclusive((float) 3.4028235E38); + } + + 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: _colour + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _display + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_display", "display", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Setting target = (Setting) object; + if (!target.hasDisplay()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _mincolour - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_mincolour", "mincolour", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Setting target = (Setting) object; - if (!target.hasMincolour()) { return null; } - return new java.lang.Integer(target.getMincolour()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Setting target = (Setting) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteMincolour(); - return; - } - target.setMincolour( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _mincolour - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + return (target.getDisplay() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Setting target = (Setting) object; + // ignore null values for non optional primitives + if (value == null) + { + return; + } + + target.setDisplay(((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _threshold - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_threshold", "threshold", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Setting target = (Setting) object; - if (!target.hasThreshold()) { return null; } - return new java.lang.Float(target.getThreshold()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Setting target = (Setting) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteThreshold(); - return; - } - target.setThreshold( ((java.lang.Float) value).floatValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _threshold - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.FloatValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive((float) -3.4028235E38); - typeValidator.setMaxInclusive((float) 3.4028235E38); + } + + 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: _display + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _order + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Float.TYPE, "_order", "order", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Setting target = (Setting) object; + if (!target.hasOrder()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _threshstate - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_threshstate", "threshstate", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Setting target = (Setting) object; - if (!target.hasThreshstate()) { return null; } - return new java.lang.Integer(target.getThreshstate()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Setting target = (Setting) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteThreshstate(); - return; - } - target.setThreshstate( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _threshstate - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + return new java.lang.Float(target.getOrder()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Setting target = (Setting) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteOrder(); + return; + } + target.setOrder(((java.lang.Float) value).floatValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _max - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_max", "max", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Setting target = (Setting) object; - if (!target.hasMax()) { return null; } - return new java.lang.Float(target.getMax()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Setting target = (Setting) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteMax(); - return; - } - target.setMax( ((java.lang.Float) value).floatValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _max - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.FloatValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive((float) -3.4028235E38); - typeValidator.setMaxInclusive((float) 3.4028235E38); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _order + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.FloatValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive((float) -3.4028235E38); + typeValidator.setMaxInclusive((float) 3.4028235E38); + } + desc.setValidator(fieldValidator); + // -- _mincolour + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_mincolour", "mincolour", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Setting target = (Setting) object; + if (!target.hasMincolour()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _min - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_min", "min", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Setting target = (Setting) object; - if (!target.hasMin()) { return null; } - return new java.lang.Float(target.getMin()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Setting target = (Setting) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteMin(); - return; - } - target.setMin( ((java.lang.Float) value).floatValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _min - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.FloatValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive((float) -3.4028235E38); - typeValidator.setMaxInclusive((float) 3.4028235E38); + return new java.lang.Integer(target.getMincolour()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Setting target = (Setting) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteMincolour(); + return; + } + target.setMincolour(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _colourByLabel - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_colourByLabel", "colourByLabel", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Setting target = (Setting) object; - if (!target.hasColourByLabel()) { return null; } - return (target.getColourByLabel() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Setting target = (Setting) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteColourByLabel(); - return; - } - target.setColourByLabel( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _colourByLabel - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _mincolour + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _threshold + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Float.TYPE, "_threshold", "threshold", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Setting target = (Setting) object; + if (!target.hasThreshold()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _autoScale - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_autoScale", "autoScale", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Setting target = (Setting) object; - if (!target.hasAutoScale()) { return null; } - return (target.getAutoScale() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Setting target = (Setting) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteAutoScale(); - return; - } - target.setAutoScale( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _autoScale - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + return new java.lang.Float(target.getThreshold()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Setting target = (Setting) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteThreshold(); + return; + } + target.setThreshold(((java.lang.Float) value).floatValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + // -- validation code for: _threshold + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.FloatValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive((float) -3.4028235E38); + typeValidator.setMaxInclusive((float) 3.4028235E38); + } + desc.setValidator(fieldValidator); + // -- _threshstate + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_threshstate", "threshstate", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Setting target = (Setting) object; + if (!target.hasThreshstate()) + { + return null; + } + return new java.lang.Integer(target.getThreshstate()); + } - //-----------/ - //- Methods -/ - //-----------/ + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Setting target = (Setting) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteThreshstate(); + return; + } + target.setThreshstate(((java.lang.Integer) value).intValue()); + } 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: _threshstate + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- _max + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Float.TYPE, "_max", "max", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Setting target = (Setting) object; + if (!target.hasMax()) + { + return null; + } + return new java.lang.Float(target.getMax()); + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.Setting.class; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Setting target = (Setting) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteMax(); + return; + } + target.setMax(((java.lang.Float) value).floatValue()); + } 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: _max + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.FloatValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive((float) -3.4028235E38); + typeValidator.setMaxInclusive((float) 3.4028235E38); } + desc.setValidator(fieldValidator); + // -- _min + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Float.TYPE, "_min", "min", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Setting target = (Setting) object; + if (!target.hasMin()) + { + return null; + } + return new java.lang.Float(target.getMin()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Setting target = (Setting) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteMin(); + return; + } + target.setMin(((java.lang.Float) value).floatValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _min + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.FloatValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive((float) -3.4028235E38); + typeValidator.setMaxInclusive((float) 3.4028235E38); } + desc.setValidator(fieldValidator); + // -- _colourByLabel + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_colourByLabel", "colourByLabel", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Setting target = (Setting) object; + if (!target.hasColourByLabel()) + { + return null; + } + return (target.getColourByLabel() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Setting target = (Setting) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteColourByLabel(); + return; + } + target.setColourByLabel(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _colourByLabel + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- _autoScale + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_autoScale", "autoScale", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Setting target = (Setting) object; + if (!target.hasAutoScale()) + { + return null; + } + return (target.getAutoScale() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } - /** - * 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 + { + Setting target = (Setting) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteAutoScale(); + return; + } + target.setAutoScale(((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _autoScale + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors + + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return super.getIdentity(); + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.Setting.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/schemabinding/version2/descriptors/StructureStateDescriptor.java b/src/jalview/schemabinding/version2/descriptors/StructureStateDescriptor.java index 8759859..16d091b 100644 --- a/src/jalview/schemabinding/version2/descriptors/StructureStateDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/StructureStateDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.StructureState; @@ -18,586 +18,710 @@ import jalview.schemabinding.version2.StructureState; * * @version $Revision$ $Date$ */ -public class StructureStateDescriptor 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 StructureStateDescriptor() { - super(); - _nsURI = "www.jalview.org"; - _xmlName = "structureState"; - _elementDefinition = true; - org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; - org.exolab.castor.mapping.FieldHandler handler = null; - org.exolab.castor.xml.FieldValidator fieldValidator = null; - //-- _content - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text); - desc.setImmutable(true); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - StructureState target = (StructureState) object; - return target.getContent(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - StructureState target = (StructureState) object; - target.setContent( (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); - addFieldDescriptor(desc); - - //-- validation code for: _content - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); - } - desc.setValidator(fieldValidator); - //-- initialize attribute descriptors - - //-- _visible - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_visible", "visible", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - StructureState target = (StructureState) object; - if (!target.hasVisible()) { return null; } - return (target.getVisible() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - StructureState target = (StructureState) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteVisible(); - return; - } - target.setVisible( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _visible - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); +public class StructureStateDescriptor 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 StructureStateDescriptor() + { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "structureState"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + // -- _content + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_content", "PCDATA", + org.exolab.castor.xml.NodeType.Text); + desc.setImmutable(true); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + StructureState target = (StructureState) object; + return target.getContent(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + StructureState target = (StructureState) object; + target.setContent((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _viewId - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_viewId", "viewId", 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 - { - StructureState target = (StructureState) object; - return target.getViewId(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - StructureState target = (StructureState) object; - target.setViewId( (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: _viewId - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + addFieldDescriptor(desc); + + // -- validation code for: _content + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.StringValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.StringValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setWhiteSpace("preserve"); + } + desc.setValidator(fieldValidator); + // -- initialize attribute descriptors + + // -- _visible + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_visible", "visible", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + StructureState target = (StructureState) object; + if (!target.hasVisible()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _alignwithAlignPanel - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_alignwithAlignPanel", "alignwithAlignPanel", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - StructureState target = (StructureState) object; - if (!target.hasAlignwithAlignPanel()) { return null; } - return (target.getAlignwithAlignPanel() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - StructureState target = (StructureState) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteAlignwithAlignPanel(); - return; - } - target.setAlignwithAlignPanel( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _alignwithAlignPanel - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + return (target.getVisible() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + StructureState target = (StructureState) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteVisible(); + return; + } + target.setVisible(((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _colourwithAlignPanel - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_colourwithAlignPanel", "colourwithAlignPanel", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - StructureState target = (StructureState) object; - if (!target.hasColourwithAlignPanel()) { return null; } - return (target.getColourwithAlignPanel() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - StructureState target = (StructureState) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteColourwithAlignPanel(); - return; - } - target.setColourwithAlignPanel( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _colourwithAlignPanel - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _visible + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _viewId + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_viewId", "viewId", + 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 + { + StructureState target = (StructureState) object; + return target.getViewId(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + StructureState target = (StructureState) object; + target.setViewId((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _colourByJmol - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_colourByJmol", "colourByJmol", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - StructureState target = (StructureState) object; - if (!target.hasColourByJmol()) { return null; } - return (target.getColourByJmol() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - StructureState target = (StructureState) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteColourByJmol(); - return; - } - target.setColourByJmol( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _colourByJmol - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _viewId + 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); + // -- _alignwithAlignPanel + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_alignwithAlignPanel", + "alignwithAlignPanel", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + StructureState target = (StructureState) object; + if (!target.hasAlignwithAlignPanel()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _type - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_type", "type", 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 - { - StructureState target = (StructureState) object; - return target.getType(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - StructureState target = (StructureState) object; - target.setType( (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: _type - 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"); + return (target.getAlignwithAlignPanel() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + StructureState target = (StructureState) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteAlignwithAlignPanel(); + return; + } + target.setAlignwithAlignPanel(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _width - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_width", "width", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - StructureState target = (StructureState) object; - if (!target.hasWidth()) { return null; } - return new java.lang.Integer(target.getWidth()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - StructureState target = (StructureState) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteWidth(); - return; - } - target.setWidth( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _width - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _alignwithAlignPanel + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _colourwithAlignPanel + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_colourwithAlignPanel", + "colourwithAlignPanel", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + StructureState target = (StructureState) object; + if (!target.hasColourwithAlignPanel()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _height - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_height", "height", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - StructureState target = (StructureState) object; - if (!target.hasHeight()) { return null; } - return new java.lang.Integer(target.getHeight()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - StructureState target = (StructureState) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteHeight(); - return; - } - target.setHeight( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _height - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + return (target.getColourwithAlignPanel() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + StructureState target = (StructureState) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteColourwithAlignPanel(); + return; + } + target.setColourwithAlignPanel(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _xpos - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_xpos", "xpos", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - StructureState target = (StructureState) object; - if (!target.hasXpos()) { return null; } - return new java.lang.Integer(target.getXpos()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - StructureState target = (StructureState) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteXpos(); - return; - } - target.setXpos( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _xpos - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _colourwithAlignPanel + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _colourByJmol + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_colourByJmol", "colourByJmol", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + StructureState target = (StructureState) object; + if (!target.hasColourByJmol()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _ypos - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_ypos", "ypos", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - StructureState target = (StructureState) object; - if (!target.hasYpos()) { return null; } - return new java.lang.Integer(target.getYpos()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - StructureState target = (StructureState) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteYpos(); - return; - } - target.setYpos( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _ypos - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + return (target.getColourByJmol() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + StructureState target = (StructureState) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteColourByJmol(); + return; + } + target.setColourByJmol(((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - } + } + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - //-----------/ - //- Methods -/ - //-----------/ + // -- validation code for: _colourByJmol + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _type + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_type", "type", + 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 + { + StructureState target = (StructureState) object; + return target.getType(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + StructureState target = (StructureState) object; + target.setType((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: _type + 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); + // -- _width + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_width", "width", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + StructureState target = (StructureState) object; + if (!target.hasWidth()) + { + return null; + } + return new java.lang.Integer(target.getWidth()); + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.StructureState.class; - } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + StructureState target = (StructureState) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteWidth(); + return; + } + target.setWidth(((java.lang.Integer) value).intValue()); + } 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: _width + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- _height + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_height", "height", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + StructureState target = (StructureState) object; + if (!target.hasHeight()) + { + return null; + } + return new java.lang.Integer(target.getHeight()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + StructureState target = (StructureState) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteHeight(); + return; + } + target.setHeight(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _height + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- _xpos + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_xpos", "xpos", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + StructureState target = (StructureState) object; + if (!target.hasXpos()) + { + return null; + } + return new java.lang.Integer(target.getXpos()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + StructureState target = (StructureState) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteXpos(); + return; + } + target.setXpos(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; + // -- validation code for: _xpos + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- _ypos + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_ypos", "ypos", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + StructureState target = (StructureState) object; + if (!target.hasYpos()) + { + return null; + } + return new java.lang.Integer(target.getYpos()); + } - /** - * 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 + { + StructureState target = (StructureState) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteYpos(); + return; + } + target.setYpos(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _ypos + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors + + } + + // -----------/ + // - Methods -/ + // -----------/ + + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } + + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return super.getIdentity(); + } + + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.StructureState.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/schemabinding/version2/descriptors/ThresholdLineDescriptor.java b/src/jalview/schemabinding/version2/descriptors/ThresholdLineDescriptor.java index 851ccb2..8a863d8 100644 --- a/src/jalview/schemabinding/version2/descriptors/ThresholdLineDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/ThresholdLineDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.ThresholdLine; @@ -18,263 +18,292 @@ import jalview.schemabinding.version2.ThresholdLine; * * @version $Revision$ $Date$ */ -public class ThresholdLineDescriptor 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 ThresholdLineDescriptor() { - super(); - _nsURI = "www.vamsas.ac.uk/jalview/version2"; - _xmlName = "thresholdLine"; - _elementDefinition = true; - org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; - org.exolab.castor.mapping.FieldHandler handler = null; - org.exolab.castor.xml.FieldValidator fieldValidator = null; - //-- initialize attribute descriptors - - //-- _label - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_label", "label", 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 - { - ThresholdLine target = (ThresholdLine) object; - return target.getLabel(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - ThresholdLine target = (ThresholdLine) object; - target.setLabel( (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: _label - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); +public class ThresholdLineDescriptor 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 ThresholdLineDescriptor() + { + super(); + _nsURI = "www.vamsas.ac.uk/jalview/version2"; + _xmlName = "thresholdLine"; + _elementDefinition = true; + org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null; + org.exolab.castor.mapping.FieldHandler handler = null; + org.exolab.castor.xml.FieldValidator fieldValidator = null; + // -- initialize attribute descriptors + + // -- _label + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_label", "label", + 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 + { + ThresholdLine target = (ThresholdLine) object; + return target.getLabel(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + ThresholdLine target = (ThresholdLine) object; + target.setLabel((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _value - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_value", "value", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - ThresholdLine target = (ThresholdLine) object; - if (!target.hasValue()) { return null; } - return new java.lang.Float(target.getValue()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - ThresholdLine target = (ThresholdLine) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteValue(); - return; - } - target.setValue( ((java.lang.Float) value).floatValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _value - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.FloatValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive((float) -3.4028235E38); - typeValidator.setMaxInclusive((float) 3.4028235E38); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _label + 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); + // -- _value + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Float.TYPE, "_value", "value", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + ThresholdLine target = (ThresholdLine) object; + if (!target.hasValue()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _colour - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_colour", "colour", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - ThresholdLine target = (ThresholdLine) object; - if (!target.hasColour()) { return null; } - return new java.lang.Integer(target.getColour()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - ThresholdLine target = (ThresholdLine) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteColour(); - return; - } - target.setColour( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _colour - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + return new java.lang.Float(target.getValue()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + ThresholdLine target = (ThresholdLine) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteValue(); + return; + } + target.setValue(((java.lang.Float) value).floatValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - } + } + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _value + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.FloatValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive((float) -3.4028235E38); + typeValidator.setMaxInclusive((float) 3.4028235E38); + } + desc.setValidator(fieldValidator); + // -- _colour + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_colour", "colour", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + ThresholdLine target = (ThresholdLine) object; + if (!target.hasColour()) + { + return null; + } + return new java.lang.Integer(target.getColour()); + } - //-----------/ - //- Methods -/ - //-----------/ + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + ThresholdLine target = (ThresholdLine) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteColour(); + return; + } + target.setColour(((java.lang.Integer) value).intValue()); + } 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: _colour + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.ThresholdLine.class; - } + } - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix( - ) { - return _nsPrefix; - } + // -----------/ + // - Methods -/ + // -----------/ - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; - } + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; - } + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return super.getIdentity(); + } - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; - } + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.ThresholdLine.class; + } - /** - * Method isElementDefinition. - * - * @return true if XML schema definition of this Class is that - * of a global - * element or element with anonymous type definition. - */ - public boolean isElementDefinition( - ) { - return _elementDefinition; - } + /** + * Method 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/schemabinding/version2/descriptors/TreeDescriptor.java b/src/jalview/schemabinding/version2/descriptors/TreeDescriptor.java index 5beffc1..8e675f3 100644 --- a/src/jalview/schemabinding/version2/descriptors/TreeDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/TreeDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.Tree; @@ -18,798 +18,978 @@ import jalview.schemabinding.version2.Tree; * * @version $Revision$ $Date$ */ -public class TreeDescriptor 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 TreeDescriptor() { - super(); - _nsURI = "www.jalview.org"; - _xmlName = "tree"; - _elementDefinition = true; - - //-- 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 - - //-- _fontName - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_fontName", "fontName", 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 - { - Tree target = (Tree) object; - return target.getFontName(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Tree target = (Tree) object; - target.setFontName( (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: _fontName - 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); - //-- _fontSize - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_fontSize", "fontSize", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Tree target = (Tree) object; - if (!target.hasFontSize()) { return null; } - return new java.lang.Integer(target.getFontSize()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Tree target = (Tree) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteFontSize(); - return; - } - target.setFontSize( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _fontSize - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); +public class TreeDescriptor 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 TreeDescriptor() + { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "tree"; + _elementDefinition = true; + + // -- 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 + + // -- _fontName + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_fontName", "fontName", + 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 + { + Tree target = (Tree) object; + return target.getFontName(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Tree target = (Tree) object; + target.setFontName((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _fontStyle - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_fontStyle", "fontStyle", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Tree target = (Tree) object; - if (!target.hasFontStyle()) { return null; } - return new java.lang.Integer(target.getFontStyle()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Tree target = (Tree) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteFontStyle(); - return; - } - target.setFontStyle( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _fontStyle - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _fontName + 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); + // -- _fontSize + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_fontSize", "fontSize", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Tree target = (Tree) object; + if (!target.hasFontSize()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _threshold - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Float.TYPE, "_threshold", "threshold", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Tree target = (Tree) object; - if (!target.hasThreshold()) { return null; } - return new java.lang.Float(target.getThreshold()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Tree target = (Tree) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteThreshold(); - return; - } - target.setThreshold( ((java.lang.Float) value).floatValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _threshold - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.FloatValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive((float) -3.4028235E38); - typeValidator.setMaxInclusive((float) 3.4028235E38); + return new java.lang.Integer(target.getFontSize()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteFontSize(); + return; + } + target.setFontSize(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _showBootstrap - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showBootstrap", "showBootstrap", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Tree target = (Tree) object; - if (!target.hasShowBootstrap()) { return null; } - return (target.getShowBootstrap() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Tree target = (Tree) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteShowBootstrap(); - return; - } - target.setShowBootstrap( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _showBootstrap - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _fontSize + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _fontStyle + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_fontStyle", "fontStyle", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Tree target = (Tree) object; + if (!target.hasFontStyle()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _showDistances - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showDistances", "showDistances", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Tree target = (Tree) object; - if (!target.hasShowDistances()) { return null; } - return (target.getShowDistances() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Tree target = (Tree) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteShowDistances(); - return; - } - target.setShowDistances( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _showDistances - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + return new java.lang.Integer(target.getFontStyle()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteFontStyle(); + return; + } + target.setFontStyle(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _markUnlinked - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_markUnlinked", "markUnlinked", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Tree target = (Tree) object; - if (!target.hasMarkUnlinked()) { return null; } - return (target.getMarkUnlinked() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Tree target = (Tree) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteMarkUnlinked(); - return; - } - target.setMarkUnlinked( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _markUnlinked - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _fontStyle + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _threshold + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Float.TYPE, "_threshold", "threshold", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Tree target = (Tree) object; + if (!target.hasThreshold()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _fitToWindow - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_fitToWindow", "fitToWindow", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Tree target = (Tree) object; - if (!target.hasFitToWindow()) { return null; } - return (target.getFitToWindow() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Tree target = (Tree) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteFitToWindow(); - return; - } - target.setFitToWindow( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _fitToWindow - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + return new java.lang.Float(target.getThreshold()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteThreshold(); + return; + } + target.setThreshold(((java.lang.Float) value).floatValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _currentTree - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_currentTree", "currentTree", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Tree target = (Tree) object; - if (!target.hasCurrentTree()) { return null; } - return (target.getCurrentTree() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Tree target = (Tree) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteCurrentTree(); - return; - } - target.setCurrentTree( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _currentTree - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _threshold + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.FloatValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.FloatValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive((float) -3.4028235E38); + typeValidator.setMaxInclusive((float) 3.4028235E38); + } + desc.setValidator(fieldValidator); + // -- _showBootstrap + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showBootstrap", "showBootstrap", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Tree target = (Tree) object; + if (!target.hasShowBootstrap()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _id - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); - super.setIdentity(desc); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Tree target = (Tree) object; - return target.getId(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Tree target = (Tree) object; - target.setId( (java.lang.String) value); - } 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.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _id - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IdValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IdValidator(); - fieldValidator.setValidator(typeValidator); + return (target.getShowBootstrap() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowBootstrap(); + return; + } + target.setShowBootstrap(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _width - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_width", "width", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Tree target = (Tree) object; - if (!target.hasWidth()) { return null; } - return new java.lang.Integer(target.getWidth()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Tree target = (Tree) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteWidth(); - return; - } - target.setWidth( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _width - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _showBootstrap + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _showDistances + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showDistances", "showDistances", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Tree target = (Tree) object; + if (!target.hasShowDistances()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _height - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_height", "height", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Tree target = (Tree) object; - if (!target.hasHeight()) { return null; } - return new java.lang.Integer(target.getHeight()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Tree target = (Tree) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteHeight(); - return; - } - target.setHeight( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _height - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + return (target.getShowDistances() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowDistances(); + return; + } + target.setShowDistances(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _xpos - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_xpos", "xpos", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Tree target = (Tree) object; - if (!target.hasXpos()) { return null; } - return new java.lang.Integer(target.getXpos()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Tree target = (Tree) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteXpos(); - return; - } - target.setXpos( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _xpos - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _showDistances + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _markUnlinked + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_markUnlinked", "markUnlinked", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Tree target = (Tree) object; + if (!target.hasMarkUnlinked()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _ypos - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_ypos", "ypos", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Tree target = (Tree) object; - if (!target.hasYpos()) { return null; } - return new java.lang.Integer(target.getYpos()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Tree target = (Tree) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteYpos(); - return; - } - target.setYpos( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _ypos - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); + return (target.getMarkUnlinked() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteMarkUnlinked(); + return; + } + target.setMarkUnlinked(((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - //-- _title - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_title", "title", 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 - { - Tree target = (Tree) object; - return target.getTitle(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Tree target = (Tree) object; - target.setTitle( (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.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _title - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _markUnlinked + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _fitToWindow + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_fitToWindow", "fitToWindow", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Tree target = (Tree) object; + if (!target.hasFitToWindow()) + { + return null; } - desc.setValidator(fieldValidator); - //-- _newick - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_newick", "newick", 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 - { - Tree target = (Tree) object; - return target.getNewick(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Tree target = (Tree) object; - target.setNewick( (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.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _newick - 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"); + return (target.getFitToWindow() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteFitToWindow(); + return; + } + target.setFitToWindow(((java.lang.Boolean) value).booleanValue()); + } 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.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _fitToWindow + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _currentTree + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_currentTree", "currentTree", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Tree target = (Tree) object; + if (!target.hasCurrentTree()) + { + return null; + } + return (target.getCurrentTree() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } - //-----------/ - //- Methods -/ - //-----------/ + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteCurrentTree(); + return; + } + target.setCurrentTree(((java.lang.Boolean) value).booleanValue()); + } 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); + + // -- validation code for: _currentTree + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_id", "id", + org.exolab.castor.xml.NodeType.Attribute); + super.setIdentity(desc); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Tree target = (Tree) object; + return target.getId(); + } - /** - * Method getIdentity. - * - * @return the identity field, null if this class has no - * identity. - */ - public org.exolab.castor.mapping.FieldDescriptor getIdentity( - ) { - return super.getIdentity(); + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Tree target = (Tree) object; + target.setId((java.lang.String) value); + } 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.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _id + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IdValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- _width + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_width", "width", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Tree target = (Tree) object; + if (!target.hasWidth()) + { + return null; + } + return new java.lang.Integer(target.getWidth()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteWidth(); + return; + } + target.setWidth(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.Tree.class; + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _width + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- _height + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_height", "height", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Tree target = (Tree) object; + if (!target.hasHeight()) + { + return null; + } + return new java.lang.Integer(target.getHeight()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteHeight(); + return; + } + target.setHeight(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix( - ) { - return _nsPrefix; + // -- validation code for: _height + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- _xpos + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_xpos", "xpos", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Tree target = (Tree) object; + if (!target.hasXpos()) + { + return null; + } + return new java.lang.Integer(target.getXpos()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteXpos(); + return; + } + target.setXpos(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; + // -- validation code for: _xpos + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- _ypos + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_ypos", "ypos", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Tree target = (Tree) object; + if (!target.hasYpos()) + { + return null; + } + return new java.lang.Integer(target.getYpos()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Tree target = (Tree) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteYpos(); + return; + } + target.setYpos(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _ypos + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- initialize element descriptors + + // -- _title + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_title", "title", + 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 + { + Tree target = (Tree) object; + return target.getTitle(); + } - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Tree target = (Tree) object; + target.setTitle((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.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _title + 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); + // -- _newick + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_newick", "newick", + 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 + { + Tree target = (Tree) object; + return target.getNewick(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Tree target = (Tree) object; + target.setNewick((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - /** - * 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 java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _newick + 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); + } + + // -----------/ + // - 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.Tree.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/schemabinding/version2/descriptors/UserColourSchemeDescriptor.java b/src/jalview/schemabinding/version2/descriptors/UserColourSchemeDescriptor.java index 7fcc16f..527b16b 100644 --- a/src/jalview/schemabinding/version2/descriptors/UserColourSchemeDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/UserColourSchemeDescriptor.java @@ -7,145 +7,142 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ -import jalview.schemabinding.version2.UserColourScheme; /** * Class UserColourSchemeDescriptor. * * @version $Revision$ $Date$ */ -public class UserColourSchemeDescriptor extends jalview.schemabinding.version2.descriptors.JalviewUserColoursDescriptor { - - - //--------------------------/ - //- 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 UserColourSchemeDescriptor() { - super(); - setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.JalviewUserColoursDescriptor()); - _nsURI = "www.jalview.org"; - _xmlName = "UserColourScheme"; - _elementDefinition = true; - } - - - //-----------/ - //- 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.UserColourScheme.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; - } +public class UserColourSchemeDescriptor + extends + jalview.schemabinding.version2.descriptors.JalviewUserColoursDescriptor +{ + + // --------------------------/ + // - 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 UserColourSchemeDescriptor() + { + super(); + setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.JalviewUserColoursDescriptor()); + _nsURI = "www.jalview.org"; + _xmlName = "UserColourScheme"; + _elementDefinition = true; + } + + // -----------/ + // - 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.UserColourScheme.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/schemabinding/version2/descriptors/UserColoursDescriptor.java b/src/jalview/schemabinding/version2/descriptors/UserColoursDescriptor.java index e5e799b..53dfde4 100644 --- a/src/jalview/schemabinding/version2/descriptors/UserColoursDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/UserColoursDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.UserColours; @@ -18,215 +18,229 @@ import jalview.schemabinding.version2.UserColours; * * @version $Revision$ $Date$ */ -public class UserColoursDescriptor 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 UserColoursDescriptor() { - super(); - _nsURI = "www.jalview.org"; - _xmlName = "UserColours"; - _elementDefinition = true; - - //-- 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 - - //-- _id - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", 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 - { - UserColours target = (UserColours) object; - return target.getId(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - UserColours target = (UserColours) object; - target.setId( (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: _id - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.StringValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.StringValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setWhiteSpace("preserve"); - } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - //-- _userColourScheme - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.UserColourScheme.class, "_userColourScheme", "UserColourScheme", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - UserColours target = (UserColours) object; - return target.getUserColourScheme(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - UserColours target = (UserColours) object; - target.setUserColourScheme( (jalview.schemabinding.version2.UserColourScheme) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.UserColourScheme(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setRequired(true); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _userColourScheme - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(1); - { //-- local scope +public class UserColoursDescriptor 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 UserColoursDescriptor() + { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "UserColours"; + _elementDefinition = true; + + // -- 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 + + // -- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_id", "id", + 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 + { + UserColours target = (UserColours) object; + return target.getId(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + UserColours target = (UserColours) object; + target.setId((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - } - - - //-----------/ - //- Methods -/ - //-----------/ + } - /** - * 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); + + // -- validation code for: _id + 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"); } - - /** - * 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.UserColours.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; + desc.setValidator(fieldValidator); + // -- initialize element descriptors + + // -- _userColourScheme + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.UserColourScheme.class, + "_userColourScheme", "UserColourScheme", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + UserColours target = (UserColours) object; + return target.getUserColourScheme(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + UserColours target = (UserColours) object; + target.setUserColourScheme((jalview.schemabinding.version2.UserColourScheme) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.UserColourScheme(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setRequired(true); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _userColourScheme + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(1); + { // -- local scope } + 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.UserColours.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/schemabinding/version2/descriptors/VAMSASDescriptor.java b/src/jalview/schemabinding/version2/descriptors/VAMSASDescriptor.java index 730fe2e..e3470ee 100644 --- a/src/jalview/schemabinding/version2/descriptors/VAMSASDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/VAMSASDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.VAMSAS; @@ -18,232 +18,256 @@ import jalview.schemabinding.version2.VAMSAS; * * @version $Revision$ $Date$ */ -public class VAMSASDescriptor 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 VAMSASDescriptor() { - super(); - _nsURI = "www.vamsas.ac.uk/jalview/version2"; - _xmlName = "VAMSAS"; - _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 - - //-- initialize element descriptors - - //-- _treeList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_treeList", "Tree", 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 - { - VAMSAS target = (VAMSAS) object; - return target.getTree(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - VAMSAS target = (VAMSAS) object; - target.addTree( (java.lang.String) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - VAMSAS target = (VAMSAS) object; - target.removeAllTree(); - } 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.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _treeList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- 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 VAMSASDescriptor 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 VAMSASDescriptor() + { + super(); + _nsURI = "www.vamsas.ac.uk/jalview/version2"; + _xmlName = "VAMSAS"; + _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 + + // -- initialize element descriptors + + // -- _treeList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_treeList", "Tree", + 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 + { + VAMSAS target = (VAMSAS) object; + return target.getTree(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + VAMSAS target = (VAMSAS) object; + target.addTree((java.lang.String) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); } - desc.setValidator(fieldValidator); - //-- _sequenceSetList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.SequenceSet.class, "_sequenceSetList", "SequenceSet", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - VAMSAS target = (VAMSAS) object; - return target.getSequenceSet(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - VAMSAS target = (VAMSAS) object; - target.addSequenceSet( (jalview.schemabinding.version2.SequenceSet) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - VAMSAS target = (VAMSAS) object; - target.removeAllSequenceSet(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.SequenceSet(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _sequenceSetList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope + } + + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + VAMSAS target = (VAMSAS) object; + target.removeAllTree(); + } 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.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _treeList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- 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); + // -- _sequenceSetList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.SequenceSet.class, + "_sequenceSetList", "SequenceSet", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + VAMSAS target = (VAMSAS) object; + return target.getSequenceSet(); + } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + VAMSAS target = (VAMSAS) object; + target.addSequenceSet((jalview.schemabinding.version2.SequenceSet) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } - //-----------/ - //- Methods -/ - //-----------/ + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + VAMSAS target = (VAMSAS) object; + target.removeAllSequenceSet(); + } 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( - ) { - return null; - } + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.SequenceSet(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2"); + desc.setMultivalued(true); + 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: _sequenceSetList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope } + desc.setValidator(fieldValidator); + } - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.VAMSAS.class; - } + // -----------/ + // - Methods -/ + // -----------/ - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix( - ) { - return _nsPrefix; - } + /** + * Method getAccessMode. + * + * @return the access mode specified for this class. + */ + public org.exolab.castor.mapping.AccessMode getAccessMode() + { + return null; + } - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; - } + /** + * Method getIdentity. + * + * @return the identity field, null if this class has no identity. + */ + public org.exolab.castor.mapping.FieldDescriptor getIdentity() + { + return super.getIdentity(); + } - /** - * Method getValidator. - * - * @return a specific validator for the class described by this - * ClassDescriptor. - */ - public org.exolab.castor.xml.TypeValidator getValidator( - ) { - return this; - } + /** + * Method getJavaClass. + * + * @return the Java class represented by this descriptor. + */ + public java.lang.Class getJavaClass() + { + return jalview.schemabinding.version2.VAMSAS.class; + } - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; - } + /** + * Method getNameSpacePrefix. + * + * @return the namespace prefix to use when marshaling as XML. + */ + public java.lang.String getNameSpacePrefix() + { + return _nsPrefix; + } - /** - * Method isElementDefinition. - * - * @return true if XML schema definition of this Class is that - * of a global - * element or element with anonymous type definition. - */ - public boolean isElementDefinition( - ) { - return _elementDefinition; - } + /** + * Method 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/schemabinding/version2/descriptors/VamsasModelDescriptor.java b/src/jalview/schemabinding/version2/descriptors/VamsasModelDescriptor.java index 584c096..fc7f9ba 100644 --- a/src/jalview/schemabinding/version2/descriptors/VamsasModelDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/VamsasModelDescriptor.java @@ -7,145 +7,141 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ -import jalview.schemabinding.version2.VamsasModel; /** * Class VamsasModelDescriptor. * * @version $Revision$ $Date$ */ -public class VamsasModelDescriptor extends jalview.schemabinding.version2.descriptors.VAMSASDescriptor { - - - //--------------------------/ - //- 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 VamsasModelDescriptor() { - super(); - setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.VAMSASDescriptor()); - _nsURI = "www.jalview.org"; - _xmlName = "vamsasModel"; - _elementDefinition = true; - } - - - //-----------/ - //- 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.VamsasModel.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; - } +public class VamsasModelDescriptor extends + jalview.schemabinding.version2.descriptors.VAMSASDescriptor +{ + + // --------------------------/ + // - 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 VamsasModelDescriptor() + { + super(); + setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.VAMSASDescriptor()); + _nsURI = "www.jalview.org"; + _xmlName = "vamsasModel"; + _elementDefinition = true; + } + + // -----------/ + // - 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.VamsasModel.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/schemabinding/version2/descriptors/ViewportDescriptor.java b/src/jalview/schemabinding/version2/descriptors/ViewportDescriptor.java index cea458c..1df3988 100644 --- a/src/jalview/schemabinding/version2/descriptors/ViewportDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/ViewportDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.Viewport; @@ -18,2102 +18,2700 @@ import jalview.schemabinding.version2.Viewport; * * @version $Revision$ $Date$ */ -public class ViewportDescriptor 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 ViewportDescriptor() { - super(); - _nsURI = "www.jalview.org"; - _xmlName = "Viewport"; - _elementDefinition = true; - - //-- 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 - - //-- _conservationSelected - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_conservationSelected", "conservationSelected", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasConservationSelected()) { return null; } - return (target.getConservationSelected() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteConservationSelected(); - return; - } - target.setConservationSelected( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _conservationSelected - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _pidSelected - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_pidSelected", "pidSelected", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasPidSelected()) { return null; } - return (target.getPidSelected() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deletePidSelected(); - return; - } - target.setPidSelected( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _pidSelected - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _bgColour - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_bgColour", "bgColour", 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 - { - Viewport target = (Viewport) object; - return target.getBgColour(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - target.setBgColour( (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: _bgColour - 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); - //-- _consThreshold - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_consThreshold", "consThreshold", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasConsThreshold()) { return null; } - return new java.lang.Integer(target.getConsThreshold()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteConsThreshold(); - return; - } - target.setConsThreshold( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _consThreshold - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); - } - desc.setValidator(fieldValidator); - //-- _pidThreshold - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_pidThreshold", "pidThreshold", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasPidThreshold()) { return null; } - return new java.lang.Integer(target.getPidThreshold()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deletePidThreshold(); - return; - } - target.setPidThreshold( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _pidThreshold - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); - } - desc.setValidator(fieldValidator); - //-- _title - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_title", "title", 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 - { - Viewport target = (Viewport) object; - return target.getTitle(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - target.setTitle( (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: _title - 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); - //-- _showFullId - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showFullId", "showFullId", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasShowFullId()) { return null; } - return (target.getShowFullId() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteShowFullId(); - return; - } - target.setShowFullId( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _showFullId - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _rightAlignIds - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_rightAlignIds", "rightAlignIds", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasRightAlignIds()) { return null; } - return (target.getRightAlignIds() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteRightAlignIds(); - return; - } - target.setRightAlignIds( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _rightAlignIds - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _showText - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showText", "showText", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasShowText()) { return null; } - return (target.getShowText() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteShowText(); - return; - } - target.setShowText( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _showText - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _showColourText - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showColourText", "showColourText", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasShowColourText()) { return null; } - return (target.getShowColourText() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteShowColourText(); - return; - } - target.setShowColourText( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _showColourText - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _showUnconserved - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showUnconserved", "showUnconserved", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasShowUnconserved()) { return null; } - return (target.getShowUnconserved() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteShowUnconserved(); - return; - } - target.setShowUnconserved( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _showUnconserved - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _showBoxes - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showBoxes", "showBoxes", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasShowBoxes()) { return null; } - return (target.getShowBoxes() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteShowBoxes(); - return; - } - target.setShowBoxes( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _showBoxes - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _wrapAlignment - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_wrapAlignment", "wrapAlignment", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasWrapAlignment()) { return null; } - return (target.getWrapAlignment() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteWrapAlignment(); - return; - } - target.setWrapAlignment( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _wrapAlignment - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _renderGaps - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_renderGaps", "renderGaps", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasRenderGaps()) { return null; } - return (target.getRenderGaps() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteRenderGaps(); - return; - } - target.setRenderGaps( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _renderGaps - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _showSequenceFeatures - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showSequenceFeatures", "showSequenceFeatures", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasShowSequenceFeatures()) { return null; } - return (target.getShowSequenceFeatures() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteShowSequenceFeatures(); - return; - } - target.setShowSequenceFeatures( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _showSequenceFeatures - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _showNPfeatureTooltip - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showNPfeatureTooltip", "showNPfeatureTooltip", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasShowNPfeatureTooltip()) { return null; } - return (target.getShowNPfeatureTooltip() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteShowNPfeatureTooltip(); - return; - } - target.setShowNPfeatureTooltip( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _showNPfeatureTooltip - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _showDbRefTooltip - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showDbRefTooltip", "showDbRefTooltip", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasShowDbRefTooltip()) { return null; } - return (target.getShowDbRefTooltip() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteShowDbRefTooltip(); - return; - } - target.setShowDbRefTooltip( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _showDbRefTooltip - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _followHighlight - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_followHighlight", "followHighlight", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasFollowHighlight()) { return null; } - return (target.getFollowHighlight() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteFollowHighlight(); - return; - } - target.setFollowHighlight( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _followHighlight - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _followSelection - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_followSelection", "followSelection", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasFollowSelection()) { return null; } - return (target.getFollowSelection() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteFollowSelection(); - return; - } - target.setFollowSelection( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _followSelection - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _showAnnotation - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showAnnotation", "showAnnotation", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasShowAnnotation()) { return null; } - return (target.getShowAnnotation() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteShowAnnotation(); - return; - } - target.setShowAnnotation( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _showAnnotation - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _centreColumnLabels - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_centreColumnLabels", "centreColumnLabels", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasCentreColumnLabels()) { return null; } - return (target.getCentreColumnLabels() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteCentreColumnLabels(); - return; - } - target.setCentreColumnLabels( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _centreColumnLabels - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _showGroupConservation - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showGroupConservation", "showGroupConservation", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasShowGroupConservation()) { return null; } - return (target.getShowGroupConservation() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteShowGroupConservation(); - return; - } - target.setShowGroupConservation( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _showGroupConservation - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _showGroupConsensus - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showGroupConsensus", "showGroupConsensus", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasShowGroupConsensus()) { return null; } - return (target.getShowGroupConsensus() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteShowGroupConsensus(); - return; - } - target.setShowGroupConsensus( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _showGroupConsensus - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _showConsensusHistogram - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showConsensusHistogram", "showConsensusHistogram", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasShowConsensusHistogram()) { return null; } - return (target.getShowConsensusHistogram() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteShowConsensusHistogram(); - return; - } - target.setShowConsensusHistogram( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _showConsensusHistogram - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _showSequenceLogo - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_showSequenceLogo", "showSequenceLogo", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasShowSequenceLogo()) { return null; } - return (target.getShowSequenceLogo() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteShowSequenceLogo(); - return; - } - target.setShowSequenceLogo( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _showSequenceLogo - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _normaliseSequenceLogo - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_normaliseSequenceLogo", "normaliseSequenceLogo", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasNormaliseSequenceLogo()) { return null; } - return (target.getNormaliseSequenceLogo() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteNormaliseSequenceLogo(); - return; - } - target.setNormaliseSequenceLogo( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _normaliseSequenceLogo - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _ignoreGapsinConsensus - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_ignoreGapsinConsensus", "ignoreGapsinConsensus", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasIgnoreGapsinConsensus()) { return null; } - return (target.getIgnoreGapsinConsensus() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteIgnoreGapsinConsensus(); - return; - } - target.setIgnoreGapsinConsensus( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _ignoreGapsinConsensus - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _startRes - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_startRes", "startRes", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasStartRes()) { return null; } - return new java.lang.Integer(target.getStartRes()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteStartRes(); - return; - } - target.setStartRes( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _startRes - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); - } - desc.setValidator(fieldValidator); - //-- _startSeq - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_startSeq", "startSeq", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasStartSeq()) { return null; } - return new java.lang.Integer(target.getStartSeq()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteStartSeq(); - return; - } - target.setStartSeq( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _startSeq - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); - } - desc.setValidator(fieldValidator); - //-- _fontName - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_fontName", "fontName", 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 - { - Viewport target = (Viewport) object; - return target.getFontName(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - target.setFontName( (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: _fontName - 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); - //-- _fontSize - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_fontSize", "fontSize", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasFontSize()) { return null; } - return new java.lang.Integer(target.getFontSize()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteFontSize(); - return; - } - target.setFontSize( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _fontSize - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); - } - desc.setValidator(fieldValidator); - //-- _fontStyle - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_fontStyle", "fontStyle", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasFontStyle()) { return null; } - return new java.lang.Integer(target.getFontStyle()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteFontStyle(); - return; - } - target.setFontStyle( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _fontStyle - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); - } - desc.setValidator(fieldValidator); - //-- _scaleProteinAsCdna - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_scaleProteinAsCdna", "scaleProteinAsCdna", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasScaleProteinAsCdna()) { return null; } - return (target.getScaleProteinAsCdna() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteScaleProteinAsCdna(); - return; - } - target.setScaleProteinAsCdna( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _scaleProteinAsCdna - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _viewName - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_viewName", "viewName", 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 - { - Viewport target = (Viewport) object; - return target.getViewName(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - target.setViewName( (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: _viewName - 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); - //-- _sequenceSetId - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_sequenceSetId", "sequenceSetId", 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 - { - Viewport target = (Viewport) object; - return target.getSequenceSetId(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - target.setSequenceSetId( (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: _sequenceSetId - 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); - //-- _gatheredViews - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_gatheredViews", "gatheredViews", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasGatheredViews()) { return null; } - return (target.getGatheredViews() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteGatheredViews(); - return; - } - target.setGatheredViews( ((java.lang.Boolean) value).booleanValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _gatheredViews - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.BooleanValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _textCol1 - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_textCol1", "textCol1", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasTextCol1()) { return null; } - return new java.lang.Integer(target.getTextCol1()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteTextCol1(); - return; - } - target.setTextCol1( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _textCol1 - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); - } - desc.setValidator(fieldValidator); - //-- _textCol2 - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_textCol2", "textCol2", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasTextCol2()) { return null; } - return new java.lang.Integer(target.getTextCol2()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteTextCol2(); - return; - } - target.setTextCol2( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _textCol2 - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); - } - desc.setValidator(fieldValidator); - //-- _textColThreshold - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_textColThreshold", "textColThreshold", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasTextColThreshold()) { return null; } - return new java.lang.Integer(target.getTextColThreshold()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteTextColThreshold(); - return; - } - target.setTextColThreshold( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _textColThreshold - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); - } - desc.setValidator(fieldValidator); - //-- _id - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute); - super.setIdentity(desc); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - return target.getId(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - target.setId( (java.lang.String) value); - } 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.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _id - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IdValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IdValidator(); - fieldValidator.setValidator(typeValidator); - } - desc.setValidator(fieldValidator); - //-- _complementId - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_complementId", "complementId", 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 - { - Viewport target = (Viewport) object; - return target.getComplementId(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - target.setComplementId( (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: _complementId - 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); - //-- _width - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_width", "width", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasWidth()) { return null; } - return new java.lang.Integer(target.getWidth()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteWidth(); - return; - } - target.setWidth( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _width - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); - } - desc.setValidator(fieldValidator); - //-- _height - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_height", "height", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasHeight()) { return null; } - return new java.lang.Integer(target.getHeight()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteHeight(); - return; - } - target.setHeight( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _height - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); - } - desc.setValidator(fieldValidator); - //-- _xpos - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_xpos", "xpos", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasXpos()) { return null; } - return new java.lang.Integer(target.getXpos()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteXpos(); - return; - } - target.setXpos( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _xpos - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); - } - desc.setValidator(fieldValidator); - //-- _ypos - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_ypos", "ypos", org.exolab.castor.xml.NodeType.Attribute); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - if (!target.hasYpos()) { return null; } - return new java.lang.Integer(target.getYpos()); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - // if null, use delete method for optional primitives - if (value == null) { - target.deleteYpos(); - return; - } - target.setYpos( ((java.lang.Integer) value).intValue()); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return null; - } - }; - desc.setHandler(handler); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _ypos - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - org.exolab.castor.xml.validators.IntValidator typeValidator; - typeValidator = new org.exolab.castor.xml.validators.IntValidator(); - fieldValidator.setValidator(typeValidator); - typeValidator.setMinInclusive(-2147483648); - typeValidator.setMaxInclusive(2147483647); - } - desc.setValidator(fieldValidator); - //-- initialize element descriptors - - //-- _annotationColours - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.AnnotationColours.class, "_annotationColours", "AnnotationColours", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - return target.getAnnotationColours(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - target.setAnnotationColours( (jalview.schemabinding.version2.AnnotationColours) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.AnnotationColours(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(false); - addFieldDescriptor(desc); - - //-- validation code for: _annotationColours - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - { //-- local scope - } - desc.setValidator(fieldValidator); - //-- _hiddenColumnsList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.HiddenColumns.class, "_hiddenColumnsList", "hiddenColumns", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - return target.getHiddenColumns(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - target.addHiddenColumns( (jalview.schemabinding.version2.HiddenColumns) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - Viewport target = (Viewport) object; - target.removeAllHiddenColumns(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.HiddenColumns(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _hiddenColumnsList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope - } - desc.setValidator(fieldValidator); - //-- _calcIdParamList - desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.CalcIdParam.class, "_calcIdParamList", "calcIdParam", org.exolab.castor.xml.NodeType.Element); - handler = new org.exolab.castor.xml.XMLFieldHandler() { - public java.lang.Object getValue( java.lang.Object object ) - throws IllegalStateException - { - Viewport target = (Viewport) object; - return target.getCalcIdParam(); - } - public void setValue( java.lang.Object object, java.lang.Object value) - throws IllegalStateException, IllegalArgumentException - { - try { - Viewport target = (Viewport) object; - target.addCalcIdParam( (jalview.schemabinding.version2.CalcIdParam) value); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException { - try { - Viewport target = (Viewport) object; - target.removeAllCalcIdParam(); - } catch (java.lang.Exception ex) { - throw new IllegalStateException(ex.toString()); - } - } - public java.lang.Object newInstance(java.lang.Object parent) { - return new jalview.schemabinding.version2.CalcIdParam(); - } - }; - desc.setHandler(handler); - desc.setNameSpaceURI("www.jalview.org"); - desc.setMultivalued(true); - addFieldDescriptor(desc); - - //-- validation code for: _calcIdParamList - fieldValidator = new org.exolab.castor.xml.FieldValidator(); - fieldValidator.setMinOccurs(0); - { //-- local scope - } - desc.setValidator(fieldValidator); +public class ViewportDescriptor 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 ViewportDescriptor() + { + super(); + _nsURI = "www.jalview.org"; + _xmlName = "Viewport"; + _elementDefinition = true; + + // -- 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 + + // -- _conservationSelected + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_conservationSelected", + "conservationSelected", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasConservationSelected()) + { + return null; + } + return (target.getConservationSelected() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteConservationSelected(); + return; + } + target.setConservationSelected(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _conservationSelected + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _pidSelected + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_pidSelected", "pidSelected", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasPidSelected()) + { + return null; + } + return (target.getPidSelected() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deletePidSelected(); + return; + } + target.setPidSelected(((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _pidSelected + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _bgColour + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_bgColour", "bgColour", + 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 + { + Viewport target = (Viewport) object; + return target.getBgColour(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + target.setBgColour((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: _bgColour + 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); + // -- _consThreshold + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_consThreshold", "consThreshold", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasConsThreshold()) + { + return null; + } + return new java.lang.Integer(target.getConsThreshold()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteConsThreshold(); + return; + } + target.setConsThreshold(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _consThreshold + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _pidThreshold + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_pidThreshold", "pidThreshold", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasPidThreshold()) + { + return null; + } + return new java.lang.Integer(target.getPidThreshold()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deletePidThreshold(); + return; + } + target.setPidThreshold(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _pidThreshold + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _title + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_title", "title", + 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 + { + Viewport target = (Viewport) object; + return target.getTitle(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + target.setTitle((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: _title + 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); + // -- _showFullId + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showFullId", "showFullId", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasShowFullId()) + { + return null; + } + return (target.getShowFullId() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowFullId(); + return; + } + target.setShowFullId(((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _showFullId + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _rightAlignIds + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_rightAlignIds", "rightAlignIds", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasRightAlignIds()) + { + return null; + } + return (target.getRightAlignIds() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteRightAlignIds(); + return; + } + target.setRightAlignIds(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _rightAlignIds + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _showText + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showText", "showText", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasShowText()) + { + return null; + } + return (target.getShowText() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowText(); + return; + } + target.setShowText(((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _showText + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _showColourText + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showColourText", "showColourText", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasShowColourText()) + { + return null; + } + return (target.getShowColourText() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowColourText(); + return; + } + target.setShowColourText(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _showColourText + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _showUnconserved + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showUnconserved", "showUnconserved", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasShowUnconserved()) + { + return null; + } + return (target.getShowUnconserved() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowUnconserved(); + return; + } + target.setShowUnconserved(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _showUnconserved + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _showBoxes + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showBoxes", "showBoxes", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasShowBoxes()) + { + return null; + } + return (target.getShowBoxes() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowBoxes(); + return; + } + target.setShowBoxes(((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _showBoxes + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _wrapAlignment + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_wrapAlignment", "wrapAlignment", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasWrapAlignment()) + { + return null; + } + return (target.getWrapAlignment() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteWrapAlignment(); + return; + } + target.setWrapAlignment(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _wrapAlignment + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _renderGaps + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_renderGaps", "renderGaps", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasRenderGaps()) + { + return null; + } + return (target.getRenderGaps() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteRenderGaps(); + return; + } + target.setRenderGaps(((java.lang.Boolean) value).booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _renderGaps + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _showSequenceFeatures + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showSequenceFeatures", + "showSequenceFeatures", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasShowSequenceFeatures()) + { + return null; + } + return (target.getShowSequenceFeatures() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowSequenceFeatures(); + return; + } + target.setShowSequenceFeatures(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _showSequenceFeatures + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _showNPfeatureTooltip + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showNPfeatureTooltip", + "showNPfeatureTooltip", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasShowNPfeatureTooltip()) + { + return null; + } + return (target.getShowNPfeatureTooltip() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowNPfeatureTooltip(); + return; + } + target.setShowNPfeatureTooltip(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _showNPfeatureTooltip + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _showDbRefTooltip + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showDbRefTooltip", + "showDbRefTooltip", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasShowDbRefTooltip()) + { + return null; + } + return (target.getShowDbRefTooltip() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowDbRefTooltip(); + return; + } + target.setShowDbRefTooltip(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _showDbRefTooltip + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _followHighlight + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_followHighlight", "followHighlight", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasFollowHighlight()) + { + return null; + } + return (target.getFollowHighlight() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteFollowHighlight(); + return; + } + target.setFollowHighlight(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _followHighlight + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _followSelection + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_followSelection", "followSelection", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasFollowSelection()) + { + return null; + } + return (target.getFollowSelection() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteFollowSelection(); + return; + } + target.setFollowSelection(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _followSelection + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _showAnnotation + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showAnnotation", "showAnnotation", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasShowAnnotation()) + { + return null; + } + return (target.getShowAnnotation() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowAnnotation(); + return; + } + target.setShowAnnotation(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _showAnnotation + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _centreColumnLabels + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_centreColumnLabels", + "centreColumnLabels", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasCentreColumnLabels()) + { + return null; + } + return (target.getCentreColumnLabels() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteCentreColumnLabels(); + return; + } + target.setCentreColumnLabels(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _centreColumnLabels + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _showGroupConservation + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showGroupConservation", + "showGroupConservation", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasShowGroupConservation()) + { + return null; + } + return (target.getShowGroupConservation() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowGroupConservation(); + return; + } + target.setShowGroupConservation(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _showGroupConservation + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _showGroupConsensus + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showGroupConsensus", + "showGroupConsensus", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasShowGroupConsensus()) + { + return null; + } + return (target.getShowGroupConsensus() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowGroupConsensus(); + return; + } + target.setShowGroupConsensus(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _showGroupConsensus + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- _showConsensusHistogram + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showConsensusHistogram", + "showConsensusHistogram", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasShowConsensusHistogram()) + { + return null; + } + return (target.getShowConsensusHistogram() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowConsensusHistogram(); + return; + } + target.setShowConsensusHistogram(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _showConsensusHistogram + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _showSequenceLogo + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_showSequenceLogo", + "showSequenceLogo", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasShowSequenceLogo()) + { + return null; + } + return (target.getShowSequenceLogo() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteShowSequenceLogo(); + return; + } + target.setShowSequenceLogo(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _showSequenceLogo + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _normaliseSequenceLogo + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_normaliseSequenceLogo", + "normaliseSequenceLogo", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasNormaliseSequenceLogo()) + { + return null; + } + return (target.getNormaliseSequenceLogo() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteNormaliseSequenceLogo(); + return; + } + target.setNormaliseSequenceLogo(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _normaliseSequenceLogo + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _ignoreGapsinConsensus + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_ignoreGapsinConsensus", + "ignoreGapsinConsensus", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasIgnoreGapsinConsensus()) + { + return null; + } + return (target.getIgnoreGapsinConsensus() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteIgnoreGapsinConsensus(); + return; + } + target.setIgnoreGapsinConsensus(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _ignoreGapsinConsensus + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _startRes + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_startRes", "startRes", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasStartRes()) + { + return null; + } + return new java.lang.Integer(target.getStartRes()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteStartRes(); + return; + } + target.setStartRes(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _startRes + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _startSeq + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_startSeq", "startSeq", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasStartSeq()) + { + return null; + } + return new java.lang.Integer(target.getStartSeq()); + } + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteStartSeq(); + return; + } + target.setStartSeq(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - //-----------/ - //- Methods -/ - //-----------/ + // -- validation code for: _startSeq + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _fontName + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_fontName", "fontName", + 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 + { + Viewport target = (Viewport) object; + return target.getFontName(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + target.setFontName((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); + + // -- validation code for: _fontName + 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); + // -- _fontSize + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_fontSize", "fontSize", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasFontSize()) + { + return null; + } + return new java.lang.Integer(target.getFontSize()); + } - /** - * Method getIdentity. - * - * @return the identity field, null if this class has no - * identity. - */ - public org.exolab.castor.mapping.FieldDescriptor getIdentity( - ) { - return super.getIdentity(); + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteFontSize(); + return; + } + target.setFontSize(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _fontSize + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- _fontStyle + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_fontStyle", "fontStyle", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasFontStyle()) + { + return null; + } + return new java.lang.Integer(target.getFontStyle()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteFontStyle(); + return; + } + target.setFontStyle(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); - /** - * Method getJavaClass. - * - * @return the Java class represented by this descriptor. - */ - public java.lang.Class getJavaClass( - ) { - return jalview.schemabinding.version2.Viewport.class; + // -- validation code for: _fontStyle + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- _scaleProteinAsCdna + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_scaleProteinAsCdna", + "scaleProteinAsCdna", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasScaleProteinAsCdna()) + { + return null; + } + return (target.getScaleProteinAsCdna() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } - /** - * Method getNameSpacePrefix. - * - * @return the namespace prefix to use when marshaling as XML. - */ - public java.lang.String getNameSpacePrefix( - ) { - return _nsPrefix; + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteScaleProteinAsCdna(); + return; + } + target.setScaleProteinAsCdna(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _scaleProteinAsCdna + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- _viewName + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_viewName", "viewName", + 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 + { + Viewport target = (Viewport) object; + return target.getViewName(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + target.setViewName((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); - /** - * Method getNameSpaceURI. - * - * @return the namespace URI used when marshaling and - * unmarshaling as XML. - */ - public java.lang.String getNameSpaceURI( - ) { - return _nsURI; + // -- validation code for: _viewName + 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); + // -- _sequenceSetId + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_sequenceSetId", "sequenceSetId", + 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 + { + Viewport target = (Viewport) object; + return target.getSequenceSetId(); + } - /** - * 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 + { + Viewport target = (Viewport) object; + target.setSequenceSetId((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: _sequenceSetId + 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); + // -- _gatheredViews + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Boolean.TYPE, "_gatheredViews", "gatheredViews", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasGatheredViews()) + { + return null; + } + return (target.getGatheredViews() ? java.lang.Boolean.TRUE + : java.lang.Boolean.FALSE); + } - /** - * Method getXMLName. - * - * @return the XML Name for the Class being described. - */ - public java.lang.String getXMLName( - ) { - return _xmlName; + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteGatheredViews(); + return; + } + target.setGatheredViews(((java.lang.Boolean) value) + .booleanValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _gatheredViews + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.BooleanValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.BooleanValidator(); + fieldValidator.setValidator(typeValidator); } + desc.setValidator(fieldValidator); + // -- _textCol1 + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_textCol1", "textCol1", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasTextCol1()) + { + return null; + } + return new java.lang.Integer(target.getTextCol1()); + } - /** - * 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 + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteTextCol1(); + return; + } + target.setTextCol1(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _textCol1 + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); } + desc.setValidator(fieldValidator); + // -- _textCol2 + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_textCol2", "textCol2", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasTextCol2()) + { + return null; + } + return new java.lang.Integer(target.getTextCol2()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteTextCol2(); + return; + } + target.setTextCol2(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _textCol2 + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _textColThreshold + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_textColThreshold", + "textColThreshold", org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasTextColThreshold()) + { + return null; + } + return new java.lang.Integer(target.getTextColThreshold()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteTextColThreshold(); + return; + } + target.setTextColThreshold(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _textColThreshold + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _id + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_id", "id", + org.exolab.castor.xml.NodeType.Attribute); + super.setIdentity(desc); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + return target.getId(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + target.setId((java.lang.String) value); + } 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.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _id + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IdValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IdValidator(); + fieldValidator.setValidator(typeValidator); + } + desc.setValidator(fieldValidator); + // -- _complementId + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.String.class, "_complementId", "complementId", + 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 + { + Viewport target = (Viewport) object; + return target.getComplementId(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + target.setComplementId((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: _complementId + 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); + // -- _width + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_width", "width", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasWidth()) + { + return null; + } + return new java.lang.Integer(target.getWidth()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteWidth(); + return; + } + target.setWidth(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _width + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _height + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_height", "height", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasHeight()) + { + return null; + } + return new java.lang.Integer(target.getHeight()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteHeight(); + return; + } + target.setHeight(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _height + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _xpos + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_xpos", "xpos", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasXpos()) + { + return null; + } + return new java.lang.Integer(target.getXpos()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteXpos(); + return; + } + target.setXpos(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _xpos + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- _ypos + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + java.lang.Integer.TYPE, "_ypos", "ypos", + org.exolab.castor.xml.NodeType.Attribute); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + if (!target.hasYpos()) + { + return null; + } + return new java.lang.Integer(target.getYpos()); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + // if null, use delete method for optional primitives + if (value == null) + { + target.deleteYpos(); + return; + } + target.setYpos(((java.lang.Integer) value).intValue()); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return null; + } + }; + desc.setHandler(handler); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _ypos + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + org.exolab.castor.xml.validators.IntValidator typeValidator; + typeValidator = new org.exolab.castor.xml.validators.IntValidator(); + fieldValidator.setValidator(typeValidator); + typeValidator.setMinInclusive(-2147483648); + typeValidator.setMaxInclusive(2147483647); + } + desc.setValidator(fieldValidator); + // -- initialize element descriptors + + // -- _annotationColours + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.AnnotationColours.class, + "_annotationColours", "AnnotationColours", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + return target.getAnnotationColours(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + target.setAnnotationColours((jalview.schemabinding.version2.AnnotationColours) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.AnnotationColours(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(false); + addFieldDescriptor(desc); + + // -- validation code for: _annotationColours + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + { // -- local scope + } + desc.setValidator(fieldValidator); + // -- _hiddenColumnsList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.HiddenColumns.class, + "_hiddenColumnsList", "hiddenColumns", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + return target.getHiddenColumns(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + target.addHiddenColumns((jalview.schemabinding.version2.HiddenColumns) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + target.removeAllHiddenColumns(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.HiddenColumns(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _hiddenColumnsList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope + } + desc.setValidator(fieldValidator); + // -- _calcIdParamList + desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl( + jalview.schemabinding.version2.CalcIdParam.class, + "_calcIdParamList", "calcIdParam", + org.exolab.castor.xml.NodeType.Element); + handler = new org.exolab.castor.xml.XMLFieldHandler() + { + public java.lang.Object getValue(java.lang.Object object) + throws IllegalStateException + { + Viewport target = (Viewport) object; + return target.getCalcIdParam(); + } + + public void setValue(java.lang.Object object, java.lang.Object value) + throws IllegalStateException, IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + target.addCalcIdParam((jalview.schemabinding.version2.CalcIdParam) value); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public void resetValue(Object object) throws IllegalStateException, + IllegalArgumentException + { + try + { + Viewport target = (Viewport) object; + target.removeAllCalcIdParam(); + } catch (java.lang.Exception ex) + { + throw new IllegalStateException(ex.toString()); + } + } + + public java.lang.Object newInstance(java.lang.Object parent) + { + return new jalview.schemabinding.version2.CalcIdParam(); + } + }; + desc.setHandler(handler); + desc.setNameSpaceURI("www.jalview.org"); + desc.setMultivalued(true); + addFieldDescriptor(desc); + + // -- validation code for: _calcIdParamList + fieldValidator = new org.exolab.castor.xml.FieldValidator(); + fieldValidator.setMinOccurs(0); + { // -- local scope + } + 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.Viewport.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/schemabinding/version2/descriptors/WebServiceParameterSetDescriptor.java b/src/jalview/schemabinding/version2/descriptors/WebServiceParameterSetDescriptor.java index 8c61a2d..beb5b50 100644 --- a/src/jalview/schemabinding/version2/descriptors/WebServiceParameterSetDescriptor.java +++ b/src/jalview/schemabinding/version2/descriptors/WebServiceParameterSetDescriptor.java @@ -7,8 +7,8 @@ package jalview.schemabinding.version2.descriptors; - //---------------------------------/ - //- Imported classes and packages -/ +//---------------------------------/ +//- Imported classes and packages -/ //---------------------------------/ import jalview.schemabinding.version2.WebServiceParameterSet; @@ -18,337 +18,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/AnnotationColourGradient.java b/src/jalview/schemes/AnnotationColourGradient.java index 133dd36..89b8f07 100755 --- a/src/jalview/schemes/AnnotationColourGradient.java +++ b/src/jalview/schemes/AnnotationColourGradient.java @@ -53,12 +53,14 @@ public class AnnotationColourGradient extends FollowerColourScheme private boolean predefinedColours = false; private boolean seqAssociated = false; + /** * false if the scheme was constructed without a minColour and maxColour used * to decide if existing colours should be taken from annotation elements when * they exist */ private boolean noGradient = false; + IdentityHashMap seqannot = null; @Override @@ -175,7 +177,7 @@ public class AnnotationColourGradient extends FollowerColourScheme // resolve the context containing all the annotation for the sequence AnnotatedCollectionI alcontext = alignment instanceof AlignmentI ? alignment : alignment.getContext(); - boolean f = true,rna=false; + boolean f = true, rna = false; for (AlignmentAnnotation alan : alcontext.findAnnotation(annotation .getCalcId())) { @@ -207,6 +209,7 @@ public class AnnotationColourGradient extends FollowerColourScheme } float aamin = 0f, aamax = 0f; + public String getAnnotation() { return annotation.label; @@ -266,8 +269,8 @@ public class AnnotationColourGradient extends FollowerColourScheme public Color findColour(char c, int j, SequenceI seq) { Color currentColour = Color.white; - AlignmentAnnotation annotation = (seqAssociated && seqannot!=null ? seqannot.get(seq) - : this.annotation); + AlignmentAnnotation annotation = (seqAssociated && seqannot != null ? seqannot + .get(seq) : this.annotation); if (annotation == null) { return currentColour; @@ -396,6 +399,7 @@ public class AnnotationColourGradient extends FollowerColourScheme return new Color(dr, dg, db); } + public boolean isPredefinedColours() { return predefinedColours; diff --git a/src/jalview/schemes/BuriedColourScheme.java b/src/jalview/schemes/BuriedColourScheme.java index e85c51d..3c68da0 100755 --- a/src/jalview/schemes/BuriedColourScheme.java +++ b/src/jalview/schemes/BuriedColourScheme.java @@ -20,7 +20,7 @@ */ package jalview.schemes; -import java.awt.*; +import java.awt.Color; /** * DOCUMENT ME! diff --git a/src/jalview/schemes/ColourSchemeI.java b/src/jalview/schemes/ColourSchemeI.java index 1604da7..effdf59 100755 --- a/src/jalview/schemes/ColourSchemeI.java +++ b/src/jalview/schemes/ColourSchemeI.java @@ -20,15 +20,13 @@ */ package jalview.schemes; -import java.awt.Color; -import java.util.Map; - -import jalview.datamodel.AlignmentI; import jalview.datamodel.AnnotatedCollectionI; import jalview.datamodel.SequenceCollectionI; -import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; +import java.awt.Color; +import java.util.Map; + public interface ColourSchemeI { /** diff --git a/src/jalview/schemes/CovariationColourScheme.java b/src/jalview/schemes/CovariationColourScheme.java index 582faeb..49d5dee 100644 --- a/src/jalview/schemes/CovariationColourScheme.java +++ b/src/jalview/schemes/CovariationColourScheme.java @@ -20,11 +20,11 @@ */ package jalview.schemes; -import java.awt.*; -import java.util.Hashtable; - import jalview.datamodel.AlignmentAnnotation; +import java.awt.Color; +import java.util.Hashtable; + /** * Became RNAHelicesColour.java. Placeholder for true covariation color scheme * diff --git a/src/jalview/schemes/HelixColourScheme.java b/src/jalview/schemes/HelixColourScheme.java index 143d0f4..1242cd3 100755 --- a/src/jalview/schemes/HelixColourScheme.java +++ b/src/jalview/schemes/HelixColourScheme.java @@ -20,7 +20,7 @@ */ package jalview.schemes; -import java.awt.*; +import java.awt.Color; public class HelixColourScheme extends ScoreColourScheme { diff --git a/src/jalview/schemes/HydrophobicColourScheme.java b/src/jalview/schemes/HydrophobicColourScheme.java index 1c776a9..055000f 100755 --- a/src/jalview/schemes/HydrophobicColourScheme.java +++ b/src/jalview/schemes/HydrophobicColourScheme.java @@ -20,7 +20,7 @@ */ package jalview.schemes; -import java.awt.*; +import java.awt.Color; /** * DOCUMENT ME! diff --git a/src/jalview/schemes/PurinePyrimidineColourScheme.java b/src/jalview/schemes/PurinePyrimidineColourScheme.java index 9c43ed1..d2b878d 100644 --- a/src/jalview/schemes/PurinePyrimidineColourScheme.java +++ b/src/jalview/schemes/PurinePyrimidineColourScheme.java @@ -20,7 +20,7 @@ */ package jalview.schemes; -import java.awt.*; +import java.awt.Color; /** * Class is based off of NucleotideColourScheme diff --git a/src/jalview/schemes/RNAHelicesColour.java b/src/jalview/schemes/RNAHelicesColour.java index ffc013d..d17f510 100644 --- a/src/jalview/schemes/RNAHelicesColour.java +++ b/src/jalview/schemes/RNAHelicesColour.java @@ -40,7 +40,6 @@ import java.util.Map; public class RNAHelicesColour extends ResidueColourScheme { - /** * Maps sequence positions to the RNA helix they belong to. Key: position, * Value: helix TODO: Revise or drop in favour of annotation position numbers diff --git a/src/jalview/schemes/ResidueColourScheme.java b/src/jalview/schemes/ResidueColourScheme.java index e3118ad..bca98cf 100755 --- a/src/jalview/schemes/ResidueColourScheme.java +++ b/src/jalview/schemes/ResidueColourScheme.java @@ -324,7 +324,9 @@ public class ResidueColourScheme implements ColourSchemeI return getClass().newInstance(); } catch (Exception q) { - throw new Error(MessageManager.formatMessage("error.implementation_error_cannot_duplicate_colour_scheme", new String[]{getClass().getName()}), q); + throw new Error(MessageManager.formatMessage( + "error.implementation_error_cannot_duplicate_colour_scheme", + new String[] { getClass().getName() }), q); } } } diff --git a/src/jalview/schemes/ResidueProperties.java b/src/jalview/schemes/ResidueProperties.java index ce83875..de99987 100755 --- a/src/jalview/schemes/ResidueProperties.java +++ b/src/jalview/schemes/ResidueProperties.java @@ -298,9 +298,9 @@ public class ResidueProperties aa2Triplet.put("v", "VAL"); } - public static final String[] aa = - { "A", "R", "N", "D", "C", "Q", "E", "G", "H", "I", "L", "K", "M", "F", - "P", "S", "T", "W", "Y", "V", "B", "Z", "X", "_", "*", ".", " " }; + public static final String[] aa = { "A", "R", "N", "D", "C", "Q", "E", + "G", "H", "I", "L", "K", "M", "F", "P", "S", "T", "W", "Y", "V", "B", + "Z", "X", "_", "*", ".", " " }; public static final Color midBlue = new Color(100, 100, 255); @@ -320,8 +320,8 @@ public class ResidueProperties scaleColours.addElement(Color.white); } - public static final Color[] taylor = - { new Color(204, 255, 0), // A Greenish-yellowy-yellow + public static final Color[] taylor = { new Color(204, 255, 0), // A + // Greenish-yellowy-yellow new Color(0, 0, 255), // R Blueish-bluey-blue new Color(204, 0, 255), // N Blueish-reddy-blue new Color(255, 0, 0), // D Reddish-reddy-red @@ -349,8 +349,7 @@ public class ResidueProperties Color.white // . }; - public static final Color[] nucleotide = - { new Color(100, 247, 63), // A + public static final Color[] nucleotide = { new Color(100, 247, 63), // A new Color(255, 179, 64), // C new Color(235, 65, 60), // G new Color(60, 136, 238), // T @@ -364,16 +363,15 @@ public class ResidueProperties }; // Added for PurinePyrimidineColourScheme - public static final Color[] purinepyrimidine = - { new Color(255, 131, 250), // A, G, R purines purplish/orchid + public static final Color[] purinepyrimidine = { + new Color(255, 131, 250), // A, G, R purines purplish/orchid new Color(64, 224, 208), // C,U, T, Y pyrimidines turquoise Color.white, // all other nucleotides Color.white // Gap }; // Zappo - public static final Color[] zappo = - { Color.pink, // A + public static final Color[] zappo = { Color.pink, // A midBlue, // R Color.green, // N Color.red, // D @@ -403,8 +401,7 @@ public class ResidueProperties }; // Dunno where I got these numbers from - public static final double[] hyd2 = - { 0.62, // A + public static final double[] hyd2 = { 0.62, // A 0.29, // R -0.90, // N -0.74, // D @@ -429,34 +426,33 @@ public class ResidueProperties 0.0 // X }; - public static final double[] helix = - { 1.42, 0.98, 0.67, 1.01, 0.70, 1.11, 1.51, 0.57, 1.00, 1.08, 1.21, 1.16, - 1.45, 1.13, 0.57, 0.77, 0.83, 1.08, 0.69, 1.06, 0.84, 1.31, 1.00, 0.0 }; + public static final double[] helix = { 1.42, 0.98, 0.67, 1.01, 0.70, + 1.11, 1.51, 0.57, 1.00, 1.08, 1.21, 1.16, 1.45, 1.13, 0.57, 0.77, + 0.83, 1.08, 0.69, 1.06, 0.84, 1.31, 1.00, 0.0 }; public static final double helixmin = 0.57; public static final double helixmax = 1.51; - public static final double[] strand = - { 0.83, 0.93, 0.89, 0.54, 1.19, 1.10, 0.37, 0.75, 0.87, 1.60, 1.30, 0.74, - 1.05, 1.38, 0.55, 0.75, 1.19, 1.37, 1.47, 1.70, 0.72, 0.74, 1.0, 0.0 }; + public static final double[] strand = { 0.83, 0.93, 0.89, 0.54, 1.19, + 1.10, 0.37, 0.75, 0.87, 1.60, 1.30, 0.74, 1.05, 1.38, 0.55, 0.75, + 1.19, 1.37, 1.47, 1.70, 0.72, 0.74, 1.0, 0.0 }; public static final double strandmin = 0.37; public static final double strandmax = 1.7; - public static final double[] turn = - { 0.66, 0.95, 1.56, 1.46, 1.19, 0.98, 0.74, 1.56, 0.95, 0.47, 0.59, 1.01, - 0.60, 0.60, 1.52, 1.43, 0.96, 0.96, 1.14, 0.50, 1.51, 0.86, 1.00, 0, - 0 }; + public static final double[] turn = { 0.66, 0.95, 1.56, 1.46, 1.19, 0.98, + 0.74, 1.56, 0.95, 0.47, 0.59, 1.01, 0.60, 0.60, 1.52, 1.43, 0.96, + 0.96, 1.14, 0.50, 1.51, 0.86, 1.00, 0, 0 }; public static final double turnmin = 0.47; public static final double turnmax = 1.56; - public static final double[] buried = - { 1.7, 0.1, 0.4, 0.4, 4.6, 0.3, 0.3, 1.8, 0.8, 3.1, 2.4, 0.05, 1.9, 2.2, - 0.6, 0.8, 0.7, 1.6, 0.5, 2.9, 0.4, 0.3, 1.358, 0.00 }; + public static final double[] buried = { 1.7, 0.1, 0.4, 0.4, 4.6, 0.3, + 0.3, 1.8, 0.8, 3.1, 2.4, 0.05, 1.9, 2.2, 0.6, 0.8, 0.7, 1.6, 0.5, + 2.9, 0.4, 0.3, 1.358, 0.00 }; public static final double buriedmin = 0.05; @@ -465,9 +461,9 @@ public class ResidueProperties // This is hydropathy index // Kyte, J., and Doolittle, R.F., J. Mol. Biol. // 1157, 105-132, 1982 - public static final double[] hyd = - { 1.8, -4.5, -3.5, -3.5, 2.5, -3.5, -3.5, -0.4, -3.2, 4.5, 3.8, -3.9, - 1.9, 2.8, -1.6, -0.8, -0.7, -0.9, -1.3, 4.2, -3.5, -3.5, -0.49, 0.0 }; + public static final double[] hyd = { 1.8, -4.5, -3.5, -3.5, 2.5, -3.5, + -3.5, -0.4, -3.2, 4.5, 3.8, -3.9, 1.9, 2.8, -1.6, -0.8, -0.7, -0.9, + -1.3, 4.2, -3.5, -3.5, -0.49, 0.0 }; public static final double hydmax = 4.5; @@ -475,8 +471,7 @@ public class ResidueProperties // public static final double hydmax = 1.38; // public static final double hydmin = -2.53; - private static final int[][] BLOSUM62 = - { + private static final int[][] BLOSUM62 = { { 4, -1, -2, -2, 0, -1, -1, 0, -2, -1, -1, -1, -1, -2, -1, 1, 0, -3, -2, 0, -2, -1, 0, -4 }, { -1, 5, 0, -2, -3, 1, 0, -2, 0, -3, -2, 2, -1, -3, -2, -1, -1, -3, @@ -526,8 +521,7 @@ public class ResidueProperties { -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, -4, 1 }, }; - static final int[][] PAM250 = - { + static final int[][] PAM250 = { { 2, -2, 0, 0, -2, 0, 0, 1, -1, -1, -2, -1, -1, -3, 1, 1, 1, -6, -3, 0, 0, 0, 0, -8 }, { -2, 6, 0, -1, -4, 1, -1, -3, 2, -2, -3, 3, 0, -4, 0, 0, -1, 2, -4, @@ -603,9 +597,7 @@ public class ResidueProperties // treats T and U identically. R and Y weak equivalence with AG and CTU. // N matches any other base weakly // - static final int[][] DNA = - { - { 10, -8, -8, -8, -8, 1, 1, 1, -8, 1, 1 }, // A + static final int[][] DNA = { { 10, -8, -8, -8, -8, 1, 1, 1, -8, 1, 1 }, // A { -8, 10, -8, -8, -8, 1, 1, -8, 1, 1, 1 }, // C { -8, -8, 10, -8, -8, 1, 1, 1, -8, 1, 1 }, // G { -8, -8, -8, 10, 10, 1, 1, -8, 1, 1, 1 }, // T @@ -628,13 +620,12 @@ public class ResidueProperties } - public static final Color[] pidColours = - { midBlue, new Color(153, 153, 255), + public static final Color[] pidColours = { midBlue, + new Color(153, 153, 255), // Color.lightGray, new Color(204, 204, 255), }; - public static final float[] pidThresholds = - { 80, 60, 40, }; + public static final float[] pidThresholds = { 80, 60, 40, }; public static Map> codonHash = new HashMap>(); @@ -728,28 +719,17 @@ public class ResidueProperties /* * Ambiguity codes as per http://www.chem.qmul.ac.uk/iubmb/misc/naseq.html */ - ambiguityCodes.put("R", new String[] - { "A", "G" }); - ambiguityCodes.put("Y", new String[] - { "T", "C" }); - ambiguityCodes.put("W", new String[] - { "A", "T" }); - ambiguityCodes.put("S", new String[] - { "G", "C" }); - ambiguityCodes.put("M", new String[] - { "A", "C" }); - ambiguityCodes.put("K", new String[] - { "G", "T" }); - ambiguityCodes.put("H", new String[] - { "A", "T", "C" }); - ambiguityCodes.put("B", new String[] - { "G", "T", "C" }); - ambiguityCodes.put("V", new String[] - { "G", "A", "C" }); - ambiguityCodes.put("D", new String[] - { "G", "A", "T" }); - ambiguityCodes.put("N", new String[] - { "G", "A", "T", "C" }); + ambiguityCodes.put("R", new String[] { "A", "G" }); + ambiguityCodes.put("Y", new String[] { "T", "C" }); + ambiguityCodes.put("W", new String[] { "A", "T" }); + ambiguityCodes.put("S", new String[] { "G", "C" }); + ambiguityCodes.put("M", new String[] { "A", "C" }); + ambiguityCodes.put("K", new String[] { "G", "T" }); + ambiguityCodes.put("H", new String[] { "A", "T", "C" }); + ambiguityCodes.put("B", new String[] { "G", "T", "C" }); + ambiguityCodes.put("V", new String[] { "G", "A", "C" }); + ambiguityCodes.put("D", new String[] { "G", "A", "T" }); + ambiguityCodes.put("N", new String[] { "G", "A", "T", "C" }); // Now build codon translation table codonHash2.put("AAA", "K"); @@ -888,8 +868,7 @@ public class ResidueProperties } else { - acodon[i] = new String[] - {}; + acodon[i] = new String[] {}; } } // enumerate all combinations and test for veracity of translation @@ -911,8 +890,7 @@ public class ResidueProperties if (acodon[ipos].length == 0 || tpos[ipos] < 0) { _acodon += codon.charAt(ipos); - allres[ipos] = new char[] - { codon.charAt(ipos) }; + allres[ipos] = new char[] { codon.charAt(ipos) }; } else { @@ -1389,8 +1367,7 @@ public class ResidueProperties propMatrixF[i][j] = 0; propMatrixPos[i][j] = 0; propMatrixEpos[i][j] = 0; - for (Enumeration en = propHash.keys(); en - .hasMoreElements();) + for (Enumeration en = propHash.keys(); en.hasMoreElements();) { String ph = en.nextElement(); Map pph = (Map) propHash @@ -1808,6 +1785,7 @@ public class ResidueProperties } System.out.println("};"); } + // to here /** @@ -1836,7 +1814,9 @@ public class ResidueProperties result.add(nuc); } } - } else { + } + else + { /* * Peptide */ diff --git a/src/jalview/schemes/StrandColourScheme.java b/src/jalview/schemes/StrandColourScheme.java index fe56ff5..1340de3 100755 --- a/src/jalview/schemes/StrandColourScheme.java +++ b/src/jalview/schemes/StrandColourScheme.java @@ -20,7 +20,7 @@ */ package jalview.schemes; -import java.awt.*; +import java.awt.Color; /** * DOCUMENT ME! diff --git a/src/jalview/schemes/TCoffeeColourScheme.java b/src/jalview/schemes/TCoffeeColourScheme.java index 48c52f1..62f3a2e 100644 --- a/src/jalview/schemes/TCoffeeColourScheme.java +++ b/src/jalview/schemes/TCoffeeColourScheme.java @@ -20,7 +20,6 @@ */ package jalview.schemes; -import jalview.analysis.SequenceIdMatcher; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.datamodel.AnnotatedCollectionI; @@ -33,7 +32,6 @@ import java.awt.Color; import java.util.ArrayList; import java.util.IdentityHashMap; import java.util.Map; -import java.util.TreeMap; /** * Defines the color score for T-Coffee MSA @@ -47,8 +45,7 @@ import java.util.TreeMap; public class TCoffeeColourScheme extends ResidueColourScheme { - static final Color[] colors = - { new Color(102, 102, 255), // #6666FF + static final Color[] colors = { new Color(102, 102, 255), // #6666FF new Color(0, 255, 0), // #00FF00 new Color(102, 255, 0), // #66FF00 new Color(204, 255, 0), // #CCFF00 diff --git a/src/jalview/schemes/TurnColourScheme.java b/src/jalview/schemes/TurnColourScheme.java index 428bfc9..22422ff 100755 --- a/src/jalview/schemes/TurnColourScheme.java +++ b/src/jalview/schemes/TurnColourScheme.java @@ -20,7 +20,7 @@ */ package jalview.schemes; -import java.awt.*; +import java.awt.Color; /** * DOCUMENT ME! diff --git a/src/jalview/schemes/UserColourScheme.java b/src/jalview/schemes/UserColourScheme.java index 80efaca..92989fb 100755 --- a/src/jalview/schemes/UserColourScheme.java +++ b/src/jalview/schemes/UserColourScheme.java @@ -20,14 +20,14 @@ */ package jalview.schemes; -import java.awt.Color; -import java.util.Map; -import java.util.StringTokenizer; - import jalview.datamodel.AnnotatedCollectionI; import jalview.datamodel.SequenceCollectionI; import jalview.datamodel.SequenceI; +import java.awt.Color; +import java.util.Map; +import java.util.StringTokenizer; + public class UserColourScheme extends ResidueColourScheme { Color[] lowerCaseColours; diff --git a/src/jalview/structure/SequenceListener.java b/src/jalview/structure/SequenceListener.java index cb65032..771b8a0 100644 --- a/src/jalview/structure/SequenceListener.java +++ b/src/jalview/structure/SequenceListener.java @@ -22,7 +22,6 @@ package jalview.structure; import jalview.datamodel.SequenceI; - public interface SequenceListener { // TODO remove this? never called on SequenceListener type diff --git a/src/jalview/structure/StructureListener.java b/src/jalview/structure/StructureListener.java index 2364549..e5c5d04 100644 --- a/src/jalview/structure/StructureListener.java +++ b/src/jalview/structure/StructureListener.java @@ -20,10 +20,10 @@ */ package jalview.structure; -import java.util.List; - import jalview.datamodel.SequenceI; +import java.util.List; + public interface StructureListener { /** diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 4359877..26b7d48 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -514,7 +514,8 @@ public class StructureSelectionManager resNum = tmp.resNumber; if (tmp.alignmentMapping >= -1) { - // TODO (JAL-1836) address root cause: negative residue no in PDB file + // TODO (JAL-1836) address root cause: negative residue no in PDB + // file mapping[tmp.alignmentMapping + 1][0] = tmp.resNumber; mapping[tmp.alignmentMapping + 1][1] = tmp.atomIndex; } @@ -719,7 +720,7 @@ public class StructureSelectionManager { results = MappingUtils.buildSearchResults(seq, index, seqmappings); - } + } if (handlingVamsasMo) { results.addResult(seq, index, index); diff --git a/src/jalview/structures/models/AAStructureBindingModel.java b/src/jalview/structures/models/AAStructureBindingModel.java index b844b52..3c40414 100644 --- a/src/jalview/structures/models/AAStructureBindingModel.java +++ b/src/jalview/structures/models/AAStructureBindingModel.java @@ -1,9 +1,5 @@ package jalview.structures.models; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - import jalview.api.StructureSelectionManagerProvider; import jalview.datamodel.AlignmentI; import jalview.datamodel.PDBEntry; @@ -15,6 +11,10 @@ import jalview.structure.StructureSelectionManager; import jalview.util.Comparison; import jalview.util.MessageManager; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + /** * * A base class to hold common function for protein structure model binding. @@ -202,7 +202,9 @@ public abstract class AAStructureBindingModel extends /** * Construct a title string for the viewer window based on the data Jalview * knows about - * @param viewerName TODO + * + * @param viewerName + * TODO * @param verbose * * @return @@ -210,8 +212,7 @@ public abstract class AAStructureBindingModel extends public String getViewerTitle(String viewerName, boolean verbose) { if (getSequence() == null || getSequence().length < 1 - || getPdbCount() < 1 - || getSequence()[0].length < 1) + || getPdbCount() < 1 || getSequence()[0].length < 1) { return ("Jalview " + viewerName + " Window"); } @@ -220,9 +221,8 @@ public abstract class AAStructureBindingModel extends StringBuilder title = new StringBuilder(64); final PDBEntry pdbEntry = getPdbEntry(0); title.append(viewerName + " view for " + getSequence()[0][0].getName() - + ":" - + pdbEntry.getId()); - + + ":" + pdbEntry.getId()); + if (verbose) { if (pdbEntry.getProperty() != null) @@ -268,8 +268,7 @@ public abstract class AAStructureBindingModel extends { throw new Error(MessageManager.formatMessage( "error.implementation_error_no_pdbentry_from_index", - new Object[] - { Integer.valueOf(pe).toString() })); + new Object[] { Integer.valueOf(pe).toString() })); } final String nullChain = "TheNullChain"; List s = new ArrayList(); @@ -339,8 +338,8 @@ public abstract class AAStructureBindingModel extends * * @returns the pdb entries added to the current set. */ - public synchronized PDBEntry[] addSequenceAndChain(PDBEntry[] pdbe, SequenceI[][] seq, - String[][] chns) + public synchronized PDBEntry[] addSequenceAndChain(PDBEntry[] pdbe, + SequenceI[][] seq, String[][] chns) { List v = new ArrayList(); List rtn = new ArrayList(); @@ -353,8 +352,7 @@ public abstract class AAStructureBindingModel extends int r = v.indexOf(pdbe[i]); if (r == -1 || r >= getPdbCount()) { - rtn.add(new int[] - { v.size(), i }); + rtn.add(new int[] { v.size(), i }); v.add(pdbe[i]); } else diff --git a/src/jalview/util/AWTConsole.java b/src/jalview/util/AWTConsole.java index 3b95f8a..7a585be 100644 --- a/src/jalview/util/AWTConsole.java +++ b/src/jalview/util/AWTConsole.java @@ -30,9 +30,23 @@ package jalview.util; // // RJHM van den Bergh , rvdb@comweb.nl -import java.io.*; -import java.awt.*; -import java.awt.event.*; +import java.awt.BorderLayout; +import java.awt.Button; +import java.awt.Dimension; +import java.awt.Frame; +import java.awt.GraphicsEnvironment; +import java.awt.Panel; +import java.awt.TextArea; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.WindowAdapter; +import java.awt.event.WindowEvent; +import java.awt.event.WindowListener; +import java.io.IOException; +import java.io.PipedInputStream; +import java.io.PipedOutputStream; +import java.io.PrintStream; public class AWTConsole extends WindowAdapter implements WindowListener, ActionListener, Runnable @@ -223,7 +237,8 @@ public class AWTConsole extends WindowAdapter implements WindowListener, } catch (InterruptedException ie) { } - throw new NullPointerException(MessageManager.getString("exception.application_test_npe")); + throw new NullPointerException( + MessageManager.getString("exception.application_test_npe")); } } diff --git a/src/jalview/util/BrowserLauncher.java b/src/jalview/util/BrowserLauncher.java index cd9c969..4a0b80a 100755 --- a/src/jalview/util/BrowserLauncher.java +++ b/src/jalview/util/BrowserLauncher.java @@ -20,8 +20,12 @@ */ package jalview.util; -import java.io.*; -import java.lang.reflect.*; +import java.io.File; +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; /** * BrowserLauncher is a class that provides one static method, openURL, which @@ -334,23 +338,19 @@ public class BrowserLauncher aeDescClass = Class.forName("com.apple.MacOS.AEDesc"); aeTargetConstructor = aeTargetClass - .getDeclaredConstructor(new Class[] - { int.class }); + .getDeclaredConstructor(new Class[] { int.class }); appleEventConstructor = appleEventClass - .getDeclaredConstructor(new Class[] - { int.class, int.class, aeTargetClass, int.class, int.class }); - aeDescConstructor = aeDescClass.getDeclaredConstructor(new Class[] - { String.class }); + .getDeclaredConstructor(new Class[] { int.class, int.class, + aeTargetClass, int.class, int.class }); + aeDescConstructor = aeDescClass + .getDeclaredConstructor(new Class[] { String.class }); makeOSType = osUtilsClass.getDeclaredMethod("makeOSType", - new Class[] - { String.class }); + new Class[] { String.class }); putParameter = appleEventClass.getDeclaredMethod("putParameter", - new Class[] - { int.class, aeDescClass }); + new Class[] { int.class, aeDescClass }); sendNoReply = appleEventClass.getDeclaredMethod("sendNoReply", - new Class[] - {}); + new Class[] {}); Field keyDirectObjectField = aeClass .getDeclaredField("keyDirectObject"); @@ -399,14 +399,11 @@ public class BrowserLauncher .getDeclaredField("kSystemFolderType"); kSystemFolderType = systemFolderField.get(null); findFolder = mrjFileUtilsClass.getDeclaredMethod("findFolder", - new Class[] - { mrjOSTypeClass }); + new Class[] { mrjOSTypeClass }); getFileCreator = mrjFileUtilsClass.getDeclaredMethod( - "getFileCreator", new Class[] - { File.class }); + "getFileCreator", new Class[] { File.class }); getFileType = mrjFileUtilsClass.getDeclaredMethod("getFileType", - new Class[] - { File.class }); + new Class[] { File.class }); } catch (ClassNotFoundException cnfe) { errorMessage = cnfe.getMessage(); @@ -441,10 +438,10 @@ public class BrowserLauncher try { Class linker = Class.forName("com.apple.mrj.jdirect.Linker"); - Constructor constructor = linker.getConstructor(new Class[] - { Class.class }); - linkage = constructor.newInstance(new Object[] - { BrowserLauncher.class }); + Constructor constructor = linker + .getConstructor(new Class[] { Class.class }); + linkage = constructor + .newInstance(new Object[] { BrowserLauncher.class }); } catch (ClassNotFoundException cnfe) { errorMessage = cnfe.getMessage(); @@ -480,8 +477,7 @@ public class BrowserLauncher { mrjFileUtilsClass = Class.forName("com.apple.mrj.MRJFileUtils"); openURL = mrjFileUtilsClass.getDeclaredMethod("openURL", - new Class[] - { String.class }); + new Class[] { String.class }); } catch (ClassNotFoundException cnfe) { errorMessage = cnfe.getMessage(); @@ -528,14 +524,13 @@ public class BrowserLauncher try { Integer finderCreatorCode = (Integer) makeOSType.invoke(null, - new Object[] - { FINDER_CREATOR }); - Object aeTarget = aeTargetConstructor.newInstance(new Object[] - { finderCreatorCode }); - Integer gurlType = (Integer) makeOSType.invoke(null, new Object[] - { GURL_EVENT }); - Object appleEvent = appleEventConstructor.newInstance(new Object[] - { gurlType, gurlType, aeTarget, kAutoGenerateReturnID, + new Object[] { FINDER_CREATOR }); + Object aeTarget = aeTargetConstructor + .newInstance(new Object[] { finderCreatorCode }); + Integer gurlType = (Integer) makeOSType.invoke(null, + new Object[] { GURL_EVENT }); + Object appleEvent = appleEventConstructor.newInstance(new Object[] { + gurlType, gurlType, aeTarget, kAutoGenerateReturnID, kAnyTransactionID }); // Don't set browser = appleEvent because then the next time we call @@ -573,8 +568,8 @@ public class BrowserLauncher try { - systemFolder = (File) findFolder.invoke(null, new Object[] - { kSystemFolderType }); + systemFolder = (File) findFolder.invoke(null, + new Object[] { kSystemFolderType }); } catch (IllegalArgumentException iare) { browser = null; @@ -615,13 +610,12 @@ public class BrowserLauncher // applications being picked up on certain Mac OS 9 systems, // especially German ones, and sending a GURL event to those // applications results in a logout under Multiple Users. - Object fileType = getFileType.invoke(null, new Object[] - { file }); + Object fileType = getFileType.invoke(null, new Object[] { file }); if (FINDER_TYPE.equals(fileType.toString())) { - Object fileCreator = getFileCreator.invoke(null, new Object[] - { file }); + Object fileCreator = getFileCreator.invoke(null, + new Object[] { file }); if (FINDER_CREATOR.equals(fileCreator.toString())) { @@ -702,14 +696,17 @@ public class BrowserLauncher { if (!loadedWithoutErrors) { - throw new IOException(MessageManager.formatMessage("exception.browser_not_found", new String[]{errorMessage})); + throw new IOException(MessageManager.formatMessage( + "exception.browser_not_found", new String[] { errorMessage })); } Object browser = locateBrowser(); if (browser == null) { - throw new IOException(MessageManager.formatMessage("exception.browser_unable_to_locate", new String[]{errorMessage})); + throw new IOException(MessageManager.formatMessage( + "exception.browser_unable_to_locate", + new String[] { errorMessage })); } switch (jvm) @@ -720,21 +717,25 @@ public class BrowserLauncher try { - aeDesc = aeDescConstructor.newInstance(new Object[] - { url }); - putParameter.invoke(browser, new Object[] - { keyDirectObject, aeDesc }); - sendNoReply.invoke(browser, new Object[] - {}); + aeDesc = aeDescConstructor.newInstance(new Object[] { url }); + putParameter.invoke(browser, + new Object[] { keyDirectObject, aeDesc }); + sendNoReply.invoke(browser, new Object[] {}); } catch (InvocationTargetException ite) { - throw new IOException(MessageManager.formatMessage("exception.invocation_target_exception_creating_aedesc", new String[]{ite.getMessage()})); + throw new IOException(MessageManager.formatMessage( + "exception.invocation_target_exception_creating_aedesc", + new String[] { ite.getMessage() })); } catch (IllegalAccessException iae) { - throw new IOException(MessageManager.formatMessage("exception.illegal_access_building_apple_evt", new String[]{iae.getMessage()})); + throw new IOException(MessageManager.formatMessage( + "exception.illegal_access_building_apple_evt", new String[] + { iae.getMessage() })); } catch (InstantiationException ie) { - throw new IOException(MessageManager.formatMessage("exception.illegal_access_building_apple_evt", new String[]{ie.getMessage()})); + throw new IOException(MessageManager.formatMessage( + "exception.illegal_access_building_apple_evt", new String[] + { ie.getMessage() })); } finally { aeDesc = null; // Encourage it to get disposed if it was created @@ -744,8 +745,7 @@ public class BrowserLauncher break; case MRJ_2_1: - Runtime.getRuntime().exec(new String[] - { (String) browser, url }); + Runtime.getRuntime().exec(new String[] { (String) browser, url }); break; @@ -756,13 +756,11 @@ public class BrowserLauncher if (result == 0) { - int[] selectionStart = new int[] - { 0 }; + int[] selectionStart = new int[] { 0 }; byte[] urlBytes = url.getBytes(); - int[] selectionEnd = new int[] - { urlBytes.length }; - result = ICLaunchURL(instance[0], new byte[] - { 0 }, urlBytes, urlBytes.length, selectionStart, selectionEnd); + int[] selectionEnd = new int[] { urlBytes.length }; + result = ICLaunchURL(instance[0], new byte[] { 0 }, urlBytes, + urlBytes.length, selectionStart, selectionEnd); if (result == 0) { @@ -772,12 +770,16 @@ public class BrowserLauncher } else { - throw new IOException(MessageManager.formatMessage("exception.unable_to_launch_url", new String[]{Integer.valueOf(result).toString()})); + throw new IOException(MessageManager.formatMessage( + "exception.unable_to_launch_url", new String[] { Integer + .valueOf(result).toString() })); } } else { - throw new IOException(MessageManager.formatMessage("exception.unable_to_create_internet_config", new String[]{Integer.valueOf(result).toString()})); + throw new IOException(MessageManager.formatMessage( + "exception.unable_to_create_internet_config", + new String[] { Integer.valueOf(result).toString() })); } break; @@ -786,14 +788,17 @@ public class BrowserLauncher try { - openURL.invoke(null, new Object[] - { url }); + openURL.invoke(null, new Object[] { url }); } catch (InvocationTargetException ite) { - throw new IOException(MessageManager.formatMessage("exception.invocation_target_calling_url", new String[]{ite.getMessage()})); + throw new IOException(MessageManager.formatMessage( + "exception.invocation_target_calling_url", + new String[] { ite.getMessage() })); } catch (IllegalAccessException iae) { - throw new IOException(MessageManager.formatMessage("exception.illegal_access_calling_url", new String[]{iae.getMessage()})); + throw new IOException(MessageManager.formatMessage( + "exception.illegal_access_calling_url", + new String[] { iae.getMessage() })); } break; @@ -804,8 +809,7 @@ public class BrowserLauncher // Add quotes around the URL to allow ampersands and other special // characters to work. Process process = Runtime.getRuntime().exec( - new String[] - { (String) browser, FIRST_WINDOWS_PARAMETER, + new String[] { (String) browser, FIRST_WINDOWS_PARAMETER, SECOND_WINDOWS_PARAMETER, THIRD_WINDOWS_PARAMETER, '"' + url + '"' }); @@ -818,7 +822,9 @@ public class BrowserLauncher process.exitValue(); } catch (InterruptedException ie) { - throw new IOException(MessageManager.formatMessage("exception.interrupted_launching_browser", new String[]{ie.getMessage()})); + throw new IOException(MessageManager.formatMessage( + "exception.interrupted_launching_browser", + new String[] { ie.getMessage() })); } break; @@ -837,8 +843,7 @@ public class BrowserLauncher * NETSCAPE_OPEN_NEW_WINDOW + NETSCAPE_OPEN_PARAMETER_END); */ process = Runtime.getRuntime().exec( - new String[] - { + new String[] { (String) browser, NETSCAPE_REMOTE_PARAMETER, @@ -852,12 +857,13 @@ public class BrowserLauncher if (exitCode != 0) { // if Netscape was not open - Runtime.getRuntime().exec(new String[] - { (String) browser, url }); + Runtime.getRuntime().exec(new String[] { (String) browser, url }); } } catch (InterruptedException ie) { - throw new IOException(MessageManager.formatMessage("exception.interrupted_launching_browser", new String[]{ie.getMessage()})); + throw new IOException(MessageManager.formatMessage( + "exception.interrupted_launching_browser", + new String[] { ie.getMessage() })); } break; @@ -866,8 +872,7 @@ public class BrowserLauncher // This should never occur, but if it does, we'll try the simplest thing // possible - Runtime.getRuntime().exec(new String[] - { (String) browser, url }); + Runtime.getRuntime().exec(new String[] { (String) browser, url }); break; } diff --git a/src/jalview/util/Comparison.java b/src/jalview/util/Comparison.java index 835a1b4..95f298b 100644 --- a/src/jalview/util/Comparison.java +++ b/src/jalview/util/Comparison.java @@ -20,11 +20,11 @@ */ package jalview.util; +import jalview.datamodel.SequenceI; + import java.util.ArrayList; import java.util.List; -import jalview.datamodel.SequenceI; - /** * Assorted methods for analysing or comparing sequences. */ @@ -40,8 +40,8 @@ public class Comparison private static final char GAP_DASH = '-'; - public static final String GapChars = new String(new char[] - { GAP_SPACE, GAP_DOT, GAP_DASH }); + public static final String GapChars = new String(new char[] { GAP_SPACE, + GAP_DOT, GAP_DASH }); /** * DOCUMENT ME! @@ -320,11 +320,13 @@ public class Comparison List flattened = new ArrayList(); for (SequenceI[] ss : seqs) { - for (SequenceI s : ss) { - flattened.add(s); + for (SequenceI s : ss) + { + flattened.add(s); } } - final SequenceI[] oneDArray = flattened.toArray(new SequenceI[flattened.size()]); + final SequenceI[] oneDArray = flattened.toArray(new SequenceI[flattened + .size()]); return isNucleotide(oneDArray); } } diff --git a/src/jalview/util/DBRefUtils.java b/src/jalview/util/DBRefUtils.java index 123a4e1..518c310 100755 --- a/src/jalview/util/DBRefUtils.java +++ b/src/jalview/util/DBRefUtils.java @@ -118,8 +118,7 @@ public class DBRefUtils { return false; } - String coordsys = dasCoordinateSystemsLookup.get(string - .toLowerCase()); + String coordsys = dasCoordinateSystemsLookup.get(string.toLowerCase()); return coordsys == null ? false : coordsys.equals(dBRefEntry .getSource()); } @@ -139,8 +138,7 @@ public class DBRefUtils { return null; } - String canonical = canonicalSourceNameLookup.get(source - .toLowerCase()); + String canonical = canonicalSourceNameLookup.get(source.toLowerCase()); return canonical == null ? source : canonical; } @@ -436,7 +434,7 @@ public class DBRefUtils { String pdbid = r.stringMatched(1); String chaincode = r.stringMatched(2); - if (chaincode==null) + if (chaincode == null) { chaincode = " "; } @@ -455,8 +453,10 @@ public class DBRefUtils pdbr.setChainCode(chaincode); // pdbr.getProperty().put("CHAIN", chaincode); seq.addPDBId(pdbr); - } else { - System.err.println("Malformed PDB DR line:"+acn); + } + else + { + System.err.println("Malformed PDB DR line:" + acn); } } else diff --git a/src/jalview/util/GroupUrlLink.java b/src/jalview/util/GroupUrlLink.java index 4900fc8..e2e83a4 100644 --- a/src/jalview/util/GroupUrlLink.java +++ b/src/jalview/util/GroupUrlLink.java @@ -24,7 +24,6 @@ import jalview.datamodel.Sequence; import jalview.datamodel.SequenceI; import java.util.Hashtable; -import java.util.Vector; public class GroupUrlLink { @@ -83,8 +82,7 @@ public class GroupUrlLink { if (tokens == null) { - tokens = new String[] - { "SEQUENCEIDS", "SEQUENCES", "DATASETID" }; + tokens = new String[] { "SEQUENCEIDS", "SEQUENCES", "DATASETID" }; } } @@ -392,11 +390,12 @@ public class GroupUrlLink Hashtable rstrings = new Hashtable(); rstrings.put(tokens[0], idstrings); rstrings.put(tokens[1], seqstrings); - rstrings.put(tokens[2], new String[] - { dsstring }); + rstrings.put(tokens[2], new String[] { dsstring }); if (idstrings.length != seqstrings.length) { - throw new Error(MessageManager.getString("error.idstring_seqstrings_only_one_per_sequence")); + throw new Error( + MessageManager + .getString("error.idstring_seqstrings_only_one_per_sequence")); } return rstrings; } @@ -423,9 +422,8 @@ public class GroupUrlLink Object[] stubs = makeUrlsIf(false, rstrings, b); if (stubs != null) { - return new Object[] - { stubs[0], stubs[1], rstrings, new boolean[] - { b } }; + return new Object[] { stubs[0], stubs[1], rstrings, + new boolean[] { b } }; } // TODO Auto-generated method stub return null; @@ -486,14 +484,19 @@ public class GroupUrlLink { if (maxs != idseq[i].length) { - throw new Error(MessageManager.formatMessage("error.cannot_have_mixed_length_replacement_vectors", - new String[]{(mtch[i]), Integer.valueOf(idseq[i].length).toString(),Integer.valueOf(maxs).toString()})); + throw new Error(MessageManager.formatMessage( + "error.cannot_have_mixed_length_replacement_vectors", + new String[] { (mtch[i]), + Integer.valueOf(idseq[i].length).toString(), + Integer.valueOf(maxs).toString() })); } } } else { - throw new Error(MessageManager.getString("error.cannot_have_zero_length_vector_replacement_strings")); + throw new Error( + MessageManager + .getString("error.cannot_have_zero_length_vector_replacement_strings")); } } // iterate through input, collating segments to be inserted into url @@ -689,9 +692,7 @@ public class GroupUrlLink { // just return the essential info about what the URL would be generated // from - return new Object[] - { new int[] - { seqsmatched }, thismatched }; + return new Object[] { new int[] { seqsmatched }, thismatched }; } // otherwise, create the URL completely. @@ -706,10 +707,8 @@ public class GroupUrlLink } } - return new Object[] - { new int[] - { seqsmatched }, thismatched, matched, new String[] - { submiturl.toString() } }; + return new Object[] { new int[] { seqsmatched }, thismatched, matched, + new String[] { submiturl.toString() } }; } /** @@ -817,8 +816,7 @@ public class GroupUrlLink public static void main(String argv[]) { // note - JAL-1383 - these services are all dead - String[] links = new String[] - { + String[] links = new String[] { "EnVision2|IDS|http://www.ebi.ac.uk/enfin-srv/envision2/pages/linkin.jsf?workflow=Enfin%20Default%20Workflow&datasetName=linkInDatasetFromJalview&input=$SEQUENCEIDS$&inputType=0|,", "EnVision2|Seqs|http://www.ebi.ac.uk/enfin-srv/envision2/pages/linkin.jsf?workflow=Enfin%20Default%20Workflow&datasetName=linkInDatasetFromJalview&input=$SEQUENCES$&inputType=1|,", "EnVision2|IDS|http://www.ebi.ac.uk/enfin-srv/envision2/pages/linkin.jsf?workflow=Enfin%20Default%20Workflow&datasetName=$DATASETID$&input=$SEQUENCEIDS$&inputType=0|,", @@ -834,8 +832,8 @@ public class GroupUrlLink */ }; - SequenceI[] seqs = new SequenceI[] - { new Sequence("StupidLabel:gi|9234|pdb|102L|A", + SequenceI[] seqs = new SequenceI[] { new Sequence( + "StupidLabel:gi|9234|pdb|102L|A", "asdiasdpasdpadpwpadasdpaspdw"), }; String[][] seqsandids = formStrings(seqs); for (int i = 0; i < links.length; i++) diff --git a/src/jalview/util/ImageMaker.java b/src/jalview/util/ImageMaker.java index 8abe965..e1543bf 100755 --- a/src/jalview/util/ImageMaker.java +++ b/src/jalview/util/ImageMaker.java @@ -89,7 +89,6 @@ public class ImageMaker } - public ImageMaker(Component parent, TYPE type, String title, int width, int height, File file, String fileTitle) { @@ -129,11 +128,10 @@ public class ImageMaker { setupPNG(width, height); } - + } catch (Exception ex) { - System.out.println("Error creating " - + type.getName() + " file."); + System.out.println("Error creating " + type.getName() + " file."); } } } @@ -143,8 +141,6 @@ public class ImageMaker return graphics; } - - public void writeImage() { try @@ -261,13 +257,14 @@ public class ImageMaker static JalviewFileChooser getPNGChooser() { if (Jalview.isHeadlessMode()) - { + { return null; } return new jalview.io.JalviewFileChooser( - jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] - { "png" }, new String[] - { "Portable network graphics" }, "Portable network graphics"); + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), + new String[] { "png" }, + new String[] { "Portable network graphics" }, + "Portable network graphics"); } static JalviewFileChooser getEPSChooser() @@ -277,20 +274,22 @@ public class ImageMaker return null; } return new jalview.io.JalviewFileChooser( - jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] - { "eps" }, new String[] - { "Encapsulated Postscript" }, "Encapsulated Postscript"); + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), + new String[] { "eps" }, + new String[] { "Encapsulated Postscript" }, + "Encapsulated Postscript"); } static JalviewFileChooser getSVGChooser() { if (Jalview.isHeadlessMode()) - { + { return null; } return new jalview.io.JalviewFileChooser( - jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[] - { "svg" }, new String[] - { "Scalable Vector Graphics" }, "Scalable Vector Graphics"); + jalview.bin.Cache.getProperty("LAST_DIRECTORY"), + new String[] { "svg" }, + new String[] { "Scalable Vector Graphics" }, + "Scalable Vector Graphics"); } } diff --git a/src/jalview/util/MapList.java b/src/jalview/util/MapList.java index 662240e..e456dab 100644 --- a/src/jalview/util/MapList.java +++ b/src/jalview/util/MapList.java @@ -202,8 +202,7 @@ public class MapList fromLowest = Math.min(fromLowest, from[i]); fromHighest = Math.max(fromHighest, from[i + 1]); - fromShifts.add(new int[] - { from[i], from[i + 1] }); + fromShifts.add(new int[] { from[i], from[i + 1] }); } toLowest = to[0]; @@ -212,8 +211,7 @@ public class MapList { toLowest = Math.min(toLowest, to[i]); toHighest = Math.max(toHighest, to[i + 1]); - toShifts.add(new int[] - { to[i], to[i + 1] }); + toShifts.add(new int[] { to[i], to[i + 1] }); } } @@ -236,16 +234,14 @@ public class MapList { for (int[] r : map.fromShifts) { - fromShifts.add(new int[] - { r[0], r[1] }); + fromShifts.add(new int[] { r[0], r[1] }); } } if (map.toShifts != null) { for (int[] r : map.toShifts) { - toShifts.add(new int[] - { r[0], r[1] }); + toShifts.add(new int[] { r[0], r[1] }); } } } @@ -258,8 +254,8 @@ public class MapList * @param fromRatio * @param toRatio */ - public MapList(List fromRange, List toRange, - int fromRatio, int toRatio) + public MapList(List fromRange, List toRange, int fromRatio, + int toRatio) { this.fromShifts = fromRange; this.toShifts = toRange; @@ -268,7 +264,8 @@ public class MapList fromLowest = Integer.MAX_VALUE; fromHighest = 0; - for (int[] range : fromRange) { + for (int[] range : fromRange) + { fromLowest = Math.min(fromLowest, range[0]); fromHighest = Math.max(fromHighest, range[1]); } @@ -313,8 +310,7 @@ public class MapList * returning mapped position */ private int[][] posMap(List shiftTo, int ratio, - List shiftFrom, - int toRatio) + List shiftFrom, int toRatio) { // TODO not used - remove?? int iv = 0, ivSize = shiftTo.size(); @@ -374,9 +370,8 @@ public class MapList } mp[i] = m; } - int[][] map = new int[][] - { new int[] - { from, to, tF, tT }, new int[to - from + 2] }; + int[][] map = new int[][] { new int[] { from, to, tF, tT }, + new int[to - from + 2] }; map[0][2] = tF; map[0][3] = tT; @@ -461,8 +456,7 @@ public class MapList return null; // throw new Error("Bad Mapping!"); } // System.out.println(fromCount[0]+" "+fromCount[1]+" "+toCount); - return new int[] - { toPos[0], fromRemainder, toPos[1] }; + return new int[] { toPos[0], fromRemainder, toPos[1] }; } /** @@ -482,8 +476,7 @@ public class MapList { if (pos >= intv[0] && pos <= intv[1]) { - return new int[] - { count + pos - intv[0] + 1, +1 }; + return new int[] { count + pos - intv[0] + 1, +1 }; } else { @@ -494,8 +487,7 @@ public class MapList { if (pos >= intv[1] && pos <= intv[0]) { - return new int[] - { count + intv[0] - pos + 1, -1 }; + return new int[] { count + intv[0] - pos + 1, -1 }; } else { @@ -516,8 +508,7 @@ public class MapList protected static int[] countToPos(List shiftFrom, int pos) { int count = 0, diff = 0, iv = 0, ivSize = shiftFrom.size(); - int[] intv = - { 0, 0 }; + int[] intv = { 0, 0 }; while (iv < ivSize) { intv = shiftFrom.get(iv++); @@ -526,8 +517,7 @@ public class MapList { if (pos <= count + 1 + diff) { - return new int[] - { pos - count - 1 + intv[0], +1 }; + return new int[] { pos - count - 1 + intv[0], +1 }; } else { @@ -538,8 +528,7 @@ public class MapList { if (pos <= count + 1 - diff) { - return new int[] - { intv[0] - (pos - count - 1), -1 }; + return new int[] { intv[0] - (pos - count - 1), -1 }; } else { @@ -597,8 +586,7 @@ public class MapList * region to final position of ending region inclusive */ protected static int[] getIntervals(List shiftFrom, - int[] fromStart, - int[] fromEnd, int fromRatio2) + int[] fromStart, int[] fromEnd, int fromRatio2) { if (fromStart == null || fromEnd == null) { @@ -688,8 +676,7 @@ public class MapList i = fs; // truncate initial interval iv = shiftFrom.get(intv++); - iv = new int[] - { iv[0], iv[1] };// clone + iv = new int[] { iv[0], iv[1] };// clone if (i == fs) { iv[0] = startpos; @@ -698,8 +685,7 @@ public class MapList { ranges.add(iv); // add initial range iv = shiftFrom.get(intv++); // get next interval - iv = new int[] - { iv[0], iv[1] };// clone + iv = new int[] { iv[0], iv[1] };// clone i++; } if (i == fe) @@ -717,8 +703,7 @@ public class MapList i--; } iv = shiftFrom.get(i); - iv = new int[] - { iv[1], iv[0] };// reverse and clone + iv = new int[] { iv[1], iv[0] };// reverse and clone // truncate initial interval if (i == fs) { @@ -728,8 +713,7 @@ public class MapList { // fix apparent logic bug when fe==-1 ranges.add(iv); // add (truncated) reversed interval iv = shiftFrom.get(i); - iv = new int[] - { iv[1], iv[0] }; // reverse and clone + iv = new int[] { iv[1], iv[0] }; // reverse and clone } if (i == fe) { @@ -788,8 +772,7 @@ public class MapList int[] mp = shiftTo(mpos); if (mp != null) { - return new int[] - { mp[0], mp[0] + mp[2] * (getFromRatio() - 1) }; + return new int[] { mp[0], mp[0] + mp[2] * (getFromRatio() - 1) }; } return null; } @@ -818,8 +801,7 @@ public class MapList int[] mp = shiftFrom(pos); if (mp != null) { - return new int[] - { mp[0], mp[0] + mp[2] * (getToRatio() - 1) }; + return new int[] { mp[0], mp[0] + mp[2] * (getToRatio() - 1) }; } return null; } diff --git a/src/jalview/util/MappingUtils.java b/src/jalview/util/MappingUtils.java index f2213ad..adfd397 100644 --- a/src/jalview/util/MappingUtils.java +++ b/src/jalview/util/MappingUtils.java @@ -1,13 +1,5 @@ package jalview.util; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; - import jalview.analysis.AlignmentSorter; import jalview.api.AlignViewportI; import jalview.commands.CommandI; @@ -25,6 +17,14 @@ import jalview.datamodel.Sequence; import jalview.datamodel.SequenceGroup; import jalview.datamodel.SequenceI; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * Helper methods for manipulations involving sequence mappings. * @@ -200,8 +200,8 @@ public final class MappingUtils */ int mappedEditPos = action == Action.DELETE_GAP ? match[0] - mappedCount : match[0]; - Edit e = result.new Edit(action, new SequenceI[] - { targetSeq }, mappedEditPos, mappedCount, gapChar); + Edit e = result.new Edit(action, new SequenceI[] { targetSeq }, + mappedEditPos, mappedCount, gapChar); result.addEdit(e); /* @@ -339,7 +339,7 @@ public final class MappingUtils */ int startResiduePos = selected.findPosition(firstUngappedPos); int endResiduePos = selected.findPosition(lastUngappedPos); - + for (AlignedCodonFrame acf : codonFrames) { SequenceI mappedSequence = targetIsNucleotide ? acf @@ -424,7 +424,8 @@ public final class MappingUtils { for (AlignedCodonFrame acf : mappings) { - SequenceI mappedSeq = mappingToNucleotide ? acf.getDnaForAaSeq(seq) : acf.getAaForDnaSeq(seq); + SequenceI mappedSeq = mappingToNucleotide ? acf.getDnaForAaSeq(seq) + : acf.getAaForDnaSeq(seq); if (mappedSeq != null) { for (SequenceI seq2 : mapTo.getSequences()) @@ -645,8 +646,10 @@ public final class MappingUtils { return result; } - for (AlignedCodonFrame mapping : mappings) { - if (mapping.involvesSequence(sequence)) { + for (AlignedCodonFrame mapping : mappings) + { + if (mapping.involvesSequence(sequence)) + { result.add(mapping); } } diff --git a/src/jalview/util/ParseHtmlBodyAndLinks.java b/src/jalview/util/ParseHtmlBodyAndLinks.java index 7aec22d..5263454 100644 --- a/src/jalview/util/ParseHtmlBodyAndLinks.java +++ b/src/jalview/util/ParseHtmlBodyAndLinks.java @@ -32,7 +32,8 @@ import java.util.regex.Pattern; */ public class ParseHtmlBodyAndLinks { - private static final Pattern LEFT_ANGLE_BRACKET_PATTERN = Pattern.compile("<"); + private static final Pattern LEFT_ANGLE_BRACKET_PATTERN = Pattern + .compile("<"); String orig = null; diff --git a/src/jalview/util/QuickSort.java b/src/jalview/util/QuickSort.java index 4826bc3..2b58095 100755 --- a/src/jalview/util/QuickSort.java +++ b/src/jalview/util/QuickSort.java @@ -47,7 +47,7 @@ public class QuickSort { return Float.compare(values[o1], values[o2]); } - + } static class IntComparator implements Comparator @@ -492,13 +492,13 @@ public class QuickSort nextZeroValue++; } } - + /* * Copy zero values back to original arrays */ System.arraycopy(f1, 0, arr, 0, nextZeroValue); System.arraycopy(s1, 0, s, 0, nextZeroValue); - + if (nextZeroValue == arr.length) { return; // all zero @@ -506,12 +506,11 @@ public class QuickSort /* * Sort the non-zero values */ - int[] nonZeroInts = Arrays - .copyOfRange(f1, nextZeroValue, f1.length); + int[] nonZeroInts = Arrays.copyOfRange(f1, nextZeroValue, f1.length); char[] nonZeroChars = Arrays.copyOfRange(s1, nextZeroValue, s1.length); externalSort(nonZeroInts, nonZeroChars); // sort(nonZeroFloats, 0, nonZeroFloats.length - 1, nonZeroChars); - + /* * Assemble sorted non-zero results */ diff --git a/src/jalview/util/ReverseListIterator.java b/src/jalview/util/ReverseListIterator.java index 69a7345..204a053 100644 --- a/src/jalview/util/ReverseListIterator.java +++ b/src/jalview/util/ReverseListIterator.java @@ -21,6 +21,7 @@ public class ReverseListIterator implements Iterator { this.iterator = stuff.listIterator(stuff.size()); } + @Override public boolean hasNext() { diff --git a/src/jalview/util/ShiftList.java b/src/jalview/util/ShiftList.java index 38d6a32..1dd18ec 100644 --- a/src/jalview/util/ShiftList.java +++ b/src/jalview/util/ShiftList.java @@ -57,8 +57,7 @@ public class ShiftList } if (sidx == shifts.size()) { - shifts.add(sidx, new int[] - { pos, shift }); + shifts.add(sidx, new int[] { pos, shift }); } else { @@ -115,8 +114,7 @@ public class ShiftList { if (sh != null) { - inverse.shifts.add(new int[] - { sh[0], -sh[1] }); + inverse.shifts.add(new int[] { sh[0], -sh[1] }); } } } diff --git a/src/jalview/util/StringUtils.java b/src/jalview/util/StringUtils.java index c55d467..3e004a6 100644 --- a/src/jalview/util/StringUtils.java +++ b/src/jalview/util/StringUtils.java @@ -4,10 +4,10 @@ import java.util.ArrayList; import java.util.List; import java.util.regex.Pattern; - public class StringUtils { - private static final Pattern DELIMITERS_PATTERN = Pattern.compile(".*='[^']*(?!')"); + private static final Pattern DELIMITERS_PATTERN = Pattern + .compile(".*='[^']*(?!')"); private static final boolean DEBUG = false; @@ -25,11 +25,10 @@ public class StringUtils * the character to insert */ public static final char[] insertCharAt(char[] in, int position, - int count, - char ch) + int count, char ch) { char[] tmp = new char[in.length + count]; - + if (position >= in.length) { System.arraycopy(in, 0, tmp, 0, in.length); @@ -39,20 +38,19 @@ public class StringUtils { System.arraycopy(in, 0, tmp, 0, position); } - + int index = position; while (count > 0) { tmp[index++] = ch; count--; } - + if (position < in.length) { - System.arraycopy(in, position, tmp, index, - in.length - position); + System.arraycopy(in, position, tmp, index, in.length - position); } - + return tmp; } diff --git a/src/jalview/util/TableSorter.java b/src/jalview/util/TableSorter.java index b14f6c0..666f945 100755 --- a/src/jalview/util/TableSorter.java +++ b/src/jalview/util/TableSorter.java @@ -20,14 +20,30 @@ */ package jalview.util; -import java.util.*; +import java.awt.Color; +import java.awt.Component; +import java.awt.Graphics; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Iterator; import java.util.List; - -import java.awt.*; -import java.awt.event.*; -import javax.swing.*; -import javax.swing.event.*; -import javax.swing.table.*; +import java.util.Map; + +import javax.swing.Icon; +import javax.swing.JLabel; +import javax.swing.JTable; +import javax.swing.event.TableModelEvent; +import javax.swing.event.TableModelListener; +import javax.swing.table.AbstractTableModel; +import javax.swing.table.JTableHeader; +import javax.swing.table.TableCellRenderer; +import javax.swing.table.TableColumnModel; +import javax.swing.table.TableModel; /** * TableSorter is a decorator for TableModels; adding sorting functionality to a diff --git a/src/jalview/util/UrlLink.java b/src/jalview/util/UrlLink.java index 3f72ab4..4297090 100644 --- a/src/jalview/util/UrlLink.java +++ b/src/jalview/util/UrlLink.java @@ -208,8 +208,7 @@ public class UrlLink if (ns == 0) { // take whole regex - return new String[] - { rg.stringMatched(), + return new String[] { rg.stringMatched(), url_prefix + rg.stringMatched() + url_suffix }; } /* * else if (ns==1) { // take only subgroup match return new String[] @@ -288,13 +287,11 @@ public class UrlLink } // just return simple url substitution. - return new String[] - { idstring, url_prefix + idstring + url_suffix }; + return new String[] { idstring, url_prefix + idstring + url_suffix }; } else { - return new String[] - { "", url_prefix }; + return new String[] { "", url_prefix }; } } @@ -329,8 +326,7 @@ public class UrlLink public static void main(String argv[]) { - String[] links = new String[] - { + String[] links = new String[] { /* * "AlinkT|Target|http://foo.foo.soo/", * "myUrl1|http://$SEQUENCE_ID=/[0-9]+/=$.someserver.org/foo", @@ -346,8 +342,7 @@ public class UrlLink * , "NOTFER|http://notfer.org/$SEQUENCE_ID=/(? hiddenRepSequences; protected ColumnSelection colSel = new ColumnSelection(); @@ -553,7 +552,6 @@ public abstract class AlignmentViewport implements AlignViewportI, protected ColourSchemeI globalColourScheme = null; - @Override public void setGlobalColourScheme(ColourSchemeI cs) { @@ -978,7 +976,6 @@ public abstract class AlignmentViewport implements AlignViewportI, */ public boolean sortByTree = false; - /** * * @@ -1060,7 +1057,6 @@ public abstract class AlignmentViewport implements AlignViewportI, return alignment.getHiddenSequences().getSize() > 0; } - protected SequenceGroup selectionGroup; public void setSequenceSetId(String newid) @@ -1309,8 +1305,7 @@ public abstract class AlignmentViewport implements AlignViewportI, public void showSequence(int index) { List tmp = alignment.getHiddenSequences().showSequence( - index, - hiddenRepSequences); + index, hiddenRepSequences); if (tmp.size() > 0) { if (selectionGroup == null) @@ -1411,8 +1406,9 @@ public abstract class AlignmentViewport implements AlignViewportI, public boolean isHiddenRepSequence(SequenceI seq) { - return alignment.getSeqrep()==seq || (hiddenRepSequences != null - && hiddenRepSequences.containsKey(seq)); + return alignment.getSeqrep() == seq + || (hiddenRepSequences != null && hiddenRepSequences + .containsKey(seq)); } public SequenceGroup getRepresentedSequences(SequenceI seq) @@ -1434,7 +1430,6 @@ public abstract class AlignmentViewport implements AlignViewportI, colSel.invertColumnSelection(0, alignment.getWidth()); } - @Override public SequenceI[] getSelectionAsNewSequence() { @@ -1462,7 +1457,6 @@ public abstract class AlignmentViewport implements AlignViewportI, return sequences; } - @Override public SequenceI[] getSequenceSelection() { @@ -1478,16 +1472,13 @@ public abstract class AlignmentViewport implements AlignViewportI, return sequences; } - @Override - public CigarArray getViewAsCigars( - boolean selectedRegionOnly) + public CigarArray getViewAsCigars(boolean selectedRegionOnly) { return new CigarArray(alignment, colSel, (selectedRegionOnly ? selectionGroup : null)); } - @Override public jalview.datamodel.AlignmentView getAlignmentView( boolean selectedOnly) @@ -1495,7 +1486,6 @@ public abstract class AlignmentViewport implements AlignViewportI, return getAlignmentView(selectedOnly, false); } - @Override public jalview.datamodel.AlignmentView getAlignmentView( boolean selectedOnly, boolean markGroups) @@ -1505,7 +1495,6 @@ public abstract class AlignmentViewport implements AlignViewportI, markGroups); } - @Override public String[] getViewAsString(boolean selectedRegionOnly) { @@ -1543,7 +1532,6 @@ public abstract class AlignmentViewport implements AlignViewportI, return selection; } - @Override public List getVisibleRegionBoundaries(int min, int max) { @@ -1571,8 +1559,7 @@ public abstract class AlignmentViewport implements AlignViewportI, } } - regions.add(new int[] - { start, end }); + regions.add(new int[] { start, end }); if (colSel != null && colSel.hasHiddenColumns()) { @@ -1587,19 +1574,23 @@ public abstract class AlignmentViewport implements AlignViewportI, } @Override - public List getVisibleAlignmentAnnotation(boolean selectedOnly) + public List getVisibleAlignmentAnnotation( + boolean selectedOnly) { ArrayList ala = new ArrayList(); AlignmentAnnotation[] aa; - if ((aa=alignment.getAlignmentAnnotation())!=null) + if ((aa = alignment.getAlignmentAnnotation()) != null) { - for (AlignmentAnnotation annot:aa) + for (AlignmentAnnotation annot : aa) { AlignmentAnnotation clone = new AlignmentAnnotation(annot); - if (selectedOnly && selectionGroup!=null) + if (selectedOnly && selectionGroup != null) + { + colSel.makeVisibleAnnotation(selectionGroup.getStartRes(), + selectionGroup.getEndRes(), clone); + } + else { - colSel.makeVisibleAnnotation(selectionGroup.getStartRes(), selectionGroup.getEndRes(),clone); - } else { colSel.makeVisibleAnnotation(clone); } ala.add(clone); @@ -1608,14 +1599,12 @@ public abstract class AlignmentViewport implements AlignViewportI, return ala; } - @Override public boolean isPadGaps() { return padGaps; } - @Override public void setPadGaps(boolean padGaps) { @@ -1943,6 +1932,7 @@ public abstract class AlignmentViewport implements AlignViewportI, } oldrfs.clear(); } + @Override public boolean isDisplayReferenceSeq() { @@ -2051,7 +2041,8 @@ public abstract class AlignmentViewport implements AlignViewportI, @Override public boolean areFeaturesDisplayed() { - return featuresDisplayed != null && featuresDisplayed.getRegisterdFeaturesCount()>0; + return featuresDisplayed != null + && featuresDisplayed.getRegisterdFeaturesCount() > 0; } /** @@ -2065,6 +2056,7 @@ public abstract class AlignmentViewport implements AlignViewportI, { viewStyle.setShowSequenceFeatures(b); } + @Override public boolean isShowSequenceFeatures() { @@ -2083,8 +2075,6 @@ public abstract class AlignmentViewport implements AlignViewportI, return viewStyle.isShowSequenceFeaturesHeight(); } - - @Override public void setShowAnnotation(boolean b) { @@ -2329,7 +2319,8 @@ public abstract class AlignmentViewport implements AlignViewportI, protected void broadcastCommand(CommandI command, boolean undo) { - getStructureSelectionManager().commandPerformed(command, undo, getVamsasSource()); + getStructureSelectionManager().commandPerformed(command, undo, + getVamsasSource()); } /** @@ -2506,15 +2497,15 @@ public abstract class AlignmentViewport implements AlignViewportI, return 0; } boolean iAmProtein = !getAlignment().isNucleotide(); - AlignmentI proteinAlignment = iAmProtein ? getAlignment() - : complement.getAlignment(); + AlignmentI proteinAlignment = iAmProtein ? getAlignment() : complement + .getAlignment(); if (proteinAlignment == null) { return 0; } final Set mappings = proteinAlignment .getCodonFrames(); - + /* * Heuristic: find the first mapped sequence (if any) with a non-gapped * residue in the middle column of the visible region. Scroll the @@ -2530,9 +2521,10 @@ public abstract class AlignmentViewport implements AlignViewportI, int middleColumn = getStartRes() + (getEndRes() - getStartRes()) / 2; final HiddenSequences hiddenSequences = getAlignment() .getHiddenSequences(); - + /* - * searching to the bottom of the alignment gives smoother scrolling across all gapped visible regions + * searching to the bottom of the alignment gives smoother scrolling across + * all gapped visible regions */ int lastSeq = alignment.getHeight() - 1; for (int seqNo = getStartSeq(); seqNo < lastSeq; seqNo++, seqOffset++) @@ -2550,10 +2542,10 @@ public abstract class AlignmentViewport implements AlignViewportI, .findMappingsForSequence(sequence, mappings); if (!seqMappings.isEmpty()) { - break; + break; } } - + if (sequence == null) { /* diff --git a/src/jalview/viewmodel/PCAModel.java b/src/jalview/viewmodel/PCAModel.java index c1175b7..b0af302 100644 --- a/src/jalview/viewmodel/PCAModel.java +++ b/src/jalview/viewmodel/PCAModel.java @@ -20,13 +20,13 @@ */ package jalview.viewmodel; -import java.util.Vector; - import jalview.analysis.PCA; +import jalview.api.RotatableCanvasI; import jalview.datamodel.AlignmentView; import jalview.datamodel.SequenceI; import jalview.datamodel.SequencePoint; -import jalview.api.RotatableCanvasI; + +import java.util.Vector; public class PCAModel { diff --git a/src/jalview/viewmodel/annotationfilter/AnnotationFilterParameter.java b/src/jalview/viewmodel/annotationfilter/AnnotationFilterParameter.java index 3cd4ef7..74d49e8 100644 --- a/src/jalview/viewmodel/annotationfilter/AnnotationFilterParameter.java +++ b/src/jalview/viewmodel/annotationfilter/AnnotationFilterParameter.java @@ -14,6 +14,7 @@ public class AnnotationFilterParameter { DISPLAY_STRING, DESCRIPTION; } + private ThresholdType thresholdType; private float thresholdValue; diff --git a/src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java b/src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java index 19c6ca8..bedbaf5 100644 --- a/src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java +++ b/src/jalview/viewmodel/seqfeatures/FeatureRendererModel.java @@ -119,8 +119,7 @@ public abstract class FeatureRendererModel implements } if (!fdi.isRegistered(featureType)) { - pushFeatureType(Arrays.asList(new String[] - { featureType })); + pushFeatureType(Arrays.asList(new String[] { featureType })); } fdi.setVisible(featureType); } @@ -163,7 +162,7 @@ public abstract class FeatureRendererModel implements types.toArray(neworder); if (renderOrder != null) { - System.arraycopy(neworder,0,neworder,renderOrder.length,ts); + System.arraycopy(neworder, 0, neworder, renderOrder.length, ts); System.arraycopy(renderOrder, 0, neworder, 0, renderOrder.length); } renderOrder = neworder; @@ -186,8 +185,7 @@ public abstract class FeatureRendererModel implements protected final byte[] normaliseScore(SequenceFeature sequenceFeature) { float[] mm = ((float[][]) minmax.get(sequenceFeature.type))[0]; - final byte[] r = new byte[] - { 0, (byte) 255 }; + final byte[] r = new byte[] { 0, (byte) 255 }; if (mm != null) { if (r[0] != 0 || mm[0] < 0.0) @@ -375,14 +373,13 @@ public abstract class FeatureRendererModel implements float[][] mm = (float[][]) minmax.get(features[index].getType()); if (mm == null) { - mm = new float[][] - { null, null }; + mm = new float[][] { null, null }; minmax.put(features[index].getType(), mm); } if (mm[nonpos] == null) { - mm[nonpos] = new float[] - { features[index].score, features[index].score }; + mm[nonpos] = new float[] { features[index].score, + features[index].score }; } else @@ -433,8 +430,7 @@ public abstract class FeatureRendererModel implements { if (initOrders) { - setOrder(oldRender[j], (1 - (1 + (float) j) - / oldRender.length)); + setOrder(oldRender[j], (1 - (1 + (float) j) / oldRender.length)); } if (allfeatures.contains(oldRender[j])) { @@ -770,8 +766,7 @@ public abstract class FeatureRendererModel implements { if (renderOrder == null) { - return Arrays.asList(new String[] - {}); + return Arrays.asList(new String[] {}); } return Arrays.asList(renderOrder); } diff --git a/src/jalview/viewmodel/seqfeatures/FeatureRendererSettings.java b/src/jalview/viewmodel/seqfeatures/FeatureRendererSettings.java index 6e85b83..49dcad7 100644 --- a/src/jalview/viewmodel/seqfeatures/FeatureRendererSettings.java +++ b/src/jalview/viewmodel/seqfeatures/FeatureRendererSettings.java @@ -25,7 +25,7 @@ public class FeatureRendererSettings implements Cloneable float transparency, Hashtable featureOrder) { super(); - this.renderOrder = Arrays.copyOf(renderOrder,renderOrder.length); + this.renderOrder = Arrays.copyOf(renderOrder, renderOrder.length); this.featureGroups = new ConcurrentHashMap(featureGroups); this.featureColours = new ConcurrentHashMap(featureColours); this.transparency = transparency; diff --git a/src/jalview/viewmodel/styles/ViewStyle.java b/src/jalview/viewmodel/styles/ViewStyle.java index 3ed5634..649d07e 100644 --- a/src/jalview/viewmodel/styles/ViewStyle.java +++ b/src/jalview/viewmodel/styles/ViewStyle.java @@ -1,9 +1,9 @@ package jalview.viewmodel.styles; -import java.awt.Color; - import jalview.api.ViewStyleI; +import java.awt.Color; + /** * A container for holding alignment view properties. View properties are * data-independent, which means they can be safely copied between views @@ -255,7 +255,8 @@ public class ViewStyle implements ViewStyleI && getWrapAlignment() == vs.getWrapAlignment() && getWrappedWidth() == vs .getWrappedWidth()); /* - * and compare non-primitive types; syntax below will match null with null values + * and compare non-primitive types; syntax below will match null with null + * values */ match = match && String.valueOf(getFontName()).equals( @@ -642,7 +643,6 @@ public class ViewStyle implements ViewStyleI abovePIDThreshold = b; } - /** * DOCUMENT ME! * @@ -667,7 +667,6 @@ public class ViewStyle implements ViewStyleI this.charWidth = w; } - /** * @param value * indicating if subsequent colourscheme changes will be propagated diff --git a/src/jalview/workers/AlignCalcWorker.java b/src/jalview/workers/AlignCalcWorker.java index 566891f..bca3145 100644 --- a/src/jalview/workers/AlignCalcWorker.java +++ b/src/jalview/workers/AlignCalcWorker.java @@ -20,8 +20,6 @@ */ package jalview.workers; -import java.util.List; - import jalview.api.AlignCalcManagerI; import jalview.api.AlignCalcWorkerI; import jalview.api.AlignViewportI; @@ -29,6 +27,8 @@ import jalview.api.AlignmentViewPanel; import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; +import java.util.List; + /** * Base class for alignment calculation workers * diff --git a/src/jalview/workers/ComplementConsensusThread.java b/src/jalview/workers/ComplementConsensusThread.java index 71bfb40..a521314 100644 --- a/src/jalview/workers/ComplementConsensusThread.java +++ b/src/jalview/workers/ComplementConsensusThread.java @@ -1,8 +1,5 @@ package jalview.workers; -import java.util.ConcurrentModificationException; -import java.util.Hashtable; - import jalview.analysis.AAFrequency; import jalview.api.AlignViewportI; import jalview.api.AlignmentViewPanel; @@ -10,6 +7,9 @@ import jalview.datamodel.AlignmentAnnotation; import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceI; +import java.util.ConcurrentModificationException; +import java.util.Hashtable; + /** * A thread to recompute the consensus of the cDNA complement for a linked * protein alignment. diff --git a/src/jalview/workers/ConsensusThread.java b/src/jalview/workers/ConsensusThread.java index f244242..a8698e6 100644 --- a/src/jalview/workers/ConsensusThread.java +++ b/src/jalview/workers/ConsensusThread.java @@ -20,8 +20,6 @@ */ package jalview.workers; -import java.util.Hashtable; - import jalview.analysis.AAFrequency; import jalview.api.AlignCalcWorkerI; import jalview.api.AlignViewportI; @@ -32,6 +30,8 @@ import jalview.datamodel.Annotation; import jalview.datamodel.SequenceI; import jalview.schemes.ColourSchemeI; +import java.util.Hashtable; + public class ConsensusThread extends AlignCalcWorker implements AlignCalcWorkerI { @@ -130,8 +130,7 @@ public class ConsensusThread extends AlignCalcWorker implements Hashtable[] hconsensus = new Hashtable[alignment.getWidth()]; SequenceI[] aseqs = getSequences(); - AAFrequency.calculate(aseqs, 0, alignment.getWidth(), hconsensus, - true); + AAFrequency.calculate(aseqs, 0, alignment.getWidth(), hconsensus, true); alignViewport.setSequenceConsensusHash(hconsensus); setColourSchemeConsensus(hconsensus); diff --git a/src/jalview/ws/AWSThread.java b/src/jalview/ws/AWSThread.java index e557614..fe28d6c 100644 --- a/src/jalview/ws/AWSThread.java +++ b/src/jalview/ws/AWSThread.java @@ -133,8 +133,8 @@ public abstract class AWSThread extends Thread { // Deal with Transaction exceptions wsInfo.appendProgressText(jobs[j].jobnum, MessageManager - .formatMessage("info.server_exception", new Object[] - { WebServiceName, ex.getMessage() })); + .formatMessage("info.server_exception", new Object[] { + WebServiceName, ex.getMessage() })); // always output the exception's stack trace to the log Cache.log.warn(WebServiceName + " job(" + jobs[j].jobnum + ") Server exception."); @@ -199,7 +199,8 @@ public abstract class AWSThread extends Thread Cache.log .debug("WebServiceJob poll loop finished with no jobs created."); wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR); - wsInfo.appendProgressText(MessageManager.getString("info.no_jobs_ran")); + wsInfo.appendProgressText(MessageManager + .getString("info.no_jobs_ran")); wsInfo.setFinishedNoResults(); } } diff --git a/src/jalview/ws/DBRefFetcher.java b/src/jalview/ws/DBRefFetcher.java index d71c653..5f03ec7 100644 --- a/src/jalview/ws/DBRefFetcher.java +++ b/src/jalview/ws/DBRefFetcher.java @@ -283,11 +283,14 @@ public class DBRefFetcher implements Runnable { if (dbSources == null) { - throw new Error(MessageManager.getString("error.implementation_error_must_init_dbsources")); + throw new Error( + MessageManager + .getString("error.implementation_error_must_init_dbsources")); } running = true; long startTime = System.currentTimeMillis(); - af.setProgressBar(MessageManager.getString("status.fetching_db_refs"), startTime); + af.setProgressBar(MessageManager.getString("status.fetching_db_refs"), + startTime); try { if (Cache.getDefault("DBREFFETCH_USEPICR", false)) @@ -393,8 +396,8 @@ public class DBRefFetcher implements Runnable { SequenceI sequence = dataset[seqIndex]; DBRefEntry[] uprefs = jalview.util.DBRefUtils.selectRefs( - sequence.getDBRef(), new String[] - { dbsource.getDbSource() }); // jalview.datamodel.DBRefSource.UNIPROT + sequence.getDBRef(), + new String[] { dbsource.getDbSource() }); // jalview.datamodel.DBRefSource.UNIPROT // }); // check for existing dbrefs to use if (uprefs != null && uprefs.length > 0) @@ -517,8 +520,7 @@ public class DBRefFetcher implements Runnable Vector sequenceMatches = new Vector(); // look for corresponding accession ids DBRefEntry[] entryRefs = jalview.util.DBRefUtils.selectRefs( - entry.getDBRef(), new String[] - { dbSource }); + entry.getDBRef(), new String[] { dbSource }); if (entryRefs == null) { System.err @@ -616,11 +618,10 @@ public class DBRefFetcher implements Runnable // absStart = 0; // create valid mapping between matching region of local sequence and // the mapped sequence - mp = new Mapping(null, new int[] - { sequence.getStart() + absStart, + mp = new Mapping(null, new int[] { + sequence.getStart() + absStart, sequence.getStart() + absStart + entrySeq.length() - 1 }, - new int[] - { entry.getStart(), + new int[] { entry.getStart(), entry.getStart() + entrySeq.length() - 1 }, 1, 1); updateRefFrame = false; // mapping is based on current start/end so // don't modify start and end diff --git a/src/jalview/ws/DasSequenceFeatureFetcher.java b/src/jalview/ws/DasSequenceFeatureFetcher.java index 3db663d..808d9a0 100644 --- a/src/jalview/ws/DasSequenceFeatureFetcher.java +++ b/src/jalview/ws/DasSequenceFeatureFetcher.java @@ -205,8 +205,10 @@ public class DasSequenceFeatureFetcher reply = JOptionPane .showInternalConfirmDialog( Desktop.desktop, - MessageManager.getString("info.you_want_jalview_to_find_uniprot_accessions"), - MessageManager.getString("label.find_uniprot_accession_ids"), + MessageManager + .getString("info.you_want_jalview_to_find_uniprot_accessions"), + MessageManager + .getString("label.find_uniprot_accession_ids"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); } @@ -264,7 +266,9 @@ public class DasSequenceFeatureFetcher startTime = System.currentTimeMillis(); if (af != null) { - af.setProgressBar(MessageManager.getString("status.fetching_das_sequence_features"), startTime); + af.setProgressBar(MessageManager + .getString("status.fetching_das_sequence_features"), + startTime); } if (sourceRegistry == null) { @@ -378,8 +382,7 @@ public class DasSequenceFeatureFetcher source)); for (String id : idl) { - List qid = Arrays.asList(new String[] - { id }); + List qid = Arrays.asList(new String[] { id }); try { DasGFFAdapter dga = featuresc.fetchData(source, qid); @@ -537,7 +540,9 @@ public class DasSequenceFeatureFetcher if (af != null) { - af.setProgressBar(MessageManager.getString("status.no_das_sources_active"), startTime); + af.setProgressBar( + MessageManager.getString("status.no_das_sources_active"), + startTime); } if (getFeatSettings() != null) { @@ -567,7 +572,9 @@ public class DasSequenceFeatureFetcher { if (af != null) { - af.setProgressBar(MessageManager.getString("status.das_feature_fetching_cancelled"), startTime); + af.setProgressBar(MessageManager + .getString("status.das_feature_fetching_cancelled"), + startTime); } cancelled = true; } @@ -582,7 +589,8 @@ public class DasSequenceFeatureFetcher if (!cancelled && af != null) { // only update the progress bar if we've completed the fetch normally - af.setProgressBar(MessageManager.getString("status.das_feature_fetching_complete"), startTime); + af.setProgressBar(MessageManager + .getString("status.das_feature_fetching_complete"), startTime); } if (af != null && af.featureSettings != null) @@ -630,8 +638,7 @@ public class DasSequenceFeatureFetcher return null; } DBRefEntry[] uprefs = jalview.util.DBRefUtils.selectRefs( - seq.getDBRef(), new String[] - { + seq.getDBRef(), new String[] { // jalview.datamodel.DBRefSource.PDB, jalview.datamodel.DBRefSource.UNIPROT, // jalview.datamodel.DBRefSource.EMBL - not tested on any EMBL coord @@ -710,8 +717,7 @@ public class DasSequenceFeatureFetcher } } - return new Object[] - { ids, qstring }; + return new Object[] { ids, qstring }; } /** diff --git a/src/jalview/ws/HttpClientUtils.java b/src/jalview/ws/HttpClientUtils.java index c6d6629..2cc3d8d 100644 --- a/src/jalview/ws/HttpClientUtils.java +++ b/src/jalview/ws/HttpClientUtils.java @@ -67,8 +67,7 @@ public class HttpClientUtils */ public static BufferedReader doHttpUrlPost(String postUrl, List vals, int connectionTimeoutMs, - int readTimeoutMs) throws ClientProtocolException, - IOException + int readTimeoutMs) throws ClientProtocolException, IOException { // todo use HttpClient 4.3 or later and class RequestConfig HttpParams params = new BasicHttpParams(); diff --git a/src/jalview/ws/SequenceFetcher.java b/src/jalview/ws/SequenceFetcher.java index 9c42f0a..6a612a0 100644 --- a/src/jalview/ws/SequenceFetcher.java +++ b/src/jalview/ws/SequenceFetcher.java @@ -20,11 +20,6 @@ */ package jalview.ws; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.List; -import java.util.Vector; - import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentI; import jalview.datamodel.DBRefSource; @@ -33,6 +28,11 @@ import jalview.ws.dbsources.das.api.jalviewSourceI; import jalview.ws.seqfetcher.ASequenceFetcher; import jalview.ws.seqfetcher.DbSourceProxy; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; +import java.util.Vector; + /** * This is the the concrete implementation of the sequence retrieval interface * and abstract class in jalview.ws.seqfetcher. This implements the run-time @@ -167,13 +167,11 @@ public class SequenceFetcher extends ASequenceFetcher { nm = nm.substring(4); } - dassrc.add(new String[] - { srcs[i], nm.toUpperCase() }); + dassrc.add(new String[] { srcs[i], nm.toUpperCase() }); } else { - nondas.add(new String[] - { srcs[i], nm.toUpperCase() }); + nondas.add(new String[] { srcs[i], nm.toUpperCase() }); } } } @@ -331,9 +329,8 @@ public class SequenceFetcher extends ASequenceFetcher } else { - noProds.addElement((dna ? new Object[] - { al, al } : new Object[] - { al })); + noProds.addElement((dna ? new Object[] { al, al } + : new Object[] { al })); } } @@ -369,8 +366,7 @@ public class SequenceFetcher extends ASequenceFetcher } if (ds == null) { - ds = new Alignment(new SequenceI[] - { sq }); + ds = new Alignment(new SequenceI[] { sq }); } else diff --git a/src/jalview/ws/WSClient.java b/src/jalview/ws/WSClient.java index 0761f19..0f5cee8 100755 --- a/src/jalview/ws/WSClient.java +++ b/src/jalview/ws/WSClient.java @@ -20,7 +20,7 @@ */ package jalview.ws; -import jalview.gui.*; +import jalview.gui.WebserviceInfo; public abstract class WSClient // implements WSMenuEntryProviderI { diff --git a/src/jalview/ws/dbsources/EbiFileRetrievedProxy.java b/src/jalview/ws/dbsources/EbiFileRetrievedProxy.java index 40e2193..7ac6936 100644 --- a/src/jalview/ws/dbsources/EbiFileRetrievedProxy.java +++ b/src/jalview/ws/dbsources/EbiFileRetrievedProxy.java @@ -20,12 +20,12 @@ */ package jalview.ws.dbsources; +import jalview.ws.seqfetcher.DbSourceProxyImpl; + import java.io.BufferedReader; import java.io.File; import java.io.FileReader; -import jalview.ws.seqfetcher.DbSourceProxyImpl; - public abstract class EbiFileRetrievedProxy extends DbSourceProxyImpl { diff --git a/src/jalview/ws/dbsources/EmblCdsSouce.java b/src/jalview/ws/dbsources/EmblCdsSouce.java index 3a9ebe9..e5fbd6c 100644 --- a/src/jalview/ws/dbsources/EmblCdsSouce.java +++ b/src/jalview/ws/dbsources/EmblCdsSouce.java @@ -20,12 +20,12 @@ */ package jalview.ws.dbsources; -import com.stevesoft.pat.Regex; - import jalview.datamodel.AlignmentI; import jalview.datamodel.DBRefSource; import jalview.ws.seqfetcher.DbSourceProxy; +import com.stevesoft.pat.Regex; + public class EmblCdsSouce extends EmblXmlSource implements DbSourceProxy { diff --git a/src/jalview/ws/dbsources/EmblSource.java b/src/jalview/ws/dbsources/EmblSource.java index 5b06c81..893ab41 100644 --- a/src/jalview/ws/dbsources/EmblSource.java +++ b/src/jalview/ws/dbsources/EmblSource.java @@ -20,12 +20,12 @@ */ package jalview.ws.dbsources; -import com.stevesoft.pat.Regex; - import jalview.datamodel.AlignmentI; import jalview.datamodel.DBRefSource; import jalview.ws.seqfetcher.DbSourceProxy; +import com.stevesoft.pat.Regex; + /** * @author JimP * diff --git a/src/jalview/ws/dbsources/EmblXmlSource.java b/src/jalview/ws/dbsources/EmblXmlSource.java index 92e863a..20da45c 100644 --- a/src/jalview/ws/dbsources/EmblXmlSource.java +++ b/src/jalview/ws/dbsources/EmblXmlSource.java @@ -20,8 +20,6 @@ */ package jalview.ws.dbsources; -import java.io.File; - import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentI; import jalview.datamodel.SequenceI; @@ -30,6 +28,8 @@ import jalview.datamodel.xdb.embl.EmblFile; import jalview.util.MessageManager; import jalview.ws.ebi.EBIFetchClient; +import java.io.File; + public abstract class EmblXmlSource extends EbiFileRetrievedProxy { @@ -66,7 +66,9 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy } catch (Exception e) { stopQuery(); - throw new Exception(MessageManager.formatMessage("exception.ebiembl_retrieval_failed_on", new String[]{emprefx.toLowerCase(),query.trim()}), e); + throw new Exception(MessageManager.formatMessage( + "exception.ebiembl_retrieval_failed_on", new String[] { + emprefx.toLowerCase(), query.trim() }), e); } return getEmblSequenceRecords(emprefx, query, reply); } @@ -98,7 +100,9 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy } else { - result.append(MessageManager.formatMessage("label.no_embl_record_found", new String[]{emprefx.toLowerCase(),query.trim()})); + result.append(MessageManager.formatMessage( + "label.no_embl_record_found", + new String[] { emprefx.toLowerCase(), query.trim() })); } } if (efile != null) @@ -143,7 +147,8 @@ public abstract class EmblXmlSource extends EbiFileRetrievedProxy if (seqs != null && seqs.length > 0) { al = new Alignment(seqs); - result.append(MessageManager.formatMessage("label.embl_successfully_parsed", new String[]{emprefx})); + result.append(MessageManager.formatMessage( + "label.embl_successfully_parsed", new String[] { emprefx })); results = result; } stopQuery(); diff --git a/src/jalview/ws/dbsources/GeneDbSource.java b/src/jalview/ws/dbsources/GeneDbSource.java index e791842..116962b 100644 --- a/src/jalview/ws/dbsources/GeneDbSource.java +++ b/src/jalview/ws/dbsources/GeneDbSource.java @@ -20,12 +20,12 @@ */ package jalview.ws.dbsources; -import com.stevesoft.pat.Regex; - import jalview.datamodel.AlignmentI; import jalview.datamodel.DBRefSource; import jalview.ws.seqfetcher.DbSourceProxy; +import com.stevesoft.pat.Regex; + /** * Test class for accessing GeneDB - not yet finished. * diff --git a/src/jalview/ws/dbsources/PDBRestClient.java b/src/jalview/ws/dbsources/PDBRestClient.java index 04c00ec..320b1c5 100644 --- a/src/jalview/ws/dbsources/PDBRestClient.java +++ b/src/jalview/ws/dbsources/PDBRestClient.java @@ -23,7 +23,6 @@ import com.sun.jersey.api.client.WebResource; import com.sun.jersey.api.client.config.ClientConfig; import com.sun.jersey.api.client.config.DefaultClientConfig; - /** * A rest client for querying the Search endpoing of the PDB REST API * diff --git a/src/jalview/ws/dbsources/Pdb.java b/src/jalview/ws/dbsources/Pdb.java index 836e211..4a50196 100644 --- a/src/jalview/ws/dbsources/Pdb.java +++ b/src/jalview/ws/dbsources/Pdb.java @@ -189,9 +189,9 @@ public class Pdb extends EbiFileRetrievedProxy implements DbSourceProxy for (SequenceI pdbcs : toremove) { pdbfile.deleteSequence(pdbcs); - if (pdbcs.getAnnotation()!=null) + if (pdbcs.getAnnotation() != null) { - for (AlignmentAnnotation aa: pdbcs.getAnnotation()) + for (AlignmentAnnotation aa : pdbcs.getAnnotation()) { pdbfile.deleteAnnotation(aa); } @@ -201,7 +201,9 @@ public class Pdb extends EbiFileRetrievedProxy implements DbSourceProxy if (pdbfile == null || pdbfile.getHeight() < 1) { - throw new Exception(MessageManager.formatMessage("exception.no_pdb_records_for_chain", new String[]{id, ((chain == null) ? "' '" : chain)})); + throw new Exception(MessageManager.formatMessage( + "exception.no_pdb_records_for_chain", new String[] { id, + ((chain == null) ? "' '" : chain) })); } } catch (Exception ex) // Problem parsing PDB file diff --git a/src/jalview/ws/dbsources/Pfam.java b/src/jalview/ws/dbsources/Pfam.java index c8f7ee7..0211bb1 100644 --- a/src/jalview/ws/dbsources/Pfam.java +++ b/src/jalview/ws/dbsources/Pfam.java @@ -20,12 +20,12 @@ */ package jalview.ws.dbsources; -import com.stevesoft.pat.Regex; - import jalview.datamodel.AlignmentI; import jalview.datamodel.DBRefEntry; import jalview.ws.seqfetcher.DbSourceProxy; +import com.stevesoft.pat.Regex; + /** * TODO: later PFAM is a complex datasource - it could return a tree in addition * to an alignment TODO: create interface to pass alignment properties and tree diff --git a/src/jalview/ws/dbsources/Rfam.java b/src/jalview/ws/dbsources/Rfam.java index 62f2b28..b07b8ea 100644 --- a/src/jalview/ws/dbsources/Rfam.java +++ b/src/jalview/ws/dbsources/Rfam.java @@ -20,10 +20,10 @@ */ package jalview.ws.dbsources; -import com.stevesoft.pat.Regex; - import jalview.ws.seqfetcher.DbSourceProxy; +import com.stevesoft.pat.Regex; + /** * Contains methods for fetching sequences from Rfam database * diff --git a/src/jalview/ws/dbsources/Uniprot.java b/src/jalview/ws/dbsources/Uniprot.java index 4c8f3ce..1e8eadb 100644 --- a/src/jalview/ws/dbsources/Uniprot.java +++ b/src/jalview/ws/dbsources/Uniprot.java @@ -225,8 +225,7 @@ public class Uniprot extends DbSourceProxyImpl implements DbSourceProxy name.append(n); } - if (entry.getProtein() != null - && entry.getProtein().getName() != null) + if (entry.getProtein() != null && entry.getProtein().getName() != null) { for (String nm : entry.getProtein().getName()) { diff --git a/src/jalview/ws/dbsources/das/api/jalviewSourceI.java b/src/jalview/ws/dbsources/das/api/jalviewSourceI.java index 359840a..bc3c8ea 100644 --- a/src/jalview/ws/dbsources/das/api/jalviewSourceI.java +++ b/src/jalview/ws/dbsources/das/api/jalviewSourceI.java @@ -20,10 +20,10 @@ */ package jalview.ws.dbsources.das.api; -import java.util.List; - import jalview.ws.seqfetcher.DbSourceProxy; +import java.util.List; + import org.biodas.jdas.schema.sources.MAINTAINER; import org.biodas.jdas.schema.sources.VERSION; diff --git a/src/jalview/ws/dbsources/das/datamodel/DasSequenceSource.java b/src/jalview/ws/dbsources/das/datamodel/DasSequenceSource.java index dd3d901..32e4f3e 100644 --- a/src/jalview/ws/dbsources/das/datamodel/DasSequenceSource.java +++ b/src/jalview/ws/dbsources/das/datamodel/DasSequenceSource.java @@ -20,6 +20,17 @@ */ package jalview.ws.dbsources.das.datamodel; +import jalview.bin.Cache; +import jalview.datamodel.Alignment; +import jalview.datamodel.AlignmentI; +import jalview.datamodel.DBRefEntry; +import jalview.datamodel.Sequence; +import jalview.datamodel.SequenceI; +import jalview.util.MessageManager; +import jalview.ws.dbsources.das.api.jalviewSourceI; +import jalview.ws.seqfetcher.DbSourceProxy; +import jalview.ws.seqfetcher.DbSourceProxyImpl; + import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -39,16 +50,6 @@ import org.biodas.jdas.schema.sources.VERSION; import com.stevesoft.pat.Regex; -import jalview.util.MessageManager; -import jalview.ws.dbsources.das.api.jalviewSourceI; -import jalview.ws.seqfetcher.*; -import jalview.bin.Cache; -import jalview.datamodel.Alignment; -import jalview.datamodel.AlignmentI; -import jalview.datamodel.DBRefEntry; -import jalview.datamodel.Sequence; -import jalview.datamodel.SequenceI; - /** * an instance of this class is created for each unique DAS Sequence source (ie * one capable of handling the 'sequence' for a particular MapMaster) @@ -101,7 +102,9 @@ public class DasSequenceSource extends DbSourceProxyImpl implements if (!(jsrc = new JalviewSource(source, connprops, false)) .isSequenceSource()) { - throw new Exception(MessageManager.formatMessage("exception.das_source_doesnt_support_sequence_command", new String[]{source.getTitle()})); + throw new Exception(MessageManager.formatMessage( + "exception.das_source_doesnt_support_sequence_command", + new String[] { source.getTitle() })); } this.tier = 1 + ((jsrc.isLocal() || jsrc.isReferenceSource()) ? 0 : 1); this.source = source; @@ -172,8 +175,7 @@ public class DasSequenceSource extends DbSourceProxyImpl implements connprops.getConnectionPropertyProviderFor(sr)); for (String q : toks) { - List qset = Arrays.asList(new String[] - { q }); + List qset = Arrays.asList(new String[] { q }); try { DasSequenceAdapter s = sq.fetchData(sr, qset); diff --git a/src/jalview/ws/dbsources/das/datamodel/JalviewSource.java b/src/jalview/ws/dbsources/das/datamodel/JalviewSource.java index b3bb342..9cc4239 100644 --- a/src/jalview/ws/dbsources/das/datamodel/JalviewSource.java +++ b/src/jalview/ws/dbsources/das/datamodel/JalviewSource.java @@ -20,6 +20,10 @@ */ package jalview.ws.dbsources.das.datamodel; +import jalview.util.MessageManager; +import jalview.ws.dbsources.das.api.jalviewSourceI; +import jalview.ws.seqfetcher.DbSourceProxy; + import java.text.ParseException; import java.util.ArrayList; import java.util.Date; @@ -37,10 +41,6 @@ import org.biodas.jdas.schema.sources.PROP; import org.biodas.jdas.schema.sources.SOURCE; import org.biodas.jdas.schema.sources.VERSION; -import jalview.util.MessageManager; -import jalview.ws.dbsources.das.api.jalviewSourceI; -import jalview.ws.seqfetcher.DbSourceProxy; - public class JalviewSource implements jalviewSourceI { SOURCE source; @@ -347,7 +347,9 @@ public class JalviewSource implements jalviewSourceI int p = cap.getQueryUri().lastIndexOf(capname); if (p < -1) { - throw new Exception(MessageManager.formatMessage("exception.invalid_das_source", new String[]{source.getUri()})); + throw new Exception(MessageManager.formatMessage( + "exception.invalid_das_source", + new String[] { source.getUri() })); } if (cap.getQueryUri().charAt(p) == '/') { diff --git a/src/jalview/ws/ebi/EBIFetchClient.java b/src/jalview/ws/ebi/EBIFetchClient.java index a785899..c33871d 100644 --- a/src/jalview/ws/ebi/EBIFetchClient.java +++ b/src/jalview/ws/ebi/EBIFetchClient.java @@ -20,6 +20,8 @@ */ package jalview.ws.ebi; +import jalview.util.MessageManager; + import java.io.BufferedInputStream; import java.io.BufferedReader; import java.io.File; @@ -31,8 +33,6 @@ import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; -import jalview.util.MessageManager; - /** * DOCUMENT ME! * diff --git a/src/jalview/ws/io/mime/MimeTypes.java b/src/jalview/ws/io/mime/MimeTypes.java index fb13cf1..83252d8 100644 --- a/src/jalview/ws/io/mime/MimeTypes.java +++ b/src/jalview/ws/io/mime/MimeTypes.java @@ -34,8 +34,8 @@ public class MimeTypes * pair list {String,JvDataType} giving a mime-type followed by its associated * JvDataType enumeration. */ - final public static Object[] typemap = new Object[] - { "application/x-align", JvDataType.ALIGNMENT, + final public static Object[] typemap = new Object[] { + "application/x-align", JvDataType.ALIGNMENT, "application/x-jalview-annotation", JvDataType.ANNOTATION, "application/x-newick", JvDataType.TREE, "application/x-new-hampshire", JvDataType.TREE, diff --git a/src/jalview/ws/jws1/Annotate3D.java b/src/jalview/ws/jws1/Annotate3D.java index 3e9c73a..8c30c69 100644 --- a/src/jalview/ws/jws1/Annotate3D.java +++ b/src/jalview/ws/jws1/Annotate3D.java @@ -20,7 +20,6 @@ */ package jalview.ws.jws1; -import jalview.datamodel.Alignment; import jalview.datamodel.AlignmentI; import jalview.io.FileParse; import jalview.io.FormatAdapter; @@ -106,7 +105,9 @@ public class Annotate3D } else { - throw new IOException(MessageManager.getString("exception.unexpected_handling_rnaml_translation_for_pdb"), + throw new IOException( + MessageManager + .getString("exception.unexpected_handling_rnaml_translation_for_pdb"), x); } } diff --git a/src/jalview/ws/jws1/Discoverer.java b/src/jalview/ws/jws1/Discoverer.java index d544bea..4643119 100644 --- a/src/jalview/ws/jws1/Discoverer.java +++ b/src/jalview/ws/jws1/Discoverer.java @@ -193,28 +193,30 @@ public class Discoverer implements Runnable jalview.bin.Cache.log.debug("Setting default services"); services = new Hashtable(); // Muscle, Clustal and JPred. - ServiceHandle[] defServices = - { + ServiceHandle[] defServices = { new ServiceHandle( "MsaWS", "Edgar, Robert C. (2004), MUSCLE: multiple sequence alignment " + "with high accuracy and high throughput, Nucleic Acids Research 32(5), 1792-97.", "http://www.compbio.dundee.ac.uk/JalviewWS/services/MuscleWS", - MessageManager.getString("label.muscle_multiple_protein_sequence_alignment")), + MessageManager + .getString("label.muscle_multiple_protein_sequence_alignment")), new ServiceHandle( "MsaWS", "Katoh, K., K. Kuma, K., Toh, H., and Miyata, T. (2005) " + "\"MAFFT version 5: improvement in accuracy of multiple sequence alignment.\"" + " Nucleic Acids Research, 33 511-518", "http://www.compbio.dundee.ac.uk/JalviewWS/services/MafftWS", - MessageManager.getString("label.mafft_multiple_sequence_alignment")), + MessageManager + .getString("label.mafft_multiple_sequence_alignment")), new ServiceHandle( "MsaWS", "Thompson, J.D., Higgins, D.G. and Gibson, T.J. (1994) CLUSTAL W: improving the sensitivity of progressive multiple" + " sequence alignment through sequence weighting, position specific gap penalties and weight matrix choice." + " Nucleic Acids Research, 22 4673-4680", "http://www.compbio.dundee.ac.uk/JalviewWS/services/ClustalWS", - MessageManager.getString("label.clustalw_multiple_sequence_alignment")), + MessageManager + .getString("label.clustalw_multiple_sequence_alignment")), new ServiceHandle( "SecStrPred", "Drozdetskiy A, Cole C, Procter J & Barton GJ. (2015)\nJPred4: a protein secondary structure prediction server" @@ -253,12 +255,11 @@ public class Discoverer implements Runnable { if (jalview.gui.Desktop.desktop != null) { - JOptionPane - .showMessageDialog( - jalview.gui.Desktop.desktop, - MessageManager.getString("label.set_proxy_settings"), - MessageManager.getString("label.proxy_authorization_failed"), - JOptionPane.WARNING_MESSAGE); + JOptionPane.showMessageDialog(jalview.gui.Desktop.desktop, + MessageManager.getString("label.set_proxy_settings"), + MessageManager + .getString("label.proxy_authorization_failed"), + JOptionPane.WARNING_MESSAGE); } } else diff --git a/src/jalview/ws/jws1/JPredClient.java b/src/jalview/ws/jws1/JPredClient.java index 2e000f8..f13672b 100644 --- a/src/jalview/ws/jws1/JPredClient.java +++ b/src/jalview/ws/jws1/JPredClient.java @@ -154,7 +154,9 @@ public class JPredClient extends WS1Client { if (!msa && msf.length > 1) { - throw new Error(MessageManager.getString("error.implementation_error_multiple_single_sequence_prediction_jobs_not_supported")); + throw new Error( + MessageManager + .getString("error.implementation_error_multiple_single_sequence_prediction_jobs_not_supported")); } String altitle = getPredictionName(WebServiceName) + " for " @@ -294,7 +296,8 @@ public class JPredClient extends WS1Client private WebserviceInfo setWebService() { WebServiceName = "JNetWS"; - WebServiceJobTitle = MessageManager.getString("label.jnet_secondary_structure_prediction"); + WebServiceJobTitle = MessageManager + .getString("label.jnet_secondary_structure_prediction"); WebServiceReference = "\"Cuff J. A and Barton G.J (2000) Application of " + "multiple sequence alignment profiles to improve protein secondary structure prediction, " + "Proteins 40:502-511\"."; @@ -320,13 +323,21 @@ public class JPredClient extends WS1Client } catch (Exception ex) { - JOptionPane.showMessageDialog(Desktop.desktop, - MessageManager.formatMessage("label.secondary_structure_prediction_service_couldnt_be_located", new String[]{WebServiceName,WsURL}), - MessageManager.getString("label.internal_jalview_error"), - JOptionPane.WARNING_MESSAGE); - wsInfo.setProgressText(MessageManager.formatMessage("label.secondary_structure_prediction_service_couldnt_be_located", new String[]{WebServiceName,WsURL}) - + "\n" - + ex.getMessage()); + JOptionPane + .showMessageDialog( + Desktop.desktop, + MessageManager + .formatMessage( + "label.secondary_structure_prediction_service_couldnt_be_located", + new String[] { WebServiceName, WsURL }), + MessageManager + .getString("label.internal_jalview_error"), + JOptionPane.WARNING_MESSAGE); + wsInfo.setProgressText(MessageManager + .formatMessage( + "label.secondary_structure_prediction_service_couldnt_be_located", + new String[] { WebServiceName, WsURL }) + + "\n" + ex.getMessage()); wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR); } diff --git a/src/jalview/ws/jws1/JPredThread.java b/src/jalview/ws/jws1/JPredThread.java index a8a49d0..8c7768d 100644 --- a/src/jalview/ws/jws1/JPredThread.java +++ b/src/jalview/ws/jws1/JPredThread.java @@ -147,10 +147,11 @@ class JPredThread extends JWS1Thread implements WSClientI { sqs[i] = al.getSequenceAt(i); } - if (!jalview.analysis.SeqsetUtils.deuniquify( - SequenceInfo, sqs)) + if (!jalview.analysis.SeqsetUtils.deuniquify(SequenceInfo, sqs)) { - throw (new Exception(MessageManager.getString("exception.couldnt_recover_sequence_properties_for_alignment"))); + throw (new Exception( + MessageManager + .getString("exception.couldnt_recover_sequence_properties_for_alignment"))); } } FirstSeq = 0; @@ -169,7 +170,9 @@ class JPredThread extends JWS1Thread implements WSClientI } else { - throw (new Exception(MessageManager.formatMessage("exception.unknown_format_for_file", new String[]{format,result.getAligfile()}))); + throw (new Exception(MessageManager.formatMessage( + "exception.unknown_format_for_file", new String[] { + format, result.getAligfile() }))); } } else @@ -183,15 +186,17 @@ class JPredThread extends JWS1Thread implements WSClientI .getAlignmentAndColumnSelection(gc)[0]; if (this.msaIndex >= sqs.length) { - throw new Error(MessageManager.getString("error.implementation_error_invalid_msa_index_for_job")); + throw new Error( + MessageManager + .getString("error.implementation_error_invalid_msa_index_for_job")); } // /// // Uses RemoveGapsCommand // /// - new jalview.commands.RemoveGapsCommand(MessageManager.getString("label.remove_gaps"), - new SequenceI[] - { sqs[msaIndex] }, currentView); + new jalview.commands.RemoveGapsCommand( + MessageManager.getString("label.remove_gaps"), + new SequenceI[] { sqs[msaIndex] }, currentView); SequenceI profileseq = al.getSequenceAt(FirstSeq); profileseq.setSequence(sqs[msaIndex].getSequenceAsString()); @@ -200,7 +205,9 @@ class JPredThread extends JWS1Thread implements WSClientI if (!jalview.analysis.SeqsetUtils.SeqCharacterUnhash( al.getSequenceAt(FirstSeq), SequenceInfo)) { - throw (new Exception(MessageManager.getString("exception.couldnt_recover_sequence_props_for_jnet_query"))); + throw (new Exception( + MessageManager + .getString("exception.couldnt_recover_sequence_props_for_jnet_query"))); } else { @@ -236,8 +243,7 @@ class JPredThread extends JWS1Thread implements WSClientI alant.sequenceRef); } } - return new Object[] - { al, alcsel }; // , FirstSeq, noMsa}; + return new Object[] { al, alcsel }; // , FirstSeq, noMsa}; } /** @@ -386,8 +392,7 @@ class JPredThread extends JWS1Thread implements WSClientI if (job.hasValidInput()) { OutputHeader = wsInfo.getProgressText(); - jobs = new WSJob[] - { job }; + jobs = new WSJob[] { job }; job.setJobnum(0); } else @@ -405,8 +410,7 @@ class JPredThread extends JWS1Thread implements WSClientI JPredJob job = new JPredJob(SequenceInfo, msf, delMap); if (job.hasValidInput()) { - jobs = new WSJob[] - { job }; + jobs = new WSJob[] { job }; OutputHeader = wsInfo.getProgressText(); job.setJobnum(0); } @@ -420,7 +424,9 @@ class JPredThread extends JWS1Thread implements WSClientI { if (!(j instanceof JPredJob)) { - throw new Error(MessageManager.formatMessage("error.implementation_error_startjob_called", new String[]{j.getClass().toString()})); + throw new Error(MessageManager.formatMessage( + "error.implementation_error_startjob_called", + new String[] { j.getClass().toString() })); } try { @@ -441,7 +447,9 @@ class JPredThread extends JWS1Thread implements WSClientI { job.result = new JpredResult(); job.result.setInvalid(true); - job.result.setStatus(MessageManager.formatMessage("label.submission_params", new String[]{job.getJobId().toString()})); + job.result.setStatus(MessageManager.formatMessage( + "label.submission_params", new String[] { job.getJobId() + .toString() })); throw new Exception(job.getJobId()); } else @@ -453,7 +461,9 @@ class JPredThread extends JWS1Thread implements WSClientI } else { - throw new Exception(MessageManager.getString("exception.server_timeout_try_later")); + throw new Exception( + MessageManager + .getString("exception.server_timeout_try_later")); } } catch (Exception e) { @@ -477,7 +487,11 @@ class JPredThread extends JWS1Thread implements WSClientI { wsInfo.setStatus(j.getJobnum(), WebserviceInfo.STATE_STOPPED_ERROR); // JBPNote - this could be a popup informing the user of the problem. - wsInfo.appendProgressText(j.getJobnum(), MessageManager.formatMessage("info.failed_to_submit_prediction", new String[]{e.getMessage(),wsInfo.getProgressText()})); + wsInfo.appendProgressText(j.getJobnum(), MessageManager + .formatMessage( + "info.failed_to_submit_prediction", + new String[] { e.getMessage(), + wsInfo.getProgressText() })); jalview.bin.Cache.log.debug( "Failed Submission of job " + j.getJobnum(), e); @@ -567,7 +581,9 @@ class JPredThread extends JWS1Thread implements WSClientI else { // do merge with other job results - throw new Error(MessageManager.getString("error.multiple_jnet_subjob_merge_not_implemented")); + throw new Error( + MessageManager + .getString("error.multiple_jnet_subjob_merge_not_implemented")); } } catch (Exception e) { @@ -575,7 +591,10 @@ class JPredThread extends JWS1Thread implements WSClientI "JNet Client: JPred Annotation Parse Error", e); wsInfo.setStatus(j.getJobnum(), WebserviceInfo.STATE_STOPPED_ERROR); - wsInfo.appendProgressText(j.getJobnum(), MessageManager.formatMessage("info.invalid_jnet_job_result_data", new String[]{OutputHeader.toString(),j.result.getStatus(), e.getMessage() })); + wsInfo.appendProgressText(j.getJobnum(), MessageManager + .formatMessage("info.invalid_jnet_job_result_data", + new String[] { OutputHeader.toString(), + j.result.getStatus(), e.getMessage() })); j.result.setBroken(true); } } diff --git a/src/jalview/ws/jws1/JWS1Thread.java b/src/jalview/ws/jws1/JWS1Thread.java index b2d6868..7ff4e5b 100644 --- a/src/jalview/ws/jws1/JWS1Thread.java +++ b/src/jalview/ws/jws1/JWS1Thread.java @@ -20,8 +20,9 @@ */ package jalview.ws.jws1; -import jalview.datamodel.*; -import jalview.gui.*; +import jalview.datamodel.AlignmentView; +import jalview.gui.AlignFrame; +import jalview.gui.WebserviceInfo; import jalview.ws.AWSThread; /** diff --git a/src/jalview/ws/jws1/MsaWSClient.java b/src/jalview/ws/jws1/MsaWSClient.java index ef2d78d..95f5527 100644 --- a/src/jalview/ws/jws1/MsaWSClient.java +++ b/src/jalview/ws/jws1/MsaWSClient.java @@ -20,15 +20,24 @@ */ package jalview.ws.jws1; +import jalview.datamodel.Alignment; +import jalview.datamodel.AlignmentView; +import jalview.gui.AlignFrame; +import jalview.gui.Desktop; +import jalview.gui.WebserviceInfo; +import jalview.util.MessageManager; + import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import javax.swing.*; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; -import ext.vamsas.*; -import jalview.datamodel.*; -import jalview.gui.*; -import jalview.util.MessageManager; +import ext.vamsas.MuscleWS; +import ext.vamsas.MuscleWSServiceLocator; +import ext.vamsas.MuscleWSSoapBindingStub; +import ext.vamsas.ServiceHandle; /** * DOCUMENT ME! @@ -70,21 +79,22 @@ public class MsaWSClient extends WS1Client alignFrame = _alignFrame; if (!sh.getAbstractName().equals("MsaWS")) { - JOptionPane - .showMessageDialog( - Desktop.desktop, - MessageManager.formatMessage("label.service_called_is_not_msa_service", new String[]{sh.getName()}), - MessageManager.getString("label.internal_jalview_error"), JOptionPane.WARNING_MESSAGE); + JOptionPane.showMessageDialog(Desktop.desktop, MessageManager + .formatMessage("label.service_called_is_not_msa_service", + new String[] { sh.getName() }), MessageManager + .getString("label.internal_jalview_error"), + JOptionPane.WARNING_MESSAGE); return; } if ((wsInfo = setWebService(sh)) == null) { - JOptionPane.showMessageDialog( - Desktop.desktop, - MessageManager.formatMessage("label.msa_service_is_unknown", new String[]{sh.getName()}), - MessageManager.getString("label.internal_jalview_error"), JOptionPane.WARNING_MESSAGE); + JOptionPane.showMessageDialog(Desktop.desktop, MessageManager + .formatMessage("label.msa_service_is_unknown", + new String[] { sh.getName() }), MessageManager + .getString("label.internal_jalview_error"), + JOptionPane.WARNING_MESSAGE); return; } diff --git a/src/jalview/ws/jws1/MsaWSThread.java b/src/jalview/ws/jws1/MsaWSThread.java index af3db9c..be21de7 100644 --- a/src/jalview/ws/jws1/MsaWSThread.java +++ b/src/jalview/ws/jws1/MsaWSThread.java @@ -20,16 +20,24 @@ */ package jalview.ws.jws1; -import java.util.*; - -import jalview.analysis.*; -import jalview.bin.*; -import jalview.datamodel.*; -import jalview.gui.*; +import jalview.analysis.AlignSeq; +import jalview.bin.Cache; +import jalview.datamodel.Alignment; +import jalview.datamodel.AlignmentOrder; +import jalview.datamodel.AlignmentView; +import jalview.datamodel.ColumnSelection; +import jalview.datamodel.SequenceI; +import jalview.gui.AlignFrame; +import jalview.gui.Desktop; +import jalview.gui.WebserviceInfo; import jalview.util.MessageManager; import jalview.ws.AWsJob; import jalview.ws.JobStateSummary; import jalview.ws.WSClientI; + +import java.util.Hashtable; +import java.util.Vector; + import vamsas.objects.simple.MsaResult; class MsaWSThread extends JWS1Thread implements WSClientI @@ -87,7 +95,9 @@ class MsaWSThread extends JWS1Thread implements WSClientI int nseqs = 0; if (minlen < 0) { - throw new Error(MessageManager.getString("error.implementation_error_minlen_must_be_greater_zero")); + throw new Error( + MessageManager + .getString("error.implementation_error_minlen_must_be_greater_zero")); } for (int i = 0; i < seqs.length; i++) { @@ -125,8 +135,7 @@ class MsaWSThread extends JWS1Thread implements WSClientI .extractGaps(jalview.util.Comparison.GapChars, seqs[i].getSequenceAsString()); } - emptySeqs.add(new String[] - { newname, empty }); + emptySeqs.add(new String[] { newname, empty }); } } this.seqs = new vamsas.objects.simple.SequenceSet(); @@ -245,8 +254,7 @@ class MsaWSThread extends JWS1Thread implements WSClientI jalview.analysis.AlignmentSorter.recoverOrder(alseqs); // account for any missing sequences jalview.analysis.SeqsetUtils.deuniquify(SeqNames, alseqs); - return new Object[] - { alseqs, msaorder }; + return new Object[] { alseqs, msaorder }; } return null; } @@ -431,7 +439,9 @@ class MsaWSThread extends JWS1Thread implements WSClientI { if (!(job instanceof MsaWSJob)) { - throw new Error(MessageManager.formatMessage("error.implementation_error_msawbjob_called", new String[]{job.getClass().toString()})); + throw new Error(MessageManager.formatMessage( + "error.implementation_error_msawbjob_called", + new String[] { job.getClass().toString() })); } MsaWSJob j = (MsaWSJob) job; if (j.isSubmitted()) @@ -449,7 +459,8 @@ class MsaWSThread extends JWS1Thread implements WSClientI j.setSubmitted(true); j.result = new MsaResult(); j.result.setFinished(true); - j.result.setStatus(MessageManager.getString("label.empty_alignment_job")); + j.result.setStatus(MessageManager + .getString("label.empty_alignment_job")); ((MsaResult) j.result).setMsa(null); } try @@ -467,7 +478,9 @@ class MsaWSThread extends JWS1Thread implements WSClientI { if (jobsubmit == null) { - throw new Exception(MessageManager.formatMessage("exception.web_service_returned_null_try_later", new String[]{WsUrl})); + throw new Exception(MessageManager.formatMessage( + "exception.web_service_returned_null_try_later", + new String[] { WsUrl })); } throw new Exception(jobsubmit.getJobId()); @@ -485,9 +498,8 @@ class MsaWSThread extends JWS1Thread implements WSClientI wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR); wsInfo.setStatus(j.getJobnum(), WebserviceInfo.STATE_STOPPED_SERVERERROR); - wsInfo.appendProgressText( - j.getJobnum(), - MessageManager.getString("info.failed_to_submit_sequences_for_alignment")); + wsInfo.appendProgressText(j.getJobnum(), MessageManager + .getString("info.failed_to_submit_sequences_for_alignment")); // e.printStackTrace(); // TODO: JBPNote DEBUG } @@ -532,8 +544,8 @@ class MsaWSThread extends JWS1Thread implements WSClientI .getMsa(); if (valign != null) { - wsInfo.appendProgressText(jobs[j].getJobnum(), - MessageManager.getString("info.alignment_object_method_notes")); + wsInfo.appendProgressText(jobs[j].getJobnum(), MessageManager + .getString("info.alignment_object_method_notes")); String[] lines = valign.getMethod(); for (int line = 0; line < lines.length; line++) { diff --git a/src/jalview/ws/jws1/SeqSearchWSClient.java b/src/jalview/ws/jws1/SeqSearchWSClient.java index b688978..d731ced 100644 --- a/src/jalview/ws/jws1/SeqSearchWSClient.java +++ b/src/jalview/ws/jws1/SeqSearchWSClient.java @@ -20,6 +20,13 @@ */ package jalview.ws.jws1; +import jalview.datamodel.Alignment; +import jalview.datamodel.AlignmentView; +import jalview.gui.AlignFrame; +import jalview.gui.Desktop; +import jalview.gui.WebserviceInfo; +import jalview.util.MessageManager; + import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -28,12 +35,14 @@ import java.util.Hashtable; import java.util.StringTokenizer; import java.util.Vector; -import javax.swing.*; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; -import ext.vamsas.*; -import jalview.datamodel.*; -import jalview.gui.*; -import jalview.util.MessageManager; +import ext.vamsas.SeqSearchI; +import ext.vamsas.SeqSearchServiceLocator; +import ext.vamsas.SeqSearchServiceSoapBindingStub; +import ext.vamsas.ServiceHandle; /** * DOCUMENT ME! @@ -76,18 +85,22 @@ public class SeqSearchWSClient extends WS1Client // name to service client name if (!sh.getAbstractName().equals(this.getServiceActionKey())) { - JOptionPane.showMessageDialog(Desktop.desktop, - MessageManager.formatMessage("label.service_called_is_not_seq_search_service", new String[]{sh.getName()}), - MessageManager.getString("label.internal_jalview_error"), JOptionPane.WARNING_MESSAGE); + JOptionPane.showMessageDialog(Desktop.desktop, MessageManager + .formatMessage( + "label.service_called_is_not_seq_search_service", + new String[] { sh.getName() }), MessageManager + .getString("label.internal_jalview_error"), + JOptionPane.WARNING_MESSAGE); return; } if ((wsInfo = setWebService(sh)) == null) { - JOptionPane.showMessageDialog(Desktop.desktop, - MessageManager.formatMessage("label.seq_search_service_is_unknown", new String[]{sh.getName()}), - MessageManager.getString("label.internal_jalview_error"), + JOptionPane.showMessageDialog(Desktop.desktop, MessageManager + .formatMessage("label.seq_search_service_is_unknown", + new String[] { sh.getName() }), MessageManager + .getString("label.internal_jalview_error"), JOptionPane.WARNING_MESSAGE); return; @@ -208,13 +221,14 @@ public class SeqSearchWSClient extends WS1Client } if (!locateWebService()) { - throw new Exception(MessageManager.formatMessage("exception.cannot_contact_service_endpoint_at", new String[]{WsURL})); + throw new Exception(MessageManager.formatMessage( + "exception.cannot_contact_service_endpoint_at", + new String[] { WsURL })); } String database = server.getDatabase(); if (database == null) { - dbParamsForEndpoint.put(WsURL, new String[] - {}); + dbParamsForEndpoint.put(WsURL, new String[] {}); return null; } StringTokenizer en = new StringTokenizer(database.trim(), ",| "); diff --git a/src/jalview/ws/jws1/SeqSearchWSThread.java b/src/jalview/ws/jws1/SeqSearchWSThread.java index 5d44ddd..a6e3731 100644 --- a/src/jalview/ws/jws1/SeqSearchWSThread.java +++ b/src/jalview/ws/jws1/SeqSearchWSThread.java @@ -20,17 +20,23 @@ */ package jalview.ws.jws1; -import java.util.*; - -import jalview.analysis.*; -import jalview.bin.*; -import jalview.datamodel.*; -import jalview.gui.*; +import jalview.analysis.AlignSeq; +import jalview.bin.Cache; +import jalview.datamodel.Alignment; +import jalview.datamodel.AlignmentView; +import jalview.datamodel.SequenceI; +import jalview.gui.AlignFrame; +import jalview.gui.Desktop; +import jalview.gui.WebserviceInfo; import jalview.io.NewickFile; import jalview.util.MessageManager; import jalview.ws.AWsJob; import jalview.ws.JobStateSummary; import jalview.ws.WSClientI; + +import java.util.Hashtable; +import java.util.Vector; + import vamsas.objects.simple.MsaResult; import vamsas.objects.simple.SeqSearchResult; @@ -85,7 +91,9 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI int nseqs = 0; if (minlen < 0) { - throw new Error(MessageManager.getString("error.implementation_error_minlen_must_be_greater_zero")); + throw new Error( + MessageManager + .getString("error.implementation_error_minlen_must_be_greater_zero")); } for (int i = 0; i < seqs.length; i++) { @@ -126,8 +134,7 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI .extractGaps(jalview.util.Comparison.GapChars, seqs[i].getSequenceAsString()); } - emptySeqs.add(new String[] - { newname, empty }); + emptySeqs.add(new String[] { newname, empty }); } } if (submitGaps) @@ -259,8 +266,7 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI * trigger a 'fetchDBids' to annotate sequences with database ids... */ - return new Object[] - { al, nf }; + return new Object[] { al, nf }; } return null; } @@ -446,7 +452,9 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI { if (!(job instanceof SeqSearchWSJob)) { - throw new Error(MessageManager.formatMessage("error.implementation_error_msawbjob_called", new String[]{job.getClass().toString()})); + throw new Error(MessageManager.formatMessage( + "error.implementation_error_msawbjob_called", + new String[] { job.getClass().toString() })); } SeqSearchWSJob j = (SeqSearchWSJob) job; if (j.isSubmitted()) @@ -464,7 +472,8 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI j.setSubmitted(true); j.result = new MsaResult(); j.result.setFinished(true); - j.result.setStatus(MessageManager.getString("label.empty_alignment_job")); + j.result.setStatus(MessageManager + .getString("label.empty_alignment_job")); ((MsaResult) j.result).setMsa(null); } try @@ -483,7 +492,9 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI { if (jobsubmit == null) { - throw new Exception(MessageManager.formatMessage("exception.web_service_returned_null_try_later", new String[]{WsUrl})); + throw new Exception(MessageManager.formatMessage( + "exception.web_service_returned_null_try_later", + new String[] { WsUrl })); } throw new Exception(jobsubmit.getJobId()); @@ -501,9 +512,8 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR); wsInfo.setStatus(j.getJobnum(), WebserviceInfo.STATE_STOPPED_SERVERERROR); - wsInfo.appendProgressText( - j.getJobnum(), - MessageManager.getString("info.failed_to_submit_sequences_for_alignment")); + wsInfo.appendProgressText(j.getJobnum(), MessageManager + .getString("info.failed_to_submit_sequences_for_alignment")); // e.printStackTrace(); // TODO: JBPNote DEBUG } @@ -541,8 +551,8 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI .getAlignment(); if (valign != null) { - wsInfo.appendProgressText(jobs[j].getJobnum(), - MessageManager.getString("info.alignment_object_method_notes")); + wsInfo.appendProgressText(jobs[j].getJobnum(), MessageManager + .getString("info.alignment_object_method_notes")); String[] lines = valign.getMethod(); for (int line = 0; line < lines.length; line++) { @@ -642,7 +652,8 @@ class SeqSearchWSThread extends JWS1Thread implements WSClientI AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT); if (nf != null) { - af.ShowNewickTree(nf, MessageManager.formatMessage("label.tree_from", new String[]{this.alTitle})); + af.ShowNewickTree(nf, MessageManager.formatMessage( + "label.tree_from", new String[] { this.alTitle })); } // initialise with same renderer settings as in parent alignframe. af.getFeatureRenderer().transferSettings(this.featureSettings); diff --git a/src/jalview/ws/jws1/WS1Client.java b/src/jalview/ws/jws1/WS1Client.java index 07b9980..f111760 100644 --- a/src/jalview/ws/jws1/WS1Client.java +++ b/src/jalview/ws/jws1/WS1Client.java @@ -111,7 +111,9 @@ public abstract class WS1Client extends WSClient implements { if (serviceHandle == null) { - throw new Error(MessageManager.getString("error.implementation_error_cannot_attach_ws_menu_entry")); + throw new Error( + MessageManager + .getString("error.implementation_error_cannot_attach_ws_menu_entry")); } attachWSMenuEntry(wsmenu, serviceHandle, alignFrame); } diff --git a/src/jalview/ws/jws2/AADisorderClient.java b/src/jalview/ws/jws2/AADisorderClient.java index 91be2e6..f929b1e 100644 --- a/src/jalview/ws/jws2/AADisorderClient.java +++ b/src/jalview/ws/jws2/AADisorderClient.java @@ -104,34 +104,29 @@ public class AADisorderClient extends JabawsCalcWorker implements Map fmap; featureMap.put(compbio.ws.client.Services.IUPredWS.toString(), fmap = new HashMap()); - fmap.put("Glob", new String[] - { "Globular Domain", "Predicted globular domain" }); + fmap.put("Glob", new String[] { "Globular Domain", + "Predicted globular domain" }); featureMap.put(compbio.ws.client.Services.JronnWS.toString(), fmap = new HashMap()); featureMap.put(compbio.ws.client.Services.DisemblWS.toString(), fmap = new HashMap()); - fmap.put("REM465", new String[] - { "REM465", "Missing density" }); - fmap.put("HOTLOOPS", new String[] - { "HOTLOOPS", "Flexible loops" }); - fmap.put("COILS", new String[] - { "COILS", "Random coil" }); + fmap.put("REM465", new String[] { "REM465", "Missing density" }); + fmap.put("HOTLOOPS", new String[] { "HOTLOOPS", "Flexible loops" }); + fmap.put("COILS", new String[] { "COILS", "Random coil" }); featureMap.put(compbio.ws.client.Services.GlobPlotWS.toString(), fmap = new HashMap()); - fmap.put("GlobDoms", new String[] - { "Globular Domain", "Predicted globular domain" }); - fmap.put("Disorder", new String[] - { "Protein Disorder", "Probable unstructured peptide region" }); + fmap.put("GlobDoms", new String[] { "Globular Domain", + "Predicted globular domain" }); + fmap.put("Disorder", new String[] { "Protein Disorder", + "Probable unstructured peptide region" }); Map> amap; annotMap = new HashMap>>(); annotMap.put(compbio.ws.client.Services.GlobPlotWS.toString(), amap = new HashMap>()); amap.put("Dydx", new HashMap()); amap.get("Dydx").put(DONTCOMBINE, DONTCOMBINE); - amap.get("Dydx").put(THRESHOLD, new double[] - { 1, 0 }); - amap.get("Dydx").put(RANGE, new float[] - { -1, +1 }); + amap.get("Dydx").put(THRESHOLD, new double[] { 1, 0 }); + amap.get("Dydx").put(RANGE, new float[] { -1, +1 }); amap.put("SmoothedScore", new HashMap()); amap.get("SmoothedScore").put(INVISIBLE, INVISIBLE); @@ -142,39 +137,27 @@ public class AADisorderClient extends JabawsCalcWorker implements amap.put("COILS", new HashMap()); amap.put("HOTLOOPS", new HashMap()); amap.put("REM465", new HashMap()); - amap.get("COILS").put(THRESHOLD, new double[] - { 1, 0.516 }); - amap.get("COILS").put(RANGE, new float[] - { 0, 1 }); - - amap.get("HOTLOOPS").put(THRESHOLD, new double[] - { 1, 0.6 }); - amap.get("HOTLOOPS").put(RANGE, new float[] - { 0, 1 }); - amap.get("REM465").put(THRESHOLD, new double[] - { 1, 0.1204 }); - amap.get("REM465").put(RANGE, new float[] - { 0, 1 }); + amap.get("COILS").put(THRESHOLD, new double[] { 1, 0.516 }); + amap.get("COILS").put(RANGE, new float[] { 0, 1 }); + + amap.get("HOTLOOPS").put(THRESHOLD, new double[] { 1, 0.6 }); + amap.get("HOTLOOPS").put(RANGE, new float[] { 0, 1 }); + amap.get("REM465").put(THRESHOLD, new double[] { 1, 0.1204 }); + amap.get("REM465").put(RANGE, new float[] { 0, 1 }); annotMap.put(compbio.ws.client.Services.IUPredWS.toString(), amap = new HashMap>()); amap.put("Long", new HashMap()); amap.put("Short", new HashMap()); - amap.get("Long").put(THRESHOLD, new double[] - { 1, 0.5 }); - amap.get("Long").put(RANGE, new float[] - { 0, 1 }); - amap.get("Short").put(THRESHOLD, new double[] - { 1, 0.5 }); - amap.get("Short").put(RANGE, new float[] - { 0, 1 }); + amap.get("Long").put(THRESHOLD, new double[] { 1, 0.5 }); + amap.get("Long").put(RANGE, new float[] { 0, 1 }); + amap.get("Short").put(THRESHOLD, new double[] { 1, 0.5 }); + amap.get("Short").put(RANGE, new float[] { 0, 1 }); annotMap.put(compbio.ws.client.Services.JronnWS.toString(), amap = new HashMap>()); amap.put("JRonn", new HashMap()); - amap.get("JRonn").put(THRESHOLD, new double[] - { 1, 0.5 }); - amap.get("JRonn").put(RANGE, new float[] - { 0, 1 }); + amap.get("JRonn").put(THRESHOLD, new double[] { 1, 0.5 }); + amap.get("JRonn").put(RANGE, new float[] { 0, 1 }); } @Override @@ -249,8 +232,8 @@ public class AADisorderClient extends JabawsCalcWorker implements if (type == null) { // create a default type for this feature - type = new String[] - { typeName + " (" + scr.getMethod() + ")", + type = new String[] { + typeName + " (" + scr.getMethod() + ")", service.getActionText() }; } if (vals.hasNext()) @@ -285,8 +268,7 @@ public class AADisorderClient extends JabawsCalcWorker implements typename = service.serviceType + " (" + scr.getMethod() + ")", calcName = service.getServiceTypeURI() + "/" - + scr.getMethod(), - aseq, base + 1, scr); + + scr.getMethod(), aseq, base + 1, scr); annot.graph = AlignmentAnnotation.LINE_GRAPH; Map styleMap = (annotTypeMap == null) ? null diff --git a/src/jalview/ws/jws2/AbstractJabaCalcWorker.java b/src/jalview/ws/jws2/AbstractJabaCalcWorker.java index a7cc5b6..43d6202 100644 --- a/src/jalview/ws/jws2/AbstractJabaCalcWorker.java +++ b/src/jalview/ws/jws2/AbstractJabaCalcWorker.java @@ -364,11 +364,13 @@ public abstract class AbstractJabaCalcWorker extends AlignCalcWorker /** * validate input for dynamic/non-dynamic update context + * * @param dynamic * @param seqs * @return true if input is valid */ - abstract boolean checkValidInputSeqs(boolean dynamic, List seqs); + abstract boolean checkValidInputSeqs(boolean dynamic, + List seqs); abstract String submitToService( List seqs) @@ -390,11 +392,11 @@ public abstract class AbstractJabaCalcWorker extends AlignCalcWorker String id = rslt; if (cancelJob(rslt)) { - System.err.println("Cancelled job "+id); + System.err.println("Cancelled job " + id); } - else + else { - System.err.println("Job "+id+" couldn't be cancelled."); + System.err.println("Job " + id + " couldn't be cancelled."); } } catch (Exception q) { diff --git a/src/jalview/ws/jws2/JPred301Client.java b/src/jalview/ws/jws2/JPred301Client.java index db70fa0..e4d6329 100644 --- a/src/jalview/ws/jws2/JPred301Client.java +++ b/src/jalview/ws/jws2/JPred301Client.java @@ -128,8 +128,7 @@ public class JPred301Client extends JabawsMsaInterfaceAlignCalcWorker String[] k = jpredRowLabels.get(fsq.getId()); if (k == null) { - k = new String[] - { fsq.getId(), "JNet Output" }; + k = new String[] { fsq.getId(), "JNet Output" }; } if (fsq.getId().startsWith("JNETSOL")) { @@ -142,7 +141,8 @@ public class JPred301Client extends JabawsMsaInterfaceAlignCalcWorker { sol[spos] = '0'; } - if (vseq[spos] == 'B' && (sol[spos]=='0' || sol[spos] < amnt)) + if (vseq[spos] == 'B' + && (sol[spos] == '0' || sol[spos] < amnt)) { sol[spos] = amnt; } @@ -252,7 +252,7 @@ public class JPred301Client extends JabawsMsaInterfaceAlignCalcWorker try { elm[i] = new Annotation("" + annot, "" + annot, annot, - Integer.valueOf(""+annot)); + Integer.valueOf("" + annot)); } catch (Exception x) { System.err.println("Expected numeric value in character '" diff --git a/src/jalview/ws/jws2/JWs2Job.java b/src/jalview/ws/jws2/JWs2Job.java index d820318..9482d1d 100644 --- a/src/jalview/ws/jws2/JWs2Job.java +++ b/src/jalview/ws/jws2/JWs2Job.java @@ -20,10 +20,10 @@ */ package jalview.ws.jws2; -import compbio.metadata.JobStatus; - import jalview.ws.AWsJob; +import compbio.metadata.JobStatus; + /** * job status processing for JWS2 jobs. * diff --git a/src/jalview/ws/jws2/JabaParamStore.java b/src/jalview/ws/jws2/JabaParamStore.java index baa1d9d..34b8a72 100644 --- a/src/jalview/ws/jws2/JabaParamStore.java +++ b/src/jalview/ws/jws2/JabaParamStore.java @@ -20,6 +20,16 @@ */ package jalview.ws.jws2; +import jalview.util.MessageManager; +import jalview.ws.jws2.dm.JabaOption; +import jalview.ws.jws2.dm.JabaParameter; +import jalview.ws.jws2.dm.JabaWsParamSet; +import jalview.ws.jws2.jabaws2.Jws2Instance; +import jalview.ws.params.ArgumentI; +import jalview.ws.params.ParamDatastoreI; +import jalview.ws.params.ParamManager; +import jalview.ws.params.WsParamSetI; + import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; @@ -34,16 +44,6 @@ import compbio.metadata.Preset; import compbio.metadata.PresetManager; import compbio.metadata.RunnerConfig; -import jalview.util.MessageManager; -import jalview.ws.jws2.dm.JabaOption; -import jalview.ws.jws2.dm.JabaParameter; -import jalview.ws.jws2.dm.JabaWsParamSet; -import jalview.ws.jws2.jabaws2.Jws2Instance; -import jalview.ws.params.ArgumentI; -import jalview.ws.params.ParamDatastoreI; -import jalview.ws.params.ParamManager; -import jalview.ws.params.WsParamSetI; - public class JabaParamStore implements ParamDatastoreI { @@ -166,7 +166,9 @@ public class JabaParamStore implements ParamDatastoreI } if (narg == null) { - throw new Error(MessageManager.formatMessage("error.implementation_error_cannot_handle_jaba_param", new String[]{rg.getClass().toString()})); + throw new Error(MessageManager.formatMessage( + "error.implementation_error_cannot_handle_jaba_param", + new String[] { rg.getClass().toString() })); } else { @@ -201,7 +203,9 @@ public class JabaParamStore implements ParamDatastoreI .getOption() : null; if (narg == null) { - throw new Error(MessageManager.formatMessage("error.implementation_error_cannot_handle_jaba_param", new String[]{rg.getClass().toString()})); + throw new Error(MessageManager.formatMessage( + "error.implementation_error_cannot_handle_jaba_param", + new String[] { rg.getClass().toString() })); } else { @@ -239,7 +243,9 @@ public class JabaParamStore implements ParamDatastoreI } if (servicePresets.containsKey(name)) { - throw new Error(MessageManager.getString("error.implementation_error_attempt_to_delete_service_preset")); + throw new Error( + MessageManager + .getString("error.implementation_error_attempt_to_delete_service_preset")); } } @@ -248,8 +254,7 @@ public class JabaParamStore implements ParamDatastoreI List jobParams) { JabaWsParamSet jps = new JabaWsParamSet(presetName, text, jobParams); - jps.setApplicableUrls(new String[] - { service.getUri() }); + jps.setApplicableUrls(new String[] { service.getUri() }); editedParams.put(jps.getName(), jps); if (manager != null) { @@ -265,13 +270,16 @@ public class JabaParamStore implements ParamDatastoreI : getPreset(presetName)); if (jps == null) { - throw new Error(MessageManager.formatMessage("error.implementation_error_cannot_locate_oldname_presetname", new String[]{oldName,presetName})); + throw new Error( + MessageManager + .formatMessage( + "error.implementation_error_cannot_locate_oldname_presetname", + new String[] { oldName, presetName })); } jps.setName(presetName); jps.setDescription(text); jps.setArguments(jobParams); - jps.setApplicableUrls(new String[] - { service.getUri() }); + jps.setApplicableUrls(new String[] { service.getUri() }); if (oldName != null && !oldName.equals(jps.getName())) { editedParams.remove(oldName); @@ -315,7 +323,9 @@ public class JabaParamStore implements ParamDatastoreI { if (!involves(urls)) { - throw new IOException(MessageManager.getString("error.implementation_error_cannot_find_service_url_in_given_set")); + throw new IOException( + MessageManager + .getString("error.implementation_error_cannot_find_service_url_in_given_set")); } JabaWsParamSet wsp = new JabaWsParamSet(); @@ -340,11 +350,17 @@ public class JabaParamStore implements ParamDatastoreI { if (!involves(pset.getApplicableUrls())) { - throw new IOException(MessageManager.formatMessage("error.implementation_error_cannot_find_service_url_in_given_set_param_store", new String[]{service.getUri()})); + throw new IOException( + MessageManager + .formatMessage( + "error.implementation_error_cannot_find_service_url_in_given_set_param_store", + new String[] { service.getUri() })); } if (!(pset instanceof JabaWsParamSet)) { - throw new Error(MessageManager.getString("error.implementation_error_jabaws_param_set_only_handled_by")); + throw new Error( + MessageManager + .getString("error.implementation_error_jabaws_param_set_only_handled_by")); } StringBuffer rslt = new StringBuffer(); diff --git a/src/jalview/ws/jws2/JabaPreset.java b/src/jalview/ws/jws2/JabaPreset.java index 64298f5..279a4f0 100644 --- a/src/jalview/ws/jws2/JabaPreset.java +++ b/src/jalview/ws/jws2/JabaPreset.java @@ -56,8 +56,7 @@ public class JabaPreset implements WsParamSetI @Override public String[] getApplicableUrls() { - return new String[] - { service.getUri() }; + return new String[] { service.getUri() }; } @Override @@ -75,7 +74,9 @@ public class JabaPreset implements WsParamSetI @Override public void setSourceFile(String newfile) { - throw new Error(MessageManager.formatMessage("error.cannot_set_source_file_for", new String[]{getClass().toString()})); + throw new Error(MessageManager.formatMessage( + "error.cannot_set_source_file_for", new String[] { getClass() + .toString() })); } @Override @@ -88,13 +89,17 @@ public class JabaPreset implements WsParamSetI } catch (Exception e) { e.printStackTrace(); - throw new Error(MessageManager.getString("error.mismatch_service_instance_preset")); + throw new Error( + MessageManager + .getString("error.mismatch_service_instance_preset")); } } @Override public void setArguments(List args) { - throw new Error(MessageManager.getString("error.cannot_set_params_for_ws_preset")); + throw new Error( + MessageManager + .getString("error.cannot_set_params_for_ws_preset")); } } diff --git a/src/jalview/ws/jws2/JabaWsServerQuery.java b/src/jalview/ws/jws2/JabaWsServerQuery.java index 5b83e11..a3ed47a 100644 --- a/src/jalview/ws/jws2/JabaWsServerQuery.java +++ b/src/jalview/ws/jws2/JabaWsServerQuery.java @@ -74,15 +74,15 @@ public class JabaWsServerQuery implements Runnable this.jwsserver = server; } - Services[] JABAWS1SERVERS = new Services[] - { Services.ClustalWS, Services.MuscleWS, Services.MafftWS, - Services.ProbconsWS, Services.TcoffeeWS }; + Services[] JABAWS1SERVERS = new Services[] { Services.ClustalWS, + Services.MuscleWS, Services.MafftWS, Services.ProbconsWS, + Services.TcoffeeWS }; - Services[] JABAWS2SERVERS = new Services[] - { Services.ClustalWS, Services.MuscleWS, Services.MafftWS, - Services.ProbconsWS, Services.TcoffeeWS, Services.AAConWS, - Services.DisemblWS, Services.GlobPlotWS, Services.IUPredWS, - Services.JronnWS, Services.RNAalifoldWS }; + Services[] JABAWS2SERVERS = new Services[] { Services.ClustalWS, + Services.MuscleWS, Services.MafftWS, Services.ProbconsWS, + Services.TcoffeeWS, Services.AAConWS, Services.DisemblWS, + Services.GlobPlotWS, Services.IUPredWS, Services.JronnWS, + Services.RNAalifoldWS }; /* * (non-Javadoc) @@ -169,9 +169,8 @@ public class JabaWsServerQuery implements Runnable service = Jws2Client.connect(jwsserver, srv); } catch (Exception e) { - System.err.println("Jws2 Discoverer: Problem on " - + jwsserver + " with service " + srv + ":\n" - + e.getMessage()); + System.err.println("Jws2 Discoverer: Problem on " + jwsserver + + " with service " + srv + ":\n" + e.getMessage()); if (!(e instanceof javax.xml.ws.WebServiceException)) { e.printStackTrace(); @@ -237,8 +236,10 @@ public class JabaWsServerQuery implements Runnable { // return Jws2Client.validURL(jwsserver); // checks syntax only boolean result = false; - if (server != null) { - try { + if (server != null) + { + try + { URL url = new URL(server); url.openStream().close(); result = true; diff --git a/src/jalview/ws/jws2/JabawsCalcWorker.java b/src/jalview/ws/jws2/JabawsCalcWorker.java index 551b957..4388f6c 100644 --- a/src/jalview/ws/jws2/JabawsCalcWorker.java +++ b/src/jalview/ws/jws2/JabawsCalcWorker.java @@ -115,7 +115,10 @@ public abstract class JabawsCalcWorker extends AbstractJabaCalcWorker rslt = aaservice.customAnalize(seqs, getJabaArguments()); } catch (WrongParameterException x) { - throw new JobSubmissionException(MessageManager.getString("exception.jobsubmission_invalid_params_set"), x); + throw new JobSubmissionException( + MessageManager + .getString("exception.jobsubmission_invalid_params_set"), + x); } } diff --git a/src/jalview/ws/jws2/JabawsMsaInterfaceAlignCalcWorker.java b/src/jalview/ws/jws2/JabawsMsaInterfaceAlignCalcWorker.java index 83bac78..0baa767 100644 --- a/src/jalview/ws/jws2/JabawsMsaInterfaceAlignCalcWorker.java +++ b/src/jalview/ws/jws2/JabawsMsaInterfaceAlignCalcWorker.java @@ -20,32 +20,31 @@ */ package jalview.ws.jws2; +import jalview.api.AlignViewportI; +import jalview.api.AlignmentViewPanel; +import jalview.datamodel.AlignmentAnnotation; +import jalview.datamodel.Annotation; +import jalview.datamodel.SequenceI; +import jalview.gui.AlignFrame; +import jalview.util.MessageManager; +import jalview.ws.jws2.jabaws2.Jws2Instance; +import jalview.ws.params.WsParamSetI; + import java.util.Iterator; import java.util.List; import compbio.data.msa.MsaWS; -import compbio.data.msa.SequenceAnnotation; import compbio.data.sequence.Alignment; import compbio.data.sequence.Score; -import compbio.data.sequence.ScoreManager; import compbio.metadata.Argument; import compbio.metadata.ChunkHolder; import compbio.metadata.JobStatus; import compbio.metadata.JobSubmissionException; import compbio.metadata.ResultNotAvailableException; import compbio.metadata.WrongParameterException; -import jalview.api.AlignViewportI; -import jalview.api.AlignmentViewPanel; -import jalview.datamodel.AlignmentAnnotation; -import jalview.datamodel.Annotation; -import jalview.datamodel.SequenceI; -import jalview.gui.AlignFrame; -import jalview.util.MessageManager; -import jalview.workers.AlignCalcWorker; -import jalview.ws.jws2.jabaws2.Jws2Instance; -import jalview.ws.params.WsParamSetI; -public abstract class JabawsMsaInterfaceAlignCalcWorker extends AbstractJabaCalcWorker +public abstract class JabawsMsaInterfaceAlignCalcWorker extends + AbstractJabaCalcWorker { @SuppressWarnings("unchecked") @@ -59,8 +58,8 @@ public abstract class JabawsMsaInterfaceAlignCalcWorker extends AbstractJabaCalc super(alignViewport, alignPanel); } - public JabawsMsaInterfaceAlignCalcWorker(Jws2Instance service, AlignFrame alignFrame, - WsParamSetI preset, List paramset) + public JabawsMsaInterfaceAlignCalcWorker(Jws2Instance service, + AlignFrame alignFrame, WsParamSetI preset, List paramset) { this(alignFrame.getCurrentView(), alignFrame.alignPanel); this.guiProgress = alignFrame; @@ -130,7 +129,10 @@ public abstract class JabawsMsaInterfaceAlignCalcWorker extends AbstractJabaCalc rslt = msaservice.customAlign(seqs, getJabaArguments()); } catch (WrongParameterException x) { - throw new JobSubmissionException(MessageManager.getString("exception.jobsubmission_invalid_params_set"), x); + throw new JobSubmissionException( + MessageManager + .getString("exception.jobsubmission_invalid_params_set"), + x); } } return rslt; diff --git a/src/jalview/ws/jws2/Jws2Client.java b/src/jalview/ws/jws2/Jws2Client.java index 696ddeb..c0b701b 100644 --- a/src/jalview/ws/jws2/Jws2Client.java +++ b/src/jalview/ws/jws2/Jws2Client.java @@ -78,7 +78,9 @@ public abstract class Jws2Client extends jalview.ws.WSClient * arguments. for (Argument opt : arguments) { newargs.add(opt); } } * paramset = newargs; } else { */ - throw new Error(MessageManager.getString("error.implementation_error_can_only_instantiate_jaba_param_sets")); + throw new Error( + MessageManager + .getString("error.implementation_error_can_only_instantiate_jaba_param_sets")); } } else @@ -174,7 +176,6 @@ public abstract class Jws2Client extends jalview.ws.WSClient */ abstract void attachWSMenuEntry(JMenu wsmenu, final Jws2Instance service, final AlignFrame alignFrame); - protected boolean registerAAConWSInstance(final JMenu wsmenu, final Jws2Instance service, final AlignFrame alignFrame) @@ -231,7 +232,8 @@ public abstract class Jws2Client extends jalview.ws.WSClient final JCheckBoxMenuItem aaConEnabled = new JCheckBoxMenuItem( aaui.getAAconToggle()); - aaConEnabled.setToolTipText(JvSwingUtils.wrapTooltip(true, aaui.getAAconToggleTooltip())); + aaConEnabled.setToolTipText(JvSwingUtils.wrapTooltip(true, + aaui.getAAconToggleTooltip())); aaConEnabled.addActionListener(new ActionListener() { @Override @@ -254,9 +256,11 @@ public abstract class Jws2Client extends jalview.ws.WSClient }); wsmenu.add(aaConEnabled); final JMenuItem modifyParams = new JMenuItem(aaui.getAAeditSettings()); - modifyParams.setToolTipText("

" - + JvSwingUtils.wrapTooltip(false, aaui.getAAeditSettingsTooltip() - + "

") + ""); + modifyParams + .setToolTipText("

" + + JvSwingUtils.wrapTooltip(false, + aaui.getAAeditSettingsTooltip() + "

") + + ""); modifyParams.addActionListener(new ActionListener() { @@ -408,7 +412,8 @@ public abstract class Jws2Client extends jalview.ws.WSClient { // TODO raise dialog box explaining error, and/or open the JABA // preferences menu. - throw new Error(MessageManager.getString("error.no_aacon_service_found")); + throw new Error( + MessageManager.getString("error.no_aacon_service_found")); } return new AAConSettings(true, service, null, null); } diff --git a/src/jalview/ws/jws2/Jws2Discoverer.java b/src/jalview/ws/jws2/Jws2Discoverer.java index 792e93f..1b2c708 100644 --- a/src/jalview/ws/jws2/Jws2Discoverer.java +++ b/src/jalview/ws/jws2/Jws2Discoverer.java @@ -145,6 +145,7 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI this.aborted = aborted; } + public void run() { @@ -172,9 +173,8 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI // first set up exclusion list if needed final Set ignoredServices = new HashSet(); - for (String ignored : Cache.getDefault( - "IGNORED_JABAWS_SERVICETYPES", "") - .split("\\|")) + for (String ignored : Cache.getDefault("IGNORED_JABAWS_SERVICETYPES", + "").split("\\|")) { ignoredServices.add(ignored); } @@ -425,9 +425,10 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI service.attachWSMenuEntry(atpoint, alignFrame); if (alternates.containsKey(service.serviceType)) { - atpoint.add(hitm = new JMenu(MessageManager.getString("label.switch_server"))); - hitm.setToolTipText(JvSwingUtils - .wrapTooltip(false, MessageManager.getString("label.choose_jabaws_server"))); + atpoint.add(hitm = new JMenu(MessageManager + .getString("label.switch_server"))); + hitm.setToolTipText(JvSwingUtils.wrapTooltip(false, + MessageManager.getString("label.choose_jabaws_server"))); for (final Jws2Instance sv : alternates.get(service.serviceType)) { JMenuItem itm; @@ -516,7 +517,8 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI atpoint = JvSwingUtils.findOrCreateMenu(atpoint, host); if (atpoint.getToolTipText() == null) { - atpoint.setToolTipText(MessageManager.formatMessage("label.services_at", new String[]{host})); + atpoint.setToolTipText(MessageManager.formatMessage( + "label.services_at", new String[] { host })); } } if (bytype) @@ -560,8 +562,8 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI Desktop.showUrl(service.getHost()); } }); - hitm.setToolTipText(JvSwingUtils - .wrapTooltip(true, MessageManager.getString("label.open_jabaws_web_page"))); + hitm.setToolTipText(JvSwingUtils.wrapTooltip(true, + MessageManager.getString("label.open_jabaws_web_page"))); lasthostFor.put(service.action, host); } hostLabels.add(host + service.serviceType @@ -710,9 +712,8 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI } } catch (MalformedURLException ex) { - Cache.log - .warn("Problem whilst trying to make a URL from '" - + ((url != null) ? url : "") + "'"); + Cache.log.warn("Problem whilst trying to make a URL from '" + + ((url != null) ? url : "") + "'"); Cache.log .warn("This was probably due to a malformed comma separated list" + " in the " @@ -723,9 +724,8 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI } } catch (Exception ex) { - Cache.log.warn( - "Error parsing comma separated list of urls in " - + JWS2HOSTURLS + " preference.", ex); + Cache.log.warn("Error parsing comma separated list of urls in " + + JWS2HOSTURLS + " preference.", ex); } return urls; } @@ -746,8 +746,8 @@ public class Jws2Discoverer implements Runnable, WSMenuEntryProviderI { try { - compbio.ws.client.WSTester.main(new String[] - { "-h=" + foo.toString() }); + compbio.ws.client.WSTester + .main(new String[] { "-h=" + foo.toString() }); } catch (Exception e) { e.printStackTrace(); diff --git a/src/jalview/ws/jws2/MsaWSClient.java b/src/jalview/ws/jws2/MsaWSClient.java index 5fe3e74..47130a3 100644 --- a/src/jalview/ws/jws2/MsaWSClient.java +++ b/src/jalview/ws/jws2/MsaWSClient.java @@ -109,8 +109,7 @@ public class MsaWSClient extends Jws2Client // redundant at mo - but may change JOptionPane.showMessageDialog(Desktop.desktop, MessageManager .formatMessage("label.service_called_is_not_msa_service", - new String[] - { sh.serviceType }), MessageManager + new String[] { sh.serviceType }), MessageManager .getString("label.internal_jalview_error"), JOptionPane.WARNING_MESSAGE); @@ -120,8 +119,8 @@ public class MsaWSClient extends Jws2Client if ((wsInfo = setWebService(sh, false)) == null) { JOptionPane.showMessageDialog(Desktop.desktop, MessageManager - .formatMessage("label.msa_service_is_unknown", new String[] - { sh.serviceType }), MessageManager + .formatMessage("label.msa_service_is_unknown", + new String[] { sh.serviceType }), MessageManager .getString("label.internal_jalview_error"), JOptionPane.WARNING_MESSAGE); @@ -130,7 +129,6 @@ public class MsaWSClient extends Jws2Client startMsaWSClient(altitle, msa, submitGaps, preserveOrder, seqdataset); - } public MsaWSClient() @@ -195,8 +193,6 @@ public class MsaWSClient extends Jws2Client System.out.println("A".matches("(-*[a-zA-Z]-*){1}[a-zA-Z-]*")); } - - protected String getServiceActionKey() { return "MsaWS"; @@ -251,8 +247,7 @@ public class MsaWSClient extends Jws2Client { action = "Realign "; msawsmenu = new JMenu(MessageManager.formatMessage( - "label.realign_with_params", new String[] - { svcname })); + "label.realign_with_params", new String[] { svcname })); msawsmenu.setToolTipText(MessageManager .getString("label.align_sequences_to_existing_alignment")); rmsawsmenu.add(msawsmenu); @@ -260,11 +255,11 @@ public class MsaWSClient extends Jws2Client final boolean withGaps = submitGaps; JMenuItem method = new JMenuItem(MessageManager.formatMessage( - "label.calcname_with_default_settings", new String[] - { calcName })); - method.setToolTipText(MessageManager.formatMessage( - "label.action_with_default_settings", new String[] - { action })); + "label.calcname_with_default_settings", + new String[] { calcName })); + method.setToolTipText(MessageManager + .formatMessage("label.action_with_default_settings", + new String[] { action })); method.addActionListener(new ActionListener() { @@ -274,9 +269,9 @@ public class MsaWSClient extends Jws2Client if (msa != null) { - new MsaWSClient(service, alignFrame.getTitle(), msa, withGaps, - true, alignFrame.getViewport().getAlignment() - .getDataset(), alignFrame); + new MsaWSClient(service, alignFrame.getTitle(), msa, withGaps, + true, alignFrame.getViewport().getAlignment() + .getDataset(), alignFrame); } } @@ -299,8 +294,9 @@ public class MsaWSClient extends Jws2Client if (msa != null) { new MsaWSClient(service, null, null, true, alignFrame - .getTitle(), msa, withGaps, true, alignFrame - .getViewport().getAlignment().getDataset(), alignFrame); + .getTitle(), msa, withGaps, true, alignFrame + .getViewport().getAlignment().getDataset(), + alignFrame); } } @@ -309,9 +305,10 @@ public class MsaWSClient extends Jws2Client List presets = service.getParamStore().getPresets(); if (presets != null && presets.size() > 0) { - JMenu presetlist = new JMenu(MessageManager.formatMessage( - "label.run_with_preset_params", new String[] - { calcName })); + JMenu presetlist = new JMenu( + MessageManager.formatMessage( + "label.run_with_preset_params", + new String[] { calcName })); final int showToolTipFor = ToolTipManager.sharedInstance() .getDismissDelay(); @@ -333,7 +330,8 @@ public class MsaWSClient extends Jws2Client @Override public void mouseExited(MouseEvent e) { - ToolTipManager.sharedInstance().setDismissDelay(showToolTipFor); + ToolTipManager.sharedInstance().setDismissDelay( + showToolTipFor); } }); @@ -356,9 +354,9 @@ public class MsaWSClient extends Jws2Client if (msa != null) { MsaWSClient msac = new MsaWSClient(service, preset, - alignFrame.getTitle(), - msa, false, true, alignFrame.getViewport() - .getAlignment().getDataset(), alignFrame); + alignFrame.getTitle(), msa, false, true, + alignFrame.getViewport().getAlignment() + .getDataset(), alignFrame); } } diff --git a/src/jalview/ws/jws2/MsaWSThread.java b/src/jalview/ws/jws2/MsaWSThread.java index d2c1b38..e2f3a7c 100644 --- a/src/jalview/ws/jws2/MsaWSThread.java +++ b/src/jalview/ws/jws2/MsaWSThread.java @@ -125,7 +125,9 @@ class MsaWSThread extends AWS2Thread implements WSClientI int nseqs = 0; if (minlen < 0) { - throw new Error(MessageManager.getString("error.implementation_error_minlen_must_be_greater_zero")); + throw new Error( + MessageManager + .getString("error.implementation_error_minlen_must_be_greater_zero")); } for (int i = 0; i < seqs.length; i++) { @@ -164,8 +166,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI .extractGaps(jalview.util.Comparison.GapChars, seqs[i].getSequenceAsString()); } - emptySeqs.add(new String[] - { newname, empty }); + emptySeqs.add(new String[] { newname, empty }); } } return valid; @@ -296,8 +297,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI jalview.analysis.AlignmentSorter.recoverOrder(alseqs); // account for any missing sequences jalview.analysis.SeqsetUtils.deuniquify(SeqNames, alseqs); - return new Object[] - { alseqs, msaorder }; + return new Object[] { alseqs, msaorder }; } return null; } @@ -529,6 +529,7 @@ class MsaWSThread extends AWS2Thread implements WSClientI { return validInput; } + public boolean isCancellable() { return true; @@ -655,7 +656,9 @@ class MsaWSThread extends AWS2Thread implements WSClientI // boiler plate template if (!(job instanceof MsaWSJob)) { - throw new Error(MessageManager.formatMessage("error.implementation_error_msawbjob_called", new String[]{job.getClass().toString()})); + throw new Error(MessageManager.formatMessage( + "error.implementation_error_msawbjob_called", + new String[] { job.getClass().toString() })); } MsaWSJob j = (MsaWSJob) job; if (j.isSubmitted()) @@ -701,28 +704,39 @@ class MsaWSThread extends AWS2Thread implements WSClientI } else { - throw new Exception(MessageManager.formatMessage("exception.web_service_returned_null_try_later", new String[]{WsUrl})); + throw new Exception(MessageManager.formatMessage( + "exception.web_service_returned_null_try_later", + new String[] { WsUrl })); } } catch (compbio.metadata.UnsupportedRuntimeException _lex) { lex = _lex; - wsInfo.appendProgressText(MessageManager.formatMessage("info.job_couldnt_be_run_server_doesnt_support_program", new String[]{_lex.getMessage()})); - wsInfo.warnUser(_lex.getMessage(), MessageManager.getString("warn.service_not_supported")); + wsInfo.appendProgressText(MessageManager.formatMessage( + "info.job_couldnt_be_run_server_doesnt_support_program", + new String[] { _lex.getMessage() })); + wsInfo.warnUser(_lex.getMessage(), + MessageManager.getString("warn.service_not_supported")); wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_SERVERERROR); wsInfo.setStatus(j.getJobnum(), WebserviceInfo.STATE_STOPPED_SERVERERROR); } catch (compbio.metadata.LimitExceededException _lex) { lex = _lex; - wsInfo.appendProgressText(MessageManager.formatMessage("info.job_couldnt_be_run_exceeded_hard_limit", new String[]{_lex.getMessage()})); - wsInfo.warnUser(_lex.getMessage(), MessageManager.getString("warn.input_is_too_big")); + wsInfo.appendProgressText(MessageManager.formatMessage( + "info.job_couldnt_be_run_exceeded_hard_limit", + new String[] { _lex.getMessage() })); + wsInfo.warnUser(_lex.getMessage(), + MessageManager.getString("warn.input_is_too_big")); wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR); wsInfo.setStatus(j.getJobnum(), WebserviceInfo.STATE_STOPPED_ERROR); } catch (compbio.metadata.WrongParameterException _lex) { lex = _lex; - wsInfo.warnUser(_lex.getMessage(), MessageManager.getString("warn.invalid_job_param_set")); - wsInfo.appendProgressText(MessageManager.formatMessage("info.job_couldnt_be_run_incorrect_param_setting", new String[]{_lex.getMessage()})); + wsInfo.warnUser(_lex.getMessage(), + MessageManager.getString("warn.invalid_job_param_set")); + wsInfo.appendProgressText(MessageManager.formatMessage( + "info.job_couldnt_be_run_incorrect_param_setting", + new String[] { _lex.getMessage() })); wsInfo.setStatus(WebserviceInfo.STATE_STOPPED_ERROR); wsInfo.setStatus(j.getJobnum(), WebserviceInfo.STATE_STOPPED_ERROR); } catch (Error e) @@ -755,8 +769,8 @@ class MsaWSThread extends AWS2Thread implements WSClientI // TODO: JBPNote catch timeout or other fault types explicitly j.setAllowedServerExceptions(0); - wsInfo.appendProgressText(j.getJobnum(), - MessageManager.getString("info.failed_to_submit_sequences_for_alignment")); + wsInfo.appendProgressText(j.getJobnum(), MessageManager + .getString("info.failed_to_submit_sequences_for_alignment")); } } } @@ -764,7 +778,9 @@ class MsaWSThread extends AWS2Thread implements WSClientI public void parseResult() { long progbar = System.currentTimeMillis(); - wsInfo.setProgressBar(MessageManager.getString("status.collecting_job_results"), progbar); + wsInfo.setProgressBar( + MessageManager.getString("status.collecting_job_results"), + progbar); int results = 0; // number of result sets received JobStateSummary finalState = new JobStateSummary(); try @@ -995,8 +1011,10 @@ class MsaWSThread extends AWS2Thread implements WSClientI * SplitFrame with the other pane similarly aligned. */ AlignFrame requestedBy = getRequestingAlignFrame(); - if (requestedBy != null && requestedBy.getSplitViewContainer() != null - && requestedBy.getSplitViewContainer().getComplement(requestedBy)!=null) + if (requestedBy != null + && requestedBy.getSplitViewContainer() != null + && requestedBy.getSplitViewContainer().getComplement( + requestedBy) != null) { AlignmentI complement = requestedBy.getSplitViewContainer() .getComplement(requestedBy); diff --git a/src/jalview/ws/jws2/ParameterUtils.java b/src/jalview/ws/jws2/ParameterUtils.java index 855f4d9..62ddd0a 100644 --- a/src/jalview/ws/jws2/ParameterUtils.java +++ b/src/jalview/ws/jws2/ParameterUtils.java @@ -22,12 +22,15 @@ package jalview.ws.jws2; import jalview.util.MessageManager; -import java.net.MalformedURLException; import java.util.ArrayList; import java.util.HashSet; import java.util.List; -import compbio.metadata.*; +import compbio.metadata.Option; +import compbio.metadata.Parameter; +import compbio.metadata.RunnerConfig; +import compbio.metadata.ValueConstrain; +import compbio.metadata.WrongParameterException; public class ParameterUtils { @@ -146,8 +149,7 @@ public class ParameterUtils } else { - copy.addOptionNames(names.toArray(new String[] - {})); + copy.addOptionNames(names.toArray(new String[] {})); } } try @@ -183,7 +185,9 @@ public class ParameterUtils } catch (Exception e) { e.printStackTrace(); - throw new Error(MessageManager.getString("error.implementation_error_couldnt_copy_value_constraint")); + throw new Error( + MessageManager + .getString("error.implementation_error_couldnt_copy_value_constraint")); } } @@ -198,8 +202,7 @@ public class ParameterUtils List pv = parameter.getPossibleValues(); if (pv != null) { - copy.addPossibleValues(pv.toArray(new String[] - {})); + copy.addPossibleValues(pv.toArray(new String[] {})); } setOptionFrom(copy, parameter); return copy; diff --git a/src/jalview/ws/jws2/RNAalifoldClient.java b/src/jalview/ws/jws2/RNAalifoldClient.java index ca1fd50..41aa223 100644 --- a/src/jalview/ws/jws2/RNAalifoldClient.java +++ b/src/jalview/ws/jws2/RNAalifoldClient.java @@ -372,8 +372,7 @@ public class RNAalifoldClient extends JabawsCalcWorker implements description = typename; } - return new String[] - { typename, description }; + return new String[] { typename, description }; } // Check whether, at position i there is a base contact and return all the diff --git a/src/jalview/ws/jws2/SequenceAnnotationWSClient.java b/src/jalview/ws/jws2/SequenceAnnotationWSClient.java index 1ddc02d..187540c 100644 --- a/src/jalview/ws/jws2/SequenceAnnotationWSClient.java +++ b/src/jalview/ws/jws2/SequenceAnnotationWSClient.java @@ -21,7 +21,6 @@ package jalview.ws.jws2; import jalview.api.AlignCalcWorkerI; -import jalview.bin.Cache; import jalview.gui.AlignFrame; import jalview.gui.Desktop; import jalview.gui.JvSwingUtils; @@ -35,12 +34,8 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.List; -import javax.swing.JCheckBoxMenuItem; import javax.swing.JMenu; import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.event.MenuEvent; -import javax.swing.event.MenuListener; /** * @author jprocter @@ -98,15 +93,15 @@ public class SequenceAnnotationWSClient extends Jws2Client try { worker = (AbstractJabaCalcWorker) (clientClass - .getConstructor(new Class[] - { Jws2Instance.class, AlignFrame.class, - WsParamSetI.class, List.class }) - .newInstance(new Object[] - { sh, alignFrame, this.preset, paramset })); + .getConstructor(new Class[] { Jws2Instance.class, + AlignFrame.class, WsParamSetI.class, List.class }) + .newInstance(new Object[] { sh, alignFrame, this.preset, + paramset })); } catch (Exception x) { x.printStackTrace(); - throw new Error(MessageManager.getString("error.implementation_error"), x); + throw new Error( + MessageManager.getString("error.implementation_error"), x); } alignFrame.getViewport().getCalcManager().registerWorker(worker); alignFrame.getViewport().getCalcManager().startWorker(worker); @@ -176,8 +171,8 @@ public class SequenceAnnotationWSClient extends Jws2Client service.serviceType.length() - 2); JMenuItem annotservice = new JMenuItem(MessageManager.formatMessage( - "label.calcname_with_default_settings", new String[] - { calcName })); + "label.calcname_with_default_settings", + new String[] { calcName })); annotservice.addActionListener(new ActionListener() { @@ -209,15 +204,20 @@ public class SequenceAnnotationWSClient extends Jws2Client List presets = service.getParamStore().getPresets(); if (presets != null && presets.size() > 0) { - JMenu presetlist = new JMenu(MessageManager.formatMessage("label.run_with_preset", new String[]{calcName})); + JMenu presetlist = new JMenu(MessageManager.formatMessage( + "label.run_with_preset", new String[] { calcName })); for (final WsParamSetI preset : presets) { final JMenuItem methodR = new JMenuItem(preset.getName()); - methodR.setToolTipText(JvSwingUtils.wrapTooltip(true, "" - + (preset.isModifiable() ? MessageManager.getString("label.user_preset") - : MessageManager.getString("label.service_preset")) + "
" - + preset.getDescription())); + methodR.setToolTipText(JvSwingUtils.wrapTooltip( + true, + "" + + (preset.isModifiable() ? MessageManager + .getString("label.user_preset") + : MessageManager + .getString("label.service_preset")) + + "
" + preset.getDescription())); methodR.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -248,7 +248,9 @@ public class SequenceAnnotationWSClient extends Jws2Client Desktop.instance.showUrl(service.docUrl); } }); - annotservice.setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.formatMessage("label.view_service_doc_url", new String[]{service.docUrl,service.docUrl}))); + annotservice.setToolTipText(JvSwingUtils.wrapTooltip(true, + MessageManager.formatMessage("label.view_service_doc_url", + new String[] { service.docUrl, service.docUrl }))); wsmenu.add(annotservice); } } diff --git a/src/jalview/ws/jws2/dm/AAConSettings.java b/src/jalview/ws/jws2/dm/AAConSettings.java index ea04709..5f068b0 100644 --- a/src/jalview/ws/jws2/dm/AAConSettings.java +++ b/src/jalview/ws/jws2/dm/AAConSettings.java @@ -20,12 +20,6 @@ */ package jalview.ws.jws2.dm; -import java.util.ArrayList; -import java.util.List; - -import compbio.metadata.Argument; -import compbio.metadata.Option; - import jalview.util.MessageManager; import jalview.ws.jws2.JabaParamStore; import jalview.ws.jws2.JabaPreset; @@ -34,6 +28,12 @@ import jalview.ws.jws2.jabaws2.Jws2Instance; import jalview.ws.params.ArgumentI; import jalview.ws.params.WsParamSetI; +import java.util.ArrayList; +import java.util.List; + +import compbio.metadata.Argument; +import compbio.metadata.Option; + /** * preferences for running AACon service * @@ -93,7 +93,9 @@ public class AAConSettings extends jalview.ws.params.AutoCalcSetting return; } // Try even harder to migrate arguments. - throw new Error(MessageManager.getString("error.parameter_migration_not_implemented_yet")); + throw new Error( + MessageManager + .getString("error.parameter_migration_not_implemented_yet")); } } @@ -146,7 +148,6 @@ public class AAConSettings extends jalview.ws.params.AutoCalcSetting @Override public String[] getServiceURLs() { - return new String[] - { service.getUri() }; + return new String[] { service.getUri() }; } } diff --git a/src/jalview/ws/jws2/dm/JabaOption.java b/src/jalview/ws/jws2/dm/JabaOption.java index 69d6170..d9f8f46 100644 --- a/src/jalview/ws/jws2/dm/JabaOption.java +++ b/src/jalview/ws/jws2/dm/JabaOption.java @@ -95,7 +95,9 @@ public class JabaOption implements jalview.ws.params.OptionI } catch (Exception e) { e.printStackTrace(); - throw new Error(MessageManager.getString("error.implementation_error_cannot_set_jaba_option")); + throw new Error( + MessageManager + .getString("error.implementation_error_cannot_set_jaba_option")); } } diff --git a/src/jalview/ws/jws2/dm/JabaParameter.java b/src/jalview/ws/jws2/dm/JabaParameter.java index 293d2e3..5da71ab 100644 --- a/src/jalview/ws/jws2/dm/JabaParameter.java +++ b/src/jalview/ws/jws2/dm/JabaParameter.java @@ -23,6 +23,7 @@ package jalview.ws.jws2.dm; import jalview.ws.jws2.ParameterUtils; import jalview.ws.params.ParameterI; import jalview.ws.params.ValueConstrainI; + import compbio.metadata.Parameter; import compbio.metadata.ValueConstrain; diff --git a/src/jalview/ws/jws2/dm/JabaValueConstrain.java b/src/jalview/ws/jws2/dm/JabaValueConstrain.java index 59dce92..b99c381 100644 --- a/src/jalview/ws/jws2/dm/JabaValueConstrain.java +++ b/src/jalview/ws/jws2/dm/JabaValueConstrain.java @@ -20,11 +20,11 @@ */ package jalview.ws.jws2.dm; -import compbio.metadata.ValueConstrain; - import jalview.util.MessageManager; import jalview.ws.params.ValueConstrainI; +import compbio.metadata.ValueConstrain; + public class JabaValueConstrain implements ValueConstrainI { @@ -46,7 +46,11 @@ public class JabaValueConstrain implements ValueConstrainI { return ValueType.Integer; } - throw new Error(MessageManager.formatMessage("error.implementation_error_valuetype_doesnt_support_jabaws_type", new String[]{vc.toString()})); + throw new Error( + MessageManager + .formatMessage( + "error.implementation_error_valuetype_doesnt_support_jabaws_type", + new String[] { vc.toString() })); } @Override diff --git a/src/jalview/ws/jws2/dm/JabaWsParamSet.java b/src/jalview/ws/jws2/dm/JabaWsParamSet.java index d7ca7ef..6d2b057 100644 --- a/src/jalview/ws/jws2/dm/JabaWsParamSet.java +++ b/src/jalview/ws/jws2/dm/JabaWsParamSet.java @@ -20,16 +20,16 @@ */ package jalview.ws.jws2.dm; -import java.util.ArrayList; -import java.util.List; - -import compbio.metadata.Option; - import jalview.util.MessageManager; import jalview.ws.jws2.JabaParamStore; import jalview.ws.params.ArgumentI; import jalview.ws.params.WsParamSetI; +import java.util.ArrayList; +import java.util.List; + +import compbio.metadata.Option; + public class JabaWsParamSet implements WsParamSetI { /** @@ -54,7 +54,9 @@ public class JabaWsParamSet implements WsParamSetI { if (!allJaba(jobParams)) { - throw new Error(MessageManager.getString("error.cannot_create_jabaws_param_set")); + throw new Error( + MessageManager + .getString("error.cannot_create_jabaws_param_set")); } else { @@ -177,7 +179,9 @@ public class JabaWsParamSet implements WsParamSetI { if (!allJaba(args)) { - throw new Error(MessageManager.getString("error.cannot_set_arguments_to_jabaws_param_set")); + throw new Error( + MessageManager + .getString("error.cannot_set_arguments_to_jabaws_param_set")); } jabaArguments = new ArrayList