From: Jim Procter Date: Thu, 11 Apr 2019 13:52:20 +0000 (+0100) Subject: Merge branch 'develop' into task/JAL-3130_Java_11_investigations-getdown_src X-Git-Tag: Release_2_11_0~17^2~7^2~43 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b74e75812b411ed8838f2c57d84fa1b328bbefe5;hp=-c;p=jalview.git Merge branch 'develop' into task/JAL-3130_Java_11_investigations-getdown_src --- b74e75812b411ed8838f2c57d84fa1b328bbefe5 diff --combined .classpath index 6b4d3fd,7b2b32a..00f7056 --- a/.classpath +++ b/.classpath @@@ -3,11 -3,15 +3,11 @@@ - - - - @@@ -43,12 -47,15 +43,12 @@@ - - - @@@ -60,6 -67,6 +60,6 @@@ - + diff --combined build-j11.xml index d56d029,d8d4465..9f2761b --- a/build-j11.xml +++ b/build-j11.xml @@@ -44,7 -44,6 +44,7 @@@ + @@@ -107,15 -106,6 +107,15 @@@ + + + + + + + + + @@@ -126,12 -116,8 +126,12 @@@ - - + + + + + + @@@ -143,7 -129,6 +143,7 @@@ + @@@ -182,10 -167,6 +182,10 @@@ + + + + @@@ -199,7 -180,6 +199,7 @@@ + @@@ -296,14 -276,7 +296,14 @@@ - + + + + + @@@ -327,13 -300,6 +327,13 @@@ + + + + + + + @@@ -341,35 -307,9 +341,35 @@@ + + + + + + + + + + + + + + + + + + + + + + + + @@@ -1034,8 -974,9 +1034,9 @@@ + - + diff --combined resources/lang/Messages.properties index 2d48fac,a400afe..664dc4c --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@@ -32,7 -32,6 +32,7 @@@ action.load_project = Load Projec action.save_project = Save Project action.save_project_as = Save Project as... action.quit = Quit +label.quit_jalview = Quit Jalview? action.expand_views = Expand Views action.gather_views = Gather Views action.page_setup = Page Setup... @@@ -185,22 -184,22 +185,22 @@@ label.out_to_textbox = Output to Textbo label.occupancy = Occupancy # delete Clustal - use FileFormat name instead label.clustal = Clustal - # label.colourScheme_ as in JalviewColourScheme + # label.colourScheme_ as in JalviewColourScheme, spaces removed label.colourScheme_clustal = Clustalx label.colourScheme_blosum62 = BLOSUM62 Score - label.colourScheme_%_identity = Percentage Identity + label.colourScheme_%identity = Percentage Identity label.colourScheme_zappo = Zappo label.colourScheme_taylor = Taylor label.colourScheme_hydrophobic = Hydrophobicity - label.colourScheme_helix_propensity = Helix Propensity - label.colourScheme_strand_propensity = Strand Propensity - label.colourScheme_turn_propensity = Turn Propensity - label.colourScheme_buried_index = Buried Index + label.colourScheme_helixpropensity = Helix Propensity + label.colourScheme_strandpropensity = Strand Propensity + label.colourScheme_turnpropensity = Turn Propensity + label.colourScheme_buriedindex = Buried Index label.colourScheme_purine/pyrimidine = Purine/Pyrimidine label.colourScheme_nucleotide = Nucleotide - label.colourScheme_t-coffee_scores = T-Coffee Scores - label.colourScheme_rna_helices = By RNA Helices - label.colourScheme_sequence_id = Sequence ID Colour + label.colourScheme_t-coffeescores = T-Coffee Scores + label.colourScheme_rnahelices = By RNA Helices + label.colourScheme_sequenceid = Sequence ID Colour label.blc = BLC label.fasta = Fasta label.msf = MSF diff --combined resources/lang/Messages_es.properties index ade37ff,08373ba..7c65eb0 --- a/resources/lang/Messages_es.properties +++ b/resources/lang/Messages_es.properties @@@ -32,7 -32,6 +32,7 @@@ action.load_project = Cargar proyect action.save_project = Guardar proyecto action.save_project_as = Guardar proyecto como... action.quit = Salir +label.quit_jalview = Salir Javliew? action.expand_views = Expandir vistas action.gather_views = Capturar vistas action.page_setup = Configuración de la página @@@ -184,19 -183,19 +184,19 @@@ label.clustal = Clusta # label.colourScheme_ as in JalviewColourScheme label.colourScheme_clustal = Clustalx label.colourScheme_blosum62 = Puntuación del BLOSUM62 - label.colourScheme_%_identity = Porcentaje de identidad + label.colourScheme_%identity = Porcentaje de identidad label.colourScheme_zappo = Zappo label.colourScheme_taylor = Taylor label.colourScheme_hydrophobic = Hidrofobicidad - label.colourScheme_helix_propensity = Tendencia de la hélice - label.colourScheme_strand_propensity = Tendencia de la hebra - label.colourScheme_turn_propensity = Tendencia de giro - label.colourScheme_buried_index = Índice de encubrimiento + label.colourScheme_helixpropensity = Tendencia de la hélice + label.colourScheme_strandpropensity = Tendencia de la hebra + label.colourScheme_turnpropensity = Tendencia de giro + label.colourScheme_buriedindex = Índice de encubrimiento label.colourScheme_purine/pyrimidine = Purina/Pirimidina label.colourScheme_nucleotide = Nucleótido - label.colourScheme_t-coffee_scores = Puntuación del T-Coffee - label.colourScheme_rna_helices = Por hélices de RNA - label.colourScheme_sequence_id = Color de ID de secuencia + label.colourScheme_t-coffeescores = Puntuación del T-Coffee + label.colourScheme_rnahelices = Por hélices de RNA + label.colourScheme_sequenceid = Color de ID de secuencia label.blc = BLC label.fasta = Fasta label.msf = MSF diff --combined src/jalview/gui/AlignFrame.java index adc8a15,0239bb4..0ab7515 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@@ -974,7 -974,7 +974,7 @@@ public class AlignFrame extends GAlignF @Override public void setStatus(String text) { - statusBar.setText(text); + statusBar.setText(text == null || text.isEmpty() ? " " : text); } /* @@@ -1203,23 -1203,7 +1203,23 @@@ PrintWriter out = new PrintWriter( new FileWriter(backupfiles.getTempFilePath())); + // TESTING code here + boolean TESTING = true; + if (TESTING) + { + out.print("; TESTSTART\n"); + int count = 20; + for (int i = 0; i < count; i++) + { + // Thread.sleep(1000); + out.println("; TEST: " + (count - 1 - i)); + } + } out.print(output); + if (TESTING) + { + out.print("; TESTEND\n"); + } out.close(); this.setTitle(file); statusBar.setText(MessageManager.formatMessage( @@@ -2108,7 -2092,7 +2108,7 @@@ newGraphGroups.add(q, null); } newGraphGroups.set(newann.graphGroup, - new Integer(++fgroup)); + Integer.valueOf(++fgroup)); } newann.graphGroup = newGraphGroups.get(newann.graphGroup) .intValue(); @@@ -2155,7 -2139,7 +2155,7 @@@ newGraphGroups.add(q, null); } newGraphGroups.set(newann.graphGroup, - new Integer(++fgroup)); + Integer.valueOf(++fgroup)); } newann.graphGroup = newGraphGroups.get(newann.graphGroup) .intValue(); @@@ -3120,7 -3104,7 +3120,7 @@@ protected void scaleAbove_actionPerformed(ActionEvent e) { viewport.setScaleAboveWrapped(scaleAbove.isSelected()); - // TODO: do we actually need to update overview for scale above change ? + alignPanel.updateLayout(); alignPanel.paintAlignment(true, false); } @@@ -3134,6 -3118,7 +3134,7 @@@ protected void scaleLeft_actionPerformed(ActionEvent e) { viewport.setScaleLeftWrapped(scaleLeft.isSelected()); + alignPanel.updateLayout(); alignPanel.paintAlignment(true, false); } @@@ -3147,6 -3132,7 +3148,7 @@@ protected void scaleRight_actionPerformed(ActionEvent e) { viewport.setScaleRightWrapped(scaleRight.isSelected()); + alignPanel.updateLayout(); alignPanel.paintAlignment(true, false); } @@@ -4505,8 -4491,7 +4507,8 @@@ int assocfiles = 0; if (filesmatched.size() > 0) { - boolean autoAssociate = Cache.getDefault("AUTOASSOCIATE_PDBANDSEQS", false); + boolean autoAssociate = Cache + .getDefault("AUTOASSOCIATE_PDBANDSEQS", false); if (!autoAssociate) { String msg = MessageManager.formatMessage( diff --combined test/jalview/bin/CommandLineOperations.java index 483bb8b,c7b1d53..ace1868 --- a/test/jalview/bin/CommandLineOperations.java +++ b/test/jalview/bin/CommandLineOperations.java @@@ -20,6 -20,9 +20,9 @@@ */ package jalview.bin; + import static org.testng.Assert.assertNotNull; + import static org.testng.Assert.assertTrue; + import jalview.gui.JvOptionPane; import java.io.BufferedReader; @@@ -48,8 -51,7 +51,8 @@@ public class CommandLineOperation JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION); } - private static final int TEST_TIMEOUT = 9000; // Note longer timeout needed on + private static final int TEST_TIMEOUT = 9000; // Note longer timeout needed + // on // full test run than on // individual tests @@@ -142,20 -144,21 +145,20 @@@ return classpath; } - private Worker jalviewDesktopRunner(boolean withAwt, String cmd, + private Worker getJalviewDesktopRunner(boolean withAwt, String cmd, int timeout) { // Note: JAL-3065 - don't include quotes for lib/* because the arguments are // not expanded by the shell String classpath = getClassPath(); - String _cmd = "java " - + (withAwt ? "-Djava.awt.headless=true" : "") + String _cmd = "java " + (withAwt ? "-Djava.awt.headless=true" : "") + " -classpath " + classpath + " jalview.bin.Jalview "; Process ls2_proc = null; Worker worker = null; try { ls2_proc = Runtime.getRuntime().exec(_cmd + cmd); - } catch (IOException e1) + } catch (Throwable e1) { e1.printStackTrace(); } @@@ -172,7 -175,7 +175,7 @@@ worker.join(timeout); } catch (InterruptedException e) { - // e.printStackTrace(); + System.err.println("Thread interrupted"); } worker.setOutputReader(outputReader); worker.setErrorReader(errorReader); @@@ -190,23 -193,27 +193,27 @@@ public void setUpForHeadlessCommandLineInputOperations() throws IOException { - String cmds = "nodisplay -open examples/uniref50.fa -sortbytree -props FILE -colour zappo " - + "-jabaws http://www.compbio.dundee.ac.uk/jabaws -nosortbytree -dasserver nickname=www.test.com " + String cmds = "nodisplay -open examples/uniref50.fa -sortbytree -props test/jalview/io/testProps.jvprops -colour zappo " + + "-jabaws http://www.compbio.dundee.ac.uk/jabaws -nosortbytree " + "-features examples/testdata/plantfdx.features -annotations examples/testdata/plantfdx.annotations -tree examples/testdata/uniref50_test_tree"; - Worker worker = jalviewDesktopRunner(true, cmds, SETUP_TIMEOUT); + Worker worker = getJalviewDesktopRunner(true, cmds, SETUP_TIMEOUT); String ln = null; while ((ln = worker.getOutputReader().readLine()) != null) { System.out.println(ln); successfulCMDs.add(ln); } + while ((ln = worker.getErrorReader().readLine()) != null) + { + System.err.println(ln); + } } @BeforeTest(alwaysRun = true) public void setUpForCommandLineInputOperations() throws IOException { String cmds = "-open examples/uniref50.fa -noquestionnaire -nousagestats"; - Worker worker = jalviewDesktopRunner(false, cmds, SETUP_TIMEOUT); + Worker worker = getJalviewDesktopRunner(false, cmds, SETUP_TIMEOUT); String ln = null; int count = 0; while ((ln = worker.getErrorReader().readLine()) != null) @@@ -226,7 -233,7 +233,7 @@@ } } - @Test(groups = { "Functional" }, dataProvider = "allInputOpearationsData") + @Test(groups = { "Functional" }, dataProvider = "allInputOperationsData") public void testAllInputOperations(String expectedString, String failureMsg) { @@@ -234,8 -241,7 +241,8 @@@ } @Test( - groups = { "Functional" }, + groups = + { "Functional", "testben" }, dataProvider = "headlessModeOutputOperationsData") public void testHeadlessModeOutputOperations(String harg, String type, String fileName, boolean withAWT, int expectedMinFileSize, @@@ -244,34 -250,35 +251,33 @@@ String cmd = harg + type + " " + fileName; // System.out.println(">>>>>>>>>>>>>>>> Command : " + cmd); File file = new File(fileName); - Worker worker = jalviewDesktopRunner(withAWT, cmd, timeout); - - FileAssert.assertFile(file, - "Didn't create an output" + type + " file.[" + harg + "]"); - // System.out.println( "File '" + file.getName() + "' has size " + - // file.length()); - // FileAssert.assertMinLength(new File(fileName), expectedMinFileSize); + file.deleteOnExit(); + Worker worker = getJalviewDesktopRunner(withAWT, cmd, timeout); + assertNotNull(worker, "worker is null"); + String msg = "Didn't create an output" + type + " file.[" + harg + "]"; + assertTrue(file.exists(), msg); + FileAssert.assertFile(file, msg); FileAssert.assertMinLength(file, expectedMinFileSize); if (worker != null && worker.exit == null) { worker.interrupt(); Thread.currentThread().interrupt(); worker.process.destroy(); - Assert.fail("Jalview did not exit after " - + type + Assert.fail("Jalview did not exit after " + type + " generation (try running test again to verify - timeout at " - + SETUP_TIMEOUT + "ms). [" - + harg + "]"); + + timeout + "ms). [" + harg + "]"); } - new File(fileName).delete(); + file.delete(); } - @DataProvider(name = "allInputOpearationsData") + @DataProvider(name = "allInputOperationsData") public Object[][] getHeadlessModeInputParams() { return new Object[][] { // headless mode input operations { "CMD [-color zappo] executed successfully!", "Failed command : -color zappo" }, - { "CMD [-props FILE] executed successfully!", + { "CMD [-props test/jalview/io/testProps.jvprops] executed successfully!", "Failed command : -props File" }, { "CMD [-sortbytree] executed successfully!", "Failed command : -sortbytree" }, @@@ -281,8 -288,7 +287,7 @@@ "Failed command : -open examples/uniref50.fa" }, { "CMD [-nosortbytree] executed successfully!", "Failed command : -nosortbytree" }, - { - "CMD [-features examples/testdata/plantfdx.features] executed successfully!", + { "CMD [-features examples/testdata/plantfdx.features] executed successfully!", "Failed command : -features examples/testdata/plantfdx.features" }, { "CMD [-annotations examples/testdata/plantfdx.annotations] executed successfully!", "Failed command : -annotations examples/testdata/plantfdx.annotations" }, @@@ -293,52 -299,59 +298,58 @@@ "Failed command : -nousagestats" }, { "CMD [-noquestionnaire] executed successfully!", "Failed command : -noquestionnaire" } }; - } @DataProvider(name = "headlessModeOutputOperationsData") public static Object[][] getHeadlessModeOutputParams() { -- return new Object[][] { -- { "nodisplay -open examples/uniref50.fa", " -eps", - "test_uniref50_out.eps", true, MINFILESIZE_BIG, TEST_TIMEOUT }, - "test/jalview/bin/test_uniref50_out.eps", true, MINFILESIZE_BIG, - TEST_TIMEOUT }, ++ return new Object[][] { { "nodisplay -open examples/uniref50.fa", ++ " -eps", "test/jalview/bin/test_uniref50_out.eps", true, ++ MINFILESIZE_BIG, TEST_TIMEOUT }, { "nodisplay -open examples/uniref50.fa", " -eps", - "test_uniref50_out.eps", false, MINFILESIZE_BIG, TEST_TIMEOUT }, + "test/jalview/bin/test_uniref50_out.eps", false, + MINFILESIZE_BIG, TEST_TIMEOUT }, { "nogui -open examples/uniref50.fa", " -eps", - "test_uniref50_out.eps", true, MINFILESIZE_BIG, TEST_TIMEOUT }, + "test/jalview/bin/test_uniref50_out.eps", true, MINFILESIZE_BIG, + TEST_TIMEOUT }, { "nogui -open examples/uniref50.fa", " -eps", - "test_uniref50_out.eps", false, MINFILESIZE_BIG, TEST_TIMEOUT }, + "test/jalview/bin/test_uniref50_out.eps", false, + MINFILESIZE_BIG, TEST_TIMEOUT }, { "headless -open examples/uniref50.fa", " -eps", - "test_uniref50_out.eps", true, MINFILESIZE_BIG, TEST_TIMEOUT }, + "test/jalview/bin/test_uniref50_out.eps", true, MINFILESIZE_BIG, + TEST_TIMEOUT }, { "headless -open examples/uniref50.fa", " -svg", - "test_uniref50_out.svg", false, MINFILESIZE_BIG, TEST_TIMEOUT }, + "test/jalview/bin/test_uniref50_out.svg", false, + MINFILESIZE_BIG, TEST_TIMEOUT }, { "headless -open examples/uniref50.fa", " -png", - "test_uniref50_out.png", true, MINFILESIZE_BIG, TEST_TIMEOUT }, + "test/jalview/bin/test_uniref50_out.png", true, MINFILESIZE_BIG, + TEST_TIMEOUT }, { "headless -open examples/uniref50.fa", " -html", - "test_uniref50_out.html", true, MINFILESIZE_BIG, TEST_TIMEOUT }, + "test/jalview/bin/test_uniref50_out.html", true, + MINFILESIZE_BIG, TEST_TIMEOUT }, { "headless -open examples/uniref50.fa", " -fasta", - "test/jalview/bin/test_uniref50_out.mfa", true, - MINFILESIZE_SMALL, TEST_TIMEOUT }, + "test_uniref50_out.mfa", true, MINFILESIZE_SMALL, + TEST_TIMEOUT }, { "headless -open examples/uniref50.fa", " -clustal", - "test/jalview/bin/test_uniref50_out.aln", true, - MINFILESIZE_SMALL, TEST_TIMEOUT }, + "test_uniref50_out.aln", true, MINFILESIZE_SMALL, + TEST_TIMEOUT }, { "headless -open examples/uniref50.fa", " -msf", - "test/jalview/bin/test_uniref50_out.msf", true, - MINFILESIZE_SMALL, TEST_TIMEOUT }, + "test_uniref50_out.msf", true, MINFILESIZE_SMALL, + TEST_TIMEOUT }, { "headless -open examples/uniref50.fa", " -pileup", - "test/jalview/bin/test_uniref50_out.aln", true, - MINFILESIZE_SMALL, TEST_TIMEOUT }, + "test_uniref50_out.aln", true, MINFILESIZE_SMALL, + TEST_TIMEOUT }, { "headless -open examples/uniref50.fa", " -pir", - "test/jalview/bin/test_uniref50_out.pir", true, - MINFILESIZE_SMALL, TEST_TIMEOUT }, + "test_uniref50_out.pir", true, MINFILESIZE_SMALL, + TEST_TIMEOUT }, { "headless -open examples/uniref50.fa", " -pfam", - "test/jalview/bin/test_uniref50_out.pfam", true, - MINFILESIZE_SMALL, TEST_TIMEOUT }, + "test_uniref50_out.pfam", true, MINFILESIZE_SMALL, + TEST_TIMEOUT }, { "headless -open examples/uniref50.fa", " -blc", - "test/jalview/bin/test_uniref50_out.blc", true, - MINFILESIZE_SMALL, TEST_TIMEOUT }, + "test_uniref50_out.blc", true, MINFILESIZE_SMALL, + TEST_TIMEOUT }, { "headless -open examples/uniref50.fa", " -jalview", - "test/jalview/bin/test_uniref50_out.jvp", true, - MINFILESIZE_SMALL, TEST_TIMEOUT }, }; + "test_uniref50_out.jvp", true, MINFILESIZE_SMALL, + TEST_TIMEOUT }, }; } } diff --combined test/jalview/gui/SeqPanelTest.java index bdbc3c9,6783514..571c75b --- a/test/jalview/gui/SeqPanelTest.java +++ b/test/jalview/gui/SeqPanelTest.java @@@ -40,7 -40,8 +40,7 @@@ import jalview.io.DataSourceType import jalview.io.FileLoader; import jalview.util.MessageManager; -import java.awt.Event; -import java.awt.EventQueue; +import java.awt.event.InputEvent;import java.awt.EventQueue; import java.awt.event.MouseEvent; import java.lang.reflect.InvocationTargetException; @@@ -240,7 -241,7 +240,7 @@@ public class SeqPanelTes /* * mouse at top left of unwrapped panel */ - MouseEvent evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, + MouseEvent evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); MousePos pos = testee.findMousePosition(evt); assertEquals(pos.column, 0); @@@ -265,8 -266,8 +265,8 @@@ av.setScaleAboveWrapped(false); av.setScaleLeftWrapped(false); av.setScaleRightWrapped(false); - alignFrame.alignPanel.paintAlignment(false, false); - waitForSwing(); // for Swing thread + + alignFrame.alignPanel.updateLayout(); final int charHeight = av.getCharHeight(); final int charWidth = av.getCharWidth(); @@@ -285,7 -286,7 +285,7 @@@ * mouse at top left of wrapped panel; there is a gap of charHeight * above the alignment */ - MouseEvent evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, + MouseEvent evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); MousePos pos = testee.findMousePosition(evt); assertEquals(pos.column, 0); @@@ -296,7 -297,7 +296,7 @@@ * cursor at bottom of gap above */ y = charHeight - 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, -1); @@@ -306,7 -307,7 +306,7 @@@ * cursor over top of first sequence */ y = charHeight; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, 0); @@@ -316,7 -317,7 +316,7 @@@ * cursor at bottom of first sequence */ y = 2 * charHeight - 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, 0); @@@ -326,7 -327,7 +326,7 @@@ * cursor at top of second sequence */ y = 2 * charHeight; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, 1); @@@ -336,7 -337,7 +336,7 @@@ * cursor at bottom of second sequence */ y = 3 * charHeight - 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, 1); @@@ -346,7 -347,7 +346,7 @@@ * cursor at bottom of last sequence */ y = charHeight * (1 + alignmentHeight) - 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, alignmentHeight - 1); @@@ -357,7 -358,7 +357,7 @@@ * method reports index of nearest sequence above */ y += 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, alignmentHeight - 1); @@@ -367,7 -368,7 +367,7 @@@ * cursor still in the gap above annotations, now at the bottom of it */ y += SeqCanvas.SEQS_ANNOTATION_GAP - 1; // 3-1 = 2 - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, alignmentHeight - 1); @@@ -381,7 -382,7 +381,7 @@@ * cursor at the top of the n'th annotation */ y += 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, alignmentHeight - 1); @@@ -391,7 -392,7 +391,7 @@@ * cursor at the bottom of the n'th annotation */ y += annotationRows[n].height - 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, alignmentHeight - 1); @@@ -402,7 -403,7 +402,7 @@@ * cursor in gap between wrapped widths */ y += 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, -1); @@@ -412,7 -413,7 +412,7 @@@ * cursor at bottom of gap between wrapped widths */ y += charHeight - 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, -1); @@@ -422,7 -423,7 +422,7 @@@ * cursor at top of first sequence, second wrapped width */ y += 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, 0); @@@ -440,8 -441,7 +440,7 @@@ av.setScaleAboveWrapped(true); av.setScaleLeftWrapped(false); av.setScaleRightWrapped(false); - alignFrame.alignPanel.paintAlignment(false, false); - waitForSwing(); + alignFrame.alignPanel.updateLayout(); final int charHeight = av.getCharHeight(); final int charWidth = av.getCharWidth(); @@@ -460,7 -460,7 +459,7 @@@ * mouse at top left of wrapped panel; there is a gap of charHeight * above the alignment */ - MouseEvent evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, + MouseEvent evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); MousePos pos = testee.findMousePosition(evt); assertEquals(pos.column, 0); @@@ -472,7 -472,7 +471,7 @@@ * two charHeights including scale panel */ y = 2 * charHeight - 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, -1); @@@ -482,7 -482,7 +481,7 @@@ * cursor over top of first sequence */ y += 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, 0); @@@ -492,7 -492,7 +491,7 @@@ * cursor at bottom of first sequence */ y += charHeight - 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, 0); @@@ -502,7 -502,7 +501,7 @@@ * cursor at top of second sequence */ y += 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, 1); @@@ -512,7 -512,7 +511,7 @@@ * cursor at bottom of second sequence */ y += charHeight - 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, 1); @@@ -523,7 -523,7 +522,7 @@@ * (scale + gap + sequences) */ y = charHeight * (2 + alignmentHeight) - 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, alignmentHeight - 1); @@@ -533,7 -533,7 +532,7 @@@ * cursor below sequences, in 3-pixel gap above annotations */ y += 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, alignmentHeight - 1); @@@ -544,7 -544,7 +543,7 @@@ * method reports index of nearest sequence above */ y += SeqCanvas.SEQS_ANNOTATION_GAP - 1; // 3-1 = 2 - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, alignmentHeight - 1); @@@ -557,7 -557,7 +556,7 @@@ * cursor at the top of the n'th annotation */ y += 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, alignmentHeight - 1); @@@ -567,7 -567,7 +566,7 @@@ * cursor at the bottom of the n'th annotation */ y += annotationRows[n].height - 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, alignmentHeight - 1); @@@ -578,7 -578,7 +577,7 @@@ * cursor in gap between wrapped widths */ y += 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, -1); @@@ -588,7 -588,7 +587,7 @@@ * cursor at bottom of gap between wrapped widths */ y += charHeight - 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, -1); @@@ -598,7 -598,7 +597,7 @@@ * cursor at top of scale, second wrapped width */ y += 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, -1); @@@ -608,7 -608,7 +607,7 @@@ * cursor at bottom of scale, second wrapped width */ y += charHeight - 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, -1); @@@ -618,7 -618,7 +617,7 @@@ * cursor at top of first sequence, second wrapped width */ y += 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, 0); @@@ -636,8 -636,7 +635,7 @@@ av.setScaleAboveWrapped(false); av.setScaleLeftWrapped(false); av.setScaleRightWrapped(false); - alignFrame.alignPanel.paintAlignment(false, false); - waitForSwing(); + alignFrame.alignPanel.updateLayout(); final int charHeight = av.getCharHeight(); final int charWidth = av.getCharWidth(); @@@ -656,7 -655,7 +654,7 @@@ * mouse at top left of wrapped panel; there is a gap of charHeight * above the alignment */ - MouseEvent evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, + MouseEvent evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); MousePos pos = testee.findMousePosition(evt); assertEquals(pos.column, 0); @@@ -667,7 -666,7 +665,7 @@@ * cursor over top of first sequence */ y = charHeight; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, 0); @@@ -677,7 -676,7 +675,7 @@@ * cursor at bottom of last sequence */ y = charHeight * (1 + alignmentHeight) - 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, alignmentHeight - 1); @@@ -687,7 -686,7 +685,7 @@@ * cursor below sequences, at top of charHeight gap between widths */ y += 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, -1); @@@ -697,7 -696,7 +695,7 @@@ * cursor below sequences, at top of charHeight gap between widths */ y += charHeight - 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, -1); @@@ -707,7 -706,7 +705,7 @@@ * cursor at the top of the first sequence, second width */ y += 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, y, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, y, 0, 0, 0, false, 0); pos = testee.findMousePosition(evt); assertEquals(pos.seqIndex, 0); @@@ -729,7 -728,7 +727,7 @@@ /* * mouse at top left of unwrapped panel */ - MouseEvent evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, 0, + MouseEvent evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, 0, 0, 0, 0, false, 0); assertEquals(testee.findColumn(evt), 0); @@@ -737,7 -736,7 +735,7 @@@ * not quite one charWidth across */ x = charWidth-1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, 0, 0, 0, 0, false, 0); assertEquals(testee.findColumn(evt), 0); @@@ -745,7 -744,7 +743,7 @@@ * one charWidth across */ x = charWidth; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, 0, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, 0, 0, 0, 0, false, 0); assertEquals(testee.findColumn(evt), 1); @@@ -753,7 -752,7 +751,7 @@@ * two charWidths across */ x = 2 * charWidth; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, 0, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, 0, 0, 0, 0, false, 0); assertEquals(testee.findColumn(evt), 2); @@@ -761,7 -760,7 +759,7 @@@ * limited to last column of seqcanvas */ x = 20000; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, 0, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, 0, 0, 0, 0, false, 0); SeqCanvas seqCanvas = alignFrame.alignPanel.getSeqPanel().seqCanvas; int w = seqCanvas.getWidth(); @@@ -775,7 -774,7 +773,7 @@@ alignFrame.getViewport().hideColumns(4, 9); x = 5 * charWidth + 2; // x is in 6th visible column, absolute column 12, or 11 base 0 - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, 0, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, 0, 0, 0, 0, false, 0); assertEquals(testee.findColumn(evt), 11); } @@@ -790,9 -789,7 +788,7 @@@ av.setScaleAboveWrapped(false); av.setScaleLeftWrapped(false); av.setScaleRightWrapped(false); - alignFrame.alignPanel.paintAlignment(false, false); - // need to wait for repaint to finish! - waitForSwing(); + alignFrame.alignPanel.updateLayout(); SeqPanel testee = alignFrame.alignPanel.getSeqPanel(); int x = 0; final int charWidth = av.getCharWidth(); @@@ -802,7 -799,7 +798,7 @@@ /* * mouse at top left of wrapped panel, no West (left) scale */ - MouseEvent evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, 0, + MouseEvent evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, 0, 0, 0, 0, false, 0); assertEquals(testee.findColumn(evt), 0); @@@ -810,7 -807,7 +806,7 @@@ * not quite one charWidth across */ x = charWidth-1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, 0, 0, 0, 0, false, 0); assertEquals(testee.findColumn(evt), 0); @@@ -818,7 -815,7 +814,7 @@@ * one charWidth across */ x = charWidth; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, 0, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, 0, 0, 0, 0, false, 0); assertEquals(testee.findColumn(evt), 1); @@@ -826,18 -823,17 +822,17 @@@ * x over scale left (before drawn columns) results in -1 */ av.setScaleLeftWrapped(true); - alignFrame.alignPanel.paintAlignment(false, false); - waitForSwing(); + alignFrame.alignPanel.updateLayout(); SeqCanvas seqCanvas = testee.seqCanvas; int labelWidth = (int) PA.getValue(seqCanvas, "labelWidthWest"); assertTrue(labelWidth > 0); x = labelWidth - 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, 0, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, 0, 0, 0, 0, false, 0); assertEquals(testee.findColumn(evt), -1); x = labelWidth; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, 0, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, 0, 0, 0, 0, false, 0); assertEquals(testee.findColumn(evt), 0); @@@ -847,7 -843,7 +842,7 @@@ int residuesWide = av.getRanges().getViewportWidth(); assertTrue(residuesWide > 0); x = labelWidth + charWidth * residuesWide - 1; - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, 0, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, 0, 0, 0, 0, false, 0); assertEquals(testee.findColumn(evt), residuesWide - 1); @@@ -855,15 -851,14 +850,14 @@@ * x over scale right (beyond drawn columns) results in -1 */ av.setScaleRightWrapped(true); - alignFrame.alignPanel.paintAlignment(false, false); - waitForSwing(); + alignFrame.alignPanel.updateLayout(); labelWidth = (int) PA.getValue(seqCanvas, "labelWidthEast"); assertTrue(labelWidth > 0); int residuesWide2 = av.getRanges().getViewportWidth(); assertTrue(residuesWide2 > 0); assertTrue(residuesWide2 < residuesWide); // available width reduced x += 1; // just over left edge of scale right - evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, 0, 0, 0, 0, + evt = new MouseEvent(testee, MouseEvent.MOUSE_MOVED, 0L, 0, x, 0, 0, 0, 0, false, 0); assertEquals(testee.findColumn(evt), -1); diff --combined test/jalview/util/PlatformTest.java index 2e5a786,5052894..617bf42 --- a/test/jalview/util/PlatformTest.java +++ b/test/jalview/util/PlatformTest.java @@@ -26,7 -26,8 +26,8 @@@ import static org.testng.Assert.assertT import jalview.gui.JvOptionPane; import java.awt.Button; -import java.awt.Event; + import java.awt.Toolkit; +import java.awt.event.InputEvent; import java.awt.event.MouseEvent; import org.testng.annotations.BeforeClass; @@@ -51,6 -52,16 +52,16 @@@ public class PlatformTes @Test(groups = "Functional") public void testIsControlDown_mac() { + String toolkit = Toolkit.getDefaultToolkit().getClass().getName(); + if ("sun.awt.X11.XToolkit".equals(toolkit)) + { + /* + * this toolkit on the build server fails these tests, + * because it returns 2, not 4, for getMenuShortcutKeyMask + */ + return; + } + int clickCount = 1; boolean isPopupTrigger = false; int buttonNo = MouseEvent.BUTTON1; @@@ -61,11 -72,11 +72,11 @@@ assertFalse(Platform.isControlDown(new MouseEvent(b, 0, 0L, mods, 0, 0, 0, 0, clickCount, isPopupTrigger, buttonNo), mac)); - mods = Event.CTRL_MASK; + mods = InputEvent.CTRL_DOWN_MASK | InputEvent.BUTTON1_DOWN_MASK; assertFalse(Platform.isControlDown(new MouseEvent(b, 0, 0L, mods, 0, 0, 0, 0, clickCount, isPopupTrigger, buttonNo), mac)); - mods = Event.META_MASK; + mods = InputEvent.META_DOWN_MASK | InputEvent.BUTTON1_DOWN_MASK; assertTrue(Platform.isControlDown(new MouseEvent(b, 0, 0L, mods, 0, 0, 0, 0, clickCount, isPopupTrigger, buttonNo), mac)); @@@ -97,12 -108,11 +108,12 @@@ assertFalse(Platform.isControlDown(new MouseEvent(b, 0, 0L, mods, 0, 0, 0, 0, clickCount, isPopupTrigger, buttonNo), mac)); - mods = Event.CTRL_MASK; + mods = InputEvent.CTRL_DOWN_MASK; assertTrue(Platform.isControlDown(new MouseEvent(b, 0, 0L, mods, 0, 0, 0, 0, clickCount, isPopupTrigger, buttonNo), mac)); - mods = Event.CTRL_MASK | Event.SHIFT_MASK | Event.ALT_MASK; + mods = InputEvent.CTRL_DOWN_MASK | InputEvent.SHIFT_DOWN_MASK + | InputEvent.ALT_DOWN_MASK; clickCount = 2; buttonNo = 2; isPopupTrigger = true;