- // /////////////////////////////////
- // Check if there are other Jmol views involving this alignment
- // and prompt user about adding this molecule to one of them
- Vector existingViews = getJmolsFor(ap);
- if (existingViews.size() > 0)
- {
- Enumeration jm = existingViews.elements();
- while (jm.hasMoreElements())
- {
- ChimeraViewFrame topJmol = (ChimeraViewFrame) jm.nextElement();
- // TODO: highlight topJmol in view somehow
- int option = JOptionPane
- .showInternalConfirmDialog(
- Desktop.desktop,
- MessageManager.formatMessage(
- "label.add_pdbentry_to_view", new String[]
- { pdbentry.getId(), topJmol.getTitle() }),
- MessageManager
- .getString("label.align_to_existing_structure_view"),
- JOptionPane.YES_NO_OPTION);
- if (option == JOptionPane.YES_OPTION)
- {
- topJmol.useAlignmentPanelForSuperposition(ap);
- topJmol.addStructure(pdbentry, seq, chains, true, ap.alignFrame);
- return;
- }
- }
- }
- // /////////////////////////////////
- openNewJmol(ap, new PDBEntry[]
- { pdbentry }, new SequenceI[][]
- { seq });
- }
-
- private void openNewJmol(AlignmentPanel ap, PDBEntry[] pdbentrys,
- SequenceI[][] seqs)
- {
- progressBar = ap.alignFrame;
- jmb = new JalviewChimeraBindingModel(this,
- ap.getStructureSelectionManager(), pdbentrys, seqs, null, null);
- addAlignmentPanel(ap);
- useAlignmentPanelForColourbyseq(ap);
- if (pdbentrys.length > 1)
- {
- alignAddedStructures = true;
- useAlignmentPanelForSuperposition(ap);
- }
- jmb.setColourBySequence(true);
- setSize(400, 400); // probably should be a configurable/dynamic default here
- initMenus();
- worker = null;
- {
- addingStructures = false;
- worker = new Thread(this);
- worker.start();
- }
- this.addInternalFrameListener(new InternalFrameAdapter()
- {
- public void internalFrameClosing(InternalFrameEvent internalFrameEvent)
- {
- closeViewer();
- }
- });
-