public void mousePressed(MouseEvent e) {
if (!(e instanceof NeoMouseEvent)) {
return;
}
NeoMouseEvent nme = (NeoMouseEvent) e;
Object coord_source = nme.getSource();
seqmap.setZoomBehavior(NeoMap.Y, NeoMap.CONSTRAIN_COORD,
nme.getCoordY());
seqmap.setZoomBehavior(NeoMap.X, NeoMap.CONSTRAIN_COORD,
nme.getCoordX());
axismap.setZoomBehavior(NeoMap.X, NeoMap.CONSTRAIN_COORD,
nme.getCoordX());
// if alt is down or shift is down, add to previous selection,
// otherwise replace previous selection
boolean multiselect = false;
if (nme.isAltDown() || nme.isShiftDown()) {
multiselect = true;
}
if (coord_source == axismap) {
if (!multiselect) {
seqmap.clearSelected();
}
} else
{
List<GlyphI> hitGlyphs = seqmap.getItems(nme.getCoordX(),
nme.getCoordY());
if (!multiselect) {
seqmap.clearSelected();
}
selected = seqmap.getSelected();
List<GlyphI> to_select = getGlyphsToSelect(hitGlyphs, selected,
multiselect);
if (to_select == null) {
selected = new ArrayList<GlyphI>();
} else {
if (to_select.size() > 0) {
seqmap.select(to_select);
selected = to_select;
}
}
}
zoomPoint.setSpot(seqmap.getZoomCoord(NeoMap.X));
axismap.updateWidget();
seqmap.updateWidget();
showProperties();
if(hairline != null) {
hairline.setRange((int)nme.getCoordX(), (int)nme.getCoordX() + 1);
}
if (e.isPopupTrigger()) {
popup.show(this, e.getX(), e.getY());
}