- public AppJmol(AlignmentPanel ap, PDBEntry[] pe, SequenceI[][] seqs)
- {
- openNewJmol(ap, pe, seqs);
- }
-
- /**
- * list of sequenceSet ids associated with the view
- */
- ArrayList<String> _aps = new ArrayList();
-
- public AlignmentPanel[] getAllAlignmentPanels()
- {
- AlignmentPanel[] t, list = new AlignmentPanel[0];
- for (String setid : _aps)
- {
- AlignmentPanel[] panels = PaintRefresher.getAssociatedPanels(setid);
- if (panels != null)
- {
- t = new AlignmentPanel[list.length + panels.length];
- System.arraycopy(list, 0, t, 0, list.length);
- System.arraycopy(panels, 0, t, list.length, panels.length);
- list = t;
- }
- }
-
- return list;
- }
-
- /**
- * list of alignment panels to use for superposition
- */
- Vector<AlignmentPanel> _alignwith = new Vector<AlignmentPanel>();
-
- /**
- * list of alignment panels that are used for colouring structures by aligned
- * sequences
- */
- Vector<AlignmentPanel> _colourwith = new Vector<AlignmentPanel>();
-
- /**
- * set the primary alignmentPanel reference and add another alignPanel to the
- * list of ones to use for colouring and aligning
- *
- * @param nap
- */
- public void addAlignmentPanel(AlignmentPanel nap)
- {
- if (ap == null)
- {
- ap = nap;
- }
- if (!_aps.contains(nap.av.getSequenceSetId()))
- {
- _aps.add(nap.av.getSequenceSetId());
- }
- }
-
- /**
- * remove any references held to the given alignment panel
- *
- * @param nap
- */
- public void removeAlignmentPanel(AlignmentPanel nap)
- {
- try
- {
- _alignwith.remove(nap);
- _colourwith.remove(nap);
- if (ap == nap)
- {
- ap = null;
- for (AlignmentPanel aps : getAllAlignmentPanels())
- {
- if (aps != nap)
- {
- ap = aps;
- break;
- }
- }
- }
- } catch (Exception ex)
- {
- }
- if (ap != null)
- {
- buildJmolActionMenu();
- }
- }
-
- public void useAlignmentPanelForSuperposition(AlignmentPanel nap)
- {
- addAlignmentPanel(nap);
- if (!_alignwith.contains(nap))
- {
- _alignwith.add(nap);
- }
- }
-
- public void excludeAlignmentPanelForSuperposition(AlignmentPanel nap)
- {
- if (_alignwith.contains(nap))
- {
- _alignwith.remove(nap);
- }
- }
-
- public void useAlignmentPanelForColourbyseq(AlignmentPanel nap, boolean enableColourBySeq)
- {
- useAlignmentPanelForColourbyseq(nap);
- jmb.setColourBySequence(enableColourBySeq);
- seqColour.setSelected(enableColourBySeq);
- jmolColour.setSelected(!enableColourBySeq);
- }
- public void useAlignmentPanelForColourbyseq(AlignmentPanel nap)