sr.forOverview = true;
fr = new FeatureRenderer(av);
- od = new OverviewDimensions(av);
+ boolean showAnnotation = false;
+ // TODO: in applet this was getSequenceConsensusHash()
+ // check if it makes any functional difference: hconsensus or conservation
+ if (av.getAlignmentConservationAnnotation() == null)
+ {
+ showAnnotation = true;
+ }
+
+ od = new OverviewDimensions(av, showAnnotation);
setSize(new Dimension(od.getWidth(), od.getHeight()));
addComponentListener(new ComponentAdapter()
@Override
public void mousePressed(MouseEvent evt)
{
- od.setBoxPositionByMouse(evt.getX(), evt.getY());
- ap.setScrollValues(od.getScrollCol(), od.getScrollRow());
- ap.paintAlignment(false);
+ mouseAction(evt);
}
@Override
public void mouseReleased(MouseEvent evt)
{
- od.setBoxPositionByMouse(evt.getX(), evt.getY());
- ap.setScrollValues(od.getScrollCol(), od.getScrollRow());
- ap.paintAlignment(false);
+ mouseAction(evt);
}
@Override
public void mouseDragged(MouseEvent evt)
{
- od.setBoxPositionByMouse(evt.getX(), evt.getY());
+ mouseAction(evt);
+ }
+
+ private void mouseAction(MouseEvent evt)
+ {
+ od.updateViewportFromMouse(evt.getX(), evt.getY());
ap.setScrollValues(od.getScrollCol(), od.getScrollRow());
ap.paintAlignment(false);
}
Graphics mg = miniMe.getGraphics();
- od.updateScales();
+ // od.updateScales();
int alwidth = av.getAlignment().getWidth();
- int alheight = av.getAlignment().getHeight()
- + av.getAlignment().getHiddenSequences().getSize();
+ int alheight = av.getAlignment().getAbsoluteHeight();
float sampleCol = alwidth / (float) od.getWidth();
float sampleRow = alheight / (float) od.getSequencesHeight();
int sameCol = 0;
jalview.datamodel.SequenceI seq = null;
- final boolean hasHiddenRows = av.hasHiddenRows();
+
final boolean hasHiddenCols = av.hasHiddenColumns();
boolean hiddenRow = false;
}
else
{
- // this should largely be a method in Alignment
- hiddenRow = false;
- if (hasHiddenRows)
- {
- // look for sequence in hidden rows
- seq = av.getAlignment().getHiddenSequences()
- .getHiddenSequence(lastrow);
- if (seq == null)
- {
- // didn't find in hidden rows, adjust the index and retrieve from
- // full row set
- int index = av.getAlignment().getHiddenSequences()
- .findIndexWithoutHiddenSeqs(lastrow);
-
- seq = av.getAlignment().getSequenceAt(index);
- }
- else
- {
- // found in hidden rows, ergo this row is hidden
- hiddenRow = true;
- }
- }
- else
- {
- seq = av.getAlignment().getSequenceAt(lastrow);
- }
- // end of Alignment method
+ // get the sequence which would be at alignment index 'lastrow' if no
+ // columns were hidden, and determine whether it is hidden or not
+ hiddenRow = av.getAlignment().isHidden(lastrow);
+ seq = av.getAlignment().getSequenceAtAbsoluteIndex(lastrow);
for (int col = 0; col < od.getWidth(); col++)
{