use of org.eclipse.bpmn2.TextAnnotation in project drools by kiegroup.
the class TextAnnotationConverter method assignAttributes.
@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
super.assignAttributes(reader, parent);
TextAnnotation ta = (TextAnnotation) parent;
String textFormat = reader.getAttribute(TEXT_FORMAT);
ta.setTextFormat(textFormat);
}
use of org.eclipse.bpmn2.TextAnnotation in project drools by kiegroup.
the class TextAnnotationConverter method writeAttributes.
@Override
protected void writeAttributes(HierarchicalStreamWriter writer, Object parent) {
super.writeAttributes(writer, parent);
TextAnnotation ta = (TextAnnotation) parent;
if (ta.getTextFormat() != null)
writer.addAttribute(TEXT_FORMAT, ta.getTextFormat());
}
use of org.eclipse.bpmn2.TextAnnotation in project drools by kiegroup.
the class TextAnnotationConverter method writeChildren.
@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
super.writeChildren(writer, context, parent);
TextAnnotation ta = (TextAnnotation) parent;
if (ta.getText() != null)
writeChildrenNode(writer, context, ta.getText(), TEXT);
}
use of org.eclipse.bpmn2.TextAnnotation in project kie-wb-common by kiegroup.
the class DMNMarshaller method ddExtAugmentStunner.
private void ddExtAugmentStunner(Optional<org.kie.workbench.common.dmn.backend.definition.v1_1.dd.DMNDiagram> dmnDDDiagram, Node currentNode) {
if (!dmnDDDiagram.isPresent()) {
return;
}
Stream<DMNShape> drgShapeStream = dmnDDDiagram.get().getAny().stream().filter(DMNShape.class::isInstance).map(DMNShape.class::cast);
View content = (View) currentNode.getContent();
if (content.getDefinition() instanceof Decision) {
Decision d = (Decision) content.getDefinition();
internalAugment(drgShapeStream, d.getId(), content.getBounds().getUpperLeft(), d.getDimensionsSet(), content.getBounds().getLowerRight(), d.getBackgroundSet(), d::setFontSet);
} else if (content.getDefinition() instanceof InputData) {
InputData d = (InputData) content.getDefinition();
internalAugment(drgShapeStream, d.getId(), content.getBounds().getUpperLeft(), d.getDimensionsSet(), content.getBounds().getLowerRight(), d.getBackgroundSet(), d::setFontSet);
} else if (content.getDefinition() instanceof BusinessKnowledgeModel) {
BusinessKnowledgeModel d = (BusinessKnowledgeModel) content.getDefinition();
internalAugment(drgShapeStream, d.getId(), content.getBounds().getUpperLeft(), d.getDimensionsSet(), content.getBounds().getLowerRight(), d.getBackgroundSet(), d::setFontSet);
} else if (content.getDefinition() instanceof KnowledgeSource) {
KnowledgeSource d = (KnowledgeSource) content.getDefinition();
internalAugment(drgShapeStream, d.getId(), content.getBounds().getUpperLeft(), d.getDimensionsSet(), content.getBounds().getLowerRight(), d.getBackgroundSet(), d::setFontSet);
} else if (content.getDefinition() instanceof TextAnnotation) {
TextAnnotation d = (TextAnnotation) content.getDefinition();
internalAugment(drgShapeStream, d.getId(), content.getBounds().getUpperLeft(), d.getDimensionsSet(), content.getBounds().getLowerRight(), d.getBackgroundSet(), d::setFontSet);
}
}
use of org.eclipse.bpmn2.TextAnnotation in project kie-wb-common by kiegroup.
the class DMNMarshaller method stunnerToDDExt.
private static DMNShape stunnerToDDExt(View<? extends DMNElement> v) {
DMNShape result = new DMNShape();
result.setId("dmnshape-" + v.getDefinition().getId().getValue());
result.setDmnElementRef(v.getDefinition().getId().getValue());
Bounds bounds = new Bounds();
result.setBounds(bounds);
bounds.setX(v.getBounds().getUpperLeft().getX());
bounds.setY(v.getBounds().getUpperLeft().getY());
if (v.getDefinition() instanceof Decision) {
Decision d = (Decision) v.getDefinition();
applyBounds(d.getDimensionsSet(), bounds);
applyBackgroundStyles(d.getBackgroundSet(), result);
result.setFontStyle(FontSetPropertyConverter.dmnFromWB(d.getFontSet()));
} else if (v.getDefinition() instanceof InputData) {
InputData d = (InputData) v.getDefinition();
applyBounds(d.getDimensionsSet(), bounds);
applyBackgroundStyles(d.getBackgroundSet(), result);
result.setFontStyle(FontSetPropertyConverter.dmnFromWB(d.getFontSet()));
} else if (v.getDefinition() instanceof BusinessKnowledgeModel) {
BusinessKnowledgeModel d = (BusinessKnowledgeModel) v.getDefinition();
applyBounds(d.getDimensionsSet(), bounds);
applyBackgroundStyles(d.getBackgroundSet(), result);
result.setFontStyle(FontSetPropertyConverter.dmnFromWB(d.getFontSet()));
} else if (v.getDefinition() instanceof KnowledgeSource) {
KnowledgeSource d = (KnowledgeSource) v.getDefinition();
applyBounds(d.getDimensionsSet(), bounds);
applyBackgroundStyles(d.getBackgroundSet(), result);
result.setFontStyle(FontSetPropertyConverter.dmnFromWB(d.getFontSet()));
} else if (v.getDefinition() instanceof TextAnnotation) {
TextAnnotation d = (TextAnnotation) v.getDefinition();
applyBounds(d.getDimensionsSet(), bounds);
applyBackgroundStyles(d.getBackgroundSet(), result);
result.setFontStyle(FontSetPropertyConverter.dmnFromWB(d.getFontSet()));
}
return result;
}
Aggregations