public double[] startDragRubberBox() { final BlockingResult<double[]> result = new BlockingResult<double[]>(); final DragPointRubberBox rubberBox = new DragPointRubberBox(drawerVisitor); dragZoomRotateInteraction.setEnable(false); rubberBox.addListener( new RubberBoxListener() { @Override public void rubberBoxEnd() { result.setResult(rubberBox.getResults()); dragZoomRotateInteraction.setEnable(true); drawerVisitor.removePostRendering(rubberBox); } }); drawerVisitor.addPostRendering(rubberBox); rubberBox.setEnable(true); return result.getResult(); }
public double[] startClickRubberBox(double initialRect[]) { final BlockingResult<double[]> result = new BlockingResult<double[]>(); final PointRubberBox rubberBox; if (initialRect.length == 0) { rubberBox = new TwoPointsRubberBox(drawerVisitor); } else { rubberBox = new OnePointRubberBox(drawerVisitor, initialRect); } dragZoomRotateInteraction.setEnable(false); rubberBox.addListener( new RubberBoxListener() { @Override public void rubberBoxEnd() { result.setResult(rubberBox.getResults()); dragZoomRotateInteraction.setEnable(true); drawerVisitor.removePostRendering(rubberBox); } }); drawerVisitor.addPostRendering(rubberBox); rubberBox.setEnable(true); return result.getResult(); }