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.
23 import java.awt.Color;
24 import java.awt.Dimension;
26 import java.awt.FontMetrics;
27 import java.awt.Graphics;
28 import java.awt.Graphics2D;
29 import java.awt.Point;
30 import java.awt.Rectangle;
31 import java.awt.RenderingHints;
32 import java.awt.event.MouseEvent;
33 import java.awt.event.MouseListener;
34 import java.awt.event.MouseMotionListener;
35 import java.awt.print.PageFormat;
36 import java.awt.print.Printable;
37 import java.awt.print.PrinterException;
38 import java.awt.print.PrinterJob;
39 import java.util.ArrayList;
40 import java.util.BitSet;
41 import java.util.HashMap;
42 import java.util.Hashtable;
43 import java.util.List;
45 import java.util.Map.Entry;
46 import java.util.Vector;
48 import javax.swing.JPanel;
49 import javax.swing.JScrollPane;
50 import javax.swing.SwingUtilities;
51 import javax.swing.ToolTipManager;
53 import jalview.analysis.Conservation;
54 import jalview.analysis.TreeModel;
55 import jalview.api.AlignViewportI;
56 import jalview.datamodel.AlignmentAnnotation;
57 import jalview.datamodel.BinaryNode;
58 import jalview.datamodel.ColumnSelection;
59 import jalview.datamodel.ContactMatrixI;
60 import jalview.datamodel.HiddenColumns;
61 import jalview.datamodel.Sequence;
62 import jalview.datamodel.SequenceGroup;
63 import jalview.datamodel.SequenceI;
64 import jalview.datamodel.SequenceNode;
65 import jalview.gui.JalviewColourChooser.ColourChooserListener;
66 import jalview.schemes.ColourSchemeI;
67 import jalview.structure.SelectionSource;
68 import jalview.util.Format;
69 import jalview.util.MessageManager;
77 public class TreeCanvas extends JPanel implements MouseListener, Runnable,
78 Printable, MouseMotionListener, SelectionSource
81 public static final String PLACEHOLDER = " * ";
85 JScrollPane scrollPane;
89 private AlignViewport av;
91 private AlignmentPanel ap;
97 boolean fitToWindow = true;
99 boolean showDistances = false;
101 boolean showBootstrap = false;
103 boolean markPlaceholders = false;
109 private float threshold;
113 int labelLength = -1;
115 Map<Object, Rectangle> nameHash = new Hashtable<>();
117 Map<BinaryNode, Rectangle> nodeHash = new Hashtable<>();
119 BinaryNode highlightNode;
121 boolean applyToAllViews = false;
124 * Creates a new TreeCanvas object.
135 public TreeCanvas(TreePanel tp, AlignmentPanel ap, JScrollPane scroller)
139 this.setAssociatedPanel(ap);
141 scrollPane = scroller;
142 addMouseListener(this);
143 addMouseMotionListener(this);
144 ToolTipManager.sharedInstance().registerComponent(this);
153 public void treeSelectionChanged(SequenceI sequence)
155 AlignmentPanel[] aps = getAssociatedPanels();
157 for (int a = 0; a < aps.length; a++)
159 SequenceGroup selected = aps[a].av.getSelectionGroup();
161 if (selected == null)
163 selected = new SequenceGroup();
164 aps[a].av.setSelectionGroup(selected);
167 selected.setEndRes(aps[a].av.getAlignment().getWidth() - 1);
168 selected.addOrRemove(sequence, true);
178 public void setTree(TreeModel tree)
181 tree.findHeight(tree.getTopNode());
183 // Now have to calculate longest name based on the leaves
184 Vector<BinaryNode> leaves = tree.findLeaves(tree.getTopNode());
185 boolean has_placeholders = false;
188 for (int i = 0; i < leaves.size(); i++)
190 BinaryNode lf = leaves.elementAt(i);
192 if (lf instanceof SequenceNode && ((SequenceNode) lf).isPlaceholder())
194 has_placeholders = true;
197 if (longestName.length() < ((Sequence) lf.element()).getName()
200 longestName = TreeCanvas.PLACEHOLDER
201 + ((Sequence) lf.element()).getName();
205 setMarkPlaceholders(has_placeholders);
226 public void drawNode(Graphics g, BinaryNode node, float chunk,
227 double wscale, int width, int offx, int offy)
234 if ((node.left() == null) && (node.right() == null))
237 double height = node.height;
238 double dist = node.dist;
240 int xstart = (int) ((height - dist) * wscale) + offx;
241 int xend = (int) (height * wscale) + offx;
243 int ypos = (int) (node.ycount * chunk) + offy;
245 if (node.element() instanceof SequenceI)
247 SequenceI seq = (SequenceI) node.element();
249 if (av.getSequenceColour(seq) == Color.white)
251 g.setColor(Color.black);
255 g.setColor(av.getSequenceColour(seq).darker());
260 g.setColor(Color.black);
263 // Draw horizontal line
264 g.drawLine(xstart, ypos, xend, ypos);
266 String nodeLabel = "";
268 if (showDistances && (node.dist > 0))
270 nodeLabel = new Format("%g").form(node.dist);
273 if (showBootstrap && node.bootstrap > -1)
277 nodeLabel = nodeLabel + " : ";
280 nodeLabel = nodeLabel + String.valueOf(node.bootstrap);
283 if (!nodeLabel.equals(""))
285 g.drawString(nodeLabel, xstart + 2, ypos - 2);
288 String name = (markPlaceholders && ((node instanceof SequenceNode
289 && ((SequenceNode) node).isPlaceholder())))
290 ? (PLACEHOLDER + node.getName())
293 int charWidth = fm.stringWidth(name) + 3;
294 int charHeight = font.getSize();
296 Rectangle rect = new Rectangle(xend + 10, ypos - charHeight / 2,
297 charWidth, charHeight);
299 nameHash.put(node.element(), rect);
301 // Colour selected leaves differently
302 boolean isSelected = false;
303 if (tp.isColumnWise())
305 isSelected = isColumnForNodeSelected(node);
309 SequenceGroup selected = av.getSelectionGroup();
311 if ((selected != null)
312 && selected.getSequences(null).contains(node.element()))
319 g.setColor(Color.gray);
321 g.fillRect(xend + 10, ypos - charHeight / 2, charWidth, charHeight);
322 g.setColor(Color.white);
325 g.drawString(name, xend + 10, ypos + fm.getDescent());
326 g.setColor(Color.black);
330 drawNode(g, (BinaryNode) node.left(), chunk, wscale, width, offx,
332 drawNode(g, (BinaryNode) node.right(), chunk, wscale, width, offx,
335 double height = node.height;
336 double dist = node.dist;
338 int xstart = (int) ((height - dist) * wscale) + offx;
339 int xend = (int) (height * wscale) + offx;
340 int ypos = (int) (node.ycount * chunk) + offy;
342 g.setColor(node.color.darker());
344 // Draw horizontal line
345 g.drawLine(xstart, ypos, xend, ypos);
346 if (node == highlightNode)
348 g.fillRect(xend - 3, ypos - 3, 6, 6);
352 g.fillRect(xend - 2, ypos - 2, 4, 4);
355 int ystart = (node.left() == null ? 0
356 : (int) (((BinaryNode) node.left()).ycount * chunk)) + offy;
357 int yend = (node.right() == null ? 0
358 : (int) (((BinaryNode) node.right()).ycount * chunk)) + offy;
360 Rectangle pos = new Rectangle(xend - 2, ypos - 2, 5, 5);
361 nodeHash.put(node, pos);
363 g.drawLine((int) (height * wscale) + offx, ystart,
364 (int) (height * wscale) + offx, yend);
366 String nodeLabel = "";
368 if (showDistances && (node.dist > 0))
370 nodeLabel = new Format("%g").form(node.dist);
373 if (showBootstrap && node.bootstrap > -1)
377 nodeLabel = nodeLabel + " : ";
380 nodeLabel = nodeLabel + String.valueOf(node.bootstrap);
383 if (!nodeLabel.equals(""))
385 g.drawString(nodeLabel, xstart + 2, ypos - 2);
398 * @return DOCUMENT ME!
400 public Object findElement(int x, int y)
402 for (Entry<Object, Rectangle> entry : nameHash.entrySet())
404 Rectangle rect = entry.getValue();
406 if ((x >= rect.x) && (x <= (rect.x + rect.width)) && (y >= rect.y)
407 && (y <= (rect.y + rect.height)))
409 return entry.getKey();
413 for (Entry<BinaryNode, Rectangle> entry : nodeHash.entrySet())
415 Rectangle rect = entry.getValue();
417 if ((x >= rect.x) && (x <= (rect.x + rect.width)) && (y >= rect.y)
418 && (y <= (rect.y + rect.height)))
420 return entry.getKey();
433 public void pickNodes(Rectangle pickBox)
435 int width = getWidth();
436 int height = getHeight();
438 BinaryNode top = tree.getTopNode();
440 double wscale = ((width * .8) - (offx * 2)) / tree.getMaxHeight();
444 top.count = ((BinaryNode) top.left()).count
445 + ((BinaryNode) top.right()).count;
448 float chunk = (float) (height - (offy)) / top.count;
450 pickNode(pickBox, top, chunk, wscale, width, offx, offy);
471 public void pickNode(Rectangle pickBox, BinaryNode node, float chunk,
472 double wscale, int width, int offx, int offy)
479 if ((node.left() == null) && (node.right() == null))
481 double height = node.height;
482 // double dist = node.dist;
483 // int xstart = (int) ((height - dist) * wscale) + offx;
484 int xend = (int) (height * wscale) + offx;
486 int ypos = (int) (node.ycount * chunk) + offy;
488 if (pickBox.contains(new Point(xend, ypos)))
490 if (node.element() instanceof SequenceI)
492 SequenceI seq = (SequenceI) node.element();
493 SequenceGroup sg = av.getSelectionGroup();
497 sg.addOrRemove(seq, true);
504 pickNode(pickBox, (BinaryNode) node.left(), chunk, wscale, width,
506 pickNode(pickBox, (BinaryNode) node.right(), chunk, wscale, width,
519 public void setColor(BinaryNode node, Color c)
527 if (node.element() instanceof SequenceI)
529 final SequenceI seq = (SequenceI) node.element();
530 AlignmentPanel[] aps = getAssociatedPanels();
533 for (int a = 0; a < aps.length; a++)
535 aps[a].av.setSequenceColour(seq, c);
539 setColor((BinaryNode) node.left(), c);
540 setColor((BinaryNode) node.right(), c);
548 Thread thread = new Thread(this);
552 // put printing in a thread to avoid painting problems
556 PrinterJob printJob = PrinterJob.getPrinterJob();
557 PageFormat defaultPage = printJob.defaultPage();
558 PageFormat pf = printJob.pageDialog(defaultPage);
560 if (defaultPage == pf)
568 printJob.setPrintable(this, pf);
570 if (printJob.printDialog())
575 } catch (Exception PrintException)
577 PrintException.printStackTrace();
592 * @return DOCUMENT ME!
594 * @throws PrinterException
598 public int print(Graphics pg, PageFormat pf, int pi)
599 throws PrinterException
602 pg.translate((int) pf.getImageableX(), (int) pf.getImageableY());
604 int pwidth = (int) pf.getImageableWidth();
605 int pheight = (int) pf.getImageableHeight();
607 int noPages = getHeight() / pheight;
611 return Printable.NO_SUCH_PAGE;
614 if (pwidth > getWidth())
621 if (pheight > getHeight())
623 pheight = getHeight();
630 FontMetrics fm = pg.getFontMetrics(font);
631 int height = fm.getHeight() * nameHash.size();
632 pg.translate(0, -pi * pheight);
633 pg.setClip(0, pi * pheight, pwidth, (pi * pheight) + pheight);
635 // translate number of pages,
636 // height is screen size as this is the
637 // non overlapping text size
641 draw(pg, pwidth, pheight);
643 return Printable.PAGE_EXISTS;
653 public void paintComponent(Graphics g)
655 super.paintComponent(g);
661 MessageManager.getString("label.calculating_tree") + "....",
662 20, getHeight() / 2);
666 fm = g.getFontMetrics(font);
668 int nameCount = nameHash.size();
674 if (fitToWindow || (!fitToWindow && (scrollPane
675 .getHeight() > ((fm.getHeight() * nameCount) + offy))))
677 draw(g, scrollPane.getWidth(), scrollPane.getHeight());
678 setPreferredSize(null);
682 setPreferredSize(new Dimension(scrollPane.getWidth(),
683 fm.getHeight() * nameCount));
684 draw(g, scrollPane.getWidth(), fm.getHeight() * nameCount);
687 scrollPane.revalidate();
698 public void setFont(Font font)
714 public void draw(Graphics g1, int width, int height)
716 Graphics2D g2 = (Graphics2D) g1;
717 g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
718 RenderingHints.VALUE_ANTIALIAS_ON);
719 g2.setColor(Color.white);
720 g2.fillRect(0, 0, width, height);
723 if (longestName == null || tree == null)
725 g2.drawString("Calculating tree.", 20, 20);
728 offy = font.getSize() + 10;
730 fm = g2.getFontMetrics(font);
732 labelLength = fm.stringWidth(longestName) + 20; // 20 allows for scrollbar
734 double wscale = (width - labelLength - (offx * 2))
735 / tree.getMaxHeight();
737 BinaryNode top = tree.getTopNode();
741 top.count = ((BinaryNode) top.left()).count
742 + ((BinaryNode) top.right()).count;
745 float chunk = (float) (height - (offy)) / top.count;
747 drawNode(g2, tree.getTopNode(), chunk, wscale, width, offx, offy);
751 if (av.getCurrentTree() == tree)
753 g2.setColor(Color.red);
757 g2.setColor(Color.gray);
760 int x = (int) ((threshold * (getWidth() - labelLength - (2 * offx)))
763 g2.drawLine(x, 0, x, getHeight());
768 * Empty method to satisfy the MouseListener interface
773 public void mouseReleased(MouseEvent e)
776 * isPopupTrigger is set on mouseReleased on Windows
778 if (e.isPopupTrigger())
780 chooseSubtreeColour();
781 e.consume(); // prevent mouseClicked happening
786 * Empty method to satisfy the MouseListener interface
791 public void mouseEntered(MouseEvent e)
796 * Empty method to satisfy the MouseListener interface
801 public void mouseExited(MouseEvent e)
806 * Handles a mouse click on a tree node (clicks elsewhere are handled in
807 * mousePressed). Click selects the sub-tree, double-click swaps leaf nodes
808 * order, right-click opens a dialogue to choose colour for the sub-tree.
813 public void mouseClicked(MouseEvent evt)
815 if (highlightNode == null)
820 if (evt.getClickCount() > 1)
822 tree.swapNodes(highlightNode);
823 tree.reCount(tree.getTopNode());
824 tree.findHeight(tree.getTopNode());
828 Vector<BinaryNode> leaves = tree.findLeaves(highlightNode);
829 if (tp.isColumnWise())
831 markColumnsFor(getAssociatedPanels(), leaves, Color.red);
835 for (int i = 0; i < leaves.size(); i++)
837 SequenceI seq = (SequenceI) leaves.elementAt(i).element();
838 treeSelectionChanged(seq);
844 PaintRefresher.Refresh(tp, av.getSequenceSetId());
849 * Offer the user the option to choose a colour for the highlighted node and
850 * its children; this colour is also applied to the corresponding sequence ids
853 void chooseSubtreeColour()
855 String ttl = MessageManager.getString("label.select_subtree_colour");
856 ColourChooserListener listener = new ColourChooserListener()
859 public void colourSelected(Color c)
861 setColor(highlightNode, c);
862 PaintRefresher.Refresh(tp, ap.av.getSequenceSetId());
866 JalviewColourChooser.showColourChooser(this, ttl, highlightNode.color,
871 public void mouseMoved(MouseEvent evt)
873 av.setCurrentTree(tree);
875 Object ob = findElement(evt.getX(), evt.getY());
877 if (ob instanceof BinaryNode)
879 highlightNode = (BinaryNode) ob;
881 "<html>" + MessageManager.getString("label.highlightnode"));
887 if (highlightNode != null)
889 highlightNode = null;
890 setToolTipText(null);
897 public void mouseDragged(MouseEvent ect)
902 * Handles a mouse press on a sequence name or the tree background canvas
903 * (click on a node is handled in mouseClicked). The action is to create
904 * groups by partitioning the tree at the mouse position. Colours for the
905 * groups (and sequence names) are generated randomly.
910 public void mousePressed(MouseEvent e)
912 av.setCurrentTree(tree);
915 * isPopupTrigger is set for mousePressed (Mac)
916 * or mouseReleased (Windows)
918 if (e.isPopupTrigger())
920 if (highlightNode != null)
922 chooseSubtreeColour();
928 * defer right-click handling on Windows to
929 * mouseClicked; note isRightMouseButton
930 * also matches Cmd-click on Mac which should do
933 if (SwingUtilities.isRightMouseButton(e))
941 Object ob = findElement(x, y);
943 if (ob instanceof SequenceI)
945 treeSelectionChanged((Sequence) ob);
946 PaintRefresher.Refresh(tp,
947 getAssociatedPanel().av.getSequenceSetId());
952 else if (!(ob instanceof BinaryNode))
955 if (tree.getMaxHeight() != 0)
957 threshold = (float) (x - offx)
958 / (float) (getWidth() - labelLength - (2 * offx));
960 List<BinaryNode> groups = tree.groupNodes(threshold);
961 setColor(tree.getTopNode(), Color.black);
963 AlignmentPanel[] aps = getAssociatedPanels();
965 // TODO push calls below into a single AlignViewportI method?
966 // see also AlignViewController.deleteGroups
967 for (int a = 0; a < aps.length; a++)
969 aps[a].av.setSelectionGroup(null);
970 aps[a].av.getAlignment().deleteAllGroups();
971 aps[a].av.clearSequenceColours();
972 if (aps[a].av.getCodingComplement() != null)
974 aps[a].av.getCodingComplement().setSelectionGroup(null);
975 aps[a].av.getCodingComplement().getAlignment()
977 aps[a].av.getCodingComplement().clearSequenceColours();
979 aps[a].av.setUpdateStructures(true);
981 colourGroups(groups);
984 * clear partition (don't show vertical line) if
985 * it is to the right of all nodes
987 if (groups.isEmpty())
993 PaintRefresher.Refresh(tp,
994 getAssociatedPanel().av.getSequenceSetId());
1000 void colourGroups(List<BinaryNode> groups)
1002 AlignmentPanel[] aps = getAssociatedPanels();
1003 List<BitSet> colGroups = new ArrayList<>();
1004 Map<BitSet, Color> colors = new HashMap();
1005 for (int i = 0; i < groups.size(); i++)
1007 Color col = new Color((int) (Math.random() * 255),
1008 (int) (Math.random() * 255), (int) (Math.random() * 255));
1009 setColor(groups.get(i), col.brighter());
1011 Vector<BinaryNode> l = tree.findLeaves(groups.get(i));
1012 if (!tp.isColumnWise())
1014 createSeqGroupFor(aps, l, col);
1018 BitSet gp = createColumnGroupFor(l, col);
1021 colors.put(gp, col);
1024 if (tp.isColumnWise())
1026 AlignmentAnnotation aa = tp.getAssocAnnotation();
1029 ContactMatrixI cm = av.getContactMatrix(aa);
1032 cm.updateGroups(colGroups);
1033 for (BitSet gp : colors.keySet())
1035 cm.setColorForGroup(gp, colors.get(gp));
1041 // notify the panel(s) to redo any group specific stuff
1042 // also updates structure views if necessary
1043 for (int a = 0; a < aps.length; a++)
1045 aps[a].updateAnnotation();
1046 final AlignViewportI codingComplement = aps[a].av
1047 .getCodingComplement();
1048 if (codingComplement != null)
1050 ((AlignViewport) codingComplement).getAlignPanel()
1051 .updateAnnotation();
1056 private boolean isColumnForNodeSelected(BinaryNode bn)
1058 SequenceI rseq = tp.assocAnnotation.sequenceRef;
1062 colm = Integer.parseInt(
1063 bn.getName().substring(bn.getName().indexOf("c") + 1));
1064 } catch (Exception e)
1068 if (av == null || av.getAlignment() == null)
1070 // alignment is closed
1073 ColumnSelection cs = av.getColumnSelection();
1075 HiddenColumns hc = av.getAlignment().getHiddenColumns();
1076 int offp = (rseq != null) ? rseq.findIndex(rseq.getStart() + colm)
1079 if (!av.hasHiddenColumns())
1081 return cs.contains(offp - 1);
1083 if (hc.isVisible(offp - 1))
1085 return cs.contains(offp - 1);
1086 // return cs.contains(hc.absoluteToVisibleColumn(offp));
1091 private BitSet createColumnGroupFor(Vector<BinaryNode> l, Color col)
1093 BitSet gp = new BitSet();
1094 for (BinaryNode bn : l)
1097 if (bn.element() != null && bn.element() instanceof Integer)
1099 colm = (Integer) bn.element();
1103 // parse out from nodename
1106 colm = Integer.parseInt(
1107 bn.getName().substring(bn.getName().indexOf("c") + 1));
1108 } catch (Exception e)
1118 private void markColumnsFor(AlignmentPanel[] aps, Vector<BinaryNode> l,
1121 SequenceI rseq = tp.assocAnnotation.sequenceRef;
1122 if (av == null || av.getAlignment() == null)
1124 // alignment is closed
1128 for (BinaryNode bn : l)
1133 colm = Integer.parseInt(
1134 bn.getName().substring(bn.getName().indexOf("c") + 1));
1135 } catch (Exception e)
1139 ColumnSelection cs = av.getColumnSelection();
1140 HiddenColumns hc = av.getAlignment().getHiddenColumns();
1142 int offp = (rseq != null) ? rseq.findIndex(rseq.getStart() + colm)
1145 if (!av.hasHiddenColumns() || hc.isVisible(offp - 1))
1147 if (cs.contains(offp - 1))
1149 cs.removeElement(offp - 1);
1153 cs.addElement(offp - 1);
1160 public void createSeqGroupFor(AlignmentPanel[] aps, Vector<BinaryNode> l,
1164 Vector<SequenceI> sequences = new Vector<>();
1166 for (int j = 0; j < l.size(); j++)
1168 SequenceI s1 = (SequenceI) l.elementAt(j).element();
1170 if (!sequences.contains(s1))
1172 sequences.addElement(s1);
1176 ColourSchemeI cs = null;
1177 SequenceGroup _sg = new SequenceGroup(sequences, null, cs, true, true,
1178 false, 0, av.getAlignment().getWidth() - 1);
1180 _sg.setName("JTreeGroup:" + _sg.hashCode());
1181 _sg.setIdColour(col);
1183 for (int a = 0; a < aps.length; a++)
1185 SequenceGroup sg = new SequenceGroup(_sg);
1186 AlignViewport viewport = aps[a].av;
1188 // Propagate group colours in each view
1189 if (viewport.getGlobalColourScheme() != null)
1191 cs = viewport.getGlobalColourScheme().getInstance(viewport, sg);
1192 sg.setColourScheme(cs);
1193 sg.getGroupColourScheme().setThreshold(
1194 viewport.getResidueShading().getThreshold(),
1195 viewport.isIgnoreGapsConsensus());
1197 if (viewport.getResidueShading().conservationApplied())
1199 Conservation c = new Conservation("Group", sg.getSequences(null),
1200 sg.getStartRes(), sg.getEndRes());
1202 c.verdict(false, viewport.getConsPercGaps());
1203 sg.cs.setConservation(c);
1206 // indicate that associated structure views will need an update
1207 viewport.setUpdateStructures(true);
1208 // propagate structure view update and sequence group to complement view
1209 viewport.addSequenceGroup(sg);
1219 public void setShowDistances(boolean state)
1221 this.showDistances = state;
1231 public void setShowBootstrap(boolean state)
1233 this.showBootstrap = state;
1243 public void setMarkPlaceholders(boolean state)
1245 this.markPlaceholders = state;
1249 AlignmentPanel[] getAssociatedPanels()
1251 if (applyToAllViews)
1253 return PaintRefresher.getAssociatedPanels(av.getSequenceSetId());
1257 return new AlignmentPanel[] { getAssociatedPanel() };
1261 public AlignmentPanel getAssociatedPanel()
1266 public void setAssociatedPanel(AlignmentPanel ap)
1271 public AlignViewport getViewport()
1276 public void setViewport(AlignViewport av)
1281 public float getThreshold()
1286 public void setThreshold(float threshold)
1288 this.threshold = threshold;
1291 public boolean isApplyToAllViews()
1293 return this.applyToAllViews;
1296 public void setApplyToAllViews(boolean applyToAllViews)
1298 this.applyToAllViews = applyToAllViews;