@Test public void checkApplyElementMutationNotifyQueued() { canvasHandler.setStaticContext(queueGraphExecutionContext); final ElementShape shape = mock(ElementShape.class); final Element candidate = mock(Element.class); final boolean applyPosition = true; final boolean applyProperties = false; final MutationContext mutationContext = mock(MutationContext.class); canvasHandler.applyElementMutation(shape, candidate, applyPosition, applyProperties, mutationContext); verify(shape, atLeastOnce()).applyPosition(any(), any()); verify(canvasElementUpdatedEvent, atLeastOnce()).fire(any()); verify(queueGraphExecutionContext, times(1)).addElement(candidate); }
@Override @SuppressWarnings("unchecked") public void applyElementMutation(final Shape shape, final Element candidate, final boolean applyPosition, final boolean applyProperties, final MutationContext mutationContext) { if (shape instanceof ElementShape) { final ElementShape graphShape = (ElementShape) shape; this.applyElementMutation(graphShape, candidate, applyPosition, applyProperties, mutationContext); } else { LOGGER.log(Level.WARNING, "The shape to handle must be type of [" + ElementShape.class.getName() + "]"); } }
BaseCanvasHandler extends AbstractCanvasHandler<D, C> { @Override @SuppressWarnings("unchecked") public void applyElementMutation(final Shape shape, final Element candidate, final boolean applyPosition, final boolean applyProperties, final MutationContext mutationContext) { if (shape instanceof ElementShape) { final ElementShape graphShape = (ElementShape) shape; this.applyElementMutation(graphShape, candidate, applyPosition, applyProperties, mutationContext); } else { LOGGER.log(Level.WARNING, "The shape to handle must be type of [" + ElementShape.class.getName() + "]"); } } }
BaseCanvasHandler extends AbstractCanvasHandler<D, C> { @Override @SuppressWarnings("unchecked") public void applyElementMutation(final Shape shape, final Element candidate, final boolean applyPosition, final boolean applyProperties, final MutationContext mutationContext) { if (shape instanceof ElementShape) { final ElementShape graphShape = (ElementShape) shape; this.applyElementMutation(graphShape, candidate, applyPosition, applyProperties, mutationContext); } else { LOGGER.log(Level.WARNING, "The shape to handle must be type of [" + ElementShape.class.getName() + "]"); } } BaseCanvasHandler(final DefinitionManager definitionManager,
                             final GraphUtils graphUtils,
                             final ShapeManager shapeManager,
                             final TextPropertyProviderFactory textPropertyProviderFactory); }
BaseCanvasHandler extends AbstractCanvasHandler<D, C> { @Override @SuppressWarnings("unchecked") public void applyElementMutation(final Shape shape, final Element candidate, final boolean applyPosition, final boolean applyProperties, final MutationContext mutationContext) { if (shape instanceof ElementShape) { final ElementShape graphShape = (ElementShape) shape; this.applyElementMutation(graphShape, candidate, applyPosition, applyProperties, mutationContext); } else { LOGGER.log(Level.WARNING, "The shape to handle must be type of [" + ElementShape.class.getName() + "]"); } } BaseCanvasHandler(final DefinitionManager definitionManager,
                             final GraphUtils graphUtils,
                             final ShapeManager shapeManager,
                             final TextPropertyProviderFactory textPropertyProviderFactory); abstract void draw(ParameterizedCommand<CommandResult> loadCallback); @Override CanvasHandler<D, C> handle(final C canvas); @Override @SuppressWarnings("unchecked") void draw(final D diagram,
                     final ParameterizedCommand<CommandResult> loadCallback); @Override RuleSet getRuleSet(); @Override C getCanvas(); @Override D getDiagram(); @Override @SuppressWarnings("unchecked") ShapeFactory<Object, Shape> getShapeFactory(final String shapeSetId); @Override void register(final Shape shape,
                         final Element<View<?>> candidate,
                         final boolean fireEvents); @Override void deregister(final Shape shape,
                           final Element element,
                           final boolean fireEvents); void addShape(final Shape shape); void removeShape(final Shape shape); @Override @SuppressWarnings("unchecked") void applyElementMutation(final Shape shape,
                                     final Element candidate,
                                     final boolean applyPosition,
                                     final boolean applyProperties,
                                     final MutationContext mutationContext); @Override @SuppressWarnings("unchecked") void addChild(final Element parent,
                         final Element child); @Override void addChild(final Element parent,
                         final Element child,
                         final int index); @Override @SuppressWarnings("unchecked") void removeChild(final Element parent,
                            final Element child); @Override @SuppressWarnings("unchecked") Optional<Element> getElementAt(final double x,
                                          final double y); @Override boolean dock(final Element parent,
                        final Element child); @Override @SuppressWarnings("unchecked") void undock(final Element target,
                       final Element child); @Override CanvasHandler<D, C> doClear(); @Override void doDestroy(); @Override DefinitionManager getDefinitionManager(); @Override TextPropertyProviderFactory getTextPropertyProviderFactory(); GraphUtils getGraphUtils(); ShapeManager getShapeManager(); }
BaseCanvasHandler extends AbstractCanvasHandler<D, C> { @Override @SuppressWarnings("unchecked") public void applyElementMutation(final Shape shape, final Element candidate, final boolean applyPosition, final boolean applyProperties, final MutationContext mutationContext) { if (shape instanceof ElementShape) { final ElementShape graphShape = (ElementShape) shape; this.applyElementMutation(graphShape, candidate, applyPosition, applyProperties, mutationContext); } else { LOGGER.log(Level.WARNING, "The shape to handle must be type of [" + ElementShape.class.getName() + "]"); } } BaseCanvasHandler(final DefinitionManager definitionManager,
                             final GraphUtils graphUtils,
                             final ShapeManager shapeManager,
                             final TextPropertyProviderFactory textPropertyProviderFactory); abstract void draw(ParameterizedCommand<CommandResult> loadCallback); @Override CanvasHandler<D, C> handle(final C canvas); @Override @SuppressWarnings("unchecked") void draw(final D diagram,
                     final ParameterizedCommand<CommandResult> loadCallback); @Override RuleSet getRuleSet(); @Override C getCanvas(); @Override D getDiagram(); @Override @SuppressWarnings("unchecked") ShapeFactory<Object, Shape> getShapeFactory(final String shapeSetId); @Override void register(final Shape shape,
                         final Element<View<?>> candidate,
                         final boolean fireEvents); @Override void deregister(final Shape shape,
                           final Element element,
                           final boolean fireEvents); void addShape(final Shape shape); void removeShape(final Shape shape); @Override @SuppressWarnings("unchecked") void applyElementMutation(final Shape shape,
                                     final Element candidate,
                                     final boolean applyPosition,
                                     final boolean applyProperties,
                                     final MutationContext mutationContext); @Override @SuppressWarnings("unchecked") void addChild(final Element parent,
                         final Element child); @Override void addChild(final Element parent,
                         final Element child,
                         final int index); @Override @SuppressWarnings("unchecked") void removeChild(final Element parent,
                            final Element child); @Override @SuppressWarnings("unchecked") Optional<Element> getElementAt(final double x,
                                          final double y); @Override boolean dock(final Element parent,
                        final Element child); @Override @SuppressWarnings("unchecked") void undock(final Element target,
                       final Element child); @Override CanvasHandler<D, C> doClear(); @Override void doDestroy(); @Override DefinitionManager getDefinitionManager(); @Override TextPropertyProviderFactory getTextPropertyProviderFactory(); GraphUtils getGraphUtils(); ShapeManager getShapeManager();  }