@Test public void testIsClickedOnShapeWhenShapeIsNotClicked() { assertThat(control.isClickedOnShape(canvasHandler, 0, 0)).isFalse(); }
protected boolean isClickedOnShape(final H canvasHandler, final int canvasX, final int canvasY) { return getSelectedNodesStream(canvasHandler) .map(Element::getContent) .filter(content -> content instanceof View) .anyMatch(view -> { final Bounds bounds = ((View) view).getBounds(); return canvasX >= bounds.getUpperLeft().getX() && canvasX <= bounds.getLowerRight().getX() && canvasY >= bounds.getUpperLeft().getY() && canvasY <= bounds.getLowerRight().getY(); }); }
DomainObjectAwareLienzoMultipleSelectionControl extends LienzoMultipleSelectionControl<H> { protected boolean isClickedOnShape(final H canvasHandler, final int canvasX, final int canvasY) { return getSelectedNodesStream(canvasHandler) .map(Element::getContent) .filter(content -> content instanceof View) .anyMatch(view -> { final Bounds bounds = ((View) view).getBounds(); return canvasX >= bounds.getUpperLeft().getX() && canvasX <= bounds.getLowerRight().getX() && canvasY >= bounds.getUpperLeft().getY() && canvasY <= bounds.getLowerRight().getY(); }); } }
DomainObjectAwareLienzoMultipleSelectionControl extends LienzoMultipleSelectionControl<H> { protected boolean isClickedOnShape(final H canvasHandler, final int canvasX, final int canvasY) { return getSelectedNodesStream(canvasHandler) .map(Element::getContent) .filter(content -> content instanceof View) .anyMatch(view -> { final Bounds bounds = ((View) view).getBounds(); return canvasX >= bounds.getUpperLeft().getX() && canvasX <= bounds.getLowerRight().getX() && canvasY >= bounds.getUpperLeft().getY() && canvasY <= bounds.getLowerRight().getY(); }); } @Inject  DomainObjectAwareLienzoMultipleSelectionControl(final Event<CanvasSelectionEvent> canvasSelectionEvent,
                                                           final Event<CanvasClearSelectionEvent> clearSelectionEvent,
                                                           final DRDContextMenu drdContextMenu); }
DomainObjectAwareLienzoMultipleSelectionControl extends LienzoMultipleSelectionControl<H> { protected boolean isClickedOnShape(final H canvasHandler, final int canvasX, final int canvasY) { return getSelectedNodesStream(canvasHandler) .map(Element::getContent) .filter(content -> content instanceof View) .anyMatch(view -> { final Bounds bounds = ((View) view).getBounds(); return canvasX >= bounds.getUpperLeft().getX() && canvasX <= bounds.getLowerRight().getX() && canvasY >= bounds.getUpperLeft().getY() && canvasY <= bounds.getLowerRight().getY(); }); } @Inject  DomainObjectAwareLienzoMultipleSelectionControl(final Event<CanvasSelectionEvent> canvasSelectionEvent,
                                                           final Event<CanvasClearSelectionEvent> clearSelectionEvent,
                                                           final DRDContextMenu drdContextMenu); @Override Optional<Object> getSelectedItemDefinition(); @Override SelectionControl<H, Element> select(final String uuid); @Override void clear(); @Override void destroy(); }
DomainObjectAwareLienzoMultipleSelectionControl extends LienzoMultipleSelectionControl<H> { protected boolean isClickedOnShape(final H canvasHandler, final int canvasX, final int canvasY) { return getSelectedNodesStream(canvasHandler) .map(Element::getContent) .filter(content -> content instanceof View) .anyMatch(view -> { final Bounds bounds = ((View) view).getBounds(); return canvasX >= bounds.getUpperLeft().getX() && canvasX <= bounds.getLowerRight().getX() && canvasY >= bounds.getUpperLeft().getY() && canvasY <= bounds.getLowerRight().getY(); }); } @Inject  DomainObjectAwareLienzoMultipleSelectionControl(final Event<CanvasSelectionEvent> canvasSelectionEvent,
                                                           final Event<CanvasClearSelectionEvent> clearSelectionEvent,
                                                           final DRDContextMenu drdContextMenu); @Override Optional<Object> getSelectedItemDefinition(); @Override SelectionControl<H, Element> select(final String uuid); @Override void clear(); @Override void destroy();  }