use of org.kie.workbench.common.dmn.api.property.dimensions.GeneralRectangleDimensionsSet in project kie-wb-common by kiegroup.
the class KnowledgeSourceConverter method nodeFromDMN.
@Override
public Node<View<KnowledgeSource>, ?> nodeFromDMN(final org.kie.dmn.model.api.KnowledgeSource dmn, final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer) {
@SuppressWarnings("unchecked") final Node<View<KnowledgeSource>, ?> node = (Node<View<KnowledgeSource>, ?>) factoryManager.newElement(dmn.getId(), getDefinitionId(KnowledgeSource.class)).asNode();
final Id id = new Id(dmn.getId());
final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription());
final Name name = new Name(dmn.getName());
final KnowledgeSourceType ksType = new KnowledgeSourceType(dmn.getType());
final LocationURI locationURI = new LocationURI(dmn.getLocationURI());
final KnowledgeSource ks = new KnowledgeSource(id, description, name, ksType, locationURI, new StylingSet(), new GeneralRectangleDimensionsSet());
node.getContent().setDefinition(ks);
DMNExternalLinksToExtensionElements.loadExternalLinksFromExtensionElements(dmn, ks);
return node;
}
use of org.kie.workbench.common.dmn.api.property.dimensions.GeneralRectangleDimensionsSet in project kie-wb-common by kiegroup.
the class TextAnnotationConverter method nodeFromDMN.
@Override
public Node<View<TextAnnotation>, ?> nodeFromDMN(final org.kie.dmn.model.api.TextAnnotation dmn, final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer) {
@SuppressWarnings("unchecked") final Node<View<TextAnnotation>, ?> node = (Node<View<TextAnnotation>, ?>) factoryManager.newElement(dmn.getId(), getDefinitionId(TextAnnotation.class)).asNode();
final Id id = new Id(dmn.getId());
final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription());
final Text text = new Text(dmn.getText());
final TextFormat textFormat = new TextFormat(dmn.getTextFormat());
final TextAnnotation textAnnotation = new TextAnnotation(id, description, text, textFormat, new StylingSet(), new GeneralRectangleDimensionsSet());
node.getContent().setDefinition(textAnnotation);
return node;
}
use of org.kie.workbench.common.dmn.api.property.dimensions.GeneralRectangleDimensionsSet in project kie-wb-common by kiegroup.
the class InputDataConverter method nodeFromDMN.
@Override
public Node<View<InputData>, ?> nodeFromDMN(final org.kie.dmn.model.api.InputData dmn, final BiConsumer<String, HasComponentWidths> hasComponentWidthsConsumer) {
@SuppressWarnings("unchecked") final Node<View<InputData>, ?> node = (Node<View<InputData>, ?>) factoryManager.newElement(dmn.getId(), getDefinitionId(InputData.class)).asNode();
final Id id = new Id(dmn.getId());
final Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription());
final Name name = new Name(dmn.getName());
final InformationItemPrimary informationItem = InformationItemPrimaryPropertyConverter.wbFromDMN(dmn.getVariable(), dmn);
final InputData inputData = new InputData(id, description, name, informationItem, new StylingSet(), new GeneralRectangleDimensionsSet());
node.getContent().setDefinition(inputData);
if (informationItem != null) {
informationItem.setParent(inputData);
}
DMNExternalLinksToExtensionElements.loadExternalLinksFromExtensionElements(dmn, inputData);
return node;
}
Aggregations