From: James Procter Date: Wed, 1 Nov 2023 19:08:58 +0000 (+0000) Subject: Merge branch 'develop' into patch/JAL-4281_idwidthandannotHeight_in_project X-Git-Tag: Release_2_11_4_0~117^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=1140532d01b32b648e7e5b17ea717ae790625f8f;p=jalview.git Merge branch 'develop' into patch/JAL-4281_idwidthandannotHeight_in_project Conflicts: src/jalview/gui/AlignmentPanel.java and regenerated schema binding --- 1140532d01b32b648e7e5b17ea717ae790625f8f diff --cc src/jalview/gui/AlignmentPanel.java index c5c7ae9,3127731..fe6477e --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@@ -331,8 -323,8 +334,8 @@@ public class AlignmentPanel extends GAl * * @param maxwidth * -1 or maximum width allowed for IdWidth - * @param includeAnnotations - when true, annotation label widths are also accounted for + * @param includeAnnotations - when true includes width of any additional marks in annotation id panel - * @param visibleOnly - + * @param visibleOnly - when true, ignore label widths for hidden annotation rows * @return Dimension giving the maximum width of the alignment label panel * that should be used. */ @@@ -374,28 -352,10 +377,29 @@@ // Also check annotation label widths if (includeAnnotations && al.getAlignmentAnnotation() != null) { - AnnotationLabels aal = getAlabels(); - int stringWidth = aal.drawLabels(null, false, idWidth, false, false, - fm, !visibleOnly); - idWidth = Math.max(idWidth, stringWidth); + fm = c.getFontMetrics(getAlabels().getFont()); + + if (!legacy || Jalview.isHeadlessMode()) + { + AnnotationLabels aal = getAlabels(); - int stringWidth = aal.drawLabels(null, false, idWidth, false, false, fm); ++ int stringWidth = aal.drawLabels(null, false, idWidth, false, false, ++ fm, !visibleOnly); + idWidth = Math.max(idWidth, stringWidth); + } + else + { + for (i = 0; i < al.getAlignmentAnnotation().length; i++) + { + AlignmentAnnotation aa = al.getAlignmentAnnotation()[i]; + if (visibleOnly && !aa.visible) + { + continue; + } + String label = aa.label; + int stringWidth = fm.stringWidth(label); + idWidth = Math.max(idWidth, stringWidth); + } + } } int w = maxwidth < 0 ? idWidth : Math.min(maxwidth, idWidth); diff --cc src/jalview/gui/IdCanvas.java index c1751d2,0dde9b5..dbffc72 --- a/src/jalview/gui/IdCanvas.java +++ b/src/jalview/gui/IdCanvas.java @@@ -451,10 -455,10 +455,10 @@@ public class IdCanvas extends JPanel im int getWidth = getWidth(); int thisIdWidth = getWidth; g.translate(0, ypos + (alheight * charHeight)); - if (!manuallyAdjusted()) + if (!isManuallyAdjusted()) { int getAnnotationsIdWidth = labels.drawLabels(g, false, -1, false,forGUI, - null); + null, false); thisIdWidth = idWidth < 0 ? getAnnotationsIdWidth : idWidth; if (thisIdWidth > getWidth) { diff --cc src/jalview/xml/binding/jalview/AlcodonFrame.java index 5fc9959,c241422..c412c36 --- a/src/jalview/xml/binding/jalview/AlcodonFrame.java +++ b/src/jalview/xml/binding/jalview/AlcodonFrame.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/Annotation.java index 3a05f57,bb20751..261e0ed --- a/src/jalview/xml/binding/jalview/Annotation.java +++ b/src/jalview/xml/binding/jalview/Annotation.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/AnnotationColourScheme.java index 9c78c57,5f2f7d0..f7e974b --- a/src/jalview/xml/binding/jalview/AnnotationColourScheme.java +++ b/src/jalview/xml/binding/jalview/AnnotationColourScheme.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/AnnotationElement.java index 9f9707e,eaddc5a..a57101a --- a/src/jalview/xml/binding/jalview/AnnotationElement.java +++ b/src/jalview/xml/binding/jalview/AnnotationElement.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/DoubleMatrix.java index 7a6ebfc,f2d3fe2..4ef5abc --- a/src/jalview/xml/binding/jalview/DoubleMatrix.java +++ b/src/jalview/xml/binding/jalview/DoubleMatrix.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/DoubleVector.java index 08f4fc2,b7d7d87..19a0d24 --- a/src/jalview/xml/binding/jalview/DoubleVector.java +++ b/src/jalview/xml/binding/jalview/DoubleVector.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/Feature.java index 83ed623,7b25d44..97bedae --- a/src/jalview/xml/binding/jalview/Feature.java +++ b/src/jalview/xml/binding/jalview/Feature.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/FeatureMatcher.java index 4a99847,d83131c..9913337 --- a/src/jalview/xml/binding/jalview/FeatureMatcher.java +++ b/src/jalview/xml/binding/jalview/FeatureMatcher.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/FeatureMatcherSet.java index 3457681,f182816..a51e7d5 --- a/src/jalview/xml/binding/jalview/FeatureMatcherSet.java +++ b/src/jalview/xml/binding/jalview/FeatureMatcherSet.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/FilterBy.java index 560cf3c,2db2173..5723e3d --- a/src/jalview/xml/binding/jalview/FilterBy.java +++ b/src/jalview/xml/binding/jalview/FilterBy.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/JalviewModel.java index 2b7decd,4e0857d..360c074 --- a/src/jalview/xml/binding/jalview/JalviewModel.java +++ b/src/jalview/xml/binding/jalview/JalviewModel.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/JalviewUserColours.java index b2dc242,1c0af33..592ef1b --- a/src/jalview/xml/binding/jalview/JalviewUserColours.java +++ b/src/jalview/xml/binding/jalview/JalviewUserColours.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/MapListType.java index 78d6e07,2bac782..d5cd7a8 --- a/src/jalview/xml/binding/jalview/MapListType.java +++ b/src/jalview/xml/binding/jalview/MapListType.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/MapOnAMatrixType.java index 0000000,47460a3..d48a315 mode 000000,100644..100644 --- a/src/jalview/xml/binding/jalview/MapOnAMatrixType.java +++ b/src/jalview/xml/binding/jalview/MapOnAMatrixType.java @@@ -1,0 -1,160 +1,160 @@@ + // + // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 + // See https://eclipse-ee4j.github.io/jaxb-ri + // Any modifications to this file will be lost upon recompilation of the source schema. -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT + // + + + package jalview.xml.binding.jalview; + + import java.util.ArrayList; + import java.util.List; + import javax.xml.bind.annotation.XmlAccessType; + import javax.xml.bind.annotation.XmlAccessorType; + import javax.xml.bind.annotation.XmlAttribute; + import javax.xml.bind.annotation.XmlType; + + + /** + * Defines a mapping from the local frame to a matrix + * and its associated data specified by MatrixType + * + * + * <p>Java class for MapOnAMatrixType complex type. + * + * <p>The following schema fragment specifies the expected content contained within this class. + * + * <pre> + * &lt;complexType name="MapOnAMatrixType"&gt; + * &lt;complexContent&gt; + * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; + * &lt;sequence&gt; + * &lt;element name="property" type="{www.vamsas.ac.uk/jalview/version2}property" maxOccurs="unbounded" minOccurs="0"/&gt; + * &lt;element name="mapping" type="{www.vamsas.ac.uk/jalview/version2}mapListType" minOccurs="0"/&gt; + * &lt;/sequence&gt; + * &lt;attribute name="matrix" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt; + * &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" /&gt; + * &lt;/restriction&gt; + * &lt;/complexContent&gt; + * &lt;/complexType&gt; + * </pre> + * + * + */ + @XmlAccessorType(XmlAccessType.FIELD) + @XmlType(name = "MapOnAMatrixType", propOrder = { + "property", + "mapping" + }) + public class MapOnAMatrixType { + + protected List property; + protected MapListType mapping; + @XmlAttribute(name = "matrix", required = true) + protected String matrix; + @XmlAttribute(name = "id") + protected String id; + + /** + * Gets the value of the property property. + * + * <p> + * This accessor method returns a reference to the live list, + * not a snapshot. Therefore any modification you make to the + * returned list will be present inside the JAXB object. + * This is why there is not a <CODE>set</CODE> method for the property property. + * + * <p> + * For example, to add a new item, do as follows: + * <pre> + * getProperty().add(newItem); + * </pre> + * + * + * <p> + * Objects of the following type(s) are allowed in the list + * {@link Property } + * + * + */ + public List getProperty() { + if (property == null) { + property = new ArrayList(); + } + return this.property; + } + + /** + * Gets the value of the mapping property. + * + * @return + * possible object is + * {@link MapListType } + * + */ + public MapListType getMapping() { + return mapping; + } + + /** + * Sets the value of the mapping property. + * + * @param value + * allowed object is + * {@link MapListType } + * + */ + public void setMapping(MapListType value) { + this.mapping = value; + } + + /** + * Gets the value of the matrix property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMatrix() { + return matrix; + } + + /** + * Sets the value of the matrix property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMatrix(String value) { + this.matrix = value; + } + + /** + * Gets the value of the id property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + } diff --cc src/jalview/xml/binding/jalview/Mapping.java index 3b0acb1,f32c611..9c98af8 --- a/src/jalview/xml/binding/jalview/Mapping.java +++ b/src/jalview/xml/binding/jalview/Mapping.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/MatrixType.java index 54384ba,01629b0..34d1158 --- a/src/jalview/xml/binding/jalview/MatrixType.java +++ b/src/jalview/xml/binding/jalview/MatrixType.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/NoValueColour.java index 8c489f5,5b329a9..8d22ad8 --- a/src/jalview/xml/binding/jalview/NoValueColour.java +++ b/src/jalview/xml/binding/jalview/NoValueColour.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/ObjectFactory.java index 93734e4,26269ec..90ce3fa --- a/src/jalview/xml/binding/jalview/ObjectFactory.java +++ b/src/jalview/xml/binding/jalview/ObjectFactory.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/PcaDataType.java index 517c9a9,a4b2dbe..aa418e5 --- a/src/jalview/xml/binding/jalview/PcaDataType.java +++ b/src/jalview/xml/binding/jalview/PcaDataType.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/Pdbentry.java index 4b5b62d,6fabea0..144076b --- a/src/jalview/xml/binding/jalview/Pdbentry.java +++ b/src/jalview/xml/binding/jalview/Pdbentry.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/Property.java index 1084043,4c85bc3..5fc6047 --- a/src/jalview/xml/binding/jalview/Property.java +++ b/src/jalview/xml/binding/jalview/Property.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/Sequence.java index 122aeae,76b4f1a..af05181 --- a/src/jalview/xml/binding/jalview/Sequence.java +++ b/src/jalview/xml/binding/jalview/Sequence.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/SequenceSet.java index 0f1c46c,ce80b9c..751f6ca --- a/src/jalview/xml/binding/jalview/SequenceSet.java +++ b/src/jalview/xml/binding/jalview/SequenceSet.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/SequenceType.java index 53f7f7b,dbcefe8..429061b --- a/src/jalview/xml/binding/jalview/SequenceType.java +++ b/src/jalview/xml/binding/jalview/SequenceType.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/ThresholdType.java index 856522a,a467506..f6570a2 --- a/src/jalview/xml/binding/jalview/ThresholdType.java +++ b/src/jalview/xml/binding/jalview/ThresholdType.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/VAMSAS.java index 2f14733,f1eab2b..6c5240f --- a/src/jalview/xml/binding/jalview/VAMSAS.java +++ b/src/jalview/xml/binding/jalview/VAMSAS.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/WebServiceParameterSet.java index 067e5c2,577c9a4..181d9e1 --- a/src/jalview/xml/binding/jalview/WebServiceParameterSet.java +++ b/src/jalview/xml/binding/jalview/WebServiceParameterSet.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // diff --cc src/jalview/xml/binding/jalview/package-info.java index 22d69d8,21a46db..bb3301a --- a/src/jalview/xml/binding/jalview/package-info.java +++ b/src/jalview/xml/binding/jalview/package-info.java @@@ -2,7 -2,7 +2,7 @@@ // This file was generated by the Eclipse Implementation of JAXB, v2.3.3 // See https://eclipse-ee4j.github.io/jaxb-ri // Any modifications to this file will be lost upon recompilation of the source schema. - // Generated on: 2023.09.08 at 03:55:49 PM BST -// Generated on: 2023.09.01 at 02:16:11 PM BST ++// Generated on: 2023.11.01 at 07:03:09 PM GMT // @javax.xml.bind.annotation.XmlSchema(namespace = "www.vamsas.ac.uk/jalview/version2", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) diff --cc test/jalview/gui/AlignmentPanelTest.java index 0f254dc,892cdef..a39257c --- a/test/jalview/gui/AlignmentPanelTest.java +++ b/test/jalview/gui/AlignmentPanelTest.java @@@ -23,8 -23,8 +23,9 @@@ package jalview.gui import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotEquals; import static org.testng.Assert.assertNotNull; +import static org.testng.Assert.assertTrue; + import java.awt.Container; import java.awt.Dimension; import java.awt.Font; import java.awt.FontMetrics; diff --cc test/jalview/project/Jalview2xmlTests.java index 07f2766,9c1b32f..76c5266 --- a/test/jalview/project/Jalview2xmlTests.java +++ b/test/jalview/project/Jalview2xmlTests.java @@@ -1646,69 -1686,56 +1686,119 @@@ public class Jalview2xmlTests extends J Assert.assertEquals(restoredMat.getGroups(), dummyMat.getGroups()); Assert.assertEquals(restoredMat.hasTree(), dummyMat.hasTree()); Assert.assertEquals(restoredMat.getNewick(), dummyMat.getNewick()); + + // verify no duplicate PAE matrix data when new view created and saved + + // add reference annotations to view first, then copy + AlignmentUtils.addReferenceAnnotationTo(newAl, newAl.getSequenceAt(0), newSeq.getAnnotation()[0],null); + + AlignmentViewPanel newview = af.newView("copy of PAE", true); + + // redundant asserts here check all is good with the new view firest... + AlignmentI newviewAl = newview.getAlignment(); + SequenceI newviewSeq = newviewAl.getSequenceAt(0); + // check annotation of the expected type exists + Assert.assertEquals(newviewSeq.getAnnotation().length, 1); + Assert.assertEquals(newviewSeq.getAnnotation()[0].graph, paeCm.graph); + // check we have just one contact matrix mapping + Assert.assertEquals(newviewSeq.getContactMaps().size(), 1); + + // and can be found for the annotation on the sequence + ContactMatrixI newviewMat = newviewSeq + .getContactMatrixFor(newviewSeq.getAnnotation()[0]); + Assert.assertNotNull(newviewMat); + + Assert.assertTrue(newviewMat == restoredMat); + + // save the two views and restore. Now look at visible annotation to check all views have shared refs. + + tfile = File.createTempFile("testStoreAndRecoverPAEmatrixTwoViews", + ".jvp"); + new Jalview2XML(false).saveState(tfile); + Desktop.instance.closeAll_actionPerformed(null); + + af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(), + DataSourceType.FILE); + newAl = af.getAlignPanels().get(0).getAlignment(); + AlignmentAnnotation view1aa = newAl.getSequenceAt(0).getAnnotation()[0]; + + newviewAl = af.getAlignPanels().get(1).getAlignment(); + AlignmentAnnotation view2aa = newviewAl.getSequenceAt(0).getAnnotation()[0]; + + // annotations are shared across alignment views - so should still have an identical pair of annotations. + Assert.assertTrue(view1aa==view2aa); + // identical annotations means identical contact matrix mappings + Assert.assertEquals(newAl.getDataset().getSequenceAt(0).getContactMaps().size(), 1); + + // TODO Verify when distinct mappable PAEs are created, only one PAE dataset is actually held. + // Assert.assertTrue(view1aa!=view2aa); + // restoredMat = newAl.getContactMatrixFor(view1aa); + // newviewMat = newviewAl.getContactMatrixFor(view2aa); + // Assert.assertTrue(restoredMat!=newviewMat); + } + @Test(groups = "Functional") + public void testStoreAndRestoreIDwidthAndAnnotationHeight() throws IOException + { + Desktop.instance.closeAll_actionPerformed(null); + final String SECONDVIEW = "With Diffferent IDwidth"; + // create a new tempfile + File tempfile = File.createTempFile("jvIdWidthStoreRestore", "jvp"); + + + AlignFrame af = new FileLoader().LoadFileWaitTillLoaded("examples/exampleFile.jvp", + DataSourceType.FILE); + assertNotNull(af, "Didn't read in the example file correctly."); + assertEquals(af.alignPanel.getAlignViewport().getIdWidth(), 144, + "Legacy project import should have fixed ID width"); + assertTrue(af.alignPanel.getIdPanel().getIdCanvas().isManuallyAdjusted()); + + + af.alignPanel.getAlignViewport().setIdWidth(100); + af.alignPanel.updateLayout(); + assertTrue(af.alignPanel.getIdPanel().getIdCanvas().isManuallyAdjusted()); + + Jalview2XML jv2xml = new jalview.project.Jalview2XML(false); + tempfile.delete(); + jv2xml.saveState(tempfile); + assertTrue(jv2xml.errorMessage == null, + "Failed to save dummy project with PCA: test broken"); + af = null; + // load again. + Desktop.instance.closeAll_actionPerformed(null); + af = new FileLoader().LoadFileWaitTillLoaded( + tempfile.getCanonicalPath(), DataSourceType.FILE); + assertTrue(af.alignPanel.getIdPanel().getIdCanvas() + .isManuallyAdjusted()); + assertEquals(af.alignPanel.getAlignViewport().getIdWidth(), 100, + "New project exported and import should have adjusted ID width"); + + af.alignPanel.getAlignViewport().setIdWidth(100); + af.alignPanel.updateLayout(); + assertTrue(af.alignPanel.getIdPanel().getIdCanvas().isManuallyAdjusted()); + + // now make it autoadjusted + af.alignPanel.getAlignViewport().setIdWidth(-1); + af.alignPanel.getIdPanel().getIdCanvas().setManuallyAdjusted(false); + af.alignPanel.updateLayout(); + assertFalse(af.alignPanel.getIdPanel().getIdCanvas().isManuallyAdjusted()); + assertTrue(af.alignPanel.getAlignViewport().getIdWidth()>-1, + "New project exported and import should have adjusted ID width"); + + jv2xml = new jalview.project.Jalview2XML(false); + tempfile.delete(); + jv2xml.saveState(tempfile); + assertTrue(jv2xml.errorMessage == null, + "Failed to save dummy project with PCA: test broken"); + af = null; + // load again. + Desktop.instance.closeAll_actionPerformed(null); + af = new FileLoader().LoadFileWaitTillLoaded( + tempfile.getCanonicalPath(), DataSourceType.FILE); + assertFalse(af.alignPanel.getIdPanel().getIdCanvas().isManuallyAdjusted()); + assertTrue(af.alignPanel.getAlignViewport().getIdWidth()>-1, + "New project exported and import should have adjusted ID width"); + } + }