@Test public void testGetNodeImageWhenNodeDoesNotHaveExpression() { final String uuid = "0000-1111-2222-3333"; final Node<View, Edge> node = new NodeImpl<>(uuid); when(expressionHelper.getOptionalHasExpression(node)).thenReturn(Optional.empty()); final String image = factory.getNodeImage(diagram, node); assertEquals(NONE, image); }
String getNodeImage(final Diagram diagram, final Node<View, Edge> node) { if (!hasExpression(node)) { return NONE; } setExpressionContainerGrid(diagram, node.getUUID()); final ExpressionContainerGrid grid = getExpressionContainerGrid(); final Viewport viewport = grid.getViewport(); final int padding = 10; final int wide = (int) (grid.getWidth() + padding); final int high = (int) (grid.getHeight() + padding); viewport.setPixelSize(wide, high); return viewport.toDataURL(DataURLType.PNG); }
DMNDocumentationDRDsFactory { String getNodeImage(final Diagram diagram, final Node<View, Edge> node) { if (!hasExpression(node)) { return NONE; } setExpressionContainerGrid(diagram, node.getUUID()); final ExpressionContainerGrid grid = getExpressionContainerGrid(); final Viewport viewport = grid.getViewport(); final int padding = 10; final int wide = (int) (grid.getWidth() + padding); final int high = (int) (grid.getHeight() + padding); viewport.setPixelSize(wide, high); return viewport.toDataURL(DataURLType.PNG); } }
DMNDocumentationDRDsFactory { String getNodeImage(final Diagram diagram, final Node<View, Edge> node) { if (!hasExpression(node)) { return NONE; } setExpressionContainerGrid(diagram, node.getUUID()); final ExpressionContainerGrid grid = getExpressionContainerGrid(); final Viewport viewport = grid.getViewport(); final int padding = 10; final int wide = (int) (grid.getWidth() + padding); final int high = (int) (grid.getHeight() + padding); viewport.setPixelSize(wide, high); return viewport.toDataURL(DataURLType.PNG); } @Inject  DMNDocumentationDRDsFactory(final SessionManager sessionManager,
                                       final BoxedExpressionHelper expressionHelper); }
DMNDocumentationDRDsFactory { String getNodeImage(final Diagram diagram, final Node<View, Edge> node) { if (!hasExpression(node)) { return NONE; } setExpressionContainerGrid(diagram, node.getUUID()); final ExpressionContainerGrid grid = getExpressionContainerGrid(); final Viewport viewport = grid.getViewport(); final int padding = 10; final int wide = (int) (grid.getWidth() + padding); final int high = (int) (grid.getHeight() + padding); viewport.setPixelSize(wide, high); return viewport.toDataURL(DataURLType.PNG); } @Inject  DMNDocumentationDRDsFactory(final SessionManager sessionManager,
                                       final BoxedExpressionHelper expressionHelper); List<DMNDocumentationDRD> create(final Diagram diagram); }
DMNDocumentationDRDsFactory { String getNodeImage(final Diagram diagram, final Node<View, Edge> node) { if (!hasExpression(node)) { return NONE; } setExpressionContainerGrid(diagram, node.getUUID()); final ExpressionContainerGrid grid = getExpressionContainerGrid(); final Viewport viewport = grid.getViewport(); final int padding = 10; final int wide = (int) (grid.getWidth() + padding); final int high = (int) (grid.getHeight() + padding); viewport.setPixelSize(wide, high); return viewport.toDataURL(DataURLType.PNG); } @Inject  DMNDocumentationDRDsFactory(final SessionManager sessionManager,
                                       final BoxedExpressionHelper expressionHelper); List<DMNDocumentationDRD> create(final Diagram diagram);  }