-
- // Now this ChimeraViewFrame is mapped to new sequences. We must add
- // them to the existing array
- JInternalFrame[] frames = Desktop.instance.getAllFrames();
-
- for (JInternalFrame frame : frames)
- {
- if (frame instanceof ChimeraViewFrame)
- {
- final ChimeraViewFrame topView = ((ChimeraViewFrame) frame);
- // JBPNOTE: this looks like a binding routine, rather than a gui
- // routine
- for (int pe = 0; pe < topView.jmb.getPdbCount(); pe++)
- {
- if (topView.jmb.getPdbEntry(pe).getFile()
- .equals(
- alreadyMapped))
- {
- topView.jmb.addSequence(pe, seq);
- topView.addAlignmentPanel(ap);
- // add it to the set used for colouring
- topView.useAlignmentPanelForColourbyseq(ap);
- topView.buildChimeraActionMenu();
- ap.getStructureSelectionManager()
- .sequenceColoursChanged(ap);
- break;
- }
- }
- }
- }
-
- return;
- }
- }
- // /////////////////////////////////
- // 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();