private void updateSelectionArea(UIPoint mousePosition, boolean finished) { if (finished && currentSelectionAreaStart != null) { int x1 = (int) mousePosition.getX(); int x2 = (int) this.currentSelectionAreaStart.getX(); int y1 = (int) mousePosition.getY(); int y2 = (int) this.currentSelectionAreaStart.getY(); if (x1 > x2) { int temp = x1; x1 = x2; x2 = temp; } if (y1 > y2) { int temp = y1; y1 = y2; y2 = temp; } IMapArea area = this.context.getRectangleOnScreen(x1, y1, x2, y2); getInterfaceConnector().fireAction(new SelectAreaAction(area)); this.currentSelectionAreaStart = null; this.currentSelectionAreaEnd = null; } else { this.currentSelectionAreaEnd = mousePosition; updateSelectionArea = true; } }