Search in sources :

Example 1 with TextAnnotation

use of org.kie.workbench.common.dmn.api.definition.v1_1.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);
}
Also used : TextAnnotation(org.kie.dmn.model.v1_1.TextAnnotation)

Example 2 with TextAnnotation

use of org.kie.workbench.common.dmn.api.definition.v1_1.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());
}
Also used : TextAnnotation(org.kie.dmn.model.v1_1.TextAnnotation)

Example 3 with TextAnnotation

use of org.kie.workbench.common.dmn.api.definition.v1_1.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);
}
Also used : TextAnnotation(org.kie.dmn.model.v1_1.TextAnnotation)

Example 4 with TextAnnotation

use of org.kie.workbench.common.dmn.api.definition.v1_1.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);
    }
}
Also used : DMNShape(org.kie.workbench.common.dmn.backend.definition.v1_1.dd.DMNShape) Child(org.kie.workbench.common.stunner.core.graph.content.relationship.Child) ApplicationScoped(javax.enterprise.context.ApplicationScoped) Id(org.kie.workbench.common.dmn.api.property.dmn.Id) Bound(org.kie.workbench.common.stunner.core.graph.content.Bounds.Bound) KnowledgeSource(org.kie.workbench.common.dmn.api.definition.v1_1.KnowledgeSource) BusinessKnowledgeModel(org.kie.workbench.common.dmn.api.definition.v1_1.BusinessKnowledgeModel) InputData(org.kie.workbench.common.dmn.api.definition.v1_1.InputData) TextAnnotation(org.kie.workbench.common.dmn.api.definition.v1_1.TextAnnotation) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Decision(org.kie.workbench.common.dmn.api.definition.v1_1.Decision)

Example 5 with TextAnnotation

use of org.kie.workbench.common.dmn.api.definition.v1_1.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;
}
Also used : DMNShape(org.kie.workbench.common.dmn.backend.definition.v1_1.dd.DMNShape) KnowledgeSource(org.kie.workbench.common.dmn.api.definition.v1_1.KnowledgeSource) Bounds(org.kie.workbench.common.dmn.backend.definition.v1_1.dd.org.omg.spec.CMMN_20151109_DC.Bounds) BusinessKnowledgeModel(org.kie.workbench.common.dmn.api.definition.v1_1.BusinessKnowledgeModel) InputData(org.kie.workbench.common.dmn.api.definition.v1_1.InputData) TextAnnotation(org.kie.workbench.common.dmn.api.definition.v1_1.TextAnnotation) Decision(org.kie.workbench.common.dmn.api.definition.v1_1.Decision)

Aggregations

TextAnnotation (org.kie.workbench.common.dmn.api.definition.v1_1.TextAnnotation)9 ArrayList (java.util.ArrayList)8 FreeTextAnnotation (org.opencastproject.metadata.mpeg7.FreeTextAnnotation)7 TextAnnotation (org.opencastproject.metadata.mpeg7.TextAnnotation)7 List (java.util.List)6 View (org.kie.workbench.common.stunner.core.graph.content.view.View)6 KeywordAnnotation (org.opencastproject.metadata.mpeg7.KeywordAnnotation)4 Iterator (java.util.Iterator)3 Entry (java.util.Map.Entry)3 TextAnnotation (org.kie.dmn.model.v1_1.TextAnnotation)3 BusinessKnowledgeModel (org.kie.workbench.common.dmn.api.definition.v1_1.BusinessKnowledgeModel)3 Decision (org.kie.workbench.common.dmn.api.definition.v1_1.Decision)3 InputData (org.kie.workbench.common.dmn.api.definition.v1_1.InputData)3 KnowledgeSource (org.kie.workbench.common.dmn.api.definition.v1_1.KnowledgeSource)3 DMNShape (org.kie.workbench.common.dmn.backend.definition.v1_1.dd.DMNShape)3 AnnotateImageRequest (com.google.cloud.vision.v1.AnnotateImageRequest)2 AnnotateImageResponse (com.google.cloud.vision.v1.AnnotateImageResponse)2 BatchAnnotateImagesResponse (com.google.cloud.vision.v1.BatchAnnotateImagesResponse)2 Block (com.google.cloud.vision.v1.Block)2 Feature (com.google.cloud.vision.v1.Feature)2