本文整理了Java中org.kie.workbench.common.stunner.core.util.UUID.uuid()
方法的一些代码示例,展示了UUID.uuid()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。UUID.uuid()
方法的具体详情如下:
包路径:org.kie.workbench.common.stunner.core.util.UUID
类名称:UUID
方法名:uuid
暂无
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
protected AbstractCanvas(final Event<CanvasClearEvent> canvasClearEvent,
final Event<CanvasShapeAddedEvent> canvasShapeAddedEvent,
final Event<CanvasShapeRemovedEvent> canvasShapeRemovedEvent,
final Event<CanvasDrawnEvent> canvasDrawnEvent,
final Event<CanvasFocusedEvent> canvasFocusedEvent) {
this.canvasClearEvent = canvasClearEvent;
this.canvasShapeAddedEvent = canvasShapeAddedEvent;
this.canvasShapeRemovedEvent = canvasShapeRemovedEvent;
this.canvasDrawnEvent = canvasDrawnEvent;
this.canvasFocusedEvent = canvasFocusedEvent;
this.uuid = UUID.uuid();
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-widgets
protected AbstractToolbarCommand(final DefinitionUtils definitionUtils,
final ManagedInstance<C> commands,
final ClientTranslationService translationService) {
this.uuid = UUID.uuid();
this.definitionUtils = definitionUtils;
this.commands = commands;
this.translationService = translationService;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
public AbstractCanvasHandler() {
this.uuid = UUID.uuid();
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-client
public KeyValueRow(String key, String value) {
this.key = Objects.isNull(key) ?"": key;
this.value = Objects.isNull(value) ?"": value;
this.uuid = UUID.uuid();
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-svg-gen
protected static String getId(final Element element) {
String id = element.getAttribute(ID);
Element parent = null;
if (Objects.nonNull(element.getParentNode()) && element.getParentNode() instanceof Element) {
parent = (Element) element.getParentNode();
}
if (!isEmpty(id)) {
return id;
}
id = (Objects.isNull(parent) ?
"prim_" + UUID.uuid(4) :
parent.getAttribute(ID) + "_" + element.getAttribute(ID) + "_" + UUID.uuid(4));
element.setAttribute(ID, id);
//return SVGModelUtils.toValidJavaId(id);
return id;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend
@SuppressWarnings("unchecked")
private void buildChildEdge(Node parentNode) {
final List<Node> nodes = (List<Node>) parentNode.getOutEdges().stream()
.map(e -> ((Edge) e).getTargetNode()).collect(Collectors.toList());
for (int i = 0, n = nodes.size() - 1; i < n; i++) {
createEdge(UUID.uuid(), nodes.get(i), nodes.get(i + 1));
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-api
@SuppressWarnings("unchecked")
protected List<Command> buildInitialisationCommands() {
final List<Command> commands = new ArrayList<>();
final Node<Definition<CaseManagementDiagram>, Edge> diagramNode =
(Node<Definition<CaseManagementDiagram>, Edge>) factoryManager.newElement(UUID.uuid(), diagramType);
commands.add(graphCommandFactory.addNode(diagramNode));
return commands;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-api
@SuppressWarnings("unchecked")
// Add a BPMN diagram and a start event nodes by default.
protected List<Command> buildInitialisationCommands() {
final List<Command> commands = new ArrayList<>();
final Node<Definition<BPMNDiagram>, Edge> diagramNode = (Node<Definition<BPMNDiagram>, Edge>) factoryManager.newElement(UUID.uuid(),
diagramType);
final Node<Definition<StartNoneEvent>, Edge> startEventNode = (Node<Definition<StartNoneEvent>, Edge>) factoryManager.newElement(UUID.uuid(),
StartNoneEvent.class);
commands.add(graphCommandFactory.addNode(diagramNode));
commands.add(graphCommandFactory.addChildNode(diagramNode,
startEventNode,
new Point2D(START_X,
START_Y)));
return commands;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend
public Graph unmarshall(final String content) throws IOException {
final XMLResource outResource = (XMLResource) resourceSet.createResource(URI.createURI("inputStream://" + UUID.uuid() + ".xml"));
outResource.getDefaultLoadOptions().put(XMLResource.OPTION_ENCODING,
"UTF-8");
outResource.setEncoding("UTF-8");
final Map<String, Object> options = new HashMap<String, Object>();
options.put(XMLResource.OPTION_ENCODING,
"UTF-8");
outResource.load(new BufferedInputStream(new ByteArrayInputStream(content.getBytes("UTF-8"))),
options);
final DocumentRoot root = (DocumentRoot) outResource.getContents().get(0);
final Definitions definitions = root.getDefinitions();
return unmarshall(definitions,
null);
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
@SuppressWarnings("unchecked")
public Canvas addShapeIntoView(final Shape shape) {
if (shape.getUUID() == null) {
shape.setUUID(UUID.uuid());
}
getView().add(shape.getShapeView());
return this;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-backend
private String getNewFileName(final Diagram diagram) {
final String defSetId = diagram.getMetadata().getDefinitionSetId();
final DefinitionSetService defSetService = getServiceById(defSetId);
return UUID.uuid(8) + "." + defSetService.getResourceType().getSuffix();
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@SuppressWarnings("unchecked")
public <M extends Metadata, D extends Diagram> D newDiagram(final String name,
final String id,
final M metadata) {
final Graph<DefinitionSet, ?> graph = (Graph<DefinitionSet, ?>) newElement(UUID.uuid(), id, metadata);
return (D) checkDiagramFactoryNotNull(graph.getContent().getDefinition(),
metadata).build(name,
metadata,
graph);
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Override
protected AbstractCompositeCommand<GraphCommandExecutionContext, RuleViolation> initialize(GraphCommandExecutionContext context) {
//getting the node parent
Optional<String> parentUUID = getParentUUID();
if (!parentUUID.isPresent()) {
throw new IllegalStateException("Parent not found for node " + candidate);
}
final Object bean = candidate.getContent().getDefinition();
clone = (Node<View, Edge>) context.getFactoryManager().newElement(UUID.uuid(), bean.getClass()).asNode();
cloneNodeContentWithProperties(context);
//creating node commands to be executed
addCommand(new RegisterNodeCommand(clone));
addCommand(new AddChildNodeCommand(parentUUID.get(), clone, position));
return this;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-client
@SuppressWarnings("unchecked")
private void addRelationship(final Node parent,
final Node child,
final OptionalInt index,
final GraphCommandExecutionContext context) {
final String uuid = UUID.uuid();
final Edge<Child, Node> edge = new EdgeImpl<>(uuid);
edge.setContent(new Child());
edge.setSourceNode(parent);
edge.setTargetNode(child);
parent.getOutEdges().add(index.orElseGet(() -> parent.getOutEdges().size()), edge);
child.getInEdges().add(edge);
getMutableIndex(context).addEdge(edge);
}
代码示例来源:origin: org.kie.workbench/kie-wb-common-dmn-api
private Node<View, Edge> newNode(final Object definition) {
final Node<View, Edge> node = new NodeImpl<>(UUID.uuid());
final View<Object> content = new ViewImpl<>(definition, bounds);
node.setContent(content);
return node;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Test
public void getLayoutInformationThreshold() {
when(n1.getUUID()).thenReturn(UUID.uuid());
when(n2.getUUID()).thenReturn(UUID.uuid());
final GraphNodeStoreImpl store = new GraphNodeStoreImpl();
store.add(n1);
doCallRealMethod().when(layoutService).getLayoutInformationThreshold(graph);
when(graph.nodes()).thenReturn(store);
double threshold = layoutService.getLayoutInformationThreshold(graph);
assertEquals(0.25, threshold, 0.01);
store.add(n2);
threshold = layoutService.getLayoutInformationThreshold(graph);
assertEquals(0.50, threshold, 0.01);
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Test
public void hasLayoutInformation() {
when(n1.getUUID()).thenReturn(UUID.uuid());
when(n2.getUUID()).thenReturn(UUID.uuid());
final GraphNodeStoreImpl store = new GraphNodeStoreImpl();
store.add(n2);
store.add(n1);
doCallRealMethod().when(layoutService).hasLayoutInformation(graph);
doCallRealMethod().when(layoutService).getLayoutInformationThreshold(graph);
when(graph.nodes()).thenReturn(store);
assertFalse(layoutService.hasLayoutInformation(graph));
final Bounds bounds = Bounds.create(10, 10, 10, 10);
final Bounds noBounds = Bounds.create(0, 0, 0, 0);
when(n1.getContent()).thenReturn(hasBounds1);
when(hasBounds1.getBounds()).thenReturn(noBounds);
when(n2.getContent()).thenReturn(hasBounds2);
when(hasBounds2.getBounds()).thenReturn(bounds);
assertTrue(layoutService.hasLayoutInformation(graph));
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend
public static Diagram<Graph, Metadata> unmarshall(DiagramMarshaller tested, InputStream is) throws Exception {
Metadata metadata =
new MetadataImpl.MetadataImplBuilder(
BindableAdapterUtils.getDefinitionSetId(BPMNDefinitionSet.class)).build();
DiagramImpl diagram = new DiagramImpl(UUID.uuid(), metadata);
Graph<DefinitionSet, Node> graph = tested.unmarshall(metadata, is);
diagram.setGraph(graph);
return diagram;
}
}
代码示例来源:origin: org.kie.workbench/kie-wb-common-dmn-api
@Before
public void setup() {
this.factory = new DMNDiagramFactoryImpl();
this.graph = new GraphImpl<>(UUID.uuid(), new GraphNodeStoreImpl());
this.graph.addNode(newNode(new DMNDiagram()));
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-bpmn-backend
private Diagram<Graph, Metadata> unmarshall(InputStream is) throws Exception {
Metadata metadata =
new MetadataImpl.MetadataImplBuilder(BindableAdapterUtils.getDefinitionSetId(BPMNDefinitionSet.class)).build();
DiagramImpl result = new DiagramImpl(org.kie.workbench.common.stunner.core.util.UUID.uuid(),
metadata);
Graph graph = tested.unmarshall(metadata,
is);
result.setGraph(graph);
// Update diagram's metadata attributes.
tested.updateRootUUID(result.getMetadata(),
graph);
tested.updateTitle(result.getMetadata(),
graph);
return result;
}
内容来源于网络,如有侵权,请联系作者删除!