use of org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent in project kie-wb-common by kiegroup.
the class StartEventConverter method noneEvent.
private BpmnNode noneEvent(StartEvent event) {
Node<View<StartNoneEvent>, Edge> node = factoryManager.newNode(event.getId(), StartNoneEvent.class);
StartNoneEvent definition = node.getContent().getDefinition();
EventPropertyReader p = propertyReaderFactory.of(event);
definition.setGeneral(new BPMNGeneralSet(new Name(p.getName()), new Documentation(p.getDocumentation())));
definition.setSimulationSet(p.getSimulationSet());
definition.setIsInterrupting(new IsInterrupting(event.isIsInterrupting()));
node.getContent().setBounds(p.getBounds());
definition.setDimensionsSet(p.getCircleDimensionSet());
definition.setFontSet(p.getFontSet());
definition.setBackgroundSet(p.getBackgroundSet());
return BpmnNode.of(node);
}
use of org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent in project kie-wb-common by kiegroup.
the class StartNoneEventTest method testStartNoneEventNameEmpty.
@Test
public void testStartNoneEventNameEmpty() {
StartNoneEvent startNoneEvent = new StartNoneEvent.StartNoneEventBuilder().build();
startNoneEvent.getGeneral().setName(new Name(""));
Set<ConstraintViolation<StartNoneEvent>> violations = this.validator.validate(startNoneEvent);
assertTrue(violations.isEmpty());
}
use of org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent in project kie-wb-common by kiegroup.
the class StartEventConverter method noneEvent.
private PropertyWriter noneEvent(Node<View<StartNoneEvent>, ?> n) {
StartEvent event = bpmn2.createStartEvent();
event.setId(n.getUUID());
StartNoneEvent definition = n.getContent().getDefinition();
CatchEventPropertyWriter p = propertyWriterFactory.of(event);
event.setIsInterrupting(false);
BPMNGeneralSet general = definition.getGeneral();
p.setName(general.getName().getValue());
p.setDocumentation(general.getDocumentation().getValue());
p.setSimulationSet(definition.getSimulationSet());
p.setBounds(n.getContent().getBounds());
return p;
}
use of org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent in project kie-wb-common by kiegroup.
the class BPMNViewHandlersTest method testFontHandler.
@Test
@SuppressWarnings("unchecked")
public void testFontHandler() {
final FontHandler<BPMNViewDefinition, ShapeView> fontHandler = new BPMNShapeViewHandlers.FontHandlerBuilder<>().build();
final StartNoneEvent bean = new StartNoneEvent.StartNoneEventBuilder().build();
bean.getFontSet().getFontColor().setValue("fontColor");
bean.getFontSet().getFontFamily().setValue("fontFamily");
bean.getFontSet().getFontSize().setValue(12d);
bean.getFontSet().getFontBorderColor().setValue("borderColor");
bean.getFontSet().getFontBorderSize().setValue(8d);
fontHandler.handle(bean, view);
verify(view, times(1)).setTitleFontColor(eq("fontColor"));
verify(view, times(1)).setTitleFontFamily(eq("fontFamily"));
verify(view, times(1)).setTitleFontSize(eq(12d));
verify(view, times(1)).setTitleStrokeColor(eq("borderColor"));
verify(view, times(1)).setTitleStrokeWidth(eq(8d));
}
use of org.kie.workbench.common.stunner.bpmn.definition.StartNoneEvent in project kie-wb-common by kiegroup.
the class BPMNViewHandlersTest method testViewHandler.
@Test
@SuppressWarnings("unchecked")
public void testViewHandler() {
final ViewAttributesHandler<BPMNViewDefinition, ShapeView> fontHandler = new BPMNShapeViewHandlers.ViewAttributesHandlerBuilder<>().build();
final StartNoneEvent bean = new StartNoneEvent.StartNoneEventBuilder().build();
bean.getBackgroundSet().getBgColor().setValue("bgColor");
bean.getBackgroundSet().getBorderColor().setValue("borderColor");
bean.getBackgroundSet().getBorderSize().setValue(5d);
fontHandler.handle(bean, view);
verify(view, times(1)).setFillGradient(any(HasFillGradient.Type.class), eq("bgColor"), anyString());
verify(view, times(1)).setStrokeColor(eq("borderColor"));
verify(view, times(1)).setStrokeWidth(eq(5d));
}
Aggregations