Skip to content
Snippets Groups Projects
Commit 6ee8c0bd authored by tjc's avatar tjc
Browse files

add the ability to add user plots from a JVM option (userplot)

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@12867 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 40e177b5
No related branches found
No related tags found
No related merge requests found
...@@ -168,7 +168,7 @@ public class GraphMenu extends JMenu ...@@ -168,7 +168,7 @@ public class GraphMenu extends JMenu
{ {
try try
{ {
addUserPlot (); addUserPlot (null);
adjustSplitPane(true); adjustSplitPane(true);
} }
catch(java.lang.OutOfMemoryError emem) catch(java.lang.OutOfMemoryError emem)
...@@ -241,6 +241,26 @@ public class GraphMenu extends JMenu ...@@ -241,6 +241,26 @@ public class GraphMenu extends JMenu
new MessageDialog (frame, "error while reading usage data: " + e); new MessageDialog (frame, "error while reading usage data: " + e);
} }
} }
// add user plots from the command line JVM option
if(System.getProperty("userplot") != null)
{
String plots[] = System.getProperty("userplot").split("\\s");
try
{
for(int i=0;i<plots.length; i++)
{
File f = new File(plots[i]);
if(f.exists())
addUserPlot (f);
else
System.err.println(plots[i]+" not found.");
}
splitPane.setDividerSize(3);
splitPane.setDividerLocation(150);
}
catch(Exception e){}
}
} }
/** /**
...@@ -525,28 +545,30 @@ public class GraphMenu extends JMenu ...@@ -525,28 +545,30 @@ public class GraphMenu extends JMenu
/** /**
* Add a UserDataAlgorithm to the display. * Add a UserDataAlgorithm to the display.
**/ **/
private void addUserPlot () private void addUserPlot (File file)
{ {
final JFrame frame = Utilities.getComponentFrame (base_plot_group);
final StickyFileChooser dialog = new StickyFileChooser ();
dialog.setDialogTitle ("Select a data file name ...");
dialog.setDialogType (JFileChooser.OPEN_DIALOG);
final JCheckBox logTransform = new JCheckBox("Use log(data+1)", false); final JCheckBox logTransform = new JCheckBox("Use log(data+1)", false);
dialog.setAccessory(logTransform); if (file == null)
final int status = dialog.showOpenDialog (frame);
if (status != JFileChooser.APPROVE_OPTION ||
dialog.getSelectedFile () == null)
{ {
return; final JFrame frame = Utilities.getComponentFrame(base_plot_group);
} final StickyFileChooser dialog = new StickyFileChooser();
final File file = dialog.setDialogTitle("Select a data file name ...");
new File (dialog.getCurrentDirectory (), dialog.setDialogType(JFileChooser.OPEN_DIALOG);
dialog.getSelectedFile ().getName ());
dialog.setAccessory(logTransform);
final int status = dialog.showOpenDialog(frame);
if(status != JFileChooser.APPROVE_OPTION ||
dialog.getSelectedFile() == null)
{
return;
}
file = new File(dialog.getCurrentDirectory(),
dialog.getSelectedFile().getName());
}
frame.setCursor(new Cursor(Cursor.WAIT_CURSOR)); frame.setCursor(new Cursor(Cursor.WAIT_CURSOR));
if (file.length () != 0) if (file.length () != 0)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment