use of org.kie.workbench.common.dmn.client.editors.expressions.ExpressionContainerGrid in project kie-wb-common by kiegroup.
the class DMNDocumentationDRDsFactory method setExpressionContainerGrid.
void setExpressionContainerGrid(final Diagram diagram, final String uuid) {
final Node<View, Edge> node = getNode(diagram, uuid);
final Object definition = DefinitionUtils.getElementDefinition(node);
final HasExpression hasExpression = expressionHelper.getHasExpression(node);
final Optional<HasName> hasName = Optional.of((HasName) definition);
final ExpressionContainerGrid grid = getExpressionContainerGrid();
grid.setExpression(node.getUUID(), hasExpression, hasName, false);
clearSelections(grid);
}
use of org.kie.workbench.common.dmn.client.editors.expressions.ExpressionContainerGrid in project kie-wb-common by kiegroup.
the class DMNDocumentationDRDsFactory method getNodeImage.
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);
}
Aggregations