Search in sources :

Example 26 with StylingSet

use of org.kie.workbench.common.dmn.api.property.styling.StylingSet 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;
}
Also used : InformationItemPrimary(org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary) Description(org.kie.workbench.common.dmn.api.property.dmn.Description) Node(org.kie.workbench.common.stunner.core.graph.Node) StylingSet(org.kie.workbench.common.dmn.api.property.styling.StylingSet) GeneralRectangleDimensionsSet(org.kie.workbench.common.dmn.api.property.dimensions.GeneralRectangleDimensionsSet) Id(org.kie.workbench.common.dmn.api.property.dmn.Id) BindableAdapterUtils.getDefinitionId(org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils.getDefinitionId) InputData(org.kie.workbench.common.dmn.api.definition.model.InputData) View(org.kie.workbench.common.stunner.core.graph.content.view.View) Name(org.kie.workbench.common.dmn.api.property.dmn.Name)

Aggregations

StylingSet (org.kie.workbench.common.dmn.api.property.styling.StylingSet)26 Description (org.kie.workbench.common.dmn.api.property.dmn.Description)22 Id (org.kie.workbench.common.dmn.api.property.dmn.Id)22 GeneralRectangleDimensionsSet (org.kie.workbench.common.dmn.api.property.dimensions.GeneralRectangleDimensionsSet)18 Name (org.kie.workbench.common.dmn.api.property.dmn.Name)18 Node (org.kie.workbench.common.stunner.core.graph.Node)14 View (org.kie.workbench.common.stunner.core.graph.content.view.View)14 BindableAdapterUtils.getDefinitionId (org.kie.workbench.common.stunner.core.definition.adapter.binding.BindableAdapterUtils.getDefinitionId)13 Test (org.junit.Test)11 InformationItemPrimary (org.kie.workbench.common.dmn.api.definition.model.InformationItemPrimary)8 QName (org.kie.workbench.common.dmn.api.property.dmn.QName)7 FontSize (org.kie.workbench.common.dmn.api.property.styling.FontSize)6 Decision (org.kie.workbench.common.dmn.api.definition.model.Decision)4 DecisionServiceDividerLineY (org.kie.workbench.common.dmn.api.property.dmn.DecisionServiceDividerLineY)4 BusinessKnowledgeModel (org.kie.workbench.common.dmn.api.definition.model.BusinessKnowledgeModel)3 DecisionService (org.kie.workbench.common.dmn.api.definition.model.DecisionService)3 TextAnnotation (org.kie.workbench.common.dmn.api.definition.model.TextAnnotation)3 AllowedAnswers (org.kie.workbench.common.dmn.api.property.dmn.AllowedAnswers)3 Question (org.kie.workbench.common.dmn.api.property.dmn.Question)3 Text (org.kie.workbench.common.dmn.api.property.dmn.Text)3