//Need to decide if the Memory Usage is to be included in
//Next release or not.
- // public static MyDesktopPane desktop;
- public static JDesktopPane desktop;
+ public static MyDesktopPane desktop;
+ // public static JDesktopPane desktop;
static int openFrameCount = 0;
setTitle("Jalview " + jalview.bin.Cache.getProperty("VERSION"));
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-
- desktop = new JDesktopPane();
+ boolean selmemusage = jalview.bin.Cache.getDefault("SHOW_MEMUSAGE",false);
+ desktop = new MyDesktopPane(selmemusage);
+ showMemusage.setSelected(selmemusage);
desktop.setBackground(Color.white);
getContentPane().setLayout(new BorderLayout());
getContentPane().add(desktop, BorderLayout.CENTER);
reorderAssociatedWindows(false, true);
}
+ /* (non-Javadoc)
+ * @see jalview.jbgui.GDesktop#garbageCollect_actionPerformed(java.awt.event.ActionEvent)
+ */
+ protected void garbageCollect_actionPerformed(ActionEvent e)
+ {
+ // We simply collect the garbage
+ jalview.bin.Cache.log.debug("Collecting garbage...");
+ System.gc();
+ jalview.bin.Cache.log.debug("Finished garbage collection.");
+ }
+
+ /* (non-Javadoc)
+ * @see jalview.jbgui.GDesktop#showMemusage_actionPerformed(java.awt.event.ActionEvent)
+ */
+ protected void showMemusage_actionPerformed(ActionEvent e)
+ {
+ desktop.showMemoryUsage(showMemusage.isSelected());
+ }
+
void reorderAssociatedWindows(boolean minimize, boolean close)
{
JInternalFrame[] frames = desktop.getAllFrames();
}
}
}
-
/**
* DOCUMENT ME!
*
UserQuestionnaireCheck jvq = new UserQuestionnaireCheck(url);
javax.swing.SwingUtilities.invokeLater(jvq);
}
-
- /*DISABLED
- class MyDesktopPane extends JDesktopPane implements Runnable
+ /**
+ * Proxy class for JDesktopPane which optionally
+ * displays the current memory usage and highlights
+ * the desktop area with a red bar if free memory runs low.
+ * @author AMW
+ */
+ public class MyDesktopPane extends JDesktopPane implements Runnable
{
+
boolean showMemoryUsage = false;
Runtime runtime;
java.text.NumberFormat df;
worker.start();
}
}
-
+ public boolean isShowMemoryUsage()
+ {
+ return showMemoryUsage;
+ }
public void run()
{
df = java.text.NumberFormat.getNumberInstance();
getHeight() - g.getFontMetrics().getHeight());
}
}
- }*/
+
+
+
+ }
protected JMenuItem groovyShell;
public void doGroovyCheck() {
if (jalview.bin.Cache.groovyJarsPresent())
{
groovyShell = new JMenuItem();
- groovyShell.setText("Groovy Shell...");
+ groovyShell.setText("Groovy Console...");
groovyShell.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e) {