<xs:attribute name="fontName" type="xs:string" />
<xs:attribute name="fontSize" type="xs:int" />
<xs:attribute name="fontStyle" type="xs:int" />
+ <xs:attribute name="idWidth" type="xs:int" />
+ <xs:attribute name="idWidthManuallyAdjusted" type="xs:boolean" />
<xs:attribute name="scaleProteinAsCdna" type="xs:boolean" use="optional" default="true" />
<xs:attribute name="viewName" type="xs:string" />
<xs:attribute name="sequenceSetId" type="xs:string" />
/**
* Calculates the width of the alignment labels based on the displayed names
- * and any bounds on label width set in preferences. The calculated width is
- * also set as a property of the viewport.
+ * and any bounds on label width set in preferences.
+ *
+ * The calculated width is set as a property of the viewport and the layout is
+ * updated.
*
* @return Dimension giving the maximum width of the alignment label panel
* that should be used.
public Dimension calculateDefaultAlignmentIdWidth()
{
+ return calculateIdWidth(-1, false, false);
+ }
+ /**
+ * pre 2.11.3 Id width calculation - used when importing old projects only
+ * @return
+ */
+ public int getLegacyIdWidth()
+ {
int afwidth = (alignFrame != null ? alignFrame.getWidth() : 300);
int idWidth = Math.min(afwidth - 200, 2 * afwidth / 3);
int maxwidth = Math.max(IdwidthAdjuster.MIN_ID_WIDTH, idWidth);
- return calculateIdWidth(-1, false, false);
+ Dimension w = calculateIdWidthOrLegacy(true, maxwidth, false, false);
+ return w.width;
}
/**
* @param maxwidth
* -1 or maximum width allowed for IdWidth
* @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.
*/
public Dimension calculateIdWidth(int maxwidth,
boolean includeAnnotations, boolean visibleOnly)
{
+ return calculateIdWidthOrLegacy(false, maxwidth, includeAnnotations, visibleOnly);
+ }
+
+ /**
+ * legacy mode or post 2.11.3 ID width calculation
+ * @param legacy - uses annotation labels, not rendered label width (excludes additional decorators)
+ * @param maxwidth
+ * @param includeAnnotations
+ * @param visibleOnly
+ * @return
+ */
+ private Dimension calculateIdWidthOrLegacy(boolean legacy, int maxwidth,
+ boolean includeAnnotations, boolean visibleOnly)
+ {
Container c = new Container();
FontMetrics fm = c.getFontMetrics(
// 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, !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);
// this is called after loading new annotation onto alignment
if (alignFrame.getHeight() == 0)
{
- jalview.bin.Console.outPrintln("NEEDS FIXING");
+ jalview.bin.Console.error("adjustAnnotationHeight called with zero height alignment window");
}
validateAnnotationDimensions(true);
addNotify();
Dimension e = idPanel.getSize();
int idWidth = e.width;
boolean manuallyAdjusted = this.getIdPanel().getIdCanvas()
- .manuallyAdjusted();
+ .isManuallyAdjusted();
annotationScroller.setPreferredSize(new Dimension(
manuallyAdjusted ? idWidth : annotationScroller.getWidth(),
annotationHeight));
}
int w = getIdPanel().getWidth();
- w = this.calculateIdWidth(-1, true, true).width;
+ w = calculateIdWidth(-1, true, true).width;
return (w > 0 ? w : calculateIdWidth().width);
}
overviewPanel = null;
}
}
-
}
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, false);
private boolean manuallyAdjusted = false;
- public boolean manuallyAdjusted()
+ public boolean isManuallyAdjusted()
{
return manuallyAdjusted;
}
public void setWidth(int newWidth)
{
if (newWidth < MIN_ID_WIDTH
- || ap.getIdPanel().getIdCanvas().manuallyAdjusted())
+ || ap.getIdPanel().getIdCanvas().isManuallyAdjusted())
{
return;
}
public boolean manuallyAdjusted()
{
- return ap.getIdPanel().getIdCanvas().manuallyAdjusted();
+ return ap.getIdPanel().getIdCanvas().isManuallyAdjusted();
}
@Override
view.setShowColourText(av.getColourText());
view.setShowFullId(av.getShowJVSuffix());
view.setRightAlignIds(av.isRightAlignIds());
+ view.setIdWidth(av.getIdWidth());
+ view.setIdWidthManuallyAdjusted(ap.getIdPanel().getIdCanvas().isManuallyAdjusted());
+
view.setShowSequenceFeatures(av.isShowSequenceFeatures());
view.setShowText(av.getShowText());
view.setShowUnconserved(av.getShowUnconserved());
}
af.setBounds(safeInt(view.getXpos()), safeInt(view.getYpos()),
safeInt(view.getWidth()), safeInt(view.getHeight()));
+
+ af.alignPanel.fontChanged(); // make sure font is updated *before* we set ID width
+ if (view.getIdWidth()==null)
+ {
+ if (!isVersionStringLaterThan("2.11.3", jm.getVersion())) {
+ // Pre 2.11.3 jalview projects do not store the id width
+ // idWidth was also calculated in a different way.
+ viewport.setIdWidth(af.alignPanel.getLegacyIdWidth());
+ af.alignPanel.getIdPanel().getIdCanvas().setManuallyAdjusted(true);
+ }
+ } else {
+ viewport.setIdWidth(view.getIdWidth());
+ af.alignPanel.getIdPanel().getIdCanvas().setManuallyAdjusted(view.isIdWidthManuallyAdjusted());
+ }
+
// startSeq set in af.alignPanel.updateLayout below
af.alignPanel.updateLayout();
ColourSchemeI cs = null;
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
* &lt;attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
* &lt;attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
+ * &lt;attribute name="idWidth" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
+ * &lt;attribute name="idWidthManuallyAdjusted" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="scaleProteinAsCdna" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
* &lt;attribute name="viewName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="sequenceSetId" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
* &lt;attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
+ * &lt;attribute name="idWidth" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
+ * &lt;attribute name="idWidthManuallyAdjusted" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="scaleProteinAsCdna" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
* &lt;attribute name="viewName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="sequenceSetId" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
protected Integer fontSize;
@XmlAttribute(name = "fontStyle")
protected Integer fontStyle;
+ @XmlAttribute(name = "idWidth")
+ protected Integer idWidth;
+ @XmlAttribute(name = "idWidthManuallyAdjusted")
+ protected Boolean idWidthManuallyAdjusted;
@XmlAttribute(name = "scaleProteinAsCdna")
protected Boolean scaleProteinAsCdna;
@XmlAttribute(name = "viewName")
}
/**
+ * Gets the value of the idWidth property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getIdWidth() {
+ return idWidth;
+ }
+
+ /**
+ * Sets the value of the idWidth property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setIdWidth(Integer value) {
+ this.idWidth = value;
+ }
+
+ /**
+ * Gets the value of the idWidthManuallyAdjusted property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isIdWidthManuallyAdjusted() {
+ return idWidthManuallyAdjusted;
+ }
+
+ /**
+ * Sets the value of the idWidthManuallyAdjusted property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setIdWidthManuallyAdjusted(Boolean value) {
+ this.idWidthManuallyAdjusted = value;
+ }
+
+ /**
* Gets the value of the scaleProteinAsCdna property.
*
* @return
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
// 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
//
@javax.xml.bind.annotation.XmlSchema(namespace = "www.vamsas.ac.uk/jalview/version2", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
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;
Cache.setProperty("FIGURE_AUTOIDWIDTH", Boolean.TRUE.toString());
assertEquals(115, af.alignPanel.getVisibleIdWidth(false));
}
+ @Test(groups = { "Functional", "Not-bamboo" })
+ public void testresetIdWidth()
+ {
+ /*
+ * width for onscreen rendering is IDPanel width
+ */
+ int w = af.alignPanel.getVisibleIdWidth(true);
+ assertEquals(w, af.alignPanel.getIdPanel().getWidth());
+ assertEquals(w, 115);
+
+ // manually adjust
+ af.viewport.setIdWidth(200);
+ w = af.alignPanel.calculateIdWidth().width;
+ assertTrue(af.alignPanel.getIdPanel().getIdCanvas().isManuallyAdjusted());
+ assertEquals(w, af.alignPanel.getIdPanel().getWidth());
+ af.viewport.setIdWidth(-1);
+ af.alignPanel.getIdPanel().getIdCanvas().setManuallyAdjusted(false);
+ w = af.alignPanel.calculateIdWidth().width;
+
+ assertEquals(w, af.alignPanel.getIdPanel().getWidth());
+
+ assertNotEquals(w,115);
+ }
@Test(groups = "Functional")
public void testSetOverviewTitle()
{
import jalview.schemes.TCoffeeColourScheme;
import jalview.structure.StructureImportSettings;
import jalview.util.MapList;
+import jalview.util.Platform;
import jalview.util.matcher.Condition;
import jalview.viewmodel.AlignmentViewport;
import jalview.viewmodel.seqfeatures.FeatureRendererModel;
}
+ @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.");
+ // FIXME JAL-4281 test made platform dependent to pass, but probably shouldn't be platform dependent
+ assertEquals(af.alignPanel.getAlignViewport().getIdWidth(), Platform.isAMacAndNotJS() ? 144 : 138,
+ "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");
+ }
+
}