@Override public Label updateLabel(LabelDTO labelDTO) { // get the label being updated Label label = locateLabel(labelDTO.getId()); // update the label state if (labelDTO.getPosition() != null) { label.setPosition(new Position(labelDTO.getPosition().getX(), labelDTO.getPosition().getY())); } if (labelDTO.getStyle() != null) { label.setStyle(labelDTO.getStyle()); } if (labelDTO.getLabel() != null) { label.setValue(labelDTO.getLabel()); } if (labelDTO.getWidth() != null && labelDTO.getHeight() != null) { label.setSize(new Size(labelDTO.getWidth(), labelDTO.getHeight())); } label.getProcessGroup().onComponentModified(); return label; }
public LabelDTO copy(final LabelDTO original) { final LabelDTO copy = new LabelDTO(); copy.setId(original.getId()); copy.setParentGroupId(original.getParentGroupId()); copy.setLabel(original.getLabel()); copy.setStyle(copy(original.getStyle())); copy.setPosition(original.getPosition()); copy.setWidth(original.getWidth()); copy.setHeight(original.getHeight()); copy.setVersionedComponentId(original.getVersionedComponentId()); return copy; }
@Override public Label createLabel(String groupId, LabelDTO labelDTO) { if (labelDTO.getParentGroupId() != null && !flowController.getFlowManager().areGroupsSame(groupId, labelDTO.getParentGroupId())) { throw new IllegalArgumentException("Cannot specify a different Parent Group ID than the Group to which the Label is being added."); } // get the desired group ProcessGroup group = locateProcessGroup(flowController, groupId); // create the label Label label = flowController.getFlowManager().createLabel(labelDTO.getId(), labelDTO.getLabel()); if (labelDTO.getPosition() != null) { label.setPosition(new Position(labelDTO.getPosition().getX(), labelDTO.getPosition().getY())); } if (labelDTO.getWidth() != null && labelDTO.getHeight() != null) { label.setSize(new Size(labelDTO.getWidth(), labelDTO.getHeight())); } label.setStyle(labelDTO.getStyle()); // add the label group.addLabel(label); return label; }
final Label label = flowManager.createLabel(labelDTO.getId(), labelDTO.getLabel()); label.setVersionedComponentId(labelDTO.getVersionedComponentId()); label.setStyle(labelDTO.getStyle());
final LabelDTO labelDTO = FlowFromDOMFactory.getLabel(labelElement); final Label label = flowManager.createLabel(labelDTO.getId(), labelDTO.getLabel()); label.setStyle(labelDTO.getStyle()); label.setPosition(new Position(labelDTO.getPosition().getX(), labelDTO.getPosition().getY())); label.setVersionedComponentId(labelDTO.getVersionedComponentId());
label.setStyle(labelDTO.getStyle()); if (!topLevel) { label.setVersionedComponentId(labelDTO.getVersionedComponentId());