Skip to content

Instantly share code, notes, and snippets.

@prem0862
Created June 1, 2018 18:20
Show Gist options
  • Save prem0862/8d8fc7c4ae6b4420c0c9abcc0d3b4b08 to your computer and use it in GitHub Desktop.
Save prem0862/8d8fc7c4ae6b4420c0c9abcc0d3b4b08 to your computer and use it in GitHub Desktop.
public final SBOLEditorAction BOOST = new SBOLEditorAction("BOOST", "Prepare for Synthesis with BOOST",
"upload.png") {
@Override
protected void perform() {
// TODO Prem fill in code here
// create document
// call boost dialog and pass in document
// print response document for now (or write to disk, etc)
try {
if (!designerPanel.confirmSave()) {
return;
}
String[] options = { "Current design", "Working documents" };
int choice = JOptionPane.showOptionDialog(panel, "What would you like to optimise with BOOST?", "BOOST",
JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
if (choice == 0) {
ComponentDefinitionBox root = new ComponentDefinitionBox();
SBOLDocument sbolDoc = createDocument(root);
//TODO: write a functon to send file to BOOST
//
} else if (choice == 1) {
if (designerPanel.documentIO == null) {
if (!designerPanel.selectCurrentFile()) {
return;
}
}
if (!SBOLUtils.setupFile().exists()) {
JOptionPane.showMessageDialog(panel, "The working document does not exist.");
return;
}
SBOLDocument sbolDoc = designerPanel.documentIO.read();
//TODO: write a functon to send file to BOOST
} else {
return;
}
} catch (Exception e) {
MessageDialog.showMessage(panel, "There was a problem with BOOST : ", e.getMessage());
e.printStackTrace();
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment