@Override public void mouseUp(MouseEvent e) { if (state == 0) return; state = 0; dollar.pointerReleased(e.x, e.y); update(e); }
@Override public void dollarDetected(Dollar dollar) { score = dollar.getScore(); name = dollar.getName(); ok = score > 0.80; if (ok) { if (name.equals("circle CCW")) { BrowserMain.browser.refresh(); } else if (name.equals("leftSquareBracket")) { BrowserMain.browser.back(); BrowserMain.location.setText(BrowserMain.browser.getUrl()); } else if (name.equals("rightSquareBracket")) { BrowserMain.browser.forward(); BrowserMain.location.setText(BrowserMain.browser.getUrl()); } else if (name.equals("v")) { openDialog(); } else { System.out.println("Gesture: " + name); } } }
public MouseCatcher() { dollar.setListener(this); dollar.setActive(true); }
@Override public void mouseDown(MouseEvent e) { state = 1; dollar.pointerPressed(e.x, e.y); update(e); }
@Override public void mouseMove(MouseEvent e) { state = 2; dollar.pointerDragged(e.x, e.y); update(e); }