public void actionPerformed(ActionEvent e) {
String warning = "Current session (all networks/attributes) will be lost.\nDo you want to continue?";
int result = JOptionPane.showConfirmDialog(Cytoscape.getDesktop(), warning, "Caution!",
JOptionPane.YES_NO_OPTION,
JOptionPane.WARNING_MESSAGE, null);
if (result == JOptionPane.YES_OPTION) {
Cytoscape.setSessionState(Cytoscape.SESSION_OPENED);
Cytoscape.createNewSession();
Cytoscape.getDesktop().setTitle("Cytoscape Desktop (New Session)");
Cytoscape.getDesktop().getNetworkPanel().repaint();
Cytoscape.getDesktop().repaint();
Cytoscape.setSessionState(Cytoscape.SESSION_NEW);
Cytoscape.getPropertyChangeSupport().firePropertyChange(Cytoscape.CYTOSCAPE_INITIALIZED, null, null);
} else {
return;
}
}
}