import javax.swing.JPanel;
/**
- * DOCUMENT ME!
+ * Panel displaying an overview of the full alignment, with an interactive box
+ * representing the viewport onto the alignment.
*
* @author $author$
* @version $Revision$
/**
* Creates a new OverviewPanel object.
*
- * @param ap
+ * @param alPanel
* The alignment panel which is shown in the overview panel
*/
- public OverviewPanel(AlignmentPanel ap)
+ public OverviewPanel(AlignmentPanel alPanel)
{
- this.av = ap.av;
- this.ap = ap;
+ this.av = alPanel.av;
+ this.ap = alPanel;
setLayout(null);
sr = new SequenceRenderer(av);
sr.renderGaps = false;
sr.forOverview = true;
- fr = new FeatureRenderer(ap);
+ fr = new FeatureRenderer(alPanel);
od = new OverviewDimensions(av);
{
// TODO: feature: jv2.5 detect shift drag and update selection from
// it.
- od.setBoxX(evt.getX());
- od.setBoxY(evt.getY());
- checkValid();
+ od.setBoxPositionByMouse(evt.getX(), evt.getY());
+ ap.setScrollValues(od.getScrollCol(), od.getScrollRow());
}
}
});
{
if (!av.getWrapAlignment())
{
- od.setBoxX(evt.getX());
- od.setBoxY(evt.getY());
- checkValid();
+ od.setBoxPositionByMouse(evt.getX(), evt.getY());
+ ap.setScrollValues(od.getScrollCol(), od.getScrollRow());
}
}
});
}
/**
- * Check box dimensions and scroll positions and correct if necessary
- */
- private void checkValid()
- {
- od.checkValid();
- ap.setScrollValues(od.getScrollCol(), od.getScrollRow());
-
- }
-
- /**
* Updates the overview image when the related alignment panel is updated
*/
public void updateOverviewImage()
}
// TODO: render selected regions
g.setColor(Color.red);
- g.drawRect(od.getBoxX(), od.getBoxY(), od.getBoxWidth(),
- od.getBoxHeight());
- g.drawRect(od.getBoxX() + 1, od.getBoxY() + 1, od.getBoxWidth() - 2,
- od.getBoxHeight() - 2);
+ od.drawBox(g);
}
}