2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
22 * Jalview - A Sequence Alignment Editor and Viewer
23 * Copyright (C) 2007 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
25 * This program is free software; you can redistribute it and/or
26 * modify it under the terms of the GNU General Public License
27 * as published by the Free Software Foundation; either version 2
28 * of the License, or (at your option) any later version.
30 * This program is distributed in the hope that it will be useful,
31 * but WITHOUT ANY WARRANTY; without even the implied warranty of
32 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 * GNU General Public License for more details.
35 * You should have received a copy of the GNU General Public License
36 * along with this program; if not, write to the Free Software
37 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
41 import java.awt.Container;
42 import java.awt.Dimension;
44 import java.awt.Rectangle;
45 import java.util.ArrayList;
46 import java.util.Hashtable;
47 import java.util.List;
49 import java.util.Vector;
51 import javax.swing.JInternalFrame;
52 import javax.swing.JOptionPane;
54 import jalview.analysis.AlignmentUtils;
55 import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
56 import jalview.analysis.NJTree;
57 import jalview.api.AlignExportSettingI;
58 import jalview.api.AlignViewportI;
59 import jalview.api.FeatureRenderer;
60 import jalview.api.ViewStyleI;
61 import jalview.bin.Cache;
62 import jalview.commands.CommandI;
63 import jalview.datamodel.AlignedCodonFrame;
64 import jalview.datamodel.Alignment;
65 import jalview.datamodel.AlignmentI;
66 import jalview.datamodel.ColumnSelection;
67 import jalview.datamodel.PDBEntry;
68 import jalview.datamodel.SearchResults;
69 import jalview.datamodel.Sequence;
70 import jalview.datamodel.SequenceGroup;
71 import jalview.datamodel.SequenceI;
72 import jalview.schemes.ColourSchemeProperty;
73 import jalview.schemes.UserColourScheme;
74 import jalview.structure.CommandListener;
75 import jalview.structure.SelectionSource;
76 import jalview.structure.StructureSelectionManager;
77 import jalview.structure.VamsasSource;
78 import jalview.util.MessageManager;
79 import jalview.viewmodel.AlignmentViewport;
80 import jalview.ws.params.AutoCalcSetting;
86 * @version $Revision: 1.141 $
88 public class AlignViewport extends AlignmentViewport implements
89 SelectionSource, CommandListener
93 NJTree currentTree = null;
95 boolean cursorMode = false;
97 boolean antiAlias = false;
99 private Rectangle explodedGeometry;
101 private FeatureRenderer featureRenderer;
103 private boolean includeHiddenRegion = true;
105 private AlignExportSettingI exportSettings;
110 * Flag set true on the view that should 'gather' multiple views of the same
111 * sequence set id when a project is reloaded. Set false on all views when
112 * they are 'exploded' into separate windows. Set true on the current view
113 * when 'Gather' is performed, and also on the first tab when the first new
116 private boolean gatherViewsHere = false;
118 private AnnotationColumnChooser annotationColumnSelectionState;
120 * Creates a new AlignViewport object.
125 public AlignViewport(AlignmentI al)
132 * Create a new AlignViewport object with a specific sequence set ID
136 * (may be null - but potential for ambiguous constructor exception)
138 public AlignViewport(AlignmentI al, String seqsetid)
140 this(al, seqsetid, null);
143 public AlignViewport(AlignmentI al, String seqsetid, String viewid)
145 sequenceSetID = seqsetid;
147 // TODO remove these once 2.4.VAMSAS release finished
148 if (Cache.log != null && Cache.log.isDebugEnabled() && seqsetid != null)
150 Cache.log.debug("Setting viewport's sequence set id : "
153 if (Cache.log != null && Cache.log.isDebugEnabled() && viewId != null)
155 Cache.log.debug("Setting viewport's view id : " + viewId);
162 * Create a new AlignViewport with hidden regions
166 * @param hiddenColumns
169 public AlignViewport(AlignmentI al, ColumnSelection hiddenColumns)
172 if (hiddenColumns != null)
174 colSel = hiddenColumns;
180 * New viewport with hidden columns and an existing sequence set id
183 * @param hiddenColumns
187 public AlignViewport(AlignmentI al, ColumnSelection hiddenColumns,
190 this(al, hiddenColumns, seqsetid, null);
194 * New viewport with hidden columns and an existing sequence set id and viewid
197 * @param hiddenColumns
203 public AlignViewport(AlignmentI al, ColumnSelection hiddenColumns,
204 String seqsetid, String viewid)
206 sequenceSetID = seqsetid;
208 // TODO remove these once 2.4.VAMSAS release finished
209 if (Cache.log != null && Cache.log.isDebugEnabled() && seqsetid != null)
211 Cache.log.debug("Setting viewport's sequence set id : "
214 if (Cache.log != null && Cache.log.isDebugEnabled() && viewId != null)
216 Cache.log.debug("Setting viewport's view id : " + viewId);
219 if (hiddenColumns != null)
221 colSel = hiddenColumns;
227 * Apply any settings saved in user preferences
229 private void applyViewProperties()
231 antiAlias = Cache.getDefault("ANTI_ALIAS", false);
233 viewStyle.setShowJVSuffix(Cache.getDefault("SHOW_JVSUFFIX", true));
234 setShowAnnotation(Cache.getDefault("SHOW_ANNOTATIONS", true));
236 setRightAlignIds(Cache.getDefault("RIGHT_ALIGN_IDS", false));
237 setCentreColumnLabels(Cache.getDefault("CENTRE_COLUMN_LABELS", false));
238 autoCalculateConsensus = Cache.getDefault("AUTO_CALC_CONSENSUS", true);
240 setPadGaps(Cache.getDefault("PAD_GAPS", true));
241 setShowNPFeats(Cache.getDefault("SHOW_NPFEATS_TOOLTIP", true));
242 setShowDBRefs(Cache.getDefault("SHOW_DBREFS_TOOLTIP", true));
243 viewStyle.setSeqNameItalics(Cache.getDefault("ID_ITALICS", true));
244 viewStyle.setWrapAlignment(Cache.getDefault("WRAP_ALIGNMENT", false));
245 viewStyle.setShowUnconserved(Cache
246 .getDefault("SHOW_UNCONSERVED", false));
247 sortByTree = Cache.getDefault("SORT_BY_TREE", false);
248 followSelection = Cache.getDefault("FOLLOW_SELECTIONS", true);
249 sortAnnotationsBy = SequenceAnnotationOrder.valueOf(Cache.getDefault(
250 Preferences.SORT_ANNOTATIONS,
251 SequenceAnnotationOrder.NONE.name()));
252 showAutocalculatedAbove = Cache.getDefault(
253 Preferences.SHOW_AUTOCALC_ABOVE, false);
254 viewStyle.setScaleProteinAsCdna(Cache.getDefault(
255 Preferences.SCALE_PROTEIN_TO_CDNA, true));
261 this.endRes = alignment.getWidth() - 1;
263 this.endSeq = alignment.getHeight() - 1;
264 applyViewProperties();
266 String fontName = Cache.getDefault("FONT_NAME", "SansSerif");
267 String fontStyle = Cache.getDefault("FONT_STYLE", Font.PLAIN + "");
268 String fontSize = Cache.getDefault("FONT_SIZE", "10");
272 if (fontStyle.equals("bold"))
276 else if (fontStyle.equals("italic"))
281 setFont(new Font(fontName, style, Integer.parseInt(fontSize)), true);
284 .setGapCharacter(Cache.getDefault("GAP_SYMBOL", "-").charAt(0));
286 // We must set conservation and consensus before setting colour,
287 // as Blosum and Clustal require this to be done
288 if (hconsensus == null && !isDataset)
290 if (!alignment.isNucleotide())
292 showConservation = Cache.getDefault("SHOW_CONSERVATION", true);
293 showQuality = Cache.getDefault("SHOW_QUALITY", true);
294 showGroupConservation = Cache.getDefault("SHOW_GROUP_CONSERVATION",
297 showConsensusHistogram = Cache.getDefault("SHOW_CONSENSUS_HISTOGRAM",
299 showSequenceLogo = Cache.getDefault("SHOW_CONSENSUS_LOGO", false);
300 normaliseSequenceLogo = Cache.getDefault("NORMALISE_CONSENSUS_LOGO",
302 showGroupConsensus = Cache.getDefault("SHOW_GROUP_CONSENSUS", false);
303 showConsensus = Cache.getDefault("SHOW_IDENTITY", true);
305 initAutoAnnotation();
306 String colourProperty = alignment.isNucleotide() ? Preferences.DEFAULT_COLOUR_NUC
307 : Preferences.DEFAULT_COLOUR_PROT;
308 String propertyValue = Cache.getProperty(colourProperty);
309 if (propertyValue == null)
311 // fall back on this property for backwards compatibility
312 propertyValue = Cache.getProperty(Preferences.DEFAULT_COLOUR);
314 if (propertyValue != null)
316 globalColourScheme = ColourSchemeProperty.getColour(alignment,
319 if (globalColourScheme instanceof UserColourScheme)
321 globalColourScheme = UserDefinedColours.loadDefaultColours();
322 ((UserColourScheme) globalColourScheme).setThreshold(0,
323 isIgnoreGapsConsensus());
326 if (globalColourScheme != null)
328 globalColourScheme.setConsensus(hconsensus);
334 * get the consensus sequence as displayed under the PID consensus annotation
337 * @return consensus sequence as a new sequence object
339 public SequenceI getConsensusSeq()
341 if (consensus == null)
343 updateConsensus(null);
345 if (consensus == null)
349 StringBuffer seqs = new StringBuffer();
350 for (int i = 0; i < consensus.annotations.length; i++)
352 if (consensus.annotations[i] != null)
354 if (consensus.annotations[i].description.charAt(0) == '[')
356 seqs.append(consensus.annotations[i].description.charAt(1));
360 seqs.append(consensus.annotations[i].displayCharacter);
365 SequenceI sq = new Sequence("Consensus", seqs.toString());
366 sq.setDescription("Percentage Identity Consensus "
367 + ((ignoreGapsInConsensusCalculation) ? " without gaps" : ""));
371 boolean validCharWidth;
374 * update view settings with the given font. You may need to call
375 * alignPanel.fontChanged to update the layout geometry
378 * when true, charWidth/height is set according to font mentrics
380 public void setFont(Font f, boolean setGrid)
384 Container c = new Container();
386 java.awt.FontMetrics fm = c.getFontMetrics(font);
387 int w = viewStyle.getCharWidth(), ww = fm.charWidth('M'), h = viewStyle
391 setCharHeight(fm.getHeight());
394 viewStyle.setFontName(font.getName());
395 viewStyle.setFontStyle(font.getStyle());
396 viewStyle.setFontSize(font.getSize());
398 validCharWidth = true;
402 public void setViewStyle(ViewStyleI settingsForView)
404 super.setViewStyle(settingsForView);
405 setFont(new Font(viewStyle.getFontName(), viewStyle.getFontStyle(),
406 viewStyle.getFontSize()), false);
412 * @return DOCUMENT ME!
414 public Font getFont()
425 public void setAlignment(AlignmentI align)
427 if (alignment != null && alignment.getCodonFrames() != null)
429 StructureSelectionManager.getStructureSelectionManager(
430 Desktop.instance).removeMappings(alignment.getCodonFrames());
432 this.alignment = align;
433 if (alignment != null && alignment.getCodonFrames() != null)
435 StructureSelectionManager.getStructureSelectionManager(
436 Desktop.instance).addMappings(alignment.getCodonFrames());
443 * @return DOCUMENT ME!
445 public char getGapCharacter()
447 return getAlignment().getGapCharacter();
456 public void setGapCharacter(char gap)
458 if (getAlignment() != null)
460 getAlignment().setGapCharacter(gap);
467 * @return DOCUMENT ME!
469 public ColumnSelection getColumnSelection()
480 public void setCurrentTree(NJTree tree)
488 * @return DOCUMENT ME!
490 public NJTree getCurrentTree()
496 * returns the visible column regions of the alignment
498 * @param selectedRegionOnly
499 * true to just return the contigs intersecting with the selected
503 public int[] getViewAsVisibleContigs(boolean selectedRegionOnly)
505 int[] viscontigs = null;
506 int start = 0, end = 0;
507 if (selectedRegionOnly && selectionGroup != null)
509 start = selectionGroup.getStartRes();
510 end = selectionGroup.getEndRes() + 1;
514 end = alignment.getWidth();
516 viscontigs = colSel.getVisibleContigs(start, end);
521 * get hash of undo and redo list for the alignment
523 * @return long[] { historyList.hashCode, redoList.hashCode };
525 public long[] getUndoRedoHash()
528 if (historyList == null || redoList == null)
534 { historyList.hashCode(), this.redoList.hashCode() };
538 * test if a particular set of hashcodes are different to the hashcodes for
539 * the undo and redo list.
542 * the stored set of hashcodes as returned by getUndoRedoHash
543 * @return true if the hashcodes differ (ie the alignment has been edited) or
544 * the stored hashcode array differs in size
546 public boolean isUndoRedoHashModified(long[] undoredo)
548 if (undoredo == null)
552 long[] cstate = getUndoRedoHash();
553 if (cstate.length != undoredo.length)
558 for (int i = 0; i < cstate.length; i++)
560 if (cstate[i] != undoredo[i])
568 public boolean followSelection = true;
571 * @return true if view selection should always follow the selections
572 * broadcast by other selection sources
574 public boolean getFollowSelection()
576 return followSelection;
580 * Send the current selection to be broadcast to any selection listeners.
582 public void sendSelection()
584 jalview.structure.StructureSelectionManager
585 .getStructureSelectionManager(Desktop.instance).sendSelection(
586 new SequenceGroup(getSelectionGroup()),
587 new ColumnSelection(getColumnSelection()), this);
591 * return the alignPanel containing the given viewport. Use this to get the
592 * components currently handling the given viewport.
595 * @return null or an alignPanel guaranteed to have non-null alignFrame
598 public AlignmentPanel getAlignPanel()
600 AlignmentPanel[] aps = PaintRefresher.getAssociatedPanels(this
601 .getSequenceSetId());
602 for (int p = 0; aps != null && p < aps.length; p++)
604 if (aps[p].av == this)
612 public boolean getSortByTree()
617 public void setSortByTree(boolean sort)
623 * synthesize a column selection if none exists so it covers the given
624 * selection group. if wholewidth is false, no column selection is made if the
625 * selection group covers the whole alignment width.
630 public void expandColSelection(SequenceGroup sg, boolean wholewidth)
634 && (sgs = sg.getStartRes()) >= 0
635 && sg.getStartRes() <= (sge = sg.getEndRes())
636 && (colSel == null || colSel.getSelected() == null || colSel
637 .getSelected().size() == 0))
639 if (!wholewidth && alignment.getWidth() == (1 + sge - sgs))
646 colSel = new ColumnSelection();
648 for (int cspos = sg.getStartRes(); cspos <= sg.getEndRes(); cspos++)
650 colSel.addElement(cspos);
656 * Returns the (Desktop) instance of the StructureSelectionManager
659 public StructureSelectionManager getStructureSelectionManager()
661 return StructureSelectionManager
662 .getStructureSelectionManager(Desktop.instance);
668 * @return an array of SequenceI arrays, one for each PDBEntry, listing which
669 * sequences in the alignment hold a reference to it
671 public SequenceI[][] collateForPDB(PDBEntry[] pdbEntries)
673 List<SequenceI[]> seqvectors = new ArrayList<SequenceI[]>();
674 for (PDBEntry pdb : pdbEntries)
676 List<SequenceI> seqs = new ArrayList<SequenceI>();
677 for (SequenceI sq : alignment.getSequences())
679 Vector<PDBEntry> pdbs = sq
680 .getDatasetSequence().getPDBId();
685 for (PDBEntry p1 : pdbs)
687 if (p1.getId().equals(pdb.getId()))
689 if (!seqs.contains(sq))
697 seqvectors.add(seqs.toArray(new SequenceI[seqs.size()]));
699 return seqvectors.toArray(new SequenceI[seqvectors.size()][]);
702 public boolean isNormaliseSequenceLogo()
704 return normaliseSequenceLogo;
707 public void setNormaliseSequenceLogo(boolean state)
709 normaliseSequenceLogo = state;
714 * @return true if alignment characters should be displayed
716 public boolean isValidCharWidth()
718 return validCharWidth;
721 private Hashtable<String, AutoCalcSetting> calcIdParams = new Hashtable<String, AutoCalcSetting>();
723 public AutoCalcSetting getCalcIdSettingsFor(String calcId)
725 return calcIdParams.get(calcId);
728 public void setCalcIdSettingsFor(String calcId, AutoCalcSetting settings,
731 calcIdParams.put(calcId, settings);
732 // TODO: create a restart list to trigger any calculations that need to be
733 // restarted after load
734 // calculator.getRegisteredWorkersOfClass(settings.getWorkerClass())
737 Cache.log.debug("trigger update for " + calcId);
742 * Method called when another alignment's edit (or possibly other) command is
745 * To allow for sequence mappings (e.g. protein to cDNA), we have to first
746 * 'unwind' the command on the source sequences (in simulation, not in fact),
747 * and then for each edit in turn:
749 * <li>compute the equivalent edit on the mapped sequences</li>
750 * <li>apply the mapped edit</li>
751 * <li>'apply' the source edit to the working copy of the source sequences</li>
759 public void mirrorCommand(CommandI command, boolean undo,
760 StructureSelectionManager ssm, VamsasSource source)
763 * Do nothing unless we are a 'complement' of the source. May replace this
764 * with direct calls not via SSM.
766 if (source instanceof AlignViewportI
767 && ((AlignViewportI) source).getCodingComplement() == this)
776 CommandI mappedCommand = ssm.mapCommand(command, undo, getAlignment(),
778 if (mappedCommand != null)
780 AlignmentI[] views = getAlignPanel().alignFrame.getViewAlignments();
781 mappedCommand.doCommand(views);
782 getAlignPanel().alignmentChanged();
787 * Add the sequences from the given alignment to this viewport. Optionally,
788 * may give the user the option to open a new frame, or split panel, with cDNA
789 * and protein linked.
794 public void addAlignment(AlignmentI al, String title)
796 // TODO: promote to AlignViewportI? applet CutAndPasteTransfer is different
798 // JBPComment: title is a largely redundant parameter at the moment
799 // JBPComment: this really should be an 'insert/pre/append' controller
800 // JBPComment: but the DNA/Protein check makes it a bit more complex
802 // refactored from FileLoader / CutAndPasteTransfer / SequenceFetcher with
804 // TODO: create undo object for this JAL-1101
807 * If any cDNA/protein mappings can be made between the alignments, offer to
808 * open a linked alignment with split frame option.
810 if (Cache.getDefault(Preferences.ENABLE_SPLIT_FRAME, false))
812 if (AlignmentUtils.isMappable(al, getAlignment()))
814 if (openLinkedAlignment(al, title))
822 * No mappings, or offer declined - add sequences to this alignment
824 // TODO: JAL-407 regardless of above - identical sequences (based on ID and
825 // provenance) should share the same dataset sequence
827 for (int i = 0; i < al.getHeight(); i++)
829 getAlignment().addSequence(al.getSequenceAt(i));
832 setEndSeq(getAlignment().getHeight());
833 firePropertyChange("alignment", null, getAlignment().getSequences());
837 * Show a dialog with the option to open and link (cDNA <-> protein) as a new
838 * alignment, either as a standalone alignment or in a split frame. Returns
839 * true if the new alignment was opened, false if not, because the user
840 * declined the offer.
845 protected boolean openLinkedAlignment(AlignmentI al, String title)
847 String[] options = new String[]
848 { MessageManager.getString("action.no"),
849 MessageManager.getString("label.split_window"),
850 MessageManager.getString("label.new_window"), };
851 final String question = JvSwingUtils.wrapTooltip(true,
852 MessageManager.getString("label.open_split_window?"));
853 int response = JOptionPane.showOptionDialog(Desktop.desktop, question,
854 MessageManager.getString("label.open_split_window"),
855 JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null,
856 options, options[0]);
858 if (response != 1 && response != 2)
862 final boolean openSplitPane = (response == 1);
863 final boolean openInNewWindow = (response == 2);
866 * Identify protein and dna alignments. Make a copy of this one if opening
867 * in a new split pane.
869 AlignmentI thisAlignment = openSplitPane ? new Alignment(getAlignment())
871 AlignmentI protein = al.isNucleotide() ? thisAlignment : al;
872 final AlignmentI cdna = al.isNucleotide() ? al : thisAlignment;
875 * Map sequences. At least one should get mapped as we have already passed
876 * the test for 'mappability'. Any mappings made will be added to the
877 * protein alignment. Note creating dataset sequences on the new alignment
878 * is a pre-requisite for building mappings.
881 AlignmentUtils.mapProteinToCdna(protein, cdna);
884 * Create the AlignFrame for the added alignment. Note this will include the
885 * cDNA consensus annotation if it is protein (because the alignment holds
886 * mappings to nucleotide)
888 AlignFrame newAlignFrame = new AlignFrame(al, AlignFrame.DEFAULT_WIDTH,
889 AlignFrame.DEFAULT_HEIGHT);
890 newAlignFrame.setTitle(title);
891 newAlignFrame.statusBar.setText(MessageManager.formatMessage(
892 "label.successfully_loaded_file", new Object[]
895 // TODO if we want this (e.g. to enable reload of the alignment from file),
896 // we will need to add parameters to the stack.
897 // if (!protocol.equals(AppletFormatAdapter.PASTE))
899 // alignFrame.setFileName(file, format);
904 Desktop.addInternalFrame(newAlignFrame, title,
905 AlignFrame.DEFAULT_WIDTH,
906 AlignFrame.DEFAULT_HEIGHT);
911 newAlignFrame.setMaximum(jalview.bin.Cache.getDefault(
914 } catch (java.beans.PropertyVetoException ex)
920 protein = openSplitFrame(newAlignFrame, thisAlignment,
921 protein.getCodonFrames());
925 * Register the mappings (held on the protein alignment) with the
926 * StructureSelectionManager (for mouseover linking).
928 final StructureSelectionManager ssm = StructureSelectionManager
929 .getStructureSelectionManager(Desktop.instance);
930 ssm.addMappings(protein.getCodonFrames());
936 * Helper method to open a new SplitFrame holding linked dna and protein
939 * @param newAlignFrame
940 * containing a new alignment to be shown
942 * cdna/protein complement alignment to show in the other split half
944 * @return the protein alignment in the split frame
946 protected AlignmentI openSplitFrame(AlignFrame newAlignFrame,
947 AlignmentI complement, Set<AlignedCodonFrame> mappings)
950 * Make a new frame with a copy of the alignment we are adding to. If this
951 * is protein, the new frame will have a cDNA consensus annotation row
954 AlignFrame copyMe = new AlignFrame(complement,
955 AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
956 copyMe.setTitle(getAlignPanel().alignFrame.getTitle());
958 AlignmentI al = newAlignFrame.viewport.getAlignment();
959 final AlignFrame proteinFrame = al.isNucleotide() ? copyMe
961 final AlignFrame cdnaFrame = al.isNucleotide() ? newAlignFrame
963 AlignmentI protein = proteinFrame.viewport.getAlignment();
964 protein.setCodonFrames(mappings);
966 cdnaFrame.setVisible(true);
967 proteinFrame.setVisible(true);
968 String linkedTitle = MessageManager
969 .getString("label.linked_view_title");
972 * Open in split pane. DNA sequence above, protein below.
974 JInternalFrame splitFrame = new SplitFrame(cdnaFrame, proteinFrame);
975 Desktop.addInternalFrame(splitFrame, linkedTitle, -1, -1);
980 public AnnotationColumnChooser getAnnotationColumnSelectionState()
982 return annotationColumnSelectionState;
985 public void setAnnotationColumnSelectionState(
986 AnnotationColumnChooser currentAnnotationColumnSelectionState)
988 this.annotationColumnSelectionState = currentAnnotationColumnSelectionState;
992 public void setIdWidth(int i)
995 AlignmentPanel ap = getAlignPanel();
998 // modify GUI elements to reflect geometry change
999 Dimension idw = getAlignPanel().getIdPanel().getIdCanvas()
1000 .getPreferredSize();
1002 getAlignPanel().getIdPanel().getIdCanvas().setPreferredSize(idw);
1006 public Rectangle getExplodedGeometry()
1008 return explodedGeometry;
1011 public void setExplodedGeometry(Rectangle explodedPosition)
1013 this.explodedGeometry = explodedPosition;
1016 public boolean isGatherViewsHere()
1018 return gatherViewsHere;
1021 public void setGatherViewsHere(boolean gatherViewsHere)
1023 this.gatherViewsHere = gatherViewsHere;
1027 * If this viewport has a (Protein/cDNA) complement, then scroll the
1028 * complementary alignment to match this one.
1030 public void scrollComplementaryAlignment()
1033 * Populate a SearchResults object with the mapped location to scroll to. If
1034 * there is no complement, or it is not following highlights, or no mapping
1035 * is found, the result will be empty.
1037 SearchResults sr = new SearchResults();
1038 int seqOffset = findComplementScrollTarget(sr);
1041 // TODO would like next line without cast but needs more refactoring...
1042 final AlignmentPanel complementPanel = ((AlignViewport) getCodingComplement()).getAlignPanel();
1043 complementPanel.setFollowingComplementScroll(true);
1044 complementPanel.scrollToCentre(sr, seqOffset);
1049 public FeatureRenderer getFeatureRenderer()
1051 return featureRenderer;
1055 public void setFeatureRenderer(FeatureRenderer featureRenderer)
1057 this.featureRenderer = featureRenderer;
1060 public AlignExportSettingI getExportSettings()
1062 return exportSettings;
1065 public void setExportSettings(AlignExportSettingI exportSettings)
1067 this.exportSettings = exportSettings;