import jalview.io.DataSourceType;
import jalview.io.FileLoader;
import jalview.structure.StructureImportSettings.TFType;
+import jalview.util.Platform;
public class AnnotationLabelsTest2
{
+ private static double scaling;
+
@BeforeClass(alwaysRun = true)
public static void setUpBeforeClass() throws Exception
{
*/
Cache.loadProperties("test/jalview/io/testProps.jvprops");
Jalview.main(new String[] { "--nonews", "--nosplash", });
+
+ scaling = JvSwingUtilsTest.getScaling(Desktop.instance);
}
@AfterMethod(alwaysRun = true)
{
AlignFrame af = new FileLoader()
.LoadFileWaitTillLoaded(alignmentFilename, DataSourceType.FILE);
+
try
{
Thread.sleep(200); // to allow alignment annotations to open
idWidth = av.getIdWidth();
assertTrue(idWidth > idWidth1min,
"idWidth (" + idWidth + ") is not greater than " + idWidth1min);
- assertTrue(idWidth < idWidth1max,
- "idWidth (" + idWidth + ") is not narrower than" + idWidth1max);
+ assertTrue(idWidth < idWidth1max, "idWidth (" + idWidth
+ + ") is not narrower than " + idWidth1max);
// set wrap
if (wrap)
// idWidth = ap.getIdPanel().getWidth();
idWidth = av.getIdWidth();
- assertTrue(idWidth > idWidth2min,
+ assertTrue(idWidth >= idWidth2min,
"idWidth (" + idWidth + ") is not greater than " + idWidth2min);
- assertTrue(idWidth < idWidth2max,
- "idWidth (" + idWidth + ") is not narrower than" + idWidth2max);
+ assertTrue(idWidth <= idWidth2max, "idWidth (" + idWidth
+ + ") is not narrower than " + idWidth2max);
}
@Test(
AlignViewport av = af.getCurrentView();
int idWidth = 0;
-
idWidth = av.getIdWidth();
assertTrue(idWidth > idWidth1min,
"idWidth (" + idWidth + ") is not greater than " + idWidth1min);
int idWidth2min,
int idWidth2max,
*/
+ int idWidth2min = scaling == 1.0 ? 114 : 108;
+ int idWidth2max = scaling == 1.0 ? 117 : 114; // was 130
+ if (Platform.isMac())
+ {
+ idWidth2max = 122;
+ }
+
return new Object[][] {
//
/*
100,
"./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb",
"./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3_scores.json",
- true, TFType.PLDDT, null, 115, 130 },
+ true, TFType.PLDDT, null, idWidth2min, idWidth2max },
{ "./test/files/annotation_label_width/sample.a2m", true, 50, 70,
100,
"./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb",
"./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3_scores.json",
- true, TFType.PLDDT, null, 115, 130 },
+ true, TFType.PLDDT, null, idWidth2min, idWidth2max },
/*
*/
};