git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
j2sNative references moved to Platform
[jalview.git]
/
src
/
jalview
/
gui
/
Desktop.java
diff --git
a/src/jalview/gui/Desktop.java
b/src/jalview/gui/Desktop.java
index
6b7a278
..
1554079
100644
(file)
--- a/
src/jalview/gui/Desktop.java
+++ b/
src/jalview/gui/Desktop.java
@@
-46,7
+46,6
@@
import jalview.util.ImageMaker.TYPE;
import jalview.util.MessageManager;
import jalview.util.Platform;
import jalview.util.UrlConstants;
import jalview.util.MessageManager;
import jalview.util.Platform;
import jalview.util.UrlConstants;
-import jalview.util.dialogrunner.RunResponse;
import jalview.viewmodel.AlignmentViewport;
import jalview.ws.params.ParamManager;
import jalview.ws.utils.UrlDownloadClient;
import jalview.viewmodel.AlignmentViewport;
import jalview.ws.params.ParamManager;
import jalview.ws.utils.UrlDownloadClient;
@@
-89,7
+88,6
@@
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
import java.util.ListIterator;
import java.util.Hashtable;
import java.util.List;
import java.util.ListIterator;
-import java.util.StringTokenizer;
import java.util.Vector;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.Vector;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@
-346,12
+344,13
@@
public class Desktop extends jalview.jbgui.GDesktop
*/
public Desktop()
{
*/
public Desktop()
{
+ super();
/**
* A note to implementors. It is ESSENTIAL that any activities that might block
* are spawned off as threads rather than waited for during this constructor.
*/
instance = this;
/**
* A note to implementors. It is ESSENTIAL that any activities that might block
* are spawned off as threads rather than waited for during this constructor.
*/
instance = this;
- if (!Jalview.isJS())
+ if (!Platform.isJS())
{
doVamsasClientCheck();
}
{
doVamsasClientCheck();
}
@@
-375,12
+374,9
@@
public class Desktop extends jalview.jbgui.GDesktop
// getContentPane().add(sp, BorderLayout.CENTER);
// BH 2018 - just an experiment to try unclipped JInternalFrames.
// getContentPane().add(sp, BorderLayout.CENTER);
// BH 2018 - just an experiment to try unclipped JInternalFrames.
- // Must set for all three to be active:
- if (Jalview.isJS())
+ if (Platform.isJS())
{
getRootPane().putClientProperty("swingjs.overflow.hidden", "false");
{
getRootPane().putClientProperty("swingjs.overflow.hidden", "false");
- ((JComponent) getContentPane()).putClientProperty("swingjs.overflow.hidden", "false");
- desktop.putClientProperty("swingjs.overflow.hidden", "false");
}
getContentPane().add(desktop, BorderLayout.CENTER);
}
getContentPane().add(desktop, BorderLayout.CENTER);
@@
-389,8
+385,8
@@
public class Desktop extends jalview.jbgui.GDesktop
// This line prevents Windows Look&Feel resizing all new windows to maximum
// if previous window was maximised
desktop.setDesktopManager(new MyDesktopManager(
// This line prevents Windows Look&Feel resizing all new windows to maximum
// if previous window was maximised
desktop.setDesktopManager(new MyDesktopManager(
- (Platform.isWindows() ? new DefaultDesktopManager()
- : Platform.isAMac()
+ (Platform.isWindowsAndNotJS() ? new DefaultDesktopManager()
+ : Platform.isAMacAndNotJS()
? new AquaInternalFrameManager(
desktop.getDesktopManager())
: desktop.getDesktopManager())));
? new AquaInternalFrameManager(
desktop.getDesktopManager())
: desktop.getDesktopManager())));
@@
-408,7
+404,7
@@
public class Desktop extends jalview.jbgui.GDesktop
setBounds(xPos, yPos, 900, 650);
}
setBounds(xPos, yPos, 900, 650);
}
- boolean doFullLoad = /** @j2sNative ! */true;
+ boolean doFullLoad = !Platform.isJS();
if (doFullLoad) {
if (doFullLoad) {
@@
-886,8
+882,7
@@
public class Desktop extends jalview.jbgui.GDesktop
frame.setResizable(resizable);
frame.setMaximizable(resizable);
frame.setIconifiable(resizable);
frame.setResizable(resizable);
frame.setMaximizable(resizable);
frame.setIconifiable(resizable);
- frame.setOpaque(/** @j2sNative true || */
- false);
+ frame.setOpaque(Platform.isJS()); // BH this should not be necessary
if (frame.getX() < 1 && frame.getY() < 1)
{
if (frame.getX() < 1 && frame.getY() < 1)
{
@@
-1125,9
+1120,8
@@
public class Desktop extends jalview.jbgui.GDesktop
MessageManager.getString("label.open_local_file"));
chooser.setToolTipText(MessageManager.getString("action.open"));
MessageManager.getString("label.open_local_file"));
chooser.setToolTipText(MessageManager.getString("action.open"));
- chooser.addResponse(new RunResponse(JalviewFileChooser.APPROVE_OPTION)
+ chooser.setResponseHandler(0, new Runnable()
{
{
-
@Override
public void run()
{
@Override
public void run()
{
@@
-1183,7
+1177,7
@@
public class Desktop extends jalview.jbgui.GDesktop
*/
JComponent history;
String urlBase = "http://www.";
*/
JComponent history;
String urlBase = "http://www.";
- if (Jalview.isJS())
+ if (Platform.isJS())
{
history = new JTextField(urlBase, 35);
}
{
history = new JTextField(urlBase, 35);
}
@@
-1207,11
+1201,11
@@
public class Desktop extends jalview.jbgui.GDesktop
Object[] options = new Object[] { MessageManager.getString("action.ok"),
MessageManager.getString("action.cancel") };
Object[] options = new Object[] { MessageManager.getString("action.ok"),
MessageManager.getString("action.cancel") };
- RunResponse action = new RunResponse(JvOptionPane.OK_OPTION) {
+ Runnable action = new Runnable() {
@Override
public void run()
{
@Override
public void run()
{
- String url = Jalview.isJS() ? ((JTextField) history).getText()
+ String url = Platform.isJS() ? ((JTextField) history).getText()
: ((JComboBox<String>) history).getSelectedItem()
.toString();
: ((JComboBox<String>) history).getSelectedItem()
.toString();
@@
-1263,7
+1257,7
@@
public class Desktop extends jalview.jbgui.GDesktop
}};
String dialogOption = MessageManager
.getString("label.input_alignment_from_url");
}};
String dialogOption = MessageManager
.getString("label.input_alignment_from_url");
- JvOptionPane.newOptionDialog(desktop).addResponse(action)
+ JvOptionPane.newOptionDialog(desktop).setResponseHandler(0, action)
.showInternalDialog(panel, dialogOption,
JvOptionPane.YES_NO_CANCEL_OPTION,
JvOptionPane.PLAIN_MESSAGE, null, options,
.showInternalDialog(panel, dialogOption,
JvOptionPane.YES_NO_CANCEL_OPTION,
JvOptionPane.PLAIN_MESSAGE, null, options,
@@
-1436,7
+1430,7
@@
public class Desktop extends jalview.jbgui.GDesktop
{
try
{
{
try
{
- if (Jalview.isJS())
+ if (Platform.isJS())
{
BrowserLauncher.openURL("http://www.jalview.org/help.html");
}
{
BrowserLauncher.openURL("http://www.jalview.org/help.html");
}
@@
-1746,14
+1740,14
@@
public class Desktop extends jalview.jbgui.GDesktop
"Jalview Project");
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager.getString("label.restore_state"));
"Jalview Project");
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager.getString("label.restore_state"));
- chooser.addResponse(new RunResponse(JalviewFileChooser.APPROVE_OPTION)
+ chooser.setResponseHandler(0, new Runnable()
{
@Override
public void run()
{
File selectedFile = chooser.getSelectedFile();
setProjectFile(selectedFile);
{
@Override
public void run()
{
File selectedFile = chooser.getSelectedFile();
setProjectFile(selectedFile);
- final String choice = selectedFile.getAbsolutePath();
+ String choice = selectedFile.getAbsolutePath();
Cache.setProperty("LAST_DIRECTORY", selectedFile.getParent());
new Thread(new Runnable()
{
Cache.setProperty("LAST_DIRECTORY", selectedFile.getParent());
new Thread(new Runnable()
{
@@
-1767,7
+1761,7
@@
public class Desktop extends jalview.jbgui.GDesktop
}
else
{
}
else
{
- new jalview.project.Jalview2XML().loadJalviewAlign(choice);
+ new jalview.project.Jalview2XML().loadJalviewAlign(selectedFile);
}
} catch (OutOfMemoryError oom)
{
}
} catch (OutOfMemoryError oom)
{
@@
-2092,7
+2086,7
@@
public class Desktop extends jalview.jbgui.GDesktop
/**
* import file into a new vamsas session (uses jalview.gui.VamsasApplication)
*
/**
* import file into a new vamsas session (uses jalview.gui.VamsasApplication)
*
- * @param file
+ * @param fileName
* @return true if import was a success and a session was started.
*/
public boolean vamsasImport(URL url)
* @return true if import was a success and a session was started.
*/
public boolean vamsasImport(URL url)
@@
-3481,7
+3475,7
@@
public class Desktop extends jalview.jbgui.GDesktop
}
else
{
}
else
{
- if (Platform.isAMac())
+ if (Platform.isAMacAndNotJS())
{
System.err.println(
"Please ignore plist error - occurs due to problem with java 8 on OSX");
{
System.err.println(
"Please ignore plist error - occurs due to problem with java 8 on OSX");
@@
-3598,8
+3592,7
@@
public class Desktop extends jalview.jbgui.GDesktop
}
}
}
}
}
}
- if (Platform.isWindows())
-
+ if (Platform.isWindowsAndNotJS())
{
Cache.log.debug("Scanning dropped content for Windows Link Files");
{
Cache.log.debug("Scanning dropped content for Windows Link Files");