/**
* @param listener
- * @see java.beans.PropertyChangeSupport#addPropertyChangeListener(
- * java.beans.PropertyChangeListener)
+ * @see java.beans.PropertyChangeSupport#addPropertyChangeListener(java.beans.PropertyChangeListener)
*/
public void addJalviewPropertyChangeListener(
PropertyChangeListener listener)
iw = (int) (iw * sw);
iy = (int) (iy * sh);
ih = (int) (ih * sh);
- while (ix>=screenSize.width) {
- jalview.bin.Cache.log.debug("Window geometry location recall error: shifting horizontal to within screenbounds.");
- ix-=screenSize.width;
+ while (ix >= screenSize.width)
+ {
+ jalview.bin.Cache.log
+ .debug("Window geometry location recall error: shifting horizontal to within screenbounds.");
+ ix -= screenSize.width;
}
- while (iy>=screenSize.height) {
- jalview.bin.Cache.log.debug("Window geometry location recall error: shifting vertical to within screenbounds.");
- iy-=screenSize.height;
+ while (iy >= screenSize.height)
+ {
+ jalview.bin.Cache.log
+ .debug("Window geometry location recall error: shifting vertical to within screenbounds.");
+ iy -= screenSize.height;
}
jalview.bin.Cache.log.debug("Got last known dimensions for "
+ windowName + ": x:" + ix + " y:" + iy + " width:" + iw
}
final JMenuItem menuItem = new JMenuItem(title);
- frame
- .addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
- {
- public void internalFrameActivated(
- javax.swing.event.InternalFrameEvent evt)
- {
- JInternalFrame itf = desktop.getSelectedFrame();
- if (itf != null)
- {
- itf.requestFocus();
- }
+ frame.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
+ {
+ public void internalFrameActivated(
+ javax.swing.event.InternalFrameEvent evt)
+ {
+ JInternalFrame itf = desktop.getSelectedFrame();
+ if (itf != null)
+ {
+ itf.requestFocus();
+ }
- }
+ }
- public void internalFrameClosed(
- javax.swing.event.InternalFrameEvent evt)
- {
- PaintRefresher.RemoveComponent(frame);
- openFrameCount--;
- windowMenu.remove(menuItem);
- JInternalFrame itf = desktop.getSelectedFrame();
- if (itf != null)
- {
- itf.requestFocus();
- }
- System.gc();
- };
- });
+ public void internalFrameClosed(
+ javax.swing.event.InternalFrameEvent evt)
+ {
+ PaintRefresher.RemoveComponent(frame);
+ openFrameCount--;
+ windowMenu.remove(menuItem);
+ JInternalFrame itf = desktop.getSelectedFrame();
+ if (itf != null)
+ {
+ itf.requestFocus();
+ }
+ System.gc();
+ };
+ });
menuItem.addActionListener(new ActionListener()
{
*/
public void inputLocalFileMenuItem_actionPerformed(AlignViewport viewport)
{
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"),
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"),
jalview.io.AppletFormatAdapter.READABLE_EXTENSIONS,
jalview.io.AppletFormatAdapter.READABLE_FNAMES,
jalview.bin.Cache.getProperty("DEFAULT_FILE_FORMAT"));
if (!jalview.bin.Cache.getProperty("LATEST_VERSION").equals(
jalview.bin.Cache.getProperty("VERSION")))
{
- message
- .append("\n\n!! Jalview version "
- + jalview.bin.Cache.getProperty("LATEST_VERSION")
- + " is available for download from http://www.jalview.org !!\n");
+ message.append("\n\n!! Jalview version "
+ + jalview.bin.Cache.getProperty("LATEST_VERSION")
+ + " is available for download from http://www.jalview.org !!\n");
}
// TODO: update this text for each release or centrally store it for lite
// and application
- message
- .append("\nAuthors: Andrew Waterhouse, Jim Procter, Michele Clamp, James Cuff, Steve Searle,\n David Martin & Geoff Barton."
- + "\nDevelopment managed by The Barton Group, University of Dundee, Scotland, UK.\n"
- + "\nFor help, see the FAQ at www.jalview.org and/or join the jalview-discuss@jalview.org mailing list\n"
- + "\nIf you use Jalview, please cite:"
- + "\nWaterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)"
- + "\nJalview Version 2 - a multiple sequence alignment editor and analysis workbench"
- + "\nBioinformatics doi: 10.1093/bioinformatics/btp033");
+ message.append("\nAuthors: Andrew Waterhouse, Jim Procter, Michele Clamp, James Cuff, Steve Searle,\n David Martin & Geoff Barton."
+ + "\nDevelopment managed by The Barton Group, University of Dundee, Scotland, UK.\n"
+ + "\nFor help, see the FAQ at www.jalview.org and/or join the jalview-discuss@jalview.org mailing list\n"
+ + "\nIf you use Jalview, please cite:"
+ + "\nWaterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)"
+ + "\nJalview Version 2 - a multiple sequence alignment editor and analysis workbench"
+ + "\nBioinformatics doi: 10.1093/bioinformatics/btp033");
JOptionPane.showInternalMessageDialog(Desktop.desktop,
message.toString(), "About Jalview", JOptionPane.INFORMATION_MESSAGE);
*/
public void saveState_actionPerformed(ActionEvent e)
{
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"), new String[]
- { "jar" }, new String[]
- { "Jalview Project" }, "Jalview Project");
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ { "jar" }, new String[]
+ { "Jalview Project" }, "Jalview Project");
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle("Save State");
if (value == JalviewFileChooser.APPROVE_OPTION)
{
java.io.File choice = chooser.getSelectedFile();
- setProgressBar("Saving jalview project "
- + choice.getName(), choice.hashCode());
+ setProgressBar("Saving jalview project " + choice.getName(),
+ choice.hashCode());
jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice.getParent());
// TODO catch and handle errors for savestate
- try {
+ try
+ {
new Jalview2XML().SaveState(choice);
} catch (OutOfMemoryError oom)
{
- new OOMWarning("Whilst saving current state to "+choice.getName(), oom);
- }
- catch (Exception ex)
+ new OOMWarning(
+ "Whilst saving current state to " + choice.getName(), oom);
+ } catch (Exception ex)
{
- Cache.log.error("Problems whilst trying to save to "+choice.getName(),ex);
- JOptionPane.showMessageDialog(this, "Error whilst saving current state to "+choice.getName(), "Couldn't save project", JOptionPane.WARNING_MESSAGE);
+ Cache.log
+ .error("Problems whilst trying to save to "
+ + choice.getName(), ex);
+ JOptionPane.showMessageDialog(this,
+ "Error whilst saving current state to " + choice.getName(),
+ "Couldn't save project", JOptionPane.WARNING_MESSAGE);
}
setProgressBar(null, choice.hashCode());
-
+
}
}
*/
public void loadState_actionPerformed(ActionEvent e)
{
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"), new String[]
- { "jar" }, new String[]
- { "Jalview Project" }, "Jalview Project");
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ { "jar" }, new String[]
+ { "Jalview Project" }, "Jalview Project");
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle("Restore state");
final String choice = chooser.getSelectedFile().getAbsolutePath();
jalview.bin.Cache.setProperty("LAST_DIRECTORY", chooser
.getSelectedFile().getParent());
- new Thread(new Runnable() {
- public void run() {
- setProgressBar("loading jalview project "
- + choice, choice.hashCode());
- try {
- new Jalview2XML().LoadJalviewAlign(choice); }
- catch (OutOfMemoryError oom)
+ new Thread(new Runnable()
{
- new OOMWarning("Whilst loading project from "+choice, oom);
- }
- catch (Exception ex)
- {
- Cache.log.error("Problems whilst loading project from "+choice,ex);
- JOptionPane.showMessageDialog(Desktop.desktop, "Error whilst loading project from "+choice, "Couldn't load project", JOptionPane.WARNING_MESSAGE);
- }
- setProgressBar(null, choice.hashCode());
+ public void run()
+ {
+ setProgressBar("loading jalview project " + choice,
+ choice.hashCode());
+ try
+ {
+ new Jalview2XML().LoadJalviewAlign(choice);
+ } catch (OutOfMemoryError oom)
+ {
+ new OOMWarning("Whilst loading project from " + choice, oom);
+ } catch (Exception ex)
+ {
+ Cache.log.error("Problems whilst loading project from "
+ + choice, ex);
+ JOptionPane.showMessageDialog(Desktop.desktop,
+ "Error whilst loading project from " + choice,
+ "Couldn't load project", JOptionPane.WARNING_MESSAGE);
+ }
+ setProgressBar(null, choice.hashCode());
}
}).start();
}
if (v_client == null)
{
// Load and try to start a session.
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"));
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle("Open a saved VAMSAS session");
- chooser
- .setToolTipText("select a vamsas session to be opened as a new vamsas session.");
+ chooser.setToolTipText("select a vamsas session to be opened as a new vamsas session.");
int value = chooser.showOpenDialog(this);
}
bis.close();
fos.close();
- v_client = new jalview.gui.VamsasApplication(this, file, url
- .toExternalForm());
+ v_client = new jalview.gui.VamsasApplication(this, file,
+ url.toExternalForm());
} catch (Exception ex)
{
jalview.bin.Cache.log.error(
return false;
}
- setProgressBar("Importing VAMSAS session from " + file.getName(), file
- .hashCode());
+ setProgressBar("Importing VAMSAS session from " + file.getName(),
+ file.hashCode());
try
{
v_client = new jalview.gui.VamsasApplication(this, file, null);
}
setupVamsasConnectedGui();
v_client.initial_update(); // TODO: thread ?
- setProgressBar("Importing VAMSAS session from " + file.getName(), file
- .hashCode());
+ setProgressBar("Importing VAMSAS session from " + file.getName(),
+ file.hashCode());
return v_client.inSession();
}
{
if (v_client != null)
{
- JalviewFileChooser chooser = new JalviewFileChooser(jalview.bin.Cache
- .getProperty("LAST_DIRECTORY"), new String[]
- { "vdj" }, // TODO: VAMSAS DOCUMENT EXTENSION is VDJ
+ JalviewFileChooser chooser = new JalviewFileChooser(
+ jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
+ { "vdj" }, // TODO: VAMSAS DOCUMENT EXTENSION is VDJ
new String[]
{ "Vamsas Document" }, "Vamsas Document");
FontMetrics fm = g.getFontMetrics();
if (fm != null)
{
- g.drawString("Total Free Memory: " + df.format(totalFreeMemory)
- + "MB; Max Memory: " + df.format(maxMemory) + "MB; "
- + df.format(percentUsage) + "%", 10, getHeight()
- - fm.getHeight());
+ g.drawString(
+ "Total Free Memory: " + df.format(totalFreeMemory)
+ + "MB; Max Memory: " + df.format(maxMemory)
+ + "MB; " + df.format(percentUsage) + "%", 10,
+ getHeight() - fm.getHeight());
}
}
}
public void actionPerformed(ActionEvent e)
{
handler.cancelActivity(id);
- us.setProgressBar("Cancelled "
- + ((JLabel) progressPanel.getComponent(0)).getText(), id);
+ us.setProgressBar(
+ "Cancelled "
+ + ((JLabel) progressPanel.getComponent(0))
+ .getText(), id);
}
});
progressPanel.add(cancel, BorderLayout.EAST);
return v_client;
}
+
/**
* flag set if jalview GUI is being operated programmatically
*/
- private boolean inBatchMode=false;
+ private boolean inBatchMode = false;
/**
* check if jalview GUI is being operated programmatically
+ *
* @return inBatchMode
*/
public boolean isInBatchMode()
/**
* set flag if jalview GUI is being operated programmatically
- * @param inBatchMode
+ *
+ * @param inBatchMode
*/
public void setInBatchMode(boolean inBatchMode)
{
this.inBatchMode = inBatchMode;
}
-
public void startServiceDiscovery()
{
startServiceDiscovery(false);
} catch (Exception e)
{
Cache.log
- .info(
- "Exception when trying to launch Envision2 workflow discovery.",
+ .info("Exception when trying to launch Envision2 workflow discovery.",
e);
Cache.log.info(e.getStackTrace());
}
}
/**
- * start a thread to open a URL in the configured browser. Pops up a warning dialog to the user if there is an exception when calling out to the browser to open the URL.
+ * start a thread to open a URL in the configured browser. Pops up a warning
+ * dialog to the user if there is an exception when calling out to the browser
+ * to open the URL.
+ *
* @param url
*/
public static void showUrl(final String url)
{
- new Thread(new Runnable() {
- public void run() {
- try {
+ new Thread(new Runnable()
+ {
+ public void run()
+ {
+ try
+ {
jalview.util.BrowserLauncher.openURL(url);
} catch (Exception ex)
- {
+ {
JOptionPane
.showInternalMessageDialog(
Desktop.desktop,
"Unixers: Couldn't find default web browser."
+ "\nAdd the full path to your browser in Preferences.",
- "Web browser not found", JOptionPane.WARNING_MESSAGE);
+ "Web browser not found",
+ JOptionPane.WARNING_MESSAGE);
ex.printStackTrace();
}
}
- }).start();
+ }).start();
}
public static WsParamSetManager wsparamManager = null;
+
public static ParamManager getUserParameterStore()
{
- if (wsparamManager==null)
+ if (wsparamManager == null)
{
wsparamManager = new WsParamSetManager();
}