try
{
- if (Platform.isAMac())
- {
- if (desktopClass.getDeclaredMethod("setAboutHandler",
- new Class[]
- { AboutHandler.class }) != null)
- {
-
- hdesktop.setAboutHandler(new AboutHandler()
- {
- @Override
- public void handleAbout(AboutEvent e)
- {
- aboutMenuItem_actionPerformed(null);
- }
- });
-
- }
-
- if (desktopClass.getDeclaredMethod("setPreferencesHandler",
- new Class[]
- { PreferencesHandler.class }) != null)
- {
-
- hdesktop.setPreferencesHandler(new PreferencesHandler()
- {
- @Override
- public void handlePreferences(PreferencesEvent e)
- {
- preferences_actionPerformed(null);
- }
- });
-
- }
-
- if (desktopClass.getDeclaredMethod("setQuitHandler",
- new Class[]
- { QuitHandler.class }) != null)
- {
-
- hdesktop.setQuitHandler(new QuitHandler()
- {
- @Override
- public void handleQuitRequestWith(QuitEvent e, QuitResponse r)
- {
- boolean confirmQuit = jalview.bin.Cache
- .getDefault(CONFIRM_KEYBOARD_QUIT, true);
- int n;
- if (confirmQuit)
- {
- n = JOptionPane.showConfirmDialog(null,
- MessageManager.getString("label.quit_jalview"),
- MessageManager.getString("action.quit"),
- JOptionPane.OK_CANCEL_OPTION,
- JOptionPane.PLAIN_MESSAGE, null);
- }
- else
- {
- n = JOptionPane.OK_OPTION;
- }
- if (n == JOptionPane.OK_OPTION)
- {
- System.out.println("Shortcut Quit confirmed by user");
- quit();
- r.performQuit(); // probably won't reach this line, but just in
- // case
- }
- else
- {
- r.cancelQuit();
- System.out.println("Shortcut Quit cancelled by user");
- }
- }
- });
- hdesktop.setQuitStrategy(QuitStrategy.CLOSE_ALL_WINDOWS);
-
- }
- }
+ if (Platform.isAMac())
+ {
+ if (desktopClass.getDeclaredMethod("setAboutHandler",
+ new Class[]
+ { AboutHandler.class }) != null)
+ {
+
+ hdesktop.setAboutHandler(new AboutHandler()
+ {
+ @Override
+ public void handleAbout(AboutEvent e)
+ {
+ aboutMenuItem_actionPerformed(null);
+ }
+ });
+
+ }
+
+ if (desktopClass.getDeclaredMethod("setPreferencesHandler",
+ new Class[]
+ { PreferencesHandler.class }) != null)
+ {
+
+ hdesktop.setPreferencesHandler(new PreferencesHandler()
+ {
+ @Override
+ public void handlePreferences(PreferencesEvent e)
+ {
+ preferences_actionPerformed(null);
+ }
+ });
+
+ }
+
+ if (desktopClass.getDeclaredMethod("setQuitHandler",
+ new Class[]
+ { QuitHandler.class }) != null)
+ {
+
+ hdesktop.setQuitHandler(new QuitHandler()
+ {
+ @Override
+ public void handleQuitRequestWith(QuitEvent e, QuitResponse r)
+ {
+ boolean confirmQuit = jalview.bin.Cache
+ .getDefault(CONFIRM_KEYBOARD_QUIT, true);
+ int n;
+ if (confirmQuit)
+ {
+ n = JOptionPane.showConfirmDialog(null,
+ MessageManager.getString("label.quit_jalview"),
+ MessageManager.getString("action.quit"),
+ JOptionPane.OK_CANCEL_OPTION,
+ JOptionPane.PLAIN_MESSAGE, null);
+ }
+ else
+ {
+ n = JOptionPane.OK_OPTION;
+ }
+ if (n == JOptionPane.OK_OPTION)
+ {
+ System.out.println("Shortcut Quit confirmed by user");
+ quit();
+ r.performQuit(); // probably won't reach this line, but just
+ // in
+ // case
+ }
+ else
+ {
+ r.cancelQuit();
+ System.out.println("Shortcut Quit cancelled by user");
+ }
+ }
+ });
+ hdesktop.setQuitStrategy(QuitStrategy.CLOSE_ALL_WINDOWS);
+
+ }
+ }
} catch (NoSuchMethodException e)
{
final String[] desc = new String[] { "Jalview Project",
"Jalview Project (old)" };
JalviewFileChooser chooser = new JalviewFileChooser(
- Cache.getProperty("LAST_DIRECTORY"), suffix,
- desc,
+ Cache.getProperty("LAST_DIRECTORY"), suffix, desc,
"Jalview Project");
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager.getString("label.restore_state"));
@Test(groups = "Functional")
public final void testGetSequenceProxy() throws Exception
{
- String pathname = "test/jalview/ext/htsjdk/pgmb.fasta";
+ String pathname = "test/jalview/ext/htsjdk/pgmB.fasta";
HtsContigDb db = new HtsContigDb("ADB", new File(pathname));
-
+
assertTrue(db.isValid());
assertTrue(db.isIndexed()); // htsjdk opens the .fai file
-
+
SequenceI sq = db.getSequenceProxy("Deminut");
assertNotNull(sq);
assertEquals(sq.getLength(), 606);
sq = db.getSequenceProxy("PPL_06716");
assertNotNull(sq);
assertEquals(sq.getLength(), 602);
-
+
// dict = db.getDictionary(f, truncate))
}
expectedExceptions = java.lang.IllegalArgumentException.class)
public final void testGetSequenceProxy_indexed()
{
- String pathname = "test/jalview/ext/htsjdk/pgmb.fasta.fai";
+ String pathname = "test/jalview/ext/htsjdk/pgmB.fasta.fai";
new HtsContigDb("ADB", new File(pathname));
fail("Expected exception opening .fai file");
}
@Test(groups = "Functional")
public void testCreateFastaSequenceIndex() throws IOException
{
- File fasta = new File("test/jalview/ext/htsjdk/pgmb.fasta");
-
+ File fasta = new File("test/jalview/ext/htsjdk/pgmB.fasta");
+
/*
* create .fai with no overwrite fails if it exists
*/
- try {
+ try
+ {
HtsContigDb.createFastaSequenceIndex(fasta.toPath(), false);
fail("Expected exception");
} catch (IOException e)
{
+ System.out.println(
+ "Caught IOException in testCreateFastaSequenceIndex");
+ e.printStackTrace();
// expected
}
import jalview.gui.JvOptionPane;
import java.awt.Button;
-import java.awt.Event;
+import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
import org.testng.annotations.BeforeClass;
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;
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;
assertTrue(Platform.isControlDown(new MouseEvent(b, 0, 0L, mods, 0, 0,
0, 0, clickCount, isPopupTrigger, buttonNo), mac));
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;