Search in sources :

Example 1 with DiagramElement

use of org.kie.dmn.model.api.dmndi.DiagramElement in project drools by kiegroup.

the class DMNDiagramConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    DMNDiagram style = (DMNDiagram) parent;
    if (style.getSize() != null) {
        writeChildrenNode(writer, context, style.getSize(), SIZE);
    }
    for (DiagramElement de : style.getDMNDiagramElement()) {
        writeChildrenNode(writer, context, de, de.getClass().getSimpleName());
    }
}
Also used : DiagramElement(org.kie.dmn.model.api.dmndi.DiagramElement) DMNDiagram(org.kie.dmn.model.api.dmndi.DMNDiagram)

Example 2 with DiagramElement

use of org.kie.dmn.model.api.dmndi.DiagramElement in project drools by kiegroup.

the class DiagramElementConverter method writeAttributes.

@Override
protected void writeAttributes(HierarchicalStreamWriter writer, Object parent) {
    super.writeAttributes(writer, parent);
    DiagramElement abs = (DiagramElement) parent;
    if (abs.getId() != null) {
        writer.addAttribute(ID, abs.getId());
    }
    if (abs.getSharedStyle() != null) {
        writer.addAttribute(SHARED_STYLE, abs.getSharedStyle().getId());
    }
}
Also used : DiagramElement(org.kie.dmn.model.api.dmndi.DiagramElement)

Example 3 with DiagramElement

use of org.kie.dmn.model.api.dmndi.DiagramElement in project drools by kiegroup.

the class DiagramElementConverter method writeChildren.

@Override
protected void writeChildren(HierarchicalStreamWriter writer, MarshallingContext context, Object parent) {
    super.writeChildren(writer, context, parent);
    DiagramElement abs = (DiagramElement) parent;
    if (abs.getExtension() != null) {
        writeChildrenNode(writer, context, abs.getExtension(), EXTENSION);
    }
    if (abs.getStyle() != null) {
        writeChildrenNode(writer, context, abs.getStyle(), STYLE);
    }
}
Also used : DiagramElement(org.kie.dmn.model.api.dmndi.DiagramElement)

Example 4 with DiagramElement

use of org.kie.dmn.model.api.dmndi.DiagramElement in project drools by kiegroup.

the class DiagramElementConverter method assignAttributes.

@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
    super.assignAttributes(reader, parent);
    DiagramElement abs = (DiagramElement) parent;
    String id = reader.getAttribute(ID);
    if (id != null) {
        abs.setId(id);
    }
    String sharedStyleXmlSerialization = reader.getAttribute(SHARED_STYLE);
    if (sharedStyleXmlSerialization != null) {
        abs.setSharedStyle(new org.kie.dmn.model.v1_2.dmndi.Style.IDREFStubStyle(sharedStyleXmlSerialization));
    }
}
Also used : DiagramElement(org.kie.dmn.model.api.dmndi.DiagramElement) Style(org.kie.dmn.model.api.dmndi.Style)

Example 5 with DiagramElement

use of org.kie.dmn.model.api.dmndi.DiagramElement in project drools by kiegroup.

the class DiagramElementConverter method assignAttributes.

@Override
protected void assignAttributes(HierarchicalStreamReader reader, Object parent) {
    super.assignAttributes(reader, parent);
    DiagramElement abs = (DiagramElement) parent;
    String id = reader.getAttribute(ID);
    if (id != null) {
        abs.setId(id);
    }
    String sharedStyleXmlSerialization = reader.getAttribute(SHARED_STYLE);
    if (sharedStyleXmlSerialization != null) {
        abs.setSharedStyle(new org.kie.dmn.model.v1_3.dmndi.Style.IDREFStubStyle(sharedStyleXmlSerialization));
    }
}
Also used : DiagramElement(org.kie.dmn.model.api.dmndi.DiagramElement) Style(org.kie.dmn.model.api.dmndi.Style)

Aggregations

DiagramElement (org.kie.dmn.model.api.dmndi.DiagramElement)11 DMNDiagram (org.kie.dmn.model.api.dmndi.DMNDiagram)4 DMNStyle (org.kie.dmn.model.api.dmndi.DMNStyle)2 Style (org.kie.dmn.model.api.dmndi.Style)2 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1 DMNShape (org.kie.dmn.model.api.dmndi.DMNShape)1