use of net.sf.mzmine.chartbasics.gestures.ChartGesture in project mzmine2 by mzmine.
the class ChartGestureMouseAdapter method mouseEntered.
@Override
public void mouseEntered(MouseEvent e) {
if (gestureHandlers == null || gestureHandlers.isEmpty() || !listensFor(Event.ENTERED))
return;
if (e.getComponent() instanceof ChartPanel) {
ChartPanel chartPanel = (ChartPanel) e.getComponent();
ChartEntity entity = findChartEntity(chartPanel, e);
ChartGesture.Entity gestureEntity = ChartGesture.getGestureEntity(entity);
Button button = Button.getButton(e.getButton());
// handle event
handleEvent(new ChartGestureEvent(chartPanel, e, entity, new ChartGesture(gestureEntity, Event.ENTERED, button)));
}
}
use of net.sf.mzmine.chartbasics.gestures.ChartGesture in project mzmine2 by mzmine.
the class ChartGestureMouseAdapter method mouseDragged.
@Override
public void mouseDragged(MouseEvent e) {
if (gestureHandlers == null || gestureHandlers.isEmpty() || !listensFor(Event.DRAGGED))
return;
if (e.getComponent() instanceof ChartPanel) {
ChartPanel chartPanel = (ChartPanel) e.getComponent();
// keep the same chartEntity
ChartEntity entity = lastDragEvent.getEntity();
ChartGesture.Entity gestureEntity = lastDragEvent.getGesture().getEntity();
Button button = lastDragEvent.getGesture().getButton();
// handle event
lastDragEvent = new ChartGestureEvent(chartPanel, e, entity, new ChartGesture(gestureEntity, Event.DRAGGED, button));
handleEvent(lastDragEvent);
}
}
Aggregations