class CaseManagementCanvasHandler extends CanvasHandlerImpl<D, C> {

    @Override
    public Optional<Element> getElementAt(double x, double y) {
        if (Double.compare(x, 0d) <= 0 || Double.compare(y, 0d) <= 0) {
            return Optional.empty();
        }

        final Point2D transform = this.getAbstractCanvas().getTransform().transform(x, y);
        final Optional<Element> parent = super.getElementAt(transform.getX(), transform.getY());

        // Return the root diagram if there is no element at the given location
        return parent.isPresent() ? parent : this.getDiagramNode();
    }

    @Inject public  CaseManagementCanvasHandler(final ClientDefinitionManager clientDefinitionManager,
                                       final RuleManager ruleManager,
                                       final GraphUtils graphUtils,
                                       final GraphIndexBuilder<? extends MutableIndex<Node, Edge>> indexBuilder,
                                       final ShapeManager shapeManager,
                                       final TextPropertyProviderFactory textPropertyProviderFactory,
                                       final Event<CanvasElementAddedEvent> canvasElementAddedEvent,
                                       final Event<CanvasElementRemovedEvent> canvasElementRemovedEvent,
                                       final Event<CanvasElementUpdatedEvent> canvasElementUpdatedEvent,
                                       final Event<CanvasElementsClearEvent> canvasElementsClearEvent,
                                       final @CaseManagementEditor CanvasCommandFactory<AbstractCanvasHandler> canvasCommandFactory);

}