- // /////////////////////////////////
- // Check if there are other Chimera views involving this alignment
- // and prompt user about adding this molecule to one of them
- List<ChimeraViewFrame> existingViews = getChimeraWindowsFor(ap);
- for (ChimeraViewFrame topView : existingViews)
- {
- // TODO: highlight topView in view somehow
- int option = JOptionPane.showInternalConfirmDialog(Desktop.desktop,
- MessageManager.formatMessage("label.add_pdbentry_to_view",
- new Object[]
- { pdbentry.getId(), topView.getTitle() }),
- MessageManager
- .getString("label.align_to_existing_structure_view"),
- JOptionPane.YES_NO_CANCEL_OPTION);
- if (option == JOptionPane.CANCEL_OPTION)
- {
- return;
- }
- if (option == JOptionPane.YES_OPTION)
- {
- topView.useAlignmentPanelForSuperposition(ap);
- topView.addStructure(pdbentry, seq, chains, true, ap.alignFrame);
- return;
- }
- }
- // /////////////////////////////////
- openNewChimera(ap, new PDBEntry[]
- { pdbentry }, new SequenceI[][]
- { seq });
- }
-
- private void openNewChimera(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();
- }
- });
-