use of org.kie.workbench.common.dmn.api.property.dmn.TextFormat in project kie-wb-common by kiegroup.
the class TextAnnotationTest method testDifferentStylingSet.
@Test
public void testDifferentStylingSet() {
final TextAnnotation modelOne = new TextAnnotation(new Id("123"), new Description(), new Text(), new TextFormat(), new StylingSet(), new GeneralRectangleDimensionsSet());
final TextAnnotation modelTwo = new TextAnnotation(new Id("123"), new Description(), new Text(), new TextFormat(), new StylingSet(), new GeneralRectangleDimensionsSet());
assertEquals(modelOne, modelTwo);
modelOne.getStylingSet().setFontSize(new FontSize(10.0));
modelTwo.getStylingSet().setFontSize(new FontSize(11.0));
assertNotEquals(modelOne, modelTwo);
}
use of org.kie.workbench.common.dmn.api.property.dmn.TextFormat in project kie-wb-common by kiegroup.
the class TextAnnotationConverter method nodeFromDMN.
@Override
public Node<View<TextAnnotation>, ?> nodeFromDMN(final NodeEntry nodeEntry) {
final JSITTextAnnotation dmn = Js.uncheckedCast(nodeEntry.getDmnElement());
@SuppressWarnings("unchecked") final Node<View<TextAnnotation>, ?> node = (Node<View<TextAnnotation>, ?>) factoryManager.newElement(nodeEntry.getId(), getDefinitionId(TextAnnotation.class)).asNode();
final Id id = IdPropertyConverter.wbFromDMN(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());
textAnnotation.setDiagramId(nodeEntry.getDiagramId());
node.getContent().setDefinition(textAnnotation);
return node;
}
use of org.kie.workbench.common.dmn.api.property.dmn.TextFormat in project kie-wb-common by kiegroup.
the class TextAnnotationConverter method nodeFromDMN.
@Override
public Node<View<TextAnnotation>, ?> nodeFromDMN(final org.kie.dmn.model.v1_1.TextAnnotation dmn) {
@SuppressWarnings("unchecked") Node<View<TextAnnotation>, ?> node = (Node<View<TextAnnotation>, ?>) factoryManager.newElement(dmn.getId(), TextAnnotation.class).asNode();
Id id = new Id(dmn.getId());
Description description = DescriptionPropertyConverter.wbFromDMN(dmn.getDescription());
Text text = new Text(dmn.getText());
TextFormat textFormat = new TextFormat(dmn.getTextFormat());
TextAnnotation textAnnotation = new TextAnnotation(id, description, text, textFormat, new BackgroundSet(), new FontSet(), new RectangleDimensionsSet());
node.getContent().setDefinition(textAnnotation);
return node;
}
use of org.kie.workbench.common.dmn.api.property.dmn.TextFormat 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;
}
Aggregations