From: gmungoc Date: Wed, 8 Jul 2015 15:19:51 +0000 (+0100) Subject: JAL-1807 merge from JAL-1759jmolUpdate X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=792a03fc1994671ae23e7263cefd51c9b0da53cb;p=jalview.git JAL-1807 merge from JAL-1759jmolUpdate --- diff --git a/.classpath b/.classpath index 5961ce9..473d937 100644 --- a/.classpath +++ b/.classpath @@ -36,8 +36,6 @@ - - @@ -66,6 +64,7 @@ + diff --git a/THIRDPARTYLIBS b/THIRDPARTYLIBS index 52214b2..3094939 100644 --- a/THIRDPARTYLIBS +++ b/THIRDPARTYLIBS @@ -10,7 +10,7 @@ ext.edu.ucsf.rbvi.strucviz2 includes sources originally developed by Scooter Mor Licencing information for each library is given below: JGoogleAnalytics_0.3.jar APL 2.0 License - http://code.google.com/p/jgoogleanalytics/ -Jmol-12.1.13.jar GPL/LGPLv2 http://sourceforge.net/projects/jmol/files/ +Jmol-14.2.14_2015.06.11.jar GPL/LGPLv2 http://sourceforge.net/projects/jmol/files/ VARNAv3-93.jar GPL licenced software by K�vin Darty, Alain Denise and Yann Ponty. http://varna.lri.fr activation.jar apache-mime4j-0.6.jar diff --git a/appletlib/JmolApplet-12.2.4.jar b/appletlib/JmolApplet-12.2.4.jar deleted file mode 100644 index e17c4ac..0000000 Binary files a/appletlib/JmolApplet-12.2.4.jar and /dev/null differ diff --git a/appletlib/JmolApplet-14.2.14_2015.06.11.jar b/appletlib/JmolApplet-14.2.14_2015.06.11.jar new file mode 100644 index 0000000..5d6338c Binary files /dev/null and b/appletlib/JmolApplet-14.2.14_2015.06.11.jar differ diff --git a/build.xml b/build.xml index e32ae33..44021ba 100755 --- a/build.xml +++ b/build.xml @@ -112,7 +112,7 @@ - + diff --git a/lib/Jmol-12.2.4.jar b/lib/Jmol-12.2.4.jar deleted file mode 100644 index f1254cd..0000000 Binary files a/lib/Jmol-12.2.4.jar and /dev/null differ diff --git a/lib/Jmol-14.2.14_2015.06.11.jar b/lib/Jmol-14.2.14_2015.06.11.jar new file mode 100644 index 0000000..f77f5f0 Binary files /dev/null and b/lib/Jmol-14.2.14_2015.06.11.jar differ diff --git a/nbproject/project.properties b/nbproject/project.properties index b505d62..ac1a2e3 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -59,8 +59,8 @@ file.reference.jalview-src=src file.reference.jaxrpc.jar=lib/jaxrpc.jar file.reference.JGoogleAnalytics_0.3.jar=lib/JGoogleAnalytics_0.3.jar file.reference.jhall.jar=lib/jhall.jar -file.reference.Jmol-12.2.4.jar=lib/Jmol-12.2.4.jar -file.reference.JmolApplet-12.2.4.jar=appletlib/JmolApplet-12.2.4.jar +file.reference.Jmol-14.2.14_2015.06.11.jar=lib/Jmol-14.2.14_2015.06.11.jar +file.reference.JmolApplet-14.2.14_2015.06.11.jar=appletlib/JmolApplet-14.2.14_2015.06.11.jar file.reference.log4j-1.2.8.jar=lib/log4j-1.2.8.jar file.reference.mail.jar=lib/mail.jar file.reference.min-jaba-client.jar=lib/min-jaba-client-2.0.jar @@ -92,7 +92,7 @@ javac.classpath=\ ${file.reference.jaxrpc.jar}:\ ${file.reference.JGoogleAnalytics_0.3.jar}:\ ${file.reference.jhall.jar}:\ - ${file.reference.Jmol-12.2.4.jar}:\ + ${file.reference.Jmol-14.2.14_2015.06.11.jar}:\ ${file.reference.miglayout-4.0-swing.jar}:\ ${file.reference.log4j-1.2.8.jar}:\ ${file.reference.mail.jar}:\ @@ -101,7 +101,7 @@ javac.classpath=\ ${file.reference.xml-apis.jar}:\ ${file.reference.xercesImpl.jar}:\ ${file.reference.wsdl4j.jar}:\ - ${file.reference.JmolApplet-12.2.4.jar} \ + ${file.reference.JmolApplet-14.2.14_2015.06.11.jar} \ ${file.reference.varna-3.9-dev.jar} # Space-separated list of extra javac options javac.compilerargs= diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 075f0d2..0225dc7 100644 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -106,6 +106,8 @@ import java.util.Map; import java.util.StringTokenizer; import java.util.Vector; +import org.jmol.viewer.Viewer; + public class AlignFrame extends EmbmenuFrame implements ActionListener, ItemListener, KeyListener, AlignViewControllerGuiI { @@ -3872,10 +3874,10 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, public SequenceStructureBinding addStructureViewInstance( Object jmolviewer, String[] sequenceIds) { - org.jmol.api.JmolViewer viewer = null; + Viewer viewer = null; try { - viewer = (org.jmol.api.JmolViewer) jmolviewer; + viewer = (Viewer) jmolviewer; } catch (ClassCastException ex) { System.err.println("Unsupported viewer object :" diff --git a/src/jalview/appletgui/AppletJmol.java b/src/jalview/appletgui/AppletJmol.java index f54717d..e889467 100644 --- a/src/jalview/appletgui/AppletJmol.java +++ b/src/jalview/appletgui/AppletJmol.java @@ -20,6 +20,23 @@ */ package jalview.appletgui; +import jalview.datamodel.AlignmentI; +import jalview.datamodel.PDBEntry; +import jalview.datamodel.SequenceI; +import jalview.io.AppletFormatAdapter; +import jalview.io.FileParse; +import jalview.schemes.BuriedColourScheme; +import jalview.schemes.HelixColourScheme; +import jalview.schemes.HydrophobicColourScheme; +import jalview.schemes.PurinePyrimidineColourScheme; +import jalview.schemes.StrandColourScheme; +import jalview.schemes.TaylorColourScheme; +import jalview.schemes.TurnColourScheme; +import jalview.schemes.UserColourScheme; +import jalview.schemes.ZappoColourScheme; +import jalview.structure.StructureSelectionManager; +import jalview.util.MessageManager; + import java.awt.BorderLayout; import java.awt.CheckboxMenuItem; import java.awt.Color; @@ -31,7 +48,6 @@ import java.awt.Menu; import java.awt.MenuBar; import java.awt.MenuItem; import java.awt.Panel; -import java.awt.Rectangle; import java.awt.TextArea; import java.awt.TextField; import java.awt.event.ActionEvent; @@ -44,25 +60,9 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.ArrayList; import java.util.Hashtable; +import java.util.List; import java.util.Vector; -import jalview.datamodel.AlignmentI; -import jalview.datamodel.PDBEntry; -import jalview.datamodel.SequenceI; -import jalview.io.AppletFormatAdapter; -import jalview.io.FileParse; -import jalview.schemes.BuriedColourScheme; -import jalview.schemes.HelixColourScheme; -import jalview.schemes.HydrophobicColourScheme; -import jalview.schemes.PurinePyrimidineColourScheme; -import jalview.schemes.StrandColourScheme; -import jalview.schemes.TaylorColourScheme; -import jalview.schemes.TurnColourScheme; -import jalview.schemes.UserColourScheme; -import jalview.schemes.ZappoColourScheme; -import jalview.structure.StructureSelectionManager; -import jalview.util.MessageManager; - public class AppletJmol extends EmbmenuFrame implements // StructureListener, KeyListener, ActionListener, ItemListener @@ -130,7 +130,8 @@ public class AppletJmol extends EmbmenuFrame implements AlignmentPanel ap; - ArrayList _aps = new ArrayList(); + List _aps = new ArrayList(); // remove? never + // added to String fileLoadingError; @@ -280,7 +281,7 @@ public class AppletJmol extends EmbmenuFrame implements dispose(); return; } - jmb.newJmolPopup(true, "Jmol", true); + // jmb.newJmolPopup(true, "Jmol", true); this.addWindowListener(new WindowAdapter() { @@ -370,7 +371,7 @@ public class AppletJmol extends EmbmenuFrame implements jmb.loadInline(string); } - void setChainMenuItems(Vector chains) + void setChainMenuItems(Vector chains) { chainMenu.removeAll(); @@ -380,10 +381,9 @@ public class AppletJmol extends EmbmenuFrame implements chainMenu.add(menuItem); CheckboxMenuItem menuItemCB; - for (int c = 0; c < chains.size(); c++) + for (String ch : chains) { - menuItemCB = new CheckboxMenuItem(chains.elementAt(c).toString(), - true); + menuItemCB = new CheckboxMenuItem(ch, true); menuItemCB.addItemListener(this); chainMenu.add(menuItemCB); } @@ -393,9 +393,7 @@ public class AppletJmol extends EmbmenuFrame implements void centerViewer() { - Vector toshow = new Vector(); - String lbl; - int mlength, p, mnum; + Vector toshow = new Vector(); for (int i = 0; i < chainMenu.getItemCount(); i++) { if (chainMenu.getItem(i) instanceof CheckboxMenuItem) @@ -547,7 +545,7 @@ public class AppletJmol extends EmbmenuFrame implements else if (evt.getSource() == seqColour) { setEnabled(seqColour); - jmb.colourBySequence(ap.av.isShowSequenceFeatures(), ap); + jmb.colourBySequence(ap); } else if (!allChainsSelected) { @@ -576,8 +574,8 @@ public class AppletJmol extends EmbmenuFrame implements public void updateColours(Object source) { - AlignmentPanel ap = (AlignmentPanel) source; - jmb.colourBySequence(ap.av.isShowSequenceFeatures(), ap); + AlignmentPanel panel = (AlignmentPanel) source; + jmb.colourBySequence(panel); } public void updateTitleAndMenus() @@ -588,7 +586,7 @@ public class AppletJmol extends EmbmenuFrame implements return; } setChainMenuItems(jmb.chainNames); - jmb.colourBySequence(ap.av.isShowSequenceFeatures(), ap); + jmb.colourBySequence(ap); setTitle(jmb.getViewerTitle()); } @@ -643,8 +641,6 @@ public class AppletJmol extends EmbmenuFrame implements { Dimension currentSize = new Dimension(); - Rectangle rectClip = new Rectangle(); - public void update(Graphics g) { paint(g); @@ -653,7 +649,6 @@ public class AppletJmol extends EmbmenuFrame implements public void paint(Graphics g) { currentSize = this.getSize(); - rectClip = g.getClipBounds(); if (jmb.viewer == null) { @@ -666,7 +661,8 @@ public class AppletJmol extends EmbmenuFrame implements } else { - jmb.viewer.renderScreenImage(g, currentSize, rectClip); + jmb.viewer.renderScreenImage(g, currentSize.width, + currentSize.height); } } } @@ -698,9 +694,9 @@ public class AppletJmol extends EmbmenuFrame implements { for (int i = 0; i < _aps.size(); i++) { - if (((AlignmentPanel) _aps.get(i)).av.getAlignment() == alignment) + if (_aps.get(i).av.getAlignment() == alignment) { - return ((AlignmentPanel) _aps.get(i)); + return (_aps.get(i)); } } return ap; diff --git a/src/jalview/appletgui/AppletJmolBinding.java b/src/jalview/appletgui/AppletJmolBinding.java index 80fafe3..7035058 100644 --- a/src/jalview/appletgui/AppletJmolBinding.java +++ b/src/jalview/appletgui/AppletJmolBinding.java @@ -23,16 +23,19 @@ package jalview.appletgui; import jalview.api.AlignmentViewPanel; import jalview.datamodel.PDBEntry; import jalview.datamodel.SequenceI; +import jalview.ext.jmol.JalviewJmolBinding; import jalview.structure.StructureSelectionManager; import java.awt.Container; -import java.util.BitSet; +import java.util.Map; + +import javajs.awt.Dimension; import org.jmol.api.JmolAppConsoleInterface; -import org.jmol.api.JmolViewer; -import org.jmol.popup.JmolPopup; +import org.jmol.console.AppletConsole; +import org.jmol.java.BS; -class AppletJmolBinding extends jalview.ext.jmol.JalviewJmolBinding +class AppletJmolBinding extends JalviewJmolBinding { /** @@ -48,6 +51,7 @@ class AppletJmolBinding extends jalview.ext.jmol.JalviewJmolBinding appletJmolBinding = appletJmol; } + @Override public jalview.api.FeatureRenderer getFeatureRenderer( AlignmentViewPanel alignment) { @@ -68,12 +72,14 @@ class AppletJmolBinding extends jalview.ext.jmol.JalviewJmolBinding return appletJmolBinding.fr; } + @Override public jalview.api.SequenceRenderer getSequenceRenderer( AlignmentViewPanel alignment) { return new SequenceRenderer(((AlignmentPanel) alignment).av); } + @Override public void sendConsoleEcho(String strEcho) { if (appletJmolBinding.scriptWindow == null) @@ -84,6 +90,7 @@ class AppletJmolBinding extends jalview.ext.jmol.JalviewJmolBinding appletJmolBinding.history.append("\n" + strEcho); } + @Override public void sendConsoleMessage(String strStatus) { if (appletJmolBinding.history != null && strStatus != null @@ -93,12 +100,14 @@ class AppletJmolBinding extends jalview.ext.jmol.JalviewJmolBinding } } + @Override public void showUrl(String url, String target) { appletJmolBinding.ap.alignFrame.showURL(url, target); } + @Override public void refreshGUI() { appletJmolBinding.updateTitleAndMenus(); @@ -107,7 +116,7 @@ class AppletJmolBinding extends jalview.ext.jmol.JalviewJmolBinding public void updateColours(Object source) { AlignmentPanel ap = (AlignmentPanel) source; - colourBySequence(ap.av.isShowSequenceFeatures(), ap); + colourBySequence(ap); } public void showUrl(String url) @@ -124,17 +133,17 @@ class AppletJmolBinding extends jalview.ext.jmol.JalviewJmolBinding public void newJmolPopup(boolean translateLocale, String menuName, boolean asPopup) { - - jmolpopup = new JmolPopup(); - jmolpopup.initialize(viewer, translateLocale, menuName, asPopup); + // jmolpopup = new JmolAwtPopup(); // is this used? + // jmolpopup.jpiInitialize((viewer), menuName); } + @Override public void notifyScriptTermination(String strStatus, int msWalltime) { // do nothing. } - public void selectionChanged(BitSet arg0) + public void selectionChanged(BS arg0) { // TODO Auto-generated method stub @@ -153,12 +162,11 @@ class AppletJmolBinding extends jalview.ext.jmol.JalviewJmolBinding } @Override - protected JmolAppConsoleInterface createJmolConsole(JmolViewer viewer2, + protected JmolAppConsoleInterface createJmolConsole( Container consolePanel, String buttonsToShow) { - // return new org.jmol.console.AppletConsole(viewer2, consolePanel); - JmolAppConsoleInterface appc = new org.jmol.console.AppletConsole() - .getAppConsole(viewer2); + JmolAppConsoleInterface appc = new AppletConsole(); + appc.start(viewer); return appc; } @@ -175,9 +183,16 @@ class AppletJmolBinding extends jalview.ext.jmol.JalviewJmolBinding } @Override - public void resizeInnerPanel(String data) + public Dimension resizeInnerPanel(String data) { // TODO Auto-generated method stub + return null; + } + @Override + public Map getJSpecViewProperty(String arg0) + { + // TODO Auto-generated method stub + return null; } } diff --git a/src/jalview/appletgui/ExtJmol.java b/src/jalview/appletgui/ExtJmol.java index cec77d2..c1035bd 100644 --- a/src/jalview/appletgui/ExtJmol.java +++ b/src/jalview/appletgui/ExtJmol.java @@ -29,12 +29,13 @@ import jalview.ext.jmol.JalviewJmolBinding; import java.awt.Container; import java.util.ArrayList; -import java.util.BitSet; import java.util.List; +import java.util.Map; import java.util.Vector; import org.jmol.api.JmolAppConsoleInterface; -import org.jmol.api.JmolViewer; +import org.jmol.java.BS; +import org.jmol.viewer.Viewer; /** * bind an alignment view to an external Jmol instance. @@ -55,7 +56,7 @@ public class ExtJmol extends JalviewJmolBinding chains, protocol); } - public ExtJmol(JmolViewer viewer, AlignmentPanel alignPanel, + public ExtJmol(Viewer viewer, AlignmentPanel alignPanel, SequenceI[][] seqs) { super(alignPanel.getStructureSelectionManager(), seqs, viewer); @@ -75,6 +76,7 @@ public class ExtJmol extends JalviewJmolBinding showUrl(arg0, "jmol"); } + @Override public FeatureRenderer getFeatureRenderer(AlignmentViewPanel alignment) { AlignmentPanel ap = (AlignmentPanel) alignment; @@ -88,41 +90,48 @@ public class ExtJmol extends JalviewJmolBinding } } + @Override public SequenceRenderer getSequenceRenderer(AlignmentViewPanel alignment) { return ((AlignmentPanel) alignment).getSequenceRenderer(); } + @Override public void notifyScriptTermination(String strStatus, int msWalltime) { // ignore } + @Override public void sendConsoleEcho(String strEcho) { // ignore } + @Override public void sendConsoleMessage(String strStatus) { // ignore } + @Override public void showUrl(String url, String target) { ap.alignFrame.showURL(url, target); } + @Override public void refreshGUI() { // ignore } - public void selectionChanged(BitSet arg0) + public void selectionChanged(BS arg0) { System.out.println(arg0); } + @Override public void refreshPdbEntries() { List pdbe = new ArrayList(); @@ -130,12 +139,12 @@ public class ExtJmol extends JalviewJmolBinding SequenceI[] sq = ap.av.getAlignment().getSequencesArray(); for (int s = 0; s < sq.length; s++) { - Vector pdbids = sq[s].getPDBId(); + Vector pdbids = sq[s].getPDBId(); if (pdbids != null) { for (int pe = 0, peSize = pdbids.size(); pe < peSize; pe++) { - PDBEntry pentry = (PDBEntry) pdbids.elementAt(pe); + PDBEntry pentry = pdbids.elementAt(pe); if (!fileids.contains(pentry.getId())) { pdbe.add(pentry); @@ -166,7 +175,7 @@ public class ExtJmol extends JalviewJmolBinding } @Override - protected JmolAppConsoleInterface createJmolConsole(JmolViewer viewer2, + protected JmolAppConsoleInterface createJmolConsole( Container consolePanel, String buttonsToShow) { // TODO Auto-generated method stub @@ -188,4 +197,11 @@ public class ExtJmol extends JalviewJmolBinding } + @Override + public Map getJSpecViewProperty(String arg0) + { + // TODO Auto-generated method stub + return null; + } + } diff --git a/src/jalview/binding/Alignment.java b/src/jalview/binding/Alignment.java index 0cc2514..5b107b5 100644 --- a/src/jalview/binding/Alignment.java +++ b/src/jalview/binding/Alignment.java @@ -1,27 +1,14 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -32,162 +19,151 @@ 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; +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); } - 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 005adf0..108d3ad 100644 --- a/src/jalview/binding/Annotation.java +++ b/src/jalview/binding/Annotation.java @@ -1,30 +1,15 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ -//- Imported classes and packages -/ -//---------------------------------/ - -import jalview.util.MessageManager; import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; @@ -34,443 +19,414 @@ 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "getAnnotationElement", - Integer.valueOf(index).toString(), - Integer.valueOf((this._annotationElementList.size() - 1)).toString() - })); +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(); } - 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; + + //-----------/ + //- 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); } - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "setAnnotationElement", - Integer.valueOf(index).toString(), - Integer.valueOf((this._annotationElementList.size() - 1)).toString() - })); + + /** + * + * + * @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); } - 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]); + /** + * 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; + } + 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; + } + + /** + * 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); } - } - - /** - * 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 7bd3d43..d133fe0 100644 --- a/src/jalview/binding/AnnotationElement.java +++ b/src/jalview/binding/AnnotationElement.java @@ -1,27 +1,14 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -32,287 +19,273 @@ 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 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 void deletePosition() - { - this._has_position = false; - } + 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 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; + public void validate( + ) + throws org.exolab.castor.xml.ValidationException { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); } - 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 f761ac1..c041723 100644 --- a/src/jalview/binding/Colour.java +++ b/src/jalview/binding/Colour.java @@ -1,27 +1,14 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -32,480 +19,465 @@ 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 ccc0d82..d429df3 100644 --- a/src/jalview/binding/Feature.java +++ b/src/jalview/binding/Feature.java @@ -1,27 +1,14 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -32,286 +19,272 @@ 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 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 void deleteBegin() - { - this._has_begin = false; - } + 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 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; + public void validate( + ) + throws org.exolab.castor.xml.ValidationException { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); } - 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 0ce377c..f3d06be 100644 --- a/src/jalview/binding/FeatureSettings.java +++ b/src/jalview/binding/FeatureSettings.java @@ -1,31 +1,16 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ -import jalview.util.MessageManager; - import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; @@ -34,275 +19,257 @@ 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 -/ - // --------------------------/ - /** - * Field _settingList. - */ - private java.util.Vector _settingList; + //--------------------------/ + //- Class/Member Variables -/ + //--------------------------/ - // ----------------/ - // - Constructors -/ - // ----------------/ + /** + * Field _settingList. + */ + private java.util.Vector _settingList; - public FeatureSettings() - { - super(); - this._settingList = new java.util.Vector(); - } - // -----------/ - // - Methods -/ - // -----------/ + //----------------/ + //- Constructors -/ + //----------------/ - /** - * - * - * @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); - } + public FeatureSettings() { + super(); + this._settingList = new java.util.Vector(); + } - /** - * - * - * @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); - } - /** - * Method enumerateSetting. - * - * @return an Enumeration over all jalview.binding.Setting elements - */ - public java.util.Enumeration enumerateSetting() - { - return this._settingList.elements(); - } + //-----------/ + //- Methods -/ + //-----------/ - /** - * 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "getSetting", - Integer.valueOf(index).toString(), - Integer.valueOf((this._settingList.size() - 1)).toString() - })); + /** + * + * + * @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); } - return (jalview.binding.Setting) _settingList.get(index); - } + /** + * + * + * @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); + } - /** - * 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 enumerateSetting. + * + * @return an Enumeration over all jalview.binding.Setting + * elements + */ + public java.util.Enumeration enumerateSetting( + ) { + return this._settingList.elements(); + } - /** - * Method getSettingCount. - * - * @return the size of this collection - */ - public int getSettingCount() - { - return this._settingList.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.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 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 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); } - 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); - } + /** + * Method getSettingCount. + * + * @return the size of this collection + */ + public int getSettingCount( + ) { + return this._settingList.size(); + } - /** - * - * - * @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 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 removeAllSetting() - { - this._settingList.clear(); - } + public void marshal( + final java.io.Writer out) + throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { + Marshaller.marshal(this, out); + } - /** - * 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 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 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; - } + /** + */ + public void removeAllSetting( + ) { + this._settingList.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.binding.Setting vSetting) - throws java.lang.IndexOutOfBoundsException - { - // check bounds for index - if (index < 0 || index >= this._settingList.size()) - { - throw new IndexOutOfBoundsException(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "setSetting", - Integer.valueOf(index).toString(), - Integer.valueOf((this._settingList.size() - 1)).toString() - })); + /** + * 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; } - this._settingList.set(index, vSetting); - } + /** + * 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; + } - /** - * - * - * @param vSettingArray - */ - public void setSetting(final jalview.binding.Setting[] vSettingArray) - { - // -- copy array - _settingList.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.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); + } - for (int i = 0; i < vSettingArray.length; i++) - { - this._settingList.add(vSettingArray[i]); + /** + * + * + * @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]); + } } - } - /** - * 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 6d398c1..e50ae7c 100644 --- a/src/jalview/binding/Features.java +++ b/src/jalview/binding/Features.java @@ -1,27 +1,14 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -32,106 +19,98 @@ 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 -/ - // ----------------/ - public Features() - { - super(); - } + //----------------/ + //- Constructors -/ + //----------------/ + + 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; + /** + * 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; } - 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 c1f9cd3..862eebd 100644 --- a/src/jalview/binding/JGroup.java +++ b/src/jalview/binding/JGroup.java @@ -1,30 +1,15 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ -//- Imported classes and packages -/ -//---------------------------------/ - -import jalview.util.MessageManager; import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; @@ -34,748 +19,721 @@ 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "getSeq", - Integer.valueOf(index).toString(), - Integer.valueOf((this._seqList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "setSeq", - Integer.valueOf(index).toString(), - Integer.valueOf((this._seqList.size() - 1)).toString() - })); - } - - 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 68d545f..14b1f2f 100644 --- a/src/jalview/binding/JSeq.java +++ b/src/jalview/binding/JSeq.java @@ -1,30 +1,15 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ -//- Imported classes and packages -/ -//---------------------------------/ - -import jalview.util.MessageManager; import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; @@ -34,635 +19,605 @@ 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "getFeatures", - Integer.valueOf(index).toString(), - Integer.valueOf((this._featuresList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "getPdbids", - Integer.valueOf(index).toString(), - Integer.valueOf((this._pdbidsList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "setFeatures", - Integer.valueOf(index).toString(), - Integer.valueOf((this._featuresList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "setPdbids", - Integer.valueOf(index).toString(), - Integer.valueOf((this._pdbidsList.size() - 1)).toString() - })); - } - - 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 cebd813..21f8be9 100644 --- a/src/jalview/binding/JalviewModel.java +++ b/src/jalview/binding/JalviewModel.java @@ -1,27 +1,14 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -32,215 +19,202 @@ 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; +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); } - 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 43fa983..5ebcee6 100644 --- a/src/jalview/binding/JalviewModelSequence.java +++ b/src/jalview/binding/JalviewModelSequence.java @@ -1,30 +1,15 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ -//- Imported classes and packages -/ -//---------------------------------/ - -import jalview.util.MessageManager; import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; @@ -34,961 +19,904 @@ 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "getJGroup", - Integer.valueOf(index).toString(), - Integer.valueOf((this._JGroupList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "getJSeq", - Integer.valueOf(index).toString(), - Integer.valueOf((this._JSeqList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "getJgetTreeSeq", - Integer.valueOf(index).toString(), - Integer.valueOf((this._treeList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "getUserColours", - Integer.valueOf(index).toString(), - Integer.valueOf((this._userColoursList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "getViewport", - Integer.valueOf(index).toString(), - Integer.valueOf((this._viewportList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "setJGroup", - Integer.valueOf(index).toString(), - Integer.valueOf((this._JGroupList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "setJSeq", - Integer.valueOf(index).toString(), - Integer.valueOf((this._JSeqList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "setTree", - Integer.valueOf(index).toString(), - Integer.valueOf((this._treeList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "setUserColours", - Integer.valueOf(index).toString(), - Integer.valueOf((this._userColoursList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "setViewport", - Integer.valueOf(index).toString(), - Integer.valueOf((this._viewportList.size() - 1)).toString() - })); - } - - 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 f368245..9a6465b 100644 --- a/src/jalview/binding/JalviewUserColours.java +++ b/src/jalview/binding/JalviewUserColours.java @@ -1,31 +1,16 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ -import jalview.util.MessageManager; - import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; @@ -34,330 +19,312 @@ 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "getColour", - Integer.valueOf(index).toString(), - Integer.valueOf((this._colourList.size() - 1)).toString() - })); +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(); } - 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; + + //-----------/ + //- 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); } - 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 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 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "setColour", - Integer.valueOf(index).toString(), - Integer.valueOf((this._colourList.size() - 1)).toString() - })); + public int getColourCount( + ) { + return this._colourList.size(); } - 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]); + /** + * 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; + } + + /** + * 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) + "]"); + } + + 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); } - } - - /** - * 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 b2bade5..cac4cf6 100644 --- a/src/jalview/binding/Pdbentry.java +++ b/src/jalview/binding/Pdbentry.java @@ -1,31 +1,16 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ -import jalview.util.MessageManager; - import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; @@ -34,330 +19,308 @@ 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "getPdbentryItem", - Integer.valueOf(index).toString(), - Integer.valueOf((this._items.size() - 1)).toString() - })); +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(); } - 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; + + //-----------/ + //- 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; } - 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 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 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "setPdbentryItem", - Integer.valueOf(index).toString(), - Integer.valueOf((this._items.size() - 1)).toString() - })); + public jalview.binding.PdbentryItem[] getPdbentryItem( + ) { + jalview.binding.PdbentryItem[] array = new jalview.binding.PdbentryItem[0]; + return (jalview.binding.PdbentryItem[]) this._items.toArray(array); } - 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]); + /** + * 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; + } + + /** + * 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) + "]"); + } + + 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); } - } - - /** - * 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 2e8d77d..83bc40a 100644 --- a/src/jalview/binding/PdbentryItem.java +++ b/src/jalview/binding/PdbentryItem.java @@ -1,215 +1,192 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ -package jalview.binding; -import jalview.util.MessageManager; +package jalview.binding; /** * Class PdbentryItem. * * @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(); - } - - // -----------/ - // - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "getProperty", - Integer.valueOf(index).toString(), - Integer.valueOf((this._propertyList.size() - 1)).toString() - })); +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) + "]"); + } + + 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(); } - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "setProperty", - Integer.valueOf(index).toString(), - Integer.valueOf((this._propertyList.size() - 1)).toString() - })); + public void removeAllProperty( + ) { + this._propertyList.clear(); } - 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]); + /** + * 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]); + } } - } } diff --git a/src/jalview/binding/Pdbids.java b/src/jalview/binding/Pdbids.java index a37f249..b4745a2 100644 --- a/src/jalview/binding/Pdbids.java +++ b/src/jalview/binding/Pdbids.java @@ -1,27 +1,14 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -32,106 +19,98 @@ 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 -/ - // ----------------/ - public Pdbids() - { - super(); - } + //----------------/ + //- Constructors -/ + //----------------/ + + 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; + /** + * 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; } - 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 8a3eb8c..f1114f7 100644 --- a/src/jalview/binding/Property.java +++ b/src/jalview/binding/Property.java @@ -1,27 +1,14 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -32,162 +19,151 @@ 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; +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); } - 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 17762a3..9c8cbc2 100644 --- a/src/jalview/binding/Sequence.java +++ b/src/jalview/binding/Sequence.java @@ -1,27 +1,14 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -32,106 +19,98 @@ 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 -/ - // ----------------/ - public Sequence() - { - super(); - } + //----------------/ + //- Constructors -/ + //----------------/ + + 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; + /** + * 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; } - 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 05da739..13a9020 100644 --- a/src/jalview/binding/SequenceSet.java +++ b/src/jalview/binding/SequenceSet.java @@ -1,30 +1,15 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ -//- Imported classes and packages -/ -//---------------------------------/ - -import jalview.util.MessageManager; import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; @@ -34,528 +19,496 @@ 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "getAnnotation", - Integer.valueOf(index).toString(), - Integer.valueOf((this._annotationList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "getSequence", - Integer.valueOf(index).toString(), - Integer.valueOf((this._sequenceList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "setAnnotation", - Integer.valueOf(index).toString(), - Integer.valueOf((this._annotationList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "setSequence", - Integer.valueOf(index).toString(), - Integer.valueOf((this._sequenceList.size() - 1)).toString() - })); - } - - 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 c23a93b..1bb2a62 100644 --- a/src/jalview/binding/SequenceType.java +++ b/src/jalview/binding/SequenceType.java @@ -1,27 +1,14 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -32,188 +19,176 @@ 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; +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); } - 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 bde410f..9cd84b4 100644 --- a/src/jalview/binding/Setting.java +++ b/src/jalview/binding/Setting.java @@ -1,27 +1,14 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -32,244 +19,232 @@ 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 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 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 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 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; + public void validate( + ) + throws org.exolab.castor.xml.ValidationException { + org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); + validator.validate(this); } - 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 59d1319..5f138d0 100644 --- a/src/jalview/binding/Tree.java +++ b/src/jalview/binding/Tree.java @@ -1,27 +1,14 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -32,825 +19,802 @@ 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 18fa2e1..24c97ff 100644 --- a/src/jalview/binding/UserColourScheme.java +++ b/src/jalview/binding/UserColourScheme.java @@ -1,27 +1,14 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -32,107 +19,98 @@ 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 -/ - // ----------------/ - public UserColourScheme() - { - super(); - } + //----------------/ + //- Constructors -/ + //----------------/ + + 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; + /** + * 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; } - 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 96bb810..bdefe05 100644 --- a/src/jalview/binding/UserColours.java +++ b/src/jalview/binding/UserColours.java @@ -1,27 +1,14 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -32,163 +19,151 @@ 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; +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); } - 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 d7f98ce..1c92bd3 100644 --- a/src/jalview/binding/VAMSAS.java +++ b/src/jalview/binding/VAMSAS.java @@ -1,31 +1,16 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ -import jalview.util.MessageManager; - import org.exolab.castor.xml.Marshaller; import org.exolab.castor.xml.Unmarshaller; @@ -34,598 +19,563 @@ 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "getAlignment", - Integer.valueOf(index).toString(), - Integer.valueOf((this._alignmentList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "getSequenceSet", - Integer.valueOf(index).toString(), - Integer.valueOf((this._sequenceSetList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "getTree", - Integer.valueOf(index).toString(), - Integer.valueOf((this._treeList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "setAlignment", - Integer.valueOf(index).toString(), - Integer.valueOf((this._alignmentList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "setSequenceSet", - Integer.valueOf(index).toString(), - Integer.valueOf((this._sequenceSetList.size() - 1)).toString() - })); - } - - 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(MessageManager.formatMessage("exception.index_value_not_in_range", new String[]{ - "setTree", - Integer.valueOf(index).toString(), - Integer.valueOf((this._treeList.size() - 1)).toString() - })); - } - - 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 c57556a..5fda35e 100644 --- a/src/jalview/binding/VamsasModel.java +++ b/src/jalview/binding/VamsasModel.java @@ -1,27 +1,14 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -32,105 +19,98 @@ 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 -/ - // ----------------/ - public VamsasModel() - { - super(); - } + //----------------/ + //- Constructors -/ + //----------------/ + + 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; + /** + * 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; } - 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 af2f286..643c323 100644 --- a/src/jalview/binding/Viewport.java +++ b/src/jalview/binding/Viewport.java @@ -1,27 +1,14 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. + * This class was automatically generated with + * Castor 1.1, using an XML + * Schema. + * $Id$ */ + package jalview.binding; -//---------------------------------/ -//- Imported classes and packages -/ + //---------------------------------/ + //- Imported classes and packages -/ //---------------------------------/ import org.exolab.castor.xml.Marshaller; @@ -32,1445 +19,1414 @@ 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 _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 -/ - // -----------/ +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 */ - public void deleteConsThreshold() - { - this._has_consThreshold = false; - } + private boolean _has_width; - /** + /** + * Field _height. */ - public void deleteConservationSelected() - { - this._has_conservationSelected = false; - } + private int _height; - /** + /** + * keeps track of state for field: _height */ - public void deleteFontSize() - { - this._has_fontSize = false; - } + private boolean _has_height; - /** + /** + * Field _startRes. */ - public void deleteFontStyle() - { - this._has_fontStyle = false; - } + private int _startRes; - /** + /** + * keeps track of state for field: _startRes */ - public void deleteHeight() - { - this._has_height = false; - } + private boolean _has_startRes; - /** + /** + * Field _startSeq. */ - public void deletePidSelected() - { - this._has_pidSelected = false; - } + private int _startSeq; - /** + /** + * keeps track of state for field: _startSeq */ - public void deletePidThreshold() - { - this._has_pidThreshold = false; - } + private boolean _has_startSeq; - /** + /** + * Field _fontName. */ - public void deleteRenderGaps() - { - this._has_renderGaps = false; - } + private java.lang.String _fontName; - /** + /** + * Field _fontSize. */ - public void deleteShowAnnotation() - { - this._has_showAnnotation = false; - } + private int _fontSize; - /** + /** + * keeps track of state for field: _fontSize */ - public void deleteShowBoxes() - { - this._has_showBoxes = false; - } + private boolean _has_fontSize; - /** + /** + * Field _fontStyle. */ - public void deleteShowColourText() - { - this._has_showColourText = false; - } + private int _fontStyle; - /** + /** + * keeps track of state for field: _fontStyle */ - public void deleteShowConservation() - { - this._has_showConservation = false; - } + private boolean _has_fontStyle; - /** + + //----------------/ + //- Constructors -/ + //----------------/ + + public Viewport() { + super(); + } + + + //-----------/ + //- Methods -/ + //-----------/ + + /** + */ + public void deleteConsThreshold( + ) { + this._has_consThreshold= false; + } + + /** */ - public void deleteShowFullId() - { - this._has_showFullId = false; - } + public void deleteConservationSelected( + ) { + this._has_conservationSelected= false; + } - /** + /** */ - public void deleteShowIdentity() - { - this._has_showIdentity = 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 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 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/ext/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index cdd137b..c7496df 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -20,6 +20,21 @@ */ package jalview.ext.jmol; +import jalview.api.AlignmentViewPanel; +import jalview.api.FeatureRenderer; +import jalview.api.SequenceRenderer; +import jalview.datamodel.AlignmentI; +import jalview.datamodel.ColumnSelection; +import jalview.datamodel.PDBEntry; +import jalview.datamodel.SequenceI; +import jalview.io.AppletFormatAdapter; +import jalview.schemes.ColourSchemeI; +import jalview.schemes.ResidueProperties; +import jalview.structure.AtomSpec; +import jalview.structure.StructureMappingcommandSet; +import jalview.structure.StructureSelectionManager; +import jalview.structures.models.AAStructureBindingModel; + import java.awt.Color; import java.awt.Container; import java.awt.event.ComponentEvent; @@ -32,28 +47,17 @@ import java.util.List; import java.util.Map; import java.util.Vector; +import javajs.awt.Dimension; + import org.jmol.adapter.smarter.SmarterJmolAdapter; import org.jmol.api.JmolAppConsoleInterface; import org.jmol.api.JmolSelectionListener; import org.jmol.api.JmolStatusListener; import org.jmol.api.JmolViewer; -import org.jmol.constant.EnumCallback; -import org.jmol.popup.JmolPopup; - -import jalview.api.AlignmentViewPanel; -import jalview.api.FeatureRenderer; -import jalview.api.SequenceRenderer; -import jalview.datamodel.AlignmentI; -import jalview.datamodel.ColumnSelection; -import jalview.datamodel.PDBEntry; -import jalview.datamodel.SequenceI; -import jalview.io.AppletFormatAdapter; -import jalview.schemes.ColourSchemeI; -import jalview.schemes.ResidueProperties; -import jalview.structure.AtomSpec; -import jalview.structure.StructureMappingcommandSet; -import jalview.structure.StructureSelectionManager; -import jalview.structures.models.AAStructureBindingModel; +import org.jmol.c.CBK; +import org.jmol.script.T; +import org.jmol.viewer.JC; +import org.jmol.viewer.Viewer; public abstract class JalviewJmolBinding extends AAStructureBindingModel implements JmolStatusListener, JmolSelectionListener, @@ -72,13 +76,11 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel */ private boolean associateNewStructs = false; - Vector atomsPicked = new Vector(); - - public Vector chainNames; + Vector atomsPicked = new Vector(); - Hashtable chainFile; + public Vector chainNames; - StringBuffer eval = new StringBuffer(); + Hashtable chainFile; public String fileLoadingError; @@ -88,7 +90,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel */ int frameNo = 0; - protected JmolPopup jmolpopup; + // protected JmolGenericPopup jmolpopup; // not used - remove? String lastCommand; @@ -103,7 +105,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel StringBuffer resetLastRes = new StringBuffer(); - public JmolViewer viewer; + public Viewer viewer; public JalviewJmolBinding(StructureSelectionManager ssm, PDBEntry[] pdbentry, SequenceI[][] sequenceIs, String[][] chains, @@ -120,7 +122,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } public JalviewJmolBinding(StructureSelectionManager ssm, - SequenceI[][] seqs, JmolViewer theViewer) + SequenceI[][] seqs, Viewer theViewer) { super(ssm, seqs); @@ -137,7 +139,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel */ public String getViewerTitle() { - return getViewerTitle("JMol", true); + return getViewerTitle("Jmol", true); } /** @@ -147,15 +149,13 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel * @param chainList * list of chains to make visible */ - public void centerViewer(Vector chainList) + public void centerViewer(Vector chainList) { - StringBuffer cmd = new StringBuffer(); - String lbl; + StringBuilder cmd = new StringBuilder(128); int mlength, p; - for (int i = 0, iSize = chainList.size(); i < iSize; i++) + for (String lbl : chainList) { mlength = 0; - lbl = (String) chainList.elementAt(i); do { p = mlength; @@ -163,7 +163,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } while (p < mlength && mlength < (lbl.length() - 2)); // TODO: lookup each pdb id and recover proper model number for it. cmd.append(":" + lbl.substring(mlength + 1) + " /" - + (1 + getModelNum((String) chainFile.get(lbl))) + " or "); + + (1 + getModelNum(chainFile.get(lbl))) + " or "); } if (cmd.length() > 0) { @@ -174,7 +174,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel public void closeViewer() { - viewer.setModeMouse(org.jmol.viewer.JmolConstants.MOUSE_NONE); + viewer.acm.setModeMouse(JC.MOUSE_NONE); // remove listeners for all structures in viewer getSsm().removeStructureViewerListener(this, this.getPdbFile()); // and shut down jmol @@ -489,9 +489,10 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel * using the getFeatureRenderer() and getSequenceRenderer() renderers but only * if colourBySequence is enabled. */ - public void colourBySequence(boolean showFeatures, - jalview.api.AlignmentViewPanel alignmentv) + public void colourBySequence(AlignmentViewPanel alignmentv) { + boolean showFeatures = alignmentv.getAlignViewport() + .isShowSequenceFeatures(); if (!colourBySequence || !isLoadingFinished()) { return; @@ -586,7 +587,10 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel return null; } // TODO: verify atomIndex is selecting correct model. - return new Color(viewer.getAtomArgb(atomIndex)); + // return new Color(viewer.getAtomArgb(atomIndex)); Jmol 12.2.4 + int colour = viewer.ms.at[atomIndex] + .atomPropertyInt(T.color); + return new Color(colour); } /** @@ -642,26 +646,33 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } if (modelFileNames == null) { - - String mset[] = new String[viewer.getModelCount()]; + String mset[] = new String[viewer.ms.mc]; _modelFileNameMap = new int[mset.length]; - int j = 1; - String m = viewer.getModelFileName(0); + String m = viewer.ms.getModelFileName(0); if (m != null) { + mset[0] = m; try { mset[0] = new File(m).getAbsolutePath(); } catch (AccessControlException x) { - // usually not allowed to do this in applet, so keep raw handle + // usually not allowed to do this in applet + System.err + .println("jmolBinding: Using local file string from Jmol: " + + m); + } + if (mset[0].indexOf("/file:") != -1) + { + // applet path with docroot - discard as format won't match pdbfile mset[0] = m; - // System.err.println("jmolBinding: Using local file string from Jmol: "+m); } } + int j = 1; for (int i = 1; i < mset.length; i++) { - m = viewer.getModelFileName(i); + m = viewer.ms.getModelFileName(i); + mset[j] = m; if (m != null) { try @@ -670,7 +681,6 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } catch (AccessControlException x) { // usually not allowed to do this in applet, so keep raw handle - mset[j] = m; // System.err.println("jmolBinding: Using local file string from Jmol: "+m); } } @@ -714,7 +724,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel public void handlePopupMenu(int x, int y) { - jmolpopup.show(x, y); + // jmolpopup.show(x, y); + // jmolpopup.jpiShow(x, y); } /** @@ -744,12 +755,10 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel // look up file model number for this pdbfile int mdlNum = 0; - String fn; // may need to adjust for URLencoding here - we don't worry about that yet. while (mdlNum < modelFileNames.length && !pdbfile.equals(modelFileNames[mdlNum])) { - // System.out.println("nomatch:"+pdbfile+"\nmodelfn:"+fn); mdlNum++; } if (mdlNum == modelFileNames.length) @@ -765,31 +774,31 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel viewer.evalStringQuiet(resetLastRes.toString()); } - eval.setLength(0); - eval.append("select " + pdbResNum); // +modelNum + StringBuilder cmd = new StringBuilder(64); + cmd.append("select " + pdbResNum); // +modelNum resetLastRes.setLength(0); resetLastRes.append("select " + pdbResNum); // +modelNum - eval.append(":"); + cmd.append(":"); resetLastRes.append(":"); if (!chain.equals(" ")) { - eval.append(chain); + cmd.append(chain); resetLastRes.append(chain); } { - eval.append(" /" + (mdlNum + 1)); + cmd.append(" /" + (mdlNum + 1)); resetLastRes.append("/" + (mdlNum + 1)); } - eval.append(";wireframe 100;" + eval.toString() + " and not hetero;"); + cmd.append(";wireframe 100;" + cmd.toString() + " and not hetero;"); resetLastRes.append(";wireframe 0;" + resetLastRes.toString() + " and not hetero; spacefill 0;"); - eval.append("spacefill 200;select none"); + cmd.append("spacefill 200;select none"); - viewer.evalStringQuiet(eval.toString()); + viewer.evalStringQuiet(cmd.toString()); jmolHistory(true); } @@ -877,7 +886,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel pdbfilename = modelFileNames[_mp]; if (pdbfilename == null) { - pdbfilename = new File(viewer.getModelFileName(mnumber)) + pdbfilename = new File( + viewer.ms.getModelFileName(mnumber)) .getAbsolutePath(); } @@ -965,7 +975,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } @Override - public void notifyCallback(EnumCallback type, Object[] data) + public void notifyCallback(CBK type, Object[] data) { try { @@ -1019,7 +1029,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } @Override - public boolean notifyEnabled(EnumCallback callbackPick) + public boolean notifyEnabled(CBK callbackPick) { switch (callbackPick) { @@ -1032,13 +1042,9 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel case HOVER: case ERROR: return true; - case RESIZE: - case SYNC: - case CLICK: - case ANIMFRAME: - case MINIMIZATION: + default: + return false; } - return false; } // incremented every time a load notification is successfully handled - @@ -1069,8 +1075,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel fileLoadingError = null; String[] oldmodels = modelFileNames; modelFileNames = null; - chainNames = new Vector(); - chainFile = new Hashtable(); + chainNames = new Vector(); + chainFile = new Hashtable(); boolean notifyLoaded = false; String[] modelfilenames = getPdbFile(); // first check if we've lost any structures @@ -1114,7 +1120,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel String fileName = modelfilenames[modelnum]; boolean foundEntry = false; MCview.PDBfile pdb = null; - String pdbfile = null, pdbfhash = null; + String pdbfile = null; // model was probably loaded inline - so check the pdb file hashcode if (loadedInline) { @@ -1123,7 +1129,6 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel // 'best guess' pdbfile = viewer.getData("" + (1 + _modelFileNameMap[modelnum]) + ".0", "PDB"); - pdbfhash = "" + pdbfile.hashCode(); } // search pdbentries and sequences to find correct pdbentry for this // model @@ -1144,9 +1149,9 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } else { - File fl; - if (matches = (fl = new File(getPdbEntry(pe).getFile())) - .equals(new File(fileName))) + File fl = new File(getPdbEntry(pe).getFile()); + matches = fl.equals(new File(fileName)); + if (matches) { foundEntry = true; // TODO: Jmol can in principle retrieve from CLASSLOADER but @@ -1204,11 +1209,11 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } // FILE LOADED OK // so finally, update the jmol bits and pieces - if (jmolpopup != null) - { - // potential for deadlock here: - // jmolpopup.updateComputedMenus(); - } + // if (jmolpopup != null) + // { + // // potential for deadlock here: + // // jmolpopup.updateComputedMenus(); + // } if (!isLoadingFromArchive()) { viewer.evalStringQuiet("model 0; select backbone;restrict;cartoon;wireframe off;spacefill off"); @@ -1360,12 +1365,14 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel { commandOptions = ""; } - viewer = JmolViewer.allocateViewer(renderPanel, + viewer = (Viewer) JmolViewer.allocateViewer(renderPanel, (jmolfileio ? new SmarterJmolAdapter() : null), htmlName + ((Object) this).toString(), documentBase, codeBase, commandOptions, this); - console = createJmolConsole(viewer, consolePanel, buttonsToShow); + viewer.setJmolStatusListener(this); // extends JmolCallbackListener + + console = createJmolConsole(consolePanel, buttonsToShow); if (consolePanel != null) { consolePanel.addComponentListener(this); @@ -1375,7 +1382,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } protected abstract JmolAppConsoleInterface createJmolConsole( - JmolViewer viewer2, Container consolePanel, String buttonsToShow); + Container consolePanel, String buttonsToShow); protected org.jmol.api.JmolAppConsoleInterface console = null; @@ -1388,10 +1395,10 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } @Override - public void resizeInnerPanel(String data) + public Dimension resizeInnerPanel(String data) { // Jalview doesn't honour resize panel requests - + return null; } public boolean isFinishedInit() @@ -1458,3 +1465,4 @@ 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 3df8957..3b6f0c2 100644 --- a/src/jalview/ext/jmol/PDBFileWithJmol.java +++ b/src/jalview/ext/jmol/PDBFileWithJmol.java @@ -34,13 +34,15 @@ import java.io.IOException; import java.util.Hashtable; import java.util.Map; +import javajs.awt.Dimension; + import org.jmol.api.JmolStatusListener; import org.jmol.api.JmolViewer; -import org.jmol.constant.EnumCallback; +import org.jmol.c.CBK; import org.jmol.modelset.Group; import org.jmol.modelset.Model; import org.jmol.modelset.ModelSet; -import org.jmol.modelset.Polymer; +import org.jmol.modelsetbio.BioModel; import org.jmol.modelsetbio.BioPolymer; import org.jmol.viewer.Viewer; import org.openscience.jmol.app.JmolApp; @@ -82,19 +84,18 @@ public class PDBFileWithJmol extends AlignFile implements private Viewer getJmolData() { if (viewer == null) - { // note that -o -n -x are all implied + { // note that -o -n -x are all implied // TODO check for Jmol 14.2 jmolApp = new JmolApp(); jmolApp.isDataOnly = true; jmolApp.haveConsole = false; jmolApp.haveDisplay = false; - jmolApp.exitUponCompletion = true; try { viewer = (Viewer) JmolViewer.allocateViewer(null, null, null, null, - null, jmolApp.commandOptions, this); + null, "-x -o -n", this); viewer.setScreenDimension(jmolApp.startupWidth, jmolApp.startupHeight); - jmolApp.startViewer(viewer, null); + jmolApp.startViewer(viewer, null, false); } catch (ClassCastException x) { throw new Error(MessageManager.formatMessage("error.jmol_version_not_compatible_with_jalview_version", new String[]{JmolViewer.getJmolVersion()}), @@ -129,136 +130,147 @@ public class PDBFileWithJmol extends AlignFile implements Viewer jmd = getJmolData(); jmd.openReader(getDataName(), getDataName(), getReader()); waitForScript(jmd); - if (jmd.getModelCount() > 0) + + if (jmd.ms.mc > 0) { - ModelSet ms = jmd.getModelSet(); - String structs = ms.calculateStructures(null, true, false, true); + ModelSet ms = jmd.ms; + // Jmol 14.2 added third argument doReport = false + ms.calculateStructures(null, true, false, false, true); // System.out.println("Structs\n"+structs); - for (Model model : ms.getModels()) + Group group = null; + int modelIndex = -1; + for (Model model : ms.am) { - for (int _bp = 0, _bpc = model.getBioPolymerCount(); _bp < _bpc; _bp++) + modelIndex++; + for (BioPolymer bp : ((BioModel) model).bioPolymers) { - Polymer bp = model.getBioPolymer(_bp); - if (bp instanceof BioPolymer) + int lastChainId = 0; // int value of character e.g. 65 for A + String lastChainIdAlpha = ""; + + int[] groups = bp.getLeadAtomIndices(); + char seq[] = new char[groups.length], secstr[] = new char[groups.length], secstrcode[] = new char[groups.length]; + int groupc = 0, len = 0, firstrnum = 1, lastrnum = 0; + + do { - BioPolymer biopoly = (BioPolymer) bp; - char _lastChainId = 0; - int[] groups = biopoly.getLeadAtomIndices(); - Group[] bpgrp = biopoly.getGroups(); - char seq[] = new char[groups.length], secstr[] = new char[groups.length], secstrcode[] = new char[groups.length]; - int groupc = 0, len = 0, firstrnum = 1, lastrnum = 0; - do + if (groupc >= groups.length + || ms.at[groups[groupc]].group.chain.chainID != lastChainId) { - if (groupc >= groups.length - || ms.atoms[groups[groupc]].getChainID() != _lastChainId) + /* + * on change of chain (or at end), construct the sequence and + * secondary structure annotation for the last chain + */ + if (len > 0) { - if (len > 0) + boolean isNa = bp.isNucleic(); + // normalise sequence from Jmol to jalview + int[] cinds = isNa ? ResidueProperties.nucleotideIndex + : ResidueProperties.aaIndex; + int nonGap = isNa ? ResidueProperties.maxNucleotideIndex + : ResidueProperties.maxProteinIndex; + char ngc = 'X'; + char newseq[] = new char[len]; + Annotation asecstr[] = new Annotation[len + firstrnum - 1]; + for (int p = 0; p < len; p++) { - boolean isNa = (biopoly.isDna() || biopoly.isRna()); - // normalise sequence from Jmol to jalview - int[] cinds = isNa ? ResidueProperties.nucleotideIndex : ResidueProperties.aaIndex; - int nonGap = isNa ? ResidueProperties.maxNucleotideIndex - : ResidueProperties.maxProteinIndex; - char ngc = 'X'; - char newseq[] = new char[len]; - Annotation asecstr[] = new Annotation[len+firstrnum-1]; - for (int p = 0; p < len; p++) + newseq[p] = cinds[seq[p]] == nonGap ? ngc : seq[p]; + if (secstr[p] >= 'A' && secstr[p] <= 'z') { - newseq[p] = cinds[seq[p]] == nonGap ? ngc : seq[p]; - if (secstr[p] >= 'A' && secstr[p] <= 'z') - { - asecstr[p] = new Annotation("" + secstr[p], null, - secstrcode[p], Float.NaN); - } + asecstr[p] = new Annotation("" + secstr[p], null, + secstrcode[p], Float.NaN); } - SequenceI sq = new Sequence("" + getDataName() + "|" - + model.getModelTitle() + "|" + _lastChainId, - newseq, firstrnum, lastrnum); - PDBEntry pdbe = new PDBEntry(); - pdbe.setFile(getDataName()); - pdbe.setId(getDataName()); - pdbe.setProperty(new Hashtable()); - // pdbe.getProperty().put("CHAIN", "" + _lastChainId); - pdbe.setChainCode(String.valueOf(_lastChainId)); - sq.addPDBId(pdbe); - // JAL-1533 - // Need to put the number of models for this polymer somewhere for Chimera/others to grab - // pdbe.getProperty().put("PDBMODELS", biopoly.) - seqs.add(sq); - if (!isNa) + } + String modelTitle = (String) ms + .getInfo(modelIndex, "title"); + SequenceI sq = new Sequence("" + getDataName() + "|" + + modelTitle + "|" + lastChainIdAlpha, newseq, + firstrnum, lastrnum); + PDBEntry pdbe = new PDBEntry(); + pdbe.setFile(getDataName()); + pdbe.setId(getDataName()); + pdbe.setProperty(new Hashtable()); + // pdbe.getProperty().put("CHAIN", "" + _lastChainId); + pdbe.setChainCode(lastChainIdAlpha); + sq.addPDBId(pdbe); + // JAL-1533 + // Need to put the number of models for this polymer somewhere + // for Chimera/others to grab + // pdbe.getProperty().put("PDBMODELS", biopoly.) + seqs.add(sq); + if (!isNa) + { + String mt = modelTitle == null ? getDataName() + : modelTitle; + if (lastChainId >= ' ') { - String mt = model.getModelTitle() == null ? getDataName() - : model.getModelTitle(); - if (_lastChainId >= ' ') - { - mt += _lastChainId; - } - AlignmentAnnotation ann = new AlignmentAnnotation( - "Secondary Structure", - "Secondary Structure for " + mt, asecstr); - ann.belowAlignment=true; - ann.visible=true; - ann.autoCalculated=false; - ann.setCalcId(getClass().getName()); - sq.addAlignmentAnnotation(ann); - ann.adjustForAlignment(); - ann.validateRangeAndDisplay(); - annotations.add(ann); + mt += lastChainIdAlpha; } + AlignmentAnnotation ann = new AlignmentAnnotation( + "Secondary Structure", "Secondary Structure for " + + mt, asecstr); + ann.belowAlignment = true; + ann.visible = true; + ann.autoCalculated = false; + ann.setCalcId(getClass().getName()); + sq.addAlignmentAnnotation(ann); + ann.adjustForAlignment(); + ann.validateRangeAndDisplay(); + annotations.add(ann); } - len = 0; - firstrnum = 1; - lastrnum = 0; } - if (groupc < groups.length) + len = 0; + firstrnum = 1; + lastrnum = 0; + } + if (groupc < groups.length) + { + group = ms.at[groups[groupc]].group; + if (len == 0) + { + firstrnum = group.getResno(); + lastChainId = group.chain.chainID; + lastChainIdAlpha = group.chain.getIDStr(); + } + else { - if (len == 0) + lastrnum = group.getResno(); + } + seq[len] = group.getGroup1(); + switch (group.getProteinStructureSubType()) + { + case HELIX310: + if (secstr[len] == 0) { - firstrnum = bpgrp[groupc].getResno(); - _lastChainId = bpgrp[groupc].getChainID(); + secstr[len] = '3'; } - else + case HELIXALPHA: + if (secstr[len] == 0) { - lastrnum = bpgrp[groupc].getResno(); + secstr[len] = 'H'; } - seq[len] = bpgrp[groupc].getGroup1(); - switch (bpgrp[groupc].getProteinStructureSubType()) + case HELIXPI: + if (secstr[len] == 0) { - case HELIX_310: - if (secstr[len] == 0) - { - secstr[len] = '3'; - } - case HELIX_ALPHA: - if (secstr[len] == 0) - { - secstr[len] = 'H'; - } - case HELIX_PI: - if (secstr[len] == 0) - { - secstr[len] = 'P'; - } - case HELIX: - if (secstr[len] == 0) - { - secstr[len] = 'H'; - } - secstrcode[len] = 'H'; - break; - case SHEET: - secstr[len] = 'E'; - secstrcode[len] = 'E'; - break; - default: - secstr[len] = 0; - secstrcode[len] = 0; + secstr[len] = 'P'; + } + case HELIX: + if (secstr[len] == 0) + { + secstr[len] = 'H'; } - len++; + secstrcode[len] = 'H'; + break; + case SHEET: + secstr[len] = 'E'; + secstrcode[len] = 'E'; + break; + default: + secstr[len] = 0; + secstrcode[len] = 0; } - } while (groupc++ < groups.length); - - } + len++; + } + } while (groupc++ < groups.length); } } @@ -305,7 +317,7 @@ public class PDBFileWithJmol extends AlignFile implements * System.err.println("Squashed Jmol callback handler error:"); * e.printStackTrace(); } } */ - public void notifyCallback(EnumCallback type, Object[] data) + public void notifyCallback(CBK type, Object[] data) { String strInfo = (data == null || data[1] == null ? null : data[1] .toString()); @@ -343,13 +355,6 @@ public class PDBFileWithJmol extends AlignFile implements } } - private void notifyFileLoaded(String string, String string2, - String string3, String string4, int intValue) - { - // TODO Auto-generated method stub - - } - String lastConsoleEcho = ""; private void sendConsoleEcho(String string) @@ -378,7 +383,7 @@ public class PDBFileWithJmol extends AlignFile implements } @Override - public boolean notifyEnabled(EnumCallback callbackPick) + public boolean notifyEnabled(CBK callbackPick) { switch (callbackPick) { @@ -388,16 +393,9 @@ public class PDBFileWithJmol extends AlignFile implements case LOADSTRUCT: case ERROR: return true; - case MEASURE: - case PICK: - case HOVER: - case RESIZE: - case SYNC: - case CLICK: - case ANIMFRAME: - case MINIMIZATION: + default: + return false; } - return false; } @Override @@ -444,10 +442,15 @@ public class PDBFileWithJmol extends AlignFile implements } @Override - public void resizeInnerPanel(String data) + public Dimension resizeInnerPanel(String data) { - // TODO Auto-generated method stub + return null; + } + @Override + public Map getJSpecViewProperty(String arg0) + { + return null; } } diff --git a/src/jalview/gui/AppJmol.java b/src/jalview/gui/AppJmol.java index c2a7299..a16ea68 100644 --- a/src/jalview/gui/AppJmol.java +++ b/src/jalview/gui/AppJmol.java @@ -20,6 +20,29 @@ */ package jalview.gui; +import jalview.bin.Cache; +import jalview.datamodel.Alignment; +import jalview.datamodel.AlignmentI; +import jalview.datamodel.ColumnSelection; +import jalview.datamodel.PDBEntry; +import jalview.datamodel.SequenceI; +import jalview.gui.StructureViewer.ViewerType; +import jalview.io.AppletFormatAdapter; +import jalview.io.JalviewFileChooser; +import jalview.io.JalviewFileView; +import jalview.schemes.BuriedColourScheme; +import jalview.schemes.ColourSchemeI; +import jalview.schemes.HelixColourScheme; +import jalview.schemes.HydrophobicColourScheme; +import jalview.schemes.PurinePyrimidineColourScheme; +import jalview.schemes.StrandColourScheme; +import jalview.schemes.TaylorColourScheme; +import jalview.schemes.TurnColourScheme; +import jalview.schemes.ZappoColourScheme; +import jalview.structures.models.AAStructureBindingModel; +import jalview.util.MessageManager; +import jalview.util.Platform; + import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; @@ -34,8 +57,8 @@ import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; import java.io.FileReader; +import java.io.IOException; import java.io.PrintWriter; -import java.util.Enumeration; import java.util.Vector; import javax.swing.JCheckBoxMenuItem; @@ -51,29 +74,6 @@ import javax.swing.event.InternalFrameEvent; import javax.swing.event.MenuEvent; import javax.swing.event.MenuListener; -import jalview.bin.Cache; -import jalview.datamodel.Alignment; -import jalview.datamodel.AlignmentI; -import jalview.datamodel.ColumnSelection; -import jalview.datamodel.PDBEntry; -import jalview.datamodel.SequenceI; -import jalview.gui.StructureViewer.ViewerType; -import jalview.io.AppletFormatAdapter; -import jalview.io.JalviewFileChooser; -import jalview.io.JalviewFileView; -import jalview.schemes.BuriedColourScheme; -import jalview.schemes.ColourSchemeI; -import jalview.schemes.HelixColourScheme; -import jalview.schemes.HydrophobicColourScheme; -import jalview.schemes.PurinePyrimidineColourScheme; -import jalview.schemes.StrandColourScheme; -import jalview.schemes.TaylorColourScheme; -import jalview.schemes.TurnColourScheme; -import jalview.schemes.ZappoColourScheme; -import jalview.structures.models.AAStructureBindingModel; -import jalview.util.MessageManager; -import jalview.util.Platform; - public class AppJmol extends StructureViewerBase { AppJmolBinding jmb; @@ -84,41 +84,8 @@ public class AppJmol extends StructureViewerBase RenderPanel renderPanel; - Vector atomsPicked = new Vector(); - private boolean addingStructures = false; - /** - * - * @param file - * @param id - * @param seq - * @param ap - * @param loadStatus - * @param bounds - * @deprecated defaults to AppJmol(String[] files, ... , viewid); - */ - @Deprecated - public AppJmol(String file, String id, SequenceI[] seq, - AlignmentPanel ap, String loadStatus, Rectangle bounds) - { - this(file, id, seq, ap, loadStatus, bounds, null); - } - - /** - * @deprecated - */ - @Deprecated - public AppJmol(String file, String id, SequenceI[] seq, - AlignmentPanel ap, String loadStatus, Rectangle bounds, - String viewid) - { - this(new String[] - { file }, new String[] - { id }, new SequenceI[][] - { seq }, ap, true, true, false, loadStatus, bounds, viewid); - } - ViewSelectionMenu seqColourBy; /** @@ -185,6 +152,7 @@ public class AppJmol extends StructureViewerBase this.addInternalFrameListener(new InternalFrameAdapter() { + @Override public void internalFrameClosing(InternalFrameEvent internalFrameEvent) { closeViewer(false); @@ -345,36 +313,30 @@ public class AppJmol extends StructureViewerBase return; } } - // ///////////////////////////////// - // Check if there are other Jmol views involving this alignment - // and prompt user about adding this molecule to one of them - Vector existingViews = getJmolsFor(ap); - if (existingViews.size() > 0) + + /* + * Check if there are other Jmol views involving this alignment and prompt + * user about adding this molecule to one of them + */ + for (AppJmol topJmol : getJmolsFor(ap)) { - Enumeration jm = existingViews.elements(); - while (jm.hasMoreElements()) + // TODO: highlight topJmol in view somehow + int option = JOptionPane.showInternalConfirmDialog(Desktop.desktop, + MessageManager.formatMessage("label.add_pdbentry_to_view", + new String[] + { pdbentry.getId(), topJmol.getTitle() }), + MessageManager + .getString("label.align_to_existing_structure_view"), + JOptionPane.YES_NO_CANCEL_OPTION); + if (option == JOptionPane.CANCEL_OPTION) { - AppJmol topJmol = (AppJmol) jm.nextElement(); - // TODO: highlight topJmol in view somehow - int option = JOptionPane - .showInternalConfirmDialog( - Desktop.desktop, - MessageManager.formatMessage( - "label.add_pdbentry_to_view", new String[] - { pdbentry.getId(), topJmol.getTitle() }), - MessageManager - .getString("label.align_to_existing_structure_view"), - JOptionPane.YES_NO_CANCEL_OPTION); - if (option == JOptionPane.CANCEL_OPTION) - { - return; - } - if (option == JOptionPane.YES_OPTION) - { - topJmol.useAlignmentPanelForSuperposition(ap); - topJmol.addStructure(pdbentry, seq, chains, true, ap.alignFrame); - return; - } + return; + } + if (option == JOptionPane.YES_OPTION) + { + topJmol.useAlignmentPanelForSuperposition(ap); + topJmol.addStructure(pdbentry, seq, chains, true, ap.alignFrame); + return; } } // ///////////////////////////////// @@ -407,6 +369,7 @@ public class AppJmol extends StructureViewerBase } this.addInternalFrameListener(new InternalFrameAdapter() { + @Override public void internalFrameClosing(InternalFrameEvent internalFrameEvent) { closeViewer(false); @@ -489,18 +452,18 @@ public class AppJmol extends StructureViewerBase return; } - private Vector getJmolsFor(AlignmentPanel apanel) + private Vector getJmolsFor(AlignmentPanel apanel) { - Vector result = new Vector(); + Vector result = new Vector(); JInternalFrame[] frames = Desktop.instance.getAllFrames(); for (JInternalFrame frame : frames) { if (frame instanceof AppJmol) { - if (((StructureViewerBase) frame).isLinkedWith(apanel)) + if (((AppJmol) frame).isLinkedWith(apanel)) { - result.addElement(frame); + result.addElement((AppJmol) frame); } } } @@ -524,10 +487,10 @@ public class AppJmol extends StructureViewerBase scriptWindow = new JPanel(bl); scriptWindow.setVisible(false); } - ; + jmb.allocateViewer(renderPanel, true, "", null, null, "", scriptWindow, null); - jmb.newJmolPopup(true, "Jmol", true); + // jmb.newJmolPopup("Jmol"); if (command == null) { command = ""; @@ -536,7 +499,7 @@ public class AppJmol extends StructureViewerBase jmb.setFinishedInit(true); } - void setChainMenuItems(Vector chains) + void setChainMenuItems(Vector chains) { chainMenu.removeAll(); if (chains == null) @@ -564,9 +527,9 @@ public class AppJmol extends StructureViewerBase chainMenu.add(menuItem); - for (int c = 0; c < chains.size(); c++) + for (String chain : chains) { - menuItem = new JCheckBoxMenuItem(chains.elementAt(c).toString(), true); + menuItem = new JCheckBoxMenuItem(chain, true); menuItem.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent evt) @@ -588,9 +551,7 @@ public class AppJmol extends StructureViewerBase void centerViewer() { - Vector toshow = new Vector(); - String lbl; - int mlength, p, mnum; + Vector toshow = new Vector(); for (int i = 0; i < chainMenu.getItemCount(); i++) { if (chainMenu.getItem(i) instanceof JCheckBoxMenuItem) @@ -763,7 +724,7 @@ public class AppJmol extends StructureViewerBase // need to wait around until script has finished while (addingStructures ? lastnotify >= jmb.getLoadNotifiesHandled() - : (jmb.isFinishedInit() && jmb.getPdbFile() != null && jmb + : (!jmb.isFinishedInit() && jmb.getPdbFile() != null && jmb .getPdbFile().length != jmb.getPdbCount())) { try @@ -774,6 +735,7 @@ public class AppJmol extends StructureViewerBase { } } + // refresh the sequence colours for the new structure(s) for (AlignmentPanel ap : _colourwith) { @@ -813,10 +775,11 @@ public class AppJmol extends StructureViewerBase if (value == JalviewFileChooser.APPROVE_OPTION) { + BufferedReader in = null; try { // TODO: cope with multiple PDB files in view - BufferedReader in = new BufferedReader(new FileReader( + in = new BufferedReader(new FileReader( jmb.getPdbFile()[0])); File outFile = chooser.getSelectedFile(); @@ -833,6 +796,18 @@ public class AppJmol extends StructureViewerBase } catch (Exception ex) { ex.printStackTrace(); + } finally + { + if (in != null) + { + try + { + in.close(); + } catch (IOException e) + { + // ignore + } + } } } } @@ -899,8 +874,7 @@ public class AppJmol extends StructureViewerBase if (im.getGraphics() != null) { - Rectangle rect = new Rectangle(width, height); - jmb.viewer.renderScreenImage(im.getGraphics(), rect.getSize(), rect); + jmb.viewer.renderScreenImage(im.getGraphics(), width, height); im.writeImage(); } } @@ -936,7 +910,7 @@ public class AppJmol extends StructureViewerBase // Set the colour using the current view for the associated alignframe for (AlignmentPanel ap : _colourwith) { - jmb.colourBySequence(ap.av.isShowSequenceFeatures(), ap); + jmb.colourBySequence(ap); } } } @@ -1077,12 +1051,10 @@ public class AppJmol extends StructureViewerBase { final Dimension currentSize = new Dimension(); - final Rectangle rectClip = new Rectangle(); - + @Override public void paintComponent(Graphics g) { getSize(currentSize); - g.getClipBounds(rectClip); if (jmb != null && jmb.fileLoadingError != null) { @@ -1121,7 +1093,8 @@ public class AppJmol extends StructureViewerBase } else { - jmb.viewer.renderScreenImage(g, currentSize, rectClip); + jmb.viewer.renderScreenImage(g, currentSize.width, + currentSize.height); } } } diff --git a/src/jalview/gui/AppJmolBinding.java b/src/jalview/gui/AppJmolBinding.java index 3a376b8..5c4346e 100644 --- a/src/jalview/gui/AppJmolBinding.java +++ b/src/jalview/gui/AppJmolBinding.java @@ -28,12 +28,11 @@ import jalview.ext.jmol.JalviewJmolBinding; import jalview.structure.StructureSelectionManager; import java.awt.Container; -import java.util.BitSet; +import java.util.Map; import org.jmol.api.JmolAppConsoleInterface; -import org.jmol.api.JmolViewer; -import org.jmol.popup.JmolPopup; -import org.openscience.jmol.app.jmolpanel.AppConsole; +import org.jmol.java.BS; +import org.openscience.jmol.app.jmolpanel.console.AppConsole; public class AppJmolBinding extends JalviewJmolBinding { @@ -77,6 +76,7 @@ public class AppJmolBinding extends JalviewJmolBinding return new SequenceRenderer(((AlignmentPanel) alignment).av); } + @Override public void sendConsoleEcho(String strEcho) { if (console != null) @@ -85,6 +85,7 @@ public class AppJmolBinding extends JalviewJmolBinding } } + @Override public void sendConsoleMessage(String strStatus) { if (console != null && strStatus != null) @@ -124,7 +125,7 @@ public class AppJmolBinding extends JalviewJmolBinding public void updateColours(Object source) { - AlignmentPanel ap = (AlignmentPanel) source, topap; + AlignmentPanel ap = (AlignmentPanel) source; // ignore events from panels not used to colour this view if (!appJmolWindow.isUsedforcolourby(ap)) { @@ -132,10 +133,11 @@ public class AppJmolBinding extends JalviewJmolBinding } if (!isLoadingFromArchive()) { - colourBySequence(ap.av.isShowSequenceFeatures(), ap); + colourBySequence(ap); } } + @Override public void notifyScriptTermination(String strStatus, int msWalltime) { // todo - script termination doesn't happen ? @@ -149,34 +151,37 @@ public class AppJmolBinding extends JalviewJmolBinding showUrl(url, "jmol"); } - public void newJmolPopup(boolean translateLocale, String menuName, - boolean asPopup) + public void newJmolPopup(String menuName) { - jmolpopup = new JmolPopup(); - jmolpopup.initialize(viewer, translateLocale, menuName, asPopup); + // jmolpopup = new JmolAwtPopup(); + // jmolpopup.jpiInitialize((viewer), menuName); } - public void selectionChanged(BitSet arg0) + @Override + public void selectionChanged(BS arg0) { // TODO Auto-generated method stub } + @Override public void refreshPdbEntries() { // TODO Auto-generated method stub } + @Override public void showConsole(boolean b) { appJmolWindow.showConsole(b); } @Override - protected JmolAppConsoleInterface createJmolConsole(JmolViewer viewer2, + protected JmolAppConsoleInterface createJmolConsole( Container consolePanel, String buttonsToShow) { + viewer.setJmolCallbackListener(this); return new AppConsole(viewer, consolePanel, buttonsToShow); } @@ -195,4 +200,11 @@ public class AppJmolBinding extends JalviewJmolBinding appJmolWindow.removeAlignmentPanel(((SeqPanel) svl).ap); } } + + @Override + public Map getJSpecViewProperty(String arg0) + { + // TODO Auto-generated method stub + return null; + } } diff --git a/src/jalview/gui/AppVarnaBinding.java b/src/jalview/gui/AppVarnaBinding.java index 25af7d1..956c2e1 100644 --- a/src/jalview/gui/AppVarnaBinding.java +++ b/src/jalview/gui/AppVarnaBinding.java @@ -20,11 +20,6 @@ */ package jalview.gui; -import jalview.datamodel.SequenceI; -import jalview.ext.varna.JalviewVarnaBinding; -import jalview.structure.AtomSpec; -import jalview.util.MessageManager; - import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; @@ -64,10 +59,38 @@ import fr.orsay.lri.varna.models.FullBackup; import fr.orsay.lri.varna.models.VARNAConfig; import fr.orsay.lri.varna.models.rna.RNA; +import jalview.datamodel.SequenceI; +import jalview.ext.varna.JalviewVarnaBinding; +import jalview.structure.AtomSpec; +import jalview.util.MessageManager; + public class AppVarnaBinding extends JalviewVarnaBinding { public VARNAPanel vp; + // remove unused (commented out) fields? + // protected JPanel _tools = new JPanel(); + // + // private JPanel _input = new JPanel(); + // + // private JPanel _strPanel = new JPanel(); + // + // private JTextField _str = new JTextField(); + // + // private JTextField _seq = new JTextField(); + // + // private JLabel _strLabel = new JLabel( + // MessageManager.getString("label.str")); + // + // private JButton _updateButton = new JButton( + // MessageManager.getString("action.update")); + // + // private JButton _deleteButton = new JButton( + // MessageManager.getString("action.delete")); + // + // private JButton _duplicateButton = new JButton( + // MessageManager.getString("action.snapshot")); + // protected JPanel _listPanel = new JPanel(); private ReorderableJList _sideList = null; @@ -142,6 +165,48 @@ public class AppVarnaBinding extends JalviewVarnaBinding vp.setBackground(_backgroundColor); + // MC commented out stuff not added to panel - remove? + // Font textFieldsFont = Font.decode("MonoSpaced-PLAIN-12"); + // + // _seq.setFont(textFieldsFont); + // if (!rnaList.isEmpty()) + // { + // _seq.setText(rnaList.get(0).getSeq()); + // } + + // _updateButton.addActionListener(new ActionListener() + // { + // public void actionPerformed(ActionEvent e) + // { + // FullBackup sel = (FullBackup) _sideList.getSelectedValue(); + // sel.rna.setSequence("A"); + // } + // }); + // + // _strLabel.setPreferredSize(new Dimension(marginTools, 15)); + // _strLabel.setHorizontalTextPosition(JLabel.LEFT); + // _str.setFont(textFieldsFont); + // _strPanel.setLayout(new BorderLayout()); + // _strPanel.add(_strLabel, BorderLayout.WEST); + // _strPanel.add(_str, BorderLayout.CENTER); + // + // _input.setLayout(new GridLayout(1, 0)); + // _input.add(_strPanel); + // + // JPanel goPanel = new JPanel(); + // goPanel.setLayout(new BorderLayout()); + // + // _tools.setLayout(new BorderLayout()); + // _tools.add(_input, BorderLayout.CENTER); + // _tools.add(goPanel, BorderLayout.EAST); + // + // goPanel.add(_updateButton, BorderLayout.CENTER); + // + // JPanel ops = new JPanel(); + // ops.setLayout(new GridLayout(1, 2)); + // ops.add(_deleteButton); + // ops.add(_duplicateButton); + JLabel j = new JLabel( MessageManager.getString("label.structures_manager"), JLabel.CENTER); diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index c27038c..6a95363 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -2617,28 +2617,6 @@ public class Desktop extends jalview.jbgui.GDesktop implements (t0 = new Thread(discoverer)).start(); } - // ENFIN services are EOLed as of Jalview 2.8.1 release - if (false) - { - try - { - if (Cache.getDefault("SHOW_ENFIN_SERVICES", true)) - { - // EnfinEnvision web service menu entries are rebuild every time the - // menu is shown, so no changeSupport events are needed. - jalview.ws.EnfinEnvision2OneWay.getInstance(); - (t1 = new Thread(jalview.ws.EnfinEnvision2OneWay.getInstance())) - .start(); - } - } catch (Exception e) - { - Cache.log - .info("Exception when trying to launch Envision2 workflow discovery.", - e); - Cache.log.info(e.getStackTrace()); - } - } - if (Cache.getDefault("SHOW_JWS2_SERVICES", true)) { if (jalview.ws.jws2.Jws2Discoverer.getDiscoverer().isRunning()) diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index b8fc077..7caea29 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -1372,10 +1372,6 @@ public class Jalview2XML final SequenceI jds, List viewIds, AlignmentPanel ap, boolean storeDataset) { - if (Desktop.desktop == null) - { - return; - } JInternalFrame[] frames = Desktop.desktop.getAllFrames(); for (int f = frames.length - 1; f > -1; f--) { diff --git a/src/jalview/gui/ScriptWindow.java b/src/jalview/gui/ScriptWindow.java deleted file mode 100644 index 972e5ef..0000000 --- a/src/jalview/gui/ScriptWindow.java +++ /dev/null @@ -1,739 +0,0 @@ -/* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. - */ -package jalview.gui; - -import org.jmol.api.*; - -import jalview.jbgui.GStructureViewer; - -import java.awt.*; -import java.awt.event.*; - -import javax.swing.*; -import javax.swing.text.*; - -import java.util.Vector; - -import org.jmol.i18n.GT; -import org.jmol.util.Logger; -import org.jmol.util.CommandHistory; - -// TODO: this class is copied in from jmol 11.0.2 - upgrade to 12.0.2 ? -public final class ScriptWindow extends JPanel implements ActionListener, - EnterListener -{ - - private ConsoleTextPane console; - - private JButton closeButton; - - private JButton runButton; - - private JButton haltButton; - - private JButton clearButton; - - private JButton historyButton; - - private JButton stateButton; - - JmolViewer viewer; - - GStructureViewer appJmol; - - public ScriptWindow(AppJmol appJmol) - { - this.viewer = appJmol.jmb.viewer; - this.appJmol = appJmol; - - setLayout(new BorderLayout()); - - console = new ConsoleTextPane(this); - - console.setPrompt(); - add(new JScrollPane(console), BorderLayout.CENTER); - - JPanel buttonPanel = new JPanel(); - add(buttonPanel, BorderLayout.SOUTH); - - runButton = new JButton(GT._("Run")); - haltButton = new JButton(GT._("Halt")); - runButton.addActionListener(this); - // buttonPanel.add(runButton); - haltButton.addActionListener(this); - // buttonPanel.add(haltButton); - haltButton.setEnabled(false); - - clearButton = new JButton(GT._("Clear")); - clearButton.addActionListener(this); - buttonPanel.add(clearButton); - - historyButton = new JButton(GT._("History")); - historyButton.addActionListener(this); - buttonPanel.add(historyButton); - - stateButton = new JButton(GT._("State")); - stateButton.addActionListener(this); - buttonPanel.add(stateButton); - - closeButton = new JButton(GT._("Close")); - closeButton.addActionListener(this); - buttonPanel.add(closeButton); - - for (int i = 0; i < buttonPanel.getComponentCount(); i++) - { - // ((JButton)buttonPanel.getComponent(i)) - // .setMargin(new Insets(0, 0, 0, 0)); - } - - } - - public void sendConsoleEcho(String strEcho) - { - if (strEcho != null && !isError) - { - - console.outputEcho(strEcho); - - } - setError(false); - } - - boolean isError = false; - - void setError(boolean TF) - { - isError = TF; - // if (isError) - // console.recallCommand(true); - } - - public void sendConsoleMessage(String strStatus) - { - if (strStatus == null) - { - console.clearContent(); - console.outputStatus(""); - } - else if (strStatus.indexOf("ERROR:") >= 0) - { - console.outputError(strStatus); - isError = true; - } - else if (!isError) - { - console.outputStatus(strStatus); - } - } - - public void notifyScriptTermination(String strMsg, int msWalltime) - { - if (strMsg != null && strMsg.indexOf("ERROR") >= 0) - { - console.outputError(strMsg); - } - runButton.setEnabled(true); - haltButton.setEnabled(false); - } - - public void enterPressed() - { - runButton.doClick(100); - // executeCommand(); - } - - class ExecuteCommandThread extends Thread - { - - String strCommand; - - ExecuteCommandThread(String command) - { - strCommand = command; - } - - public void run() - { - try - { - executeCommand(strCommand); - } catch (Exception ie) - { - Logger.debug("execution command interrupted!" + ie); - } - } - } - - ExecuteCommandThread execThread; - - void executeCommandAsThread() - { - String strCommand = console.getCommandString().trim(); - if (strCommand.length() > 0) - { - execThread = new ExecuteCommandThread(strCommand); - execThread.start(); - } - } - - void executeCommand(String strCommand) - { - boolean doWait; - setError(false); - console.appendNewline(); - console.setPrompt(); - if (strCommand.length() > 0) - { - String strErrorMessage = null; - doWait = (strCommand.indexOf("WAIT ") == 0); - if (doWait) - { // for testing, mainly - // demonstrates using the statusManager system. - runButton.setEnabled(false); - haltButton.setEnabled(true); - - Vector info = (Vector) viewer - .scriptWaitStatus(strCommand.substring(5), - "+fileLoaded,+scriptStarted,+scriptStatus,+scriptEcho,+scriptTerminated"); - runButton.setEnabled(true); - haltButton.setEnabled(false); - /* - * info = [ statusRecortSet0, statusRecortSet1, statusRecortSet2, ...] - * statusRecordSet = [ statusRecord0, statusRecord1, statusRecord2, ...] - * statusRecord = [int msgPtr, String statusName, int intInfo, String - * msg] - */ - for (int i = 0; i < info.size(); i++) - { - Vector statusRecordSet = (Vector) info.get(i); - for (int j = 0; j < statusRecordSet.size(); j++) - { - Vector statusRecord = (Vector) statusRecordSet.get(j); - Logger.info("msg#=" + statusRecord.get(0) + " " - + statusRecord.get(1) + " intInfo=" - + statusRecord.get(2) + " stringInfo=" - + statusRecord.get(3)); - } - } - console.appendNewline(); - } - else - { - boolean isScriptExecuting = viewer.isScriptExecuting(); - if (viewer.checkHalt(strCommand, true)) - strErrorMessage = (isScriptExecuting ? "string execution halted with " - + strCommand - : "no script was executing"); - else - strErrorMessage = "";// viewer.scriptCheck(strCommand); - // the problem is that scriptCheck is synchronized, so these might get - // backed up. - if (strErrorMessage != null && strErrorMessage.length() > 0) - { - console.outputError(strErrorMessage); - } - else - { - // runButton.setEnabled(false); - haltButton.setEnabled(true); - viewer.script(strCommand); - } - } - } - console.grabFocus(); - } - - public void actionPerformed(ActionEvent e) - { - Object source = e.getSource(); - if (source == closeButton) - { - // appJmol.showConsole(false); - } - else if (source == runButton) - { - executeCommandAsThread(); - } - else if (source == clearButton) - { - console.clearContent(); - } - else if (source == historyButton) - { - console.clearContent(viewer.getSetHistory(Integer.MAX_VALUE)); - } - else if (source == stateButton) - { - console.clearContent(viewer.getStateInfo()); - } - else if (source == haltButton) - { - viewer.haltScriptExecution(); - } - console.grabFocus(); // always grab the focus (e.g., after clear) - } -} - -class ConsoleTextPane extends JTextPane -{ - - ConsoleDocument consoleDoc; - - EnterListener enterListener; - - JmolViewer viewer; - - ConsoleTextPane(ScriptWindow scriptWindow) - { - super(new ConsoleDocument()); - consoleDoc = (ConsoleDocument) getDocument(); - consoleDoc.setConsoleTextPane(this); - this.enterListener = (EnterListener) scriptWindow; - this.viewer = scriptWindow.viewer; - } - - public String getCommandString() - { - String cmd = consoleDoc.getCommandString(); - return cmd; - } - - public void setPrompt() - { - consoleDoc.setPrompt(); - } - - public void appendNewline() - { - consoleDoc.appendNewline(); - } - - public void outputError(String strError) - { - consoleDoc.outputError(strError); - } - - public void outputErrorForeground(String strError) - { - consoleDoc.outputErrorForeground(strError); - } - - public void outputEcho(String strEcho) - { - consoleDoc.outputEcho(strEcho); - } - - public void outputStatus(String strStatus) - { - consoleDoc.outputStatus(strStatus); - } - - public void enterPressed() - { - if (enterListener != null) - enterListener.enterPressed(); - } - - public void clearContent() - { - clearContent(null); - } - - public void clearContent(String text) - { - consoleDoc.clearContent(); - if (text != null) - consoleDoc.outputEcho(text); - setPrompt(); - } - - /* - * (non-Javadoc) - * - * @see java.awt.Component#processKeyEvent(java.awt.event.KeyEvent) - */ - - /** - * Custom key event processing for command 0 implementation. - * - * Captures key up and key down strokes to call command history and redefines - * the same events with control down to allow caret vertical shift. - * - * @see java.awt.Component#processKeyEvent(java.awt.event.KeyEvent) - */ - protected void processKeyEvent(KeyEvent ke) - { - // Id Control key is down, captures events does command - // history recall and inhibits caret vertical shift. - if (ke.getKeyCode() == KeyEvent.VK_UP - && ke.getID() == KeyEvent.KEY_PRESSED && !ke.isControlDown()) - { - recallCommand(true); - } - else if (ke.getKeyCode() == KeyEvent.VK_DOWN - && ke.getID() == KeyEvent.KEY_PRESSED && !ke.isControlDown()) - { - recallCommand(false); - } - // If Control key is down, redefines the event as if it - // where a key up or key down stroke without modifiers. - // This allows to move the caret up and down - // with no command history recall. - else if ((ke.getKeyCode() == KeyEvent.VK_DOWN || ke.getKeyCode() == KeyEvent.VK_UP) - && ke.getID() == KeyEvent.KEY_PRESSED && ke.isControlDown()) - { - super.processKeyEvent(new KeyEvent((Component) ke.getSource(), ke - .getID(), ke.getWhen(), 0, // No modifiers - ke.getKeyCode(), ke.getKeyChar(), ke.getKeyLocation())); - } - // Standard processing for other events. - else - { - super.processKeyEvent(ke); - // check command for compiler-identifyable syntax issues - // this may have to be taken out if people start complaining - // that only some of the commands are being checked - // that is -- that the script itself is not being fully checked - - // not perfect -- help here? - if (ke.getID() == KeyEvent.KEY_RELEASED - && (ke.getKeyCode() > KeyEvent.VK_DOWN) - || ke.getKeyCode() == KeyEvent.VK_BACK_SPACE) - checkCommand(); - } - } - - /** - * Recall command history. - * - * @param up - * - history up or down - */ - void recallCommand(boolean up) - { - String cmd = viewer.getSetHistory(up ? -1 : 1); - if (cmd == null) - { - return; - } - try - { - if (cmd.endsWith(CommandHistory.ERROR_FLAG)) - { - cmd = cmd.substring(0, cmd.indexOf(CommandHistory.ERROR_FLAG)); - consoleDoc.replaceCommand(cmd, true); - } - else - { - consoleDoc.replaceCommand(cmd, false); - } - } catch (BadLocationException e) - { - e.printStackTrace(); - } - } - - void checkCommand() - { - String strCommand = consoleDoc.getCommandString(); - if (strCommand.length() == 0) - return; - consoleDoc - .colorCommand(viewer.scriptCheck(strCommand) == null ? consoleDoc.attUserInput - : consoleDoc.attError); - } - -} - -class ConsoleDocument extends DefaultStyledDocument -{ - - ConsoleTextPane consoleTextPane; - - SimpleAttributeSet attError; - - SimpleAttributeSet attEcho; - - SimpleAttributeSet attPrompt; - - SimpleAttributeSet attUserInput; - - SimpleAttributeSet attStatus; - - ConsoleDocument() - { - super(); - - attError = new SimpleAttributeSet(); - StyleConstants.setForeground(attError, Color.red); - - attPrompt = new SimpleAttributeSet(); - StyleConstants.setForeground(attPrompt, Color.magenta); - - attUserInput = new SimpleAttributeSet(); - StyleConstants.setForeground(attUserInput, Color.black); - - attEcho = new SimpleAttributeSet(); - StyleConstants.setForeground(attEcho, Color.blue); - StyleConstants.setBold(attEcho, true); - - attStatus = new SimpleAttributeSet(); - StyleConstants.setForeground(attStatus, Color.black); - StyleConstants.setItalic(attStatus, true); - } - - void setConsoleTextPane(ConsoleTextPane consoleTextPane) - { - this.consoleTextPane = consoleTextPane; - } - - Position positionBeforePrompt; // starts at 0, so first time isn't tracked - - // (at least on Mac OS X) - - Position positionAfterPrompt; // immediately after $, so this will track - - int offsetAfterPrompt; // only still needed for the insertString override and - - // replaceCommand - - /** - * Removes all content of the script window, and add a new prompt. - */ - void clearContent() - { - try - { - super.remove(0, getLength()); - } catch (BadLocationException exception) - { - System.out.println("Could not clear script window content: " - + exception.getMessage()); - } - } - - void setPrompt() - { - try - { - super.insertString(getLength(), "$ ", attPrompt); - setOffsetPositions(); - consoleTextPane.setCaretPosition(offsetAfterPrompt); - } catch (BadLocationException e) - { - e.printStackTrace(); - } - } - - void setOffsetPositions() - { - try - { - offsetAfterPrompt = getLength(); - positionBeforePrompt = createPosition(offsetAfterPrompt - 2); - // after prompt should be immediately after $ otherwise tracks the end - // of the line (and no command will be found) at least on Mac OS X it did. - positionAfterPrompt = createPosition(offsetAfterPrompt - 1); - } catch (BadLocationException e) - { - e.printStackTrace(); - } - } - - void setNoPrompt() - { - try - { - offsetAfterPrompt = getLength(); - positionAfterPrompt = positionBeforePrompt = createPosition(offsetAfterPrompt); - consoleTextPane.setCaretPosition(offsetAfterPrompt); - } catch (BadLocationException e) - { - e.printStackTrace(); - } - } - - // it looks like the positionBeforePrompt does not track when it started out - // as 0 - // and a insertString at location 0 occurs. It may be better to track the - // position after the prompt in stead - void outputBeforePrompt(String str, SimpleAttributeSet attribute) - { - try - { - int pt = consoleTextPane.getCaretPosition(); - Position caretPosition = createPosition(pt); - pt = positionBeforePrompt.getOffset(); - super.insertString(pt, str + "\n", attribute); - setOffsetPositions(); - pt = caretPosition.getOffset(); - consoleTextPane.setCaretPosition(pt); - } catch (BadLocationException e) - { - e.printStackTrace(); - } - } - - void outputError(String strError) - { - outputBeforePrompt(strError, attError); - } - - void outputErrorForeground(String strError) - { - try - { - super.insertString(getLength(), strError + "\n", attError); - consoleTextPane.setCaretPosition(getLength()); - } catch (BadLocationException e) - { - e.printStackTrace(); - - } - } - - void outputEcho(String strEcho) - { - outputBeforePrompt(strEcho, attEcho); - } - - void outputStatus(String strStatus) - { - outputBeforePrompt(strStatus, attStatus); - } - - void appendNewline() - { - try - { - super.insertString(getLength(), "\n", attUserInput); - consoleTextPane.setCaretPosition(getLength()); - } catch (BadLocationException e) - { - e.printStackTrace(); - } - } - - // override the insertString to make sure everything typed ends up at the end - // or in the 'command line' using the proper font, and the newline is - // processed. - public void insertString(int offs, String str, AttributeSet a) - throws BadLocationException - { - int ichNewline = str.indexOf('\n'); - if (ichNewline > 0) - str = str.substring(0, ichNewline); - if (ichNewline != 0) - { - if (offs < offsetAfterPrompt) - { - offs = getLength(); - } - super.insertString(offs, str, a == attError ? a : attUserInput); - consoleTextPane.setCaretPosition(offs + str.length()); - } - if (ichNewline >= 0) - { - consoleTextPane.enterPressed(); - } - } - - String getCommandString() - { - String strCommand = ""; - try - { - int cmdStart = positionAfterPrompt.getOffset(); - strCommand = getText(cmdStart, getLength() - cmdStart); - while (strCommand.length() > 0 && strCommand.charAt(0) == ' ') - strCommand = strCommand.substring(1); - } catch (BadLocationException e) - { - e.printStackTrace(); - } - return strCommand; - } - - public void remove(int offs, int len) throws BadLocationException - { - if (offs < offsetAfterPrompt) - { - len -= offsetAfterPrompt - offs; - if (len <= 0) - return; - offs = offsetAfterPrompt; - } - super.remove(offs, len); - // consoleTextPane.setCaretPosition(offs); - } - - public void replace(int offs, int length, String str, AttributeSet attrs) - throws BadLocationException - { - if (offs < offsetAfterPrompt) - { - if (offs + length < offsetAfterPrompt) - { - offs = getLength(); - length = 0; - } - else - { - length -= offsetAfterPrompt - offs; - offs = offsetAfterPrompt; - } - } - super.replace(offs, length, str, attrs); - // consoleTextPane.setCaretPosition(offs + str.length()); - } - - /** - * Replaces current command on script. - * - * @param newCommand - * new command value - * @param isError - * true to set error color ends with #?? - * - * @throws BadLocationException - */ - void replaceCommand(String newCommand, boolean isError) - throws BadLocationException - { - if (positionAfterPrompt == positionBeforePrompt) - return; - replace(offsetAfterPrompt, getLength() - offsetAfterPrompt, newCommand, - isError ? attError : attUserInput); - } - - void colorCommand(SimpleAttributeSet att) - { - if (positionAfterPrompt == positionBeforePrompt) - return; - setCharacterAttributes(offsetAfterPrompt, getLength() - - offsetAfterPrompt, att, true); - } -} - -interface EnterListener -{ - public void enterPressed(); -} diff --git a/src/jalview/schemabinding/version2/.castor.cdr b/src/jalview/schemabinding/version2/.castor.cdr index 2b8e4b5..e01bbd4 100644 --- a/src/jalview/schemabinding/version2/.castor.cdr +++ b/src/jalview/schemabinding/version2/.castor.cdr @@ -1,4 +1,4 @@ -#Wed Jun 17 15:04:02 BST 2015 +#Fri Jun 26 14:22:47 BST 2015 jalview.schemabinding.version2.ThresholdLine=jalview.schemabinding.version2.descriptors.ThresholdLineDescriptor jalview.schemabinding.version2.SequenceSetProperties=jalview.schemabinding.version2.descriptors.SequenceSetPropertiesDescriptor jalview.schemabinding.version2.StructureState=jalview.schemabinding.version2.descriptors.StructureStateDescriptor diff --git a/src/jalview/schemabinding/version2/CalcIdParam.java b/src/jalview/schemabinding/version2/CalcIdParam.java index 9fc3384..cae3ec2 100644 --- a/src/jalview/schemabinding/version2/CalcIdParam.java +++ b/src/jalview/schemabinding/version2/CalcIdParam.java @@ -29,13 +29,16 @@ implements java.io.Serializable //--------------------------/ /** - * handle for the calculation which uses this parameter set + * 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 + * should the calculation be performed + * immediately after loading in order to refresh results + * */ private boolean _needsUpdate = false; @@ -45,7 +48,9 @@ implements java.io.Serializable private boolean _has_needsUpdate; /** - * should the calculation be automatically performed on edits + * should the calculation be automatically + * performed on edits + * */ private boolean _autoUpdate; @@ -85,7 +90,9 @@ implements java.io.Serializable /** * Returns the value of field 'autoUpdate'. The field * 'autoUpdate' has the following description: should the - * calculation be automatically performed on edits + * calculation be automatically + * performed on edits + * * * @return the value of field 'AutoUpdate'. */ @@ -97,7 +104,9 @@ implements java.io.Serializable /** * Returns the value of field 'calcId'. The field 'calcId' has * the following description: handle for the calculation which - * uses this parameter set + * uses + * this parameter set + * * * @return the value of field 'CalcId'. */ @@ -109,8 +118,9 @@ implements java.io.Serializable /** * 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 + * calculation be performed + * immediately after loading in order to refresh results + * * * @return the value of field 'NeedsUpdate'. */ @@ -142,7 +152,9 @@ implements java.io.Serializable /** * Returns the value of field 'autoUpdate'. The field * 'autoUpdate' has the following description: should the - * calculation be automatically performed on edits + * calculation be automatically + * performed on edits + * * * @return the value of field 'AutoUpdate'. */ @@ -154,8 +166,9 @@ implements java.io.Serializable /** * 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 + * calculation be performed + * immediately after loading in order to refresh results + * * * @return the value of field 'NeedsUpdate'. */ @@ -214,7 +227,9 @@ implements java.io.Serializable /** * Sets the value of field 'autoUpdate'. The field 'autoUpdate' * has the following description: should the calculation be - * automatically performed on edits + * automatically + * performed on edits + * * * @param autoUpdate the value of field 'autoUpdate'. */ @@ -227,7 +242,8 @@ implements java.io.Serializable /** * Sets the value of field 'calcId'. The field 'calcId' has the * following description: handle for the calculation which uses - * this parameter set + * this parameter set + * * * @param calcId the value of field 'calcId'. */ @@ -239,8 +255,9 @@ implements java.io.Serializable /** * 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 + * calculation be performed + * immediately after loading in order to refresh results + * * * @param needsUpdate the value of field 'needsUpdate'. */ diff --git a/src/jalview/schemabinding/version2/JGroup.java b/src/jalview/schemabinding/version2/JGroup.java index 86d789e..602473f 100644 --- a/src/jalview/schemabinding/version2/JGroup.java +++ b/src/jalview/schemabinding/version2/JGroup.java @@ -198,7 +198,8 @@ public class JGroup implements java.io.Serializable { /** * Optional sequence group ID (only - * needs to be unique for this + * needs to be + * unique for this * alignment) * */ @@ -452,7 +453,8 @@ public class JGroup implements java.io.Serializable { /** * Returns the value of field 'id'. The field 'id' has the * following description: Optional sequence group ID (only - * needs to be unique for this + * needs to be + * unique for this * alignment) * * @@ -1027,7 +1029,8 @@ public class JGroup implements java.io.Serializable { /** * Sets the value of field 'id'. The field 'id' has the * following description: Optional sequence group ID (only - * needs to be unique for this + * needs to be + * unique for this * alignment) * * diff --git a/src/jalview/schemabinding/version2/Setting.java b/src/jalview/schemabinding/version2/Setting.java index 5408c63..2c19f1f 100644 --- a/src/jalview/schemabinding/version2/Setting.java +++ b/src/jalview/schemabinding/version2/Setting.java @@ -63,7 +63,8 @@ public class Setting implements java.io.Serializable { /** * Optional minimum colour - * for graduated feature + * for graduated + * feature * colour * */ @@ -286,7 +287,8 @@ public class Setting implements java.io.Serializable { * Returns the value of field 'mincolour'. The field * 'mincolour' has the following description: Optional minimum * colour - * for graduated feature + * for graduated + * feature * colour * * @@ -591,7 +593,8 @@ public class Setting implements java.io.Serializable { /** * Sets the value of field 'mincolour'. The field 'mincolour' * has the following description: Optional minimum colour - * for graduated feature + * for graduated + * feature * colour * * diff --git a/src/jalview/schemabinding/version2/StructureState.java b/src/jalview/schemabinding/version2/StructureState.java index 82773a3..fe7c95d 100644 --- a/src/jalview/schemabinding/version2/StructureState.java +++ b/src/jalview/schemabinding/version2/StructureState.java @@ -199,8 +199,17 @@ public class StructureState implements java.io.Serializable { private boolean _has_colourByJmol; /** - * An identifier for the viewer type, currently either - * JMOL or CHIMERA + * An + * identifier + * for + * the + * viewer + * type, + * currently + * either + * JMOL + * or + * CHIMERA * */ private java.lang.String _type; @@ -441,9 +450,17 @@ public class StructureState implements java.io.Serializable { /** * Returns the value of field 'type'. The field 'type' has the - * following description: An identifier for the viewer type, - * currently either - * JMOL or CHIMERA + * following description: An + * identifier + * for + * the + * viewer + * type, + * currently + * either + * JMOL + * or + * CHIMERA * * * @return the value of field 'Type'. @@ -929,9 +946,17 @@ public class StructureState implements java.io.Serializable { /** * Sets the value of field 'type'. The field 'type' has the - * following description: An identifier for the viewer type, - * currently either - * JMOL or CHIMERA + * following description: An + * identifier + * for + * the + * viewer + * type, + * currently + * either + * JMOL + * or + * CHIMERA * * * @param type the value of field 'type'. diff --git a/src/jalview/schemabinding/version2/Tree.java b/src/jalview/schemabinding/version2/Tree.java index 7fd6238..b147498 100644 --- a/src/jalview/schemabinding/version2/Tree.java +++ b/src/jalview/schemabinding/version2/Tree.java @@ -113,7 +113,8 @@ public class Tree implements java.io.Serializable { /** * Tree ID added for binding tree - * visualization settings to vamsas + * visualization + * settings to vamsas * document trees in jalview 2.4.1 * */ @@ -330,7 +331,8 @@ public class Tree implements java.io.Serializable { /** * Returns the value of field 'id'. The field 'id' has the * following description: Tree ID added for binding tree - * visualization settings to vamsas + * visualization + * settings to vamsas * document trees in jalview 2.4.1 * * @@ -716,7 +718,8 @@ public class Tree implements java.io.Serializable { /** * Sets the value of field 'id'. The field 'id' has the * following description: Tree ID added for binding tree - * visualization settings to vamsas + * visualization + * settings to vamsas * document trees in jalview 2.4.1 * * diff --git a/src/jalview/schemabinding/version2/Viewport.java b/src/jalview/schemabinding/version2/Viewport.java index 7dcb3ee..136a3b3 100644 --- a/src/jalview/schemabinding/version2/Viewport.java +++ b/src/jalview/schemabinding/version2/Viewport.java @@ -383,15 +383,16 @@ public class Viewport implements java.io.Serializable { /** * unique id used by jalview to - * synchronize between stored and + * synchronize + * between stored and * instantiated views * */ private java.lang.String _id; /** - * The viewport id of this viewport's (cdna/protein) coding - * complement, if any + * The viewport id of this viewport's + * (cdna/protein) coding complement, if any * */ private java.lang.String _complementId; @@ -882,8 +883,8 @@ public class Viewport implements java.io.Serializable { /** * 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 + * id of this viewport's + * (cdna/protein) coding complement, if any * * * @return the value of field 'ComplementId'. @@ -1033,7 +1034,8 @@ public class Viewport implements java.io.Serializable { /** * Returns the value of field 'id'. The field 'id' has the * following description: unique id used by jalview to - * synchronize between stored and + * synchronize + * between stored and * instantiated views * * @@ -2151,8 +2153,8 @@ public class Viewport implements java.io.Serializable { /** * 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 + * id of this viewport's + * (cdna/protein) coding complement, if any * * * @param complementId the value of field 'complementId'. @@ -2299,7 +2301,8 @@ public class Viewport implements java.io.Serializable { /** * Sets the value of field 'id'. The field 'id' has the * following description: unique id used by jalview to - * synchronize between stored and + * synchronize + * between stored and * instantiated views * * diff --git a/src/jalview/ws/EnfinEnvision2OneWay.java b/src/jalview/ws/EnfinEnvision2OneWay.java deleted file mode 100644 index 239a626..0000000 --- a/src/jalview/ws/EnfinEnvision2OneWay.java +++ /dev/null @@ -1,703 +0,0 @@ -/* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. - */ -package jalview.ws; - -import jalview.bin.Cache; -import jalview.datamodel.DBRefEntry; -import jalview.datamodel.SequenceGroup; -import jalview.datamodel.SequenceI; -import jalview.gui.AlignFrame; -import jalview.gui.Desktop; -import jalview.gui.JvSwingUtils; -import jalview.util.GroupUrlLink; -import jalview.util.MessageManager; -import jalview.util.GroupUrlLink.UrlStringTooLongException; - -import java.awt.Component; -import java.awt.Cursor; -import java.awt.event.ActionEvent; -import java.io.UnsupportedEncodingException; -import java.net.URL; -import java.net.URLEncoder; -import java.util.Hashtable; -import java.util.Map; -import java.util.Vector; -import java.util.regex.Pattern; - -import javax.swing.JMenu; -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.event.MenuEvent; -import javax.swing.event.MenuListener; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; - -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; -import org.xml.sax.helpers.DefaultHandler; - -import com.lowagie.text.html.HtmlEncoder; - -/** - * Lightweight runnable to discover dynamic 'one way' group URL services - * - * as of Jalview 2.8.1 this class is mothballed and will be dropped in v3. - * - * @author JimP - * @deprecated - * - */ -public class EnfinEnvision2OneWay extends DefaultHandler implements - Runnable, WSMenuEntryProviderI -{ - private static EnfinEnvision2OneWay groupURLLinksGatherer = null; - - public static EnfinEnvision2OneWay getInstance() - { - if (groupURLLinksGatherer == null) - { - groupURLLinksGatherer = new EnfinEnvision2OneWay(); - } - return groupURLLinksGatherer; - } - - private void waitForCompletion() - { - if (groupURLLinksGatherer.isRunning()) - { - // wait around and show a visual delay indicator - Cursor oldCursor = Desktop.instance.getCursor(); - Desktop.instance.setCursor(new Cursor(Cursor.WAIT_CURSOR)); - while (groupURLLinksGatherer.isRunning()) - { - try - { - Thread.sleep(100); - } catch (InterruptedException e) - { - } - ; - } - Desktop.instance.setCursor(oldCursor); - } - } - - public Vector getEnvisionServiceGroupURLS() - { - waitForCompletion(); - return groupURLLinks; - } - - /** - * indicate if - */ - private static String BACKGROUND = "BACKGROUNDPARAM"; - - /** - * contains null strings or one of the above constants - indicate if this URL - * is a special case. - */ - private Vector additionalPar = new Vector(); - - /** - * the enfin service URL - */ - private String enfinService = null; - - private String description = null; - - private String wfname; - - /* - * (non-Javadoc) - * - * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, - * java.lang.String, java.lang.String) - */ - public void endElement(String uri, String localName, String qName) - throws SAXException - { - - // System.err.println("End element: : '"+uri+" "+localName+" "+qName); - if (qName.equalsIgnoreCase("workflow") && description != null - && description.length() > 0) - { - // groupURLLinks.addElement("UNIPROT|EnVision2|http://www.ebi.ac.uk/enfin-srv/envision2/pages/linkin.jsf?tool=Jalview&workflow=Default&datasetName=JalviewIDs$DATASETID$&input=$SEQUENCEIDS$&inputType=0|,"); - // groupURLLinks.addElement("Seqs|EnVision2|http://www.ebi.ac.uk/enfin-srv/envision2/pages/linkin.jsf?tool=Jalview&workflow=Default&datasetName=JalviewSeqs$DATASETID$&input=$SEQUENCES=/([A-Za-z]+)+/=$&inputType=1|,"); - System.err.println("Adding entry for " + wfname + " " + description); - if (wfname.toLowerCase().indexOf("funcnet") == -1) - { - description = Pattern.compile("\\s+", Pattern.MULTILINE) - .matcher(description).replaceAll(" "); - groupURLdescr.addElement(description); - groupURLdescr.addElement(description); - String urlstub = wfname; - if (wfname.indexOf(" ") > -1) - { - // make the name safe! - try - { - urlstub = URLEncoder.encode(wfname, "utf-8"); - } catch (UnsupportedEncodingException e) - { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - groupURLLinks - .addElement(wfname - + "|" - + "http://www.ebi.ac.uk/enfin-srv/envision2/pages/linkin.jsf?tool=Jalview&workflow=" - + urlstub - + "&datasetName=JalviewSeqs$DATASETID$&input=$SEQUENCEIDS$&inputType=0|,"); // #"+description+"#"); - groupURLLinks - .addElement(wfname - + "|" - + "http://www.ebi.ac.uk/enfin-srv/envision2/pages/linkin.jsf?tool=Jalview&workflow=" - + urlstub - + "&datasetName=JalviewSeqs$DATASETID$&input=$SEQUENCES=/([A-Za-z]+)+/=$&inputType=1|,"); // #"+description+"#"); - } - } - } - - /* - * (non-Javadoc) - * - * @see org.xml.sax.helpers.DefaultHandler#characters(char[], int, int) - */ - public void characters(char[] ch, int start, int length) - throws SAXException - { - if (description != null) - { - for (int i = start; i < start + length; i++) - { - description += ch[i]; - } - } - } - - /* - * (non-Javadoc) - * - * @see org.xml.sax.helpers.DefaultHandler#startElement(java.lang.String, - * java.lang.String, java.lang.String, org.xml.sax.Attributes) - */ - public void startElement(String uri, String localName, String qName, - Attributes attributes) throws SAXException - { - if (qName.equalsIgnoreCase("workflow")) - { - description = null; - wfname = attributes.getValue("name"); - } - if (qName.equalsIgnoreCase("description")) - { - description = ""; - } - - // System.err.println("Start element: : '"+uri+" "+localName+" "+qName+" attributes"+attributes); - // super.startElement(uri,localName,qname,attributes); - } - - private boolean started = false; - - private boolean running = false; - - private Vector groupURLLinks = null; - - private Vector groupURLdescr = null; - - private static String[] allowedDb = new String[] - { "UNIPROT", "EMBL", "PDB" }; - - public EnfinEnvision2OneWay() - { - groupURLLinks = new Vector(); - groupURLdescr = new Vector(); - - enfinService = Cache.getDefault("ENVISION2_WORKFLOWSERVICE", - "http://www.ebi.ac.uk/enfin-srv/envision2/pages/workflows.xml"); - new Thread(this).start(); - } - - public void run() - { - started = true; - running = true; - try - { - SAXParserFactory spf = SAXParserFactory.newInstance(); - SAXParser sp = spf.newSAXParser(); - sp.parse(new URL(enfinService).openStream(), this); - } catch (Exception e) - { - Cache.log.warn("Exception when discovering One Way services: ", e); - } catch (Error e) - { - Cache.log.warn("Error when discovering One Way services: ", e); - } - running = false; - Cache.log.debug("Finished running."); - } - - /** - * have we finished running yet ? - * - * @return false if we have been run. - */ - public boolean isRunning() - { - - // TODO Auto-generated method stub - return !started || running; - } - - public static void main(String[] args) - { - Cache.initLogger(); - EnfinEnvision2OneWay ow = new EnfinEnvision2OneWay(); - while (ow.isRunning()) - { - try - { - Thread.sleep(50); - } catch (Exception e) - { - } - ; - - } - for (int i = 0; i < ow.groupURLLinks.size(); i++) - { - System.err.println("Description" + ow.groupURLdescr.elementAt(i) - + "Service URL: " + ow.groupURLLinks.elementAt(i)); - } - } - - // / Copied from jalview.gui.PopupMenu - /** - * add a late bound URL service item to the given menu - * - * @param linkMenu - * @param label - * - menu label string - * @param urlgenerator - * GroupURLLink used to generate URL - * @param urlstub - * Object array returned from the makeUrlStubs function. - */ - private void addshowLink(JMenu linkMenu, String label, String descr, - String dbname, final GroupUrlLink urlgenerator, - final Object[] urlstub) - { - Component[] jmi = linkMenu.getMenuComponents(); - for (int i = 0; i < jmi.length; i++) - { - if (jmi[i] instanceof JMenuItem - && ((JMenuItem) jmi[i]).getText().equalsIgnoreCase(label)) - { - // don't add this - its a repeat of an existing URL. - return; - } - } - try - { - descr = HtmlEncoder.encode(descr); - } catch (Exception e) - { - } - ; - - boolean seqsorids = (urlgenerator.getGroupURLType() & urlgenerator.SEQUENCEIDS) == 0; - int i = urlgenerator.getNumberInvolved(urlstub); - JMenuItem item = new JMenuItem(label); - // - if (dbname == null || dbname.trim().length() == 0) - { - dbname = ""; - } - item.setToolTipText(JvSwingUtils.wrapTooltip(true, MessageManager.formatMessage("label.submit_sequence", new String[]{Integer.valueOf(i).toString(), dbname, (seqsorids ? "sequence" : "sequence id"), (i > 1 ? "s" : "")}))); - item.addActionListener(new java.awt.event.ActionListener() - { - public void actionPerformed(ActionEvent e) - { - new Thread(new Runnable() - { - - public void run() - { - try - { - showLink(urlgenerator.constructFrom(urlstub)); - } catch (UrlStringTooLongException ex) - { - Cache.log.warn("Not showing link: URL is too long!", ex); - } - } - - }).start(); - } - }); - - linkMenu.add(item); - } - - /** - * open the given link in a new browser window - * - * @param url - */ - public void showLink(String url) - { - try - { - 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); - - ex.printStackTrace(); - } - } - - /** - * called by a web service menu instance when it is opened. - * - * @param enfinServiceMenu - * @param alignFrame - */ - private void buildGroupLinkMenu(JMenu enfinServiceMenu, - AlignFrame alignFrame) - { - if (running || !started) - { - return; - } - SequenceI[] seqs = alignFrame.getViewport().getSelectionAsNewSequence(); - SequenceGroup sg = alignFrame.getViewport().getSelectionGroup(); - if (sg == null) - { - // consider visible regions here/ - } - enfinServiceMenu.removeAll(); - JMenu entries = buildGroupURLMenu(seqs, sg); - if (entries != null) - { - for (int i = 0, iSize = entries.getMenuComponentCount(); i < iSize; i++) - { - // transfer - menu component is removed from entries automatically - enfinServiceMenu.add(entries.getMenuComponent(0)); - } - // entries.removeAll(); - enfinServiceMenu.setEnabled(true); - } - else - { - enfinServiceMenu.setEnabled(false); - } - } - - /** - * construct a dynamic enfin services menu given a sequence selection - * - * @param seqs - * @param sg - * @param groupLinks - * @return - */ - private JMenu buildGroupURLMenu(SequenceI[] seqs, SequenceGroup sg) - { - if (groupURLdescr == null || groupURLLinks == null) - return null; - // TODO: usability: thread off the generation of group url content so root - // menu appears asap - // sequence only URLs - // ID/regex match URLs - JMenu groupLinksMenu = new JMenu(MessageManager.getString("action.group_link")); - String[][] idandseqs = GroupUrlLink.formStrings(seqs); - Hashtable commonDbrefs = new Hashtable(); - for (int sq = 0; sq < seqs.length; sq++) - { - - int start, end; - if (sg != null) - { - start = seqs[sq].findPosition(sg.getStartRes()); - end = seqs[sq].findPosition(sg.getEndRes()); - } - else - { - // get total width of alignment. - start = seqs[sq].getStart(); - end = seqs[sq].findPosition(seqs[sq].getLength()); - } - // we skip sequences which do not have any non-gaps in the region of - // interest - if (start > end) - { - continue; - } - // just collect ids from dataset sequence - // TODO: check if IDs collected from selecton group intersects with the - // current selection, too - SequenceI sqi = seqs[sq]; - while (sqi.getDatasetSequence() != null) - { - sqi = sqi.getDatasetSequence(); - } - DBRefEntry[] dbr = sqi.getDBRef(); - if (dbr != null && dbr.length > 0) - { - for (int d = 0; d < dbr.length; d++) - { - String src = dbr[d].getSource(); // jalview.util.DBRefUtils.getCanonicalName(dbr[d].getSource()).toUpperCase(); - Object[] sarray = (Object[]) commonDbrefs.get(src); - if (sarray == null) - { - sarray = new Object[2]; - sarray[0] = new int[] - { 0 }; - sarray[1] = new String[seqs.length]; - - commonDbrefs.put(src, sarray); - } - - if (((String[]) sarray[1])[sq] == null) - { - if (!dbr[d].hasMap() - || (dbr[d].getMap().locateMappedRange(start, end) != null)) - { - ((String[]) sarray[1])[sq] = dbr[d].getAccessionId(); - ((int[]) sarray[0])[0]++; - } - } - } - } - } - // now create group links for all distinct ID/sequence sets. - Hashtable gurlMenus = new Hashtable(); - /** - * last number of sequences where URL generation failed - */ - int[] nsqtype = new int[] - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - for (int i = 0; i < groupURLLinks.size(); i++) - { - String link = (String) groupURLLinks.elementAt(i); - String descr = (String) groupURLdescr.elementAt(i); - - // boolean specialCase = - // additionalPar.elementAt(i).toString().equals(BACKGROUND); - GroupUrlLink urlLink = null; - try - { - urlLink = new GroupUrlLink(link); - } catch (Exception foo) - { - jalview.bin.Cache.log.error("Exception for GroupURLLink '" + link - + "'", foo); - continue; - } - ; - if (!urlLink.isValid()) - { - jalview.bin.Cache.log.error(urlLink.getInvalidMessage()); - continue; - } - final String label = urlLink.getLabel(); - // create/recover the sub menus that might be populated for this link. - JMenu[] wflinkMenus = gurlMenus.get(label); - if (wflinkMenus == null) - { - // three types of url that might be - // created. - wflinkMenus = new JMenu[] - { null, new JMenu(MessageManager.getString("action.ids")), new JMenu(MessageManager.getString("action.sequences")), - new JMenu(MessageManager.getString("action.ids_sequences")) }; - gurlMenus.put(label, wflinkMenus); - } - - boolean usingNames = false; - // Now see which parts of the group apply for this URL - String ltarget; - String[] seqstr, ids; // input to makeUrl - for (int t = 0; t < allowedDb.length; t++) - { - ltarget = allowedDb[t]; // jalview.util.DBRefUtils.getCanonicalName(urlLink.getTarget()); - Object[] idset = (Object[]) commonDbrefs.get(ltarget.toUpperCase()); - if (idset != null) - { - int numinput = ((int[]) idset[0])[0]; - String[] allids = ((String[]) idset[1]); - seqstr = new String[numinput]; - ids = new String[numinput]; - if (nsqtype[urlLink.getGroupURLType()] > 0 - && numinput >= nsqtype[urlLink.getGroupURLType()]) - { - continue; - } - for (int sq = 0, idcount = 0; sq < seqs.length; sq++) - { - if (allids[sq] != null) - { - ids[idcount] = allids[sq]; - seqstr[idcount++] = idandseqs[1][sq]; - } - } - try - { - createAndAddLinks(wflinkMenus, false, urlLink, ltarget, null, - descr, ids, seqstr); - } catch (UrlStringTooLongException ex) - { - nsqtype[urlLink.getGroupURLType()] = numinput; - } - } - } - // also do names only. - seqstr = idandseqs[1]; - ids = idandseqs[0]; - if (nsqtype[urlLink.getGroupURLType()] > 0 - && idandseqs[0].length >= nsqtype[urlLink.getGroupURLType()]) - { - continue; - } - - try - { - createAndAddLinks(wflinkMenus, true, urlLink, "Any", null, descr, - ids, seqstr); - } catch (UrlStringTooLongException ex) - { - nsqtype[urlLink.getGroupURLType()] = idandseqs[0].length; - } - } - boolean anyadded = false; // indicates if there are any group links to give - // to user - for (Map.Entry menues : gurlMenus.entrySet()) - { - JMenu grouplinkset = new JMenu(menues.getKey()); - JMenu[] wflinkMenus = menues.getValue(); - for (int m = 0; m < wflinkMenus.length; m++) - { - if (wflinkMenus[m] != null - && wflinkMenus[m].getMenuComponentCount() > 0) - { - anyadded = true; - grouplinkset.add(wflinkMenus[m]); - } - } - groupLinksMenu.add(grouplinkset); - } - if (anyadded) - { - return groupLinksMenu; - } - return null; - } - - private boolean createAndAddLinks(JMenu[] linkMenus, boolean usingNames, - GroupUrlLink urlLink, String label, String ltarget, String descr, - String[] ids, String[] seqstr) throws UrlStringTooLongException - { - Object[] urlset = urlLink.makeUrlStubs(ids, seqstr, "FromJalview" - + System.currentTimeMillis(), false); - - if (urlset != null) - { - int type = urlLink.getGroupURLType() & 3; - // System.out.println(urlLink.getGroupURLType() - // +" "+((String[])urlset[3])[0]); - // first two bits ofurlLink type bitfield are sequenceids and sequences - // TODO: FUTURE: ensure the groupURL menu structure can be generalised - addshowLink( - linkMenus[type], - label - + " " - + (ltarget == null ? (((type & 1) == 1 ? "ID" - : "Sequence") + (urlLink - .getNumberInvolved(urlset) > 1 ? "s" : "")) - : (usingNames ? (((type & 1) == 1) ? "(Names)" - : "") - : ("(" + ltarget + ")"))), descr, - usingNames ? null : label, urlLink, urlset); - return true; - } - return false; - } - - // / end of stuff copied from popupmenu - public void attachWSMenuEntry(final JMenu wsmenu, - final AlignFrame alignFrame) - { - final JMenu enfinServiceMenu = new JMenu("Envision 2"); - wsmenu.add(enfinServiceMenu); - enfinServiceMenu.setEnabled(false); - wsmenu.addMenuListener(new MenuListener() - { - // this listener remembers when the menu was first selected, and - // doesn't rebuild the session list until it has been cleared and - // reselected again. - boolean refresh = true; - - public void menuCanceled(MenuEvent e) - { - refresh = true; - } - - public void menuDeselected(MenuEvent e) - { - refresh = true; - } - - public void menuSelected(MenuEvent e) - { - if (refresh && !isRunning()) - { - new Thread(new Runnable() - { - public void run() - { - try - { - buildGroupLinkMenu(enfinServiceMenu, alignFrame); - } catch (OutOfMemoryError ex) - { - Cache.log - .error("Out of memory when calculating the Envision2 links.", - ex); - enfinServiceMenu.setEnabled(false); - } - } - }).start(); - refresh = false; - } - } - }); - - } - -} diff --git a/src/jalview/ws/jws2/JabaParamStore.java b/src/jalview/ws/jws2/JabaParamStore.java index be18b51..baa1d9d 100644 --- a/src/jalview/ws/jws2/JabaParamStore.java +++ b/src/jalview/ws/jws2/JabaParamStore.java @@ -27,7 +27,6 @@ import java.util.Hashtable; import java.util.List; import java.util.StringTokenizer; -import org.jmol.util.ArrayUtil; import compbio.metadata.Argument; import compbio.metadata.Option; import compbio.metadata.Parameter; diff --git a/test/MCview/PDBfileTest.java b/test/MCview/PDBfileTest.java index 05680af..1dfeba9 100644 --- a/test/MCview/PDBfileTest.java +++ b/test/MCview/PDBfileTest.java @@ -15,6 +15,7 @@ import jalview.datamodel.SequenceI; import jalview.io.AppletFormatAdapter; import java.io.IOException; +import java.util.List; import org.testng.annotations.Test; @@ -96,6 +97,21 @@ public class PDBfileTest assertTrue(chainD.sequence.getSequenceAsString().startsWith("ATYNVK")); assertTrue(chainD.sequence.getSequenceAsString().endsWith("KEEELT")); assertEquals("3W5V|D", chainD.sequence.getName()); + + /* + * verify PDB-related data in parsed sequences + */ + List seqs = pf.getSeqs(); + assertEquals(4, seqs.size()); + assertEquals("3W5V|A", seqs.get(0).getName()); + assertEquals("3W5V|B", seqs.get(1).getName()); + assertEquals("3W5V|C", seqs.get(2).getName()); + assertEquals("3W5V|D", seqs.get(3).getName()); + assertEquals(1, seqs.get(0).getPDBId().size()); + PDBEntry pdbe = seqs.get(0).getPDBId().get(0); + assertEquals("A", pdbe.getChainCode()); + assertEquals("3W5V", pdbe.getId()); + assertEquals(PDBEntry.Type.PDB.toString(), pdbe.getType()); } /** diff --git a/test/jalview/analysis/AlignSeqTest.java b/test/jalview/analysis/AlignSeqTest.java index 34ae612..ed686a7 100644 --- a/test/jalview/analysis/AlignSeqTest.java +++ b/test/jalview/analysis/AlignSeqTest.java @@ -3,11 +3,11 @@ package jalview.analysis; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; -import org.testng.annotations.Test; +import org.junit.Test; public class AlignSeqTest { - @Test(groups ={ "Functional" }) + @Test public void testExtractGaps() { assertNull(AlignSeq.extractGaps(null, null)); diff --git a/utils/InstallAnywhere/Jalview.iap_xml b/utils/InstallAnywhere/Jalview.iap_xml index 6402019..14b372f 100755 --- a/utils/InstallAnywhere/Jalview.iap_xml +++ b/utils/InstallAnywhere/Jalview.iap_xml @@ -1216,7 +1216,7 @@ and any path to a file to save to the file]]> - + false @@ -1234,7 +1234,7 @@ and any path to a file to save to the file]]> true - + 4938027