@Override public void finished(GOEvent event) { if (action != null) { this.connector.fireAction(this.action); } }
@Override public void contentHiding(ActionFireable actionFireable, AbstractContentProvider nextContent) { uiContentUpdater.stop(); if (activeBuilding != null) { actionFireable.fireAction(new ShowConstructionMarksAction(null)); } } }
@Override public void finished(GOEvent event) { eventDataChanged(event); firerer.fireAction(new EndDrawingAction(last)); }
public GOEventHandlerImplementation(UIPoint lastpoint) { last = toMapPosition(lastpoint); firerer.fireAction(new StartDrawingAction(last)); starty = lastpoint.getY(); }
@Override public void contentHiding(ActionFireable actionFireable, AbstractContentProvider nextContent) { if (!nextContent.isForSelection()) { // TODO: Replace with a deselect-all-action actionFireable.fireAction(new Action(EActionType.DESELECT)); } super.contentHiding(actionFireable, nextContent); }
@Override public void eventDataChanged(GOEvent event) { UIPoint pos = ((GODrawEvent) event).getDrawPosition(); ShortPoint2D cur = toMapPosition(pos); firerer.fireAction(new DrawLineAction(last, cur, pos.getY() - starty)); last = cur; } }
/** * Forward a single action * * @throws InterruptedException */ protected void forwardSingleAction() throws InterruptedException { IAction action = toFire.take(); if (action instanceof DrawLineAction && toFire.peek() instanceof DrawLineAction) { ShortPoint2D start = ((DrawLineAction) action).getStart(); ShortPoint2D end = ((DrawLineAction) action).getEnd(); double uidy = ((DrawLineAction) action).getUidy(); while (toFire.peek() instanceof DrawLineAction) { DrawLineAction next = (DrawLineAction) toFire.poll(); end = next.getEnd(); uidy += next.getUidy(); } action = new DrawLineAction(start, end, uidy); } fireTo.fireAction(action); }
@Override public void run() { FireringAction action; while (!stopped) { try { synchronized (toFireMutex) { while (toFire.isEmpty() && !stopped) { toFireMutex.wait(); } if (stopped) { break; } action = toFire.poll(); } startWatchdog(action.startTime); fireTo.fireAction(action.action); stopWatchdog(); } catch (Throwable e) { System.err.println("Exception while handling action:"); e.printStackTrace(); if (blockingListener != null) { blockingListener.actionThreadCaughtException(e); } } if (toFire.isEmpty()) { disableWatchdog(); } } } }