public abstract TreeModel getCurrentTree();
public abstract void setCurrentTree(TreeModel tree);
+
+ void setHighlightedSeqs(List<SequenceI> list);
+
+ List<SequenceI> getHighlightedSeqs();
}
viewport.setSelectionGroup(null);
viewport.getColumnSelection().clear();
viewport.setSelectionGroup(null);
- alignPanel.getIdPanel().getIdCanvas().searchResults = null;
+ viewport.setHighlightedSeqs(null);
// JAL-2034 - should delegate to
// alignPanel to decide if overview needs
// updating.
boolean fastPaint = false;
- List<SequenceI> searchResults;
-
AnnotationPanel ap;
private Font idfont;
int xPos = 0;
int panelWidth = getWidth();
int charHeight = av.getCharHeight();
-
+ List<SequenceI> searchResults = av.getHighlightedSeqs();
if ((searchResults != null) && searchResults.contains(s))
{
g.setColor(Color.black);
}
ViewportRanges ranges = av.getRanges();
+ List<SequenceI> searchResults = av.getHighlightedSeqs();
gg.copyArea(0, 0, getWidth(), imgHeight, 0,
-vertical * av.getCharHeight());
gg.setColor(Color.white);
gg.fillRect(0, 0, getWidth(), imgHeight);
- drawIds(gg, av, av.getRanges().getStartSeq(), av.getRanges().getEndSeq(), searchResults);
+ drawIds(gg, av, av.getRanges().getStartSeq(),
+ av.getRanges().getEndSeq(), av.getHighlightedSeqs());
g.drawImage(image, 0, 0, this);
}
return getIdfont();
}
- /**
- * DOCUMENT ME!
- *
- * @param list
- * DOCUMENT ME!
- */
- public void setHighlighted(List<SequenceI> list)
- {
- searchResults = list;
- repaint();
- }
-
public Font getIdfont()
{
return idfont;
*/
public void highlightSearchResults(List<SequenceI> list)
{
- getIdCanvas().setHighlighted(list);
+ av.setHighlightedSeqs(list);
if (list == null)
{
+ idCanvas.repaint();
return;
}
{
av.getRanges().setStartSeq(index);
}
+ else
+ {
+ // just repaint
+ idCanvas.repaint();
+ }
}
public IdCanvas getIdCanvas()
@Override
public void internalFrameClosing(InternalFrameEvent evt)
{
- ap.getIdPanel().getIdCanvas().setHighlighted(null);
+ ap.av.setHighlightedSeqs(null);
+ ap.getIdPanel().getIdCanvas().repaint();
}
});
redundantSequences.add(originalSequences[i]);
}
}
- ap.getIdPanel().getIdCanvas().setHighlighted(redundantSequences);
+ ap.av.setHighlightedSeqs(redundantSequences);
+ ap.getIdPanel().getIdCanvas().repaint();
}
/**
{
return currentTree;
}
+
+ List<SequenceI> highlightedSeqs = null;
+
+ /**
+ * Highlight the IDs for the given sequences call alignPanel.repaint() to
+ * update view after setting.
+ *
+ * @param list
+ * List<SequenceI>
+ */
+ @Override
+ public void setHighlightedSeqs(List<SequenceI> list)
+ {
+ highlightedSeqs = list;
+ }
+
+ @Override
+ public List<SequenceI> getHighlightedSeqs()
+ {
+ return highlightedSeqs;
+ }
}