public ChimeraViewFrame(PDBEntry pdbentry, SequenceI[] seq,
String[] chains, final AlignmentPanel ap)
{
- super();
+ this();
String pdbId = pdbentry.getId();
/*
SequenceI[][] seqsArray, boolean colourByChimera,
boolean colourBySequence, String newViewId)
{
- super();
+ this();
setViewId(newViewId);
this.chimeraSessionFile = chimeraSessionFile;
openNewChimera(alignPanel, pdbArray, seqsArray);
public ChimeraViewFrame(PDBEntry[] pe, SequenceI[][] seqs,
AlignmentPanel ap)
{
- super();
+ this();
openNewChimera(ap, pe, seqs);
}
- public ChimeraViewFrame(Map<PDBEntry, List<SequenceI>> toView,
- AlignmentPanel alignPanel)
+ /**
+ * Default constructor
+ */
+ public ChimeraViewFrame()
{
super();
/*
- * Convert the map of sequences per pdb entry into the tied arrays expected
- * by openNewChimera
- *
- * TODO pass the Map down to openNewChimera and its callees instead
+ * closeViewer will decide whether or not to close this frame
+ * depending on whether user chooses to Cancel or not
*/
- final Set<PDBEntry> pdbEntries = toView.keySet();
- PDBEntry[] pdbs = pdbEntries.toArray(new PDBEntry[pdbEntries.size()]);
- SequenceI[][] seqsForPdbs = new SequenceI[pdbEntries.size()][];
- for (int i = 0; i < pdbs.length; i++)
- {
- final List<SequenceI> seqsForPdb = toView.get(pdbs[i]);
- seqsForPdbs[i] = seqsForPdb.toArray(new SequenceI[seqsForPdb.size()]);
- }
-
- openNewChimera(alignPanel, pdbs, seqsForPdbs);
+ setDefaultCloseOperation(JInternalFrame.DO_NOTHING_ON_CLOSE);
}
/**
prompt = JvSwingUtils.wrapTooltip(true, prompt);
int confirm = JOptionPane.showConfirmDialog(this, prompt,
MessageManager.getString("label.close_viewer"),
- JOptionPane.YES_NO_OPTION);
+ JOptionPane.YES_NO_CANCEL_OPTION);
+ if (confirm == JOptionPane.CANCEL_OPTION)
+ {
+ return;
+ }
closeChimera = confirm == JOptionPane.YES_OPTION;
}
jmb.closeViewer(closeChimera);
// TODO: check for memory leaks where instance isn't finalised because jmb
// holds a reference to the window
jmb = null;
+ dispose();
}
/**