X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FSeqPanel.java;h=f36a8e29791f59323b4739b5c0219143d56fcfa1;hb=b5a209613f14ad6e75f43aa537a96484d847ce0a;hp=2d2e3fdc06cda4a1ffcd14d490caabcbe5639769;hpb=1499d3297cf70ff34df05362449dbf36873c5bc1;p=jalview.git diff --git a/src/jalview/appletgui/SeqPanel.java b/src/jalview/appletgui/SeqPanel.java index 2d2e3fd..f36a8e2 100644 --- a/src/jalview/appletgui/SeqPanel.java +++ b/src/jalview/appletgui/SeqPanel.java @@ -54,6 +54,8 @@ import java.awt.event.InputEvent; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; +import java.util.Collections; +import java.util.List; import java.util.Vector; public class SeqPanel extends Panel implements MouseMotionListener, @@ -130,8 +132,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, if (editCommand != null && editCommand.getSize() > 0) { ap.alignFrame.addHistoryItem(editCommand); - av.firePropertyChange("alignment", null, av.getAlignment() - .getSequences()); + av.firePropertyChange("alignment", null, + av.getAlignment().getSequences()); } startseq = -1; @@ -181,23 +183,21 @@ public class SeqPanel extends Panel implements MouseMotionListener, { seqCanvas.cursorX += dx; seqCanvas.cursorY += dy; - if (av.hasHiddenColumns() - && !av.getAlignment().getHiddenColumns() - .isVisible(seqCanvas.cursorX)) + if (av.hasHiddenColumns() && !av.getAlignment().getHiddenColumns() + .isVisible(seqCanvas.cursorX)) { int original = seqCanvas.cursorX - dx; int maxWidth = av.getAlignment().getWidth(); while (!av.getAlignment().getHiddenColumns() - .isVisible(seqCanvas.cursorX) - && seqCanvas.cursorX < maxWidth && seqCanvas.cursorX > 0) + .isVisible(seqCanvas.cursorX) && seqCanvas.cursorX < maxWidth + && seqCanvas.cursorX > 0) { seqCanvas.cursorX += dx; } - if (seqCanvas.cursorX >= maxWidth - || !av.getAlignment().getHiddenColumns() - .isVisible(seqCanvas.cursorX)) + if (seqCanvas.cursorX >= maxWidth || !av.getAlignment() + .getHiddenColumns().isVisible(seqCanvas.cursorX)) { seqCanvas.cursorX = original; } @@ -228,7 +228,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, endEditing(); if (av.getWrapAlignment()) { - ap.scrollToWrappedVisible(seqCanvas.cursorX); + av.getRanges().scrollToWrappedVisible(seqCanvas.cursorX); } else { @@ -236,25 +236,25 @@ public class SeqPanel extends Panel implements MouseMotionListener, HiddenColumns hidden = av.getAlignment().getHiddenColumns(); while (seqCanvas.cursorY < ranges.getStartSeq()) { - ap.scrollUp(true); + ranges.scrollUp(true); } while (seqCanvas.cursorY > ranges.getEndSeq()) { - ap.scrollUp(false); + ranges.scrollUp(false); } - while (seqCanvas.cursorX < hidden.adjustForHiddenColumns(ranges - .getStartRes())) + while (seqCanvas.cursorX < hidden + .adjustForHiddenColumns(ranges.getStartRes())) { - if (!ap.scrollRight(false)) + if (!ranges.scrollRight(false)) { break; } } - while (seqCanvas.cursorX > hidden.adjustForHiddenColumns(ranges - .getEndRes())) + while (seqCanvas.cursorX > hidden + .adjustForHiddenColumns(ranges.getEndRes())) { - if (!ap.scrollRight(true)) + if (!ranges.scrollRight(true)) { break; } @@ -441,9 +441,9 @@ public class SeqPanel extends Panel implements MouseMotionListener, } else { - residue = "X".equalsIgnoreCase(displayChar) ? "X" : ("*" - .equals(displayChar) ? "STOP" : ResidueProperties.aa2Triplet - .get(displayChar)); + residue = "X".equalsIgnoreCase(displayChar) ? "X" + : ("*".equals(displayChar) ? "STOP" + : ResidueProperties.aa2Triplet.get(displayChar)); if (residue != null) { text.append(" Residue: ").append(residue); @@ -505,7 +505,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, // For now, ignore the mouseWheel font resizing on Macs // As the Button2_mask always seems to be true - if ((evt.getModifiers() & InputEvent.BUTTON2_MASK) == InputEvent.BUTTON2_MASK + if ((evt.getModifiers() + & InputEvent.BUTTON2_MASK) == InputEvent.BUTTON2_MASK && !av.MAC) { mouseWheelPressed = true; @@ -527,7 +528,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, } int seq = findSeq(evt); - int res = findRes(evt); + int res = findColumn(evt); if (seq < 0 || res < 0) { @@ -563,22 +564,20 @@ public class SeqPanel extends Panel implements MouseMotionListener, av.setSelectionGroup(null); } - SequenceFeature[] features = findFeaturesAtRes(sequence, - sequence.findPosition(findRes(evt))); + int column = findColumn(evt); + List features = findFeaturesAtColumn(sequence, + column + 1); - if (features != null && features.length > 0) + if (!features.isEmpty()) { SearchResultsI highlight = new SearchResults(); - highlight.addResult(sequence, features[0].getBegin(), - features[0].getEnd()); + highlight.addResult(sequence, features.get(0).getBegin(), + features.get(0).getEnd()); seqCanvas.highlightSearchResults(highlight); - } - if (features != null && features.length > 0) - { seqCanvas.getFeatureRenderer().amendFeatures( - new SequenceI[] { sequence }, features, false, ap); - - seqCanvas.highlightSearchResults(null); + Collections.singletonList(sequence), features, false, ap); + av.setSearchResults(null); // clear highlighting + seqCanvas.repaint(); // draw new/amended features } } } @@ -586,13 +585,13 @@ public class SeqPanel extends Panel implements MouseMotionListener, @Override public void mouseReleased(MouseEvent evt) { + boolean didDrag = mouseDragging; // did we come here after a drag mouseDragging = false; mouseWheelPressed = false; - ap.paintAlignment(true); if (!editingSeqs) { - doMouseReleasedDefineMode(evt); + doMouseReleasedDefineMode(evt, didDrag); return; } @@ -604,11 +603,19 @@ public class SeqPanel extends Panel implements MouseMotionListener, int wrappedBlock = -1; - int findRes(MouseEvent evt) + /** + * Returns the aligned sequence position (base 0) at the mouse position, or + * the closest visible one + * + * @param evt + * @return + */ + int findColumn(MouseEvent evt) { int res = 0; int x = evt.getX(); + int startRes = av.getRanges().getStartRes(); if (av.getWrapAlignment()) { @@ -623,7 +630,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, int y = evt.getY(); y -= hgap; - x -= seqCanvas.LABEL_WEST; + x = Math.max(0, x - seqCanvas.LABEL_WEST); int cwidth = seqCanvas.getWrappedCanvasWidth(getSize().width); if (cwidth < 1) @@ -632,14 +639,15 @@ public class SeqPanel extends Panel implements MouseMotionListener, } wrappedBlock = y / cHeight; - wrappedBlock += av.getRanges().getStartRes() / cwidth; - - res = wrappedBlock * cwidth + x / av.getCharWidth(); - + wrappedBlock += startRes / cwidth; + int startOffset = startRes % cwidth; // in case start is scrolled right + // from 0 + res = wrappedBlock * cwidth + startOffset + + +Math.min(cwidth - 1, x / av.getCharWidth()); } else { - res = (x / av.getCharWidth()) + av.getRanges().getStartRes(); + res = (x / av.getCharWidth()) + startRes; } if (av.hasHiddenColumns()) @@ -681,8 +689,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, y -= hgap; - seq = Math.min((y % cHeight) / av.getCharHeight(), av.getAlignment() - .getHeight() - 1); + seq = Math.min((y % cHeight) / av.getCharHeight(), + av.getAlignment().getHeight() - 1); if (seq < 0) { seq = -1; @@ -690,10 +698,9 @@ public class SeqPanel extends Panel implements MouseMotionListener, } else { - seq = Math.min((y / av.getCharHeight()) - + av.getRanges().getStartSeq(), - av - .getAlignment().getHeight() - 1); + seq = Math.min( + (y / av.getCharHeight()) + av.getRanges().getStartSeq(), + av.getAlignment().getHeight() - 1); if (seq < 0) { seq = -1; @@ -707,7 +714,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, { int seq = findSeq(evt); - int res = findRes(evt); + int res = findColumn(evt); if (seq < av.getAlignment().getHeight() && res < av.getAlignment().getSequenceAt(seq).getLength()) @@ -747,10 +754,16 @@ public class SeqPanel extends Panel implements MouseMotionListener, { if (av.isFollowHighlight()) { + // don't allow highlight of protein/cDNA to also scroll a complementary + // panel,as this sets up a feedback loop (scrolling panel 1 causes moused + // over residue to change abruptly, causing highlighted residue in panel 2 + // to change, causing a scroll in panel 1 etc) + ap.setToScrollComplementPanel(false); if (ap.scrollToPosition(results, true)) { ap.alignFrame.repaint(); } + ap.setToScrollComplementPanel(true); } setStatusMessage(results); seqCanvas.highlightSearchResults(results); @@ -773,7 +786,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, @Override public void mouseMoved(MouseEvent evt) { - final int column = findRes(evt); + final int column = findColumn(evt); int seq = findSeq(evt); if (seq >= av.getAlignment().getHeight() || seq < 0 || column < 0) @@ -796,9 +809,11 @@ public class SeqPanel extends Panel implements MouseMotionListener, } final char ch = sequence.getCharAt(column); - int respos = Comparison.isGap(ch) ? -1 : sequence.findPosition(column); + boolean isGapped = Comparison.isGap(ch); + // find residue at column (or nearest if at a gap) + int respos = sequence.findPosition(column); - if (ssm != null && respos != -1) + if (ssm != null && !isGapped) { mouseOverSequence(sequence, column, respos); } @@ -807,30 +822,20 @@ public class SeqPanel extends Panel implements MouseMotionListener, text.append("Sequence ").append(Integer.toString(seq + 1)) .append(" ID: ").append(sequence.getName()); - String obj = null; - if (respos != -1) + if (!isGapped) { if (av.getAlignment().isNucleotide()) { - obj = ResidueProperties.nucleotideName.get(ch); - if (obj != null) - { - text.append(" Nucleotide: ").append(obj); - } + String base = ResidueProperties.nucleotideName.get(ch); + text.append(" Nucleotide: ").append(base == null ? ch : base); } else { - obj = (ch == 'x' || ch == 'X') ? "X" : ResidueProperties.aa2Triplet - .get(String.valueOf(ch)); - if (obj != null) - { - text.append(" Residue: ").append(obj); - } - } - if (obj != null) - { - text.append(" (").append(Integer.toString(respos)).append(")"); + String residue = (ch == 'x' || ch == 'X') ? "X" + : ResidueProperties.aa2Triplet.get(String.valueOf(ch)); + text.append(" Residue: ").append(residue == null ? ch : residue); } + text.append(" (").append(Integer.toString(respos)).append(")"); } ap.alignFrame.statusBar.setText(text.toString()); @@ -841,7 +846,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, { for (int g = 0; g < groups.length; g++) { - if (groups[g].getStartRes() <= column && groups[g].getEndRes() >= column) + if (groups[g].getStartRes() <= column + && groups[g].getEndRes() >= column) { if (!groups[g].getName().startsWith("JTreeGroup") && !groups[g].getName().startsWith("JGroup")) @@ -858,18 +864,15 @@ public class SeqPanel extends Panel implements MouseMotionListener, } /* - * add feature details to tooltip if over one or more features + * add feature details to tooltip, including any that straddle + * a gapped position */ - if (respos != -1) + if (av.isShowSequenceFeatures()) { - SequenceFeature[] allFeatures = findFeaturesAtRes(sequence, - sequence.findPosition(column)); - - int index = 0; - while (index < allFeatures.length) + List allFeatures = findFeaturesAtColumn(sequence, + column + 1); + for (SequenceFeature sf : allFeatures) { - SequenceFeature sf = allFeatures[index]; - tooltipText.append(sf.getType() + " " + sf.begin + ":" + sf.end); if (sf.getDescription() != null) @@ -886,8 +889,6 @@ public class SeqPanel extends Panel implements MouseMotionListener, } } tooltipText.append("\n"); - - index++; } } @@ -901,40 +902,19 @@ public class SeqPanel extends Panel implements MouseMotionListener, } } - SequenceFeature[] findFeaturesAtRes(SequenceI sequence, int res) + /** + * Returns features at the specified aligned column on the given sequence. + * Non-positional features are not included. If the column has a gap, then + * enclosing features are included (but not contact features). + * + * @param sequence + * @param column + * (1..) + * @return + */ + List findFeaturesAtColumn(SequenceI sequence, int column) { - Vector tmp = new Vector(); - SequenceFeature[] features = sequence.getSequenceFeatures(); - if (features != null) - { - for (int i = 0; i < features.length; i++) - { - if (av.getFeaturesDisplayed() == null - || !av.getFeaturesDisplayed().isVisible( - features[i].getType())) - { - continue; - } - - if (features[i].featureGroup != null - && !seqCanvas.fr.checkGroupVisibility( - features[i].featureGroup, false)) - { - continue; - } - - if ((features[i].getBegin() <= res) - && (features[i].getEnd() >= res)) - { - tmp.addElement(features[i]); - } - } - } - - features = new SequenceFeature[tmp.size()]; - tmp.copyInto(features); - - return features; + return seqCanvas.getFeatureRenderer().findFeaturesAtColumn(sequence, column); } Tooltip tooltip; @@ -955,8 +935,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, int oldWidth = av.getCharWidth(); // Which is bigger, left-right or up-down? - if (Math.abs(evt.getY() - lastMousePress.y) > Math.abs(evt.getX() - - lastMousePress.x)) + if (Math.abs(evt.getY() - lastMousePress.y) > Math + .abs(evt.getX() - lastMousePress.x)) { int fontSize = av.font.getSize(); @@ -1014,7 +994,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, return; } - int res = findRes(evt); + int res = findColumn(evt); if (res < 0) { @@ -1065,8 +1045,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, StringBuffer message = new StringBuffer(); if (groupEditing) { - message.append(MessageManager.getString("action.edit_group")).append( - ":"); + message.append(MessageManager.getString("action.edit_group")) + .append(":"); if (editCommand == null) { editCommand = new EditCommand( @@ -1084,8 +1064,9 @@ public class SeqPanel extends Panel implements MouseMotionListener, } if (editCommand == null) { - editCommand = new EditCommand(MessageManager.formatMessage( - "label.edit_params", new String[] { label })); + editCommand = new EditCommand(MessageManager + .formatMessage("label.edit_params", new String[] + { label })); } } @@ -1102,9 +1083,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, ap.alignFrame.statusBar.setText(message.toString()); // Are we editing within a selection group? - if (groupEditing - || (sg != null && sg.getSequences(av.getHiddenRepSequences()) - .contains(seq))) + if (groupEditing || (sg != null + && sg.getSequences(av.getHiddenRepSequences()).contains(seq))) { fixedColumns = true; @@ -1196,7 +1176,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, // Find the next gap before the end // of the visible region boundary boolean blank = false; - for (fixedRight = fixedRight; fixedRight > lastres; fixedRight--) + for (; fixedRight > lastres; fixedRight--) { blank = true; @@ -1204,8 +1184,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, { for (int j = 0; j < startres - lastres; j++) { - if (!jalview.util.Comparison.isGap(gs.getCharAt(fixedRight - - j))) + if (!jalview.util.Comparison + .isGap(gs.getCharAt(fixedRight - j))) { blank = false; break; @@ -1326,9 +1306,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, } else { - editCommand.appendEdit(Action.INSERT_GAP, - new SequenceI[] { seq }, lastres, startres - lastres, - av.getAlignment(), true); + editCommand.appendEdit(Action.INSERT_GAP, new SequenceI[] { seq }, + lastres, startres - lastres, av.getAlignment(), true); } } else @@ -1362,8 +1341,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, if (max > 0) { editCommand.appendEdit(Action.DELETE_GAP, - new SequenceI[] { seq }, startres, max, - av.getAlignment(), true); + new SequenceI[] + { seq }, startres, max, av.getAlignment(), true); } } } @@ -1423,11 +1402,11 @@ public class SeqPanel extends Panel implements MouseMotionListener, { if (scrollThread != null) { - scrollThread.running = false; + scrollThread.threadRunning = false; scrollThread = null; } - int res = findRes(evt); + int column = findColumn(evt); int seq = findSeq(evt); oldSeq = seq; startWrapBlock = wrappedBlock; @@ -1439,16 +1418,16 @@ public class SeqPanel extends Panel implements MouseMotionListener, SequenceI sequence = av.getAlignment().getSequenceAt(seq); - if (sequence == null || res > sequence.getLength()) + if (sequence == null || column > sequence.getLength()) { return; } stretchGroup = av.getSelectionGroup(); - if (stretchGroup == null || !stretchGroup.contains(sequence, res)) + if (stretchGroup == null || !stretchGroup.contains(sequence, column)) { - stretchGroup = av.getAlignment().findGroup(sequence, res); + stretchGroup = av.getAlignment().findGroup(sequence, column); if (stretchGroup != null) { // only update the current selection if the popup menu has a group to @@ -1458,27 +1437,22 @@ public class SeqPanel extends Panel implements MouseMotionListener, } // DETECT RIGHT MOUSE BUTTON IN AWT - if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK) + if ((evt.getModifiers() + & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK) { - SequenceFeature[] allFeatures = findFeaturesAtRes(sequence, - sequence.findPosition(res)); + List allFeatures = findFeaturesAtColumn(sequence, + sequence.findPosition(column + 1)); Vector links = null; - if (allFeatures != null) + for (SequenceFeature sf : allFeatures) { - for (int i = 0; i < allFeatures.length; i++) + if (sf.links != null) { - if (allFeatures[i].links != null) + if (links == null) { - if (links == null) - { - links = new Vector(); - } - for (int j = 0; j < allFeatures[i].links.size(); j++) - { - links.addElement(allFeatures[i].links.elementAt(j)); - } + links = new Vector(); } + links.addAll(sf.links); } } APopupMenu popup = new APopupMenu(ap, null, links); @@ -1489,7 +1463,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, if (av.cursorMode) { - seqCanvas.cursorX = findRes(evt); + seqCanvas.cursorX = findColumn(evt); seqCanvas.cursorY = findSeq(evt); seqCanvas.repaint(); return; @@ -1501,8 +1475,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, { // define a new group here SequenceGroup sg = new SequenceGroup(); - sg.setStartRes(res); - sg.setEndRes(res); + sg.setStartRes(column); + sg.setEndRes(column); sg.addSequence(sequence, false); av.setSelectionGroup(sg); stretchGroup = sg; @@ -1521,7 +1495,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, } } - public void doMouseReleasedDefineMode(MouseEvent evt) + public void doMouseReleasedDefineMode(MouseEvent evt, boolean afterDrag) { if (stretchGroup == null) { @@ -1531,7 +1505,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, // but defer colourscheme update until hidden sequences are passed in boolean vischange = stretchGroup.recalcConservation(true); // here we rely on stretchGroup == av.getSelection() - needOverviewUpdate |= vischange && av.isSelectionDefinedGroup(); + needOverviewUpdate |= vischange && av.isSelectionDefinedGroup() + && afterDrag; if (stretchGroup.cs != null) { stretchGroup.cs.alignmentChanged(stretchGroup, @@ -1559,7 +1534,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, public void doMouseDraggedDefineMode(MouseEvent evt) { - int res = findRes(evt); + int res = findColumn(evt); int y = findSeq(evt); if (wrappedBlock != startWrapBlock) @@ -1674,7 +1649,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, mouseExited(evt); } - if (scrollThread != null) + if ((scrollThread != null) && (scrollThread.isRunning())) { scrollThread.setEvent(evt); } @@ -1690,9 +1665,9 @@ public class SeqPanel extends Panel implements MouseMotionListener, oldSeq = 0; } - if (scrollThread != null) + if ((scrollThread != null) && (scrollThread.isRunning())) { - scrollThread.running = false; + scrollThread.stopScrolling(); scrollThread = null; } } @@ -1715,9 +1690,9 @@ public class SeqPanel extends Panel implements MouseMotionListener, { if (evt == null) { - if (scrollThread != null) + if ((scrollThread != null) && (scrollThread.isRunning())) { - scrollThread.running = false; + scrollThread.stopScrolling(); scrollThread = null; } mouseDragging = false; @@ -1740,7 +1715,7 @@ public class SeqPanel extends Panel implements MouseMotionListener, { MouseEvent evt; - boolean running = false; + private volatile boolean threadRunning = true; public ScrollThread() { @@ -1754,14 +1729,18 @@ public class SeqPanel extends Panel implements MouseMotionListener, public void stopScrolling() { - running = false; + threadRunning = false; + } + + public boolean isRunning() + { + return threadRunning; } @Override public void run() { - running = true; - while (running) + while (threadRunning) { if (evt != null) @@ -1770,24 +1749,23 @@ public class SeqPanel extends Panel implements MouseMotionListener, if (mouseDragging && evt.getY() < 0 && av.getRanges().getStartSeq() > 0) { - running = ap.scrollUp(true); + av.getRanges().scrollUp(true); } - if (mouseDragging && evt.getY() >= getSize().height - && av.getAlignment().getHeight() > av.getRanges() - .getEndSeq()) + if (mouseDragging && evt.getY() >= getSize().height && av + .getAlignment().getHeight() > av.getRanges().getEndSeq()) { - running = ap.scrollUp(false); + av.getRanges().scrollUp(false); } if (mouseDragging && evt.getX() < 0) { - running = ap.scrollRight(false); + av.getRanges().scrollRight(false); } else if (mouseDragging && evt.getX() >= getSize().width) { - running = ap.scrollRight(true); + av.getRanges().scrollRight(true); } } @@ -1812,9 +1790,10 @@ public class SeqPanel extends Panel implements MouseMotionListener, // handles selection messages... // TODO: extend config options to allow user to control if selections may be // shared between viewports. - if (av != null - && (av == source || !av.followSelection || (source instanceof AlignViewport && ((AlignmentViewport) source) - .getSequenceSetId().equals(av.getSequenceSetId())))) + if (av != null && (av == source || !av.followSelection + || (source instanceof AlignViewport + && ((AlignmentViewport) source).getSequenceSetId() + .equals(av.getSequenceSetId())))) { return; } @@ -1843,11 +1822,9 @@ public class SeqPanel extends Panel implements MouseMotionListener, { if (av.getAlignment() == null) { - System.out - .println("Selection message: alignviewport av SeqSetId=" - + av.getSequenceSetId() + " ViewId=" - + av.getViewId() - + " 's alignment is NULL! returning immediatly."); + System.out.println("Selection message: alignviewport av SeqSetId=" + + av.getSequenceSetId() + " ViewId=" + av.getViewId() + + " 's alignment is NULL! returning immediatly."); return; } sgroup = seqsel.intersect(av.getAlignment(), @@ -1867,9 +1844,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, } repaint = av.isSelectionGroupChanged(true); } - if (copycolsel - && (av.getColumnSelection() == null || !av - .isColSelChanged(true))) + if (copycolsel && (av.getColumnSelection() == null + || !av.isColSelChanged(true))) { // the current selection is unset or from a previous message // so import the new colsel. @@ -1895,10 +1871,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, } repaint |= av.isColSelChanged(true); } - if (copycolsel - && av.hasHiddenColumns() - && (av.getColumnSelection() == null || av.getAlignment() - .getHiddenColumns().getHiddenRegions() == null)) + if (copycolsel && av.hasHiddenColumns() + && (av.getColumnSelection() == null)) { System.err.println("Bad things"); } @@ -1932,8 +1906,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, { row = row < 0 ? ap.av.getRanges().getStartSeq() : row; - ap.scrollTo(ap.av.getRanges().getStartRes(), ap.av.getRanges() - .getStartRes(), row, true, true); + ap.scrollTo(ap.av.getRanges().getStartRes(), + ap.av.getRanges().getStartRes(), row, true, true); } /** @@ -1945,7 +1919,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, { column = column < 0 ? ap.av.getRanges().getStartRes() : column; - ap.scrollTo(column, column, ap.av.getRanges().getStartSeq(), true, true); + ap.scrollTo(column, column, ap.av.getRanges().getStartSeq(), true, + true); } /**