本文整理了Java中org.kie.workbench.common.stunner.core.diagram.Metadata.getShapeSetId()
方法的一些代码示例,展示了Metadata.getShapeSetId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Metadata.getShapeSetId()
方法的具体详情如下:
包路径:org.kie.workbench.common.stunner.core.diagram.Metadata
类名称:Metadata
方法名:getShapeSetId
暂无
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
private String getShapeSetId(final AbstractCanvasHandler context) {
return context.getDiagram().getMetadata().getShapeSetId();
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-widgets
private String getShapeSetId() {
return canvasHandler.getDiagram().getMetadata().getShapeSetId();
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
protected String getShapeSetId() {
return canvasHandler.getDiagram().getMetadata().getShapeSetId();
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
@Override
public CommandResult<CanvasViolation> undo(final AbstractCanvasHandler context) {
final String ssid = context.getDiagram().getMetadata().getShapeSetId();
return new AddCanvasConnectorCommand(candidate,
ssid).execute(context);
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
@Override
public CommandResult<CanvasViolation> undo(final AbstractCanvasHandler context) {
final String ssid = context.getDiagram().getMetadata().getShapeSetId();
final AbstractCanvasCommand command = createUndoCommand(parent, candidate, ssid);
return command.execute(context);
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
private CanvasCommand<AbstractCanvasHandler> addEdge(final CanvasHandler canvasHandler,
final Node<View<?>, Edge> sourceNode,
final Node<View<?>, Edge> targetNode,
final Edge<? extends ViewConnector<?>, Node> connector) {
return canvasCommandFactory.addConnector(sourceNode,
connector,
MagnetConnection.Builder.forElement(sourceNode, targetNode),
canvasHandler.getDiagram().getMetadata().getShapeSetId());
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
protected Consumer<Node> cloneNodeCallback(AbstractCanvasHandler context) {
return clone -> {
//check if not a redo operation, in case size == 1 it was set before
if (!command.isEmpty()) {
command = buildCommand();
}
command.addCommand(getCloneCanvasNodeCommand(GraphUtils.getParent(clone).asNode(), clone, context.getDiagram().getMetadata().getShapeSetId()));
cloneNodeCommandCallback.ifPresent(callback -> callback.accept(clone));
};
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
private CommandResult<CanvasViolation> processConnectors(Counter processedNodesCountdown) {
if (processedNodesCountdown.equalsToValue(0)) {
final CompositeCommand.Builder<AbstractCanvasHandler, CanvasViolation> commandBuilder = createCommandBuilder();
commandBuilder.addCommands(clipboardControl.getElements().stream()
.filter(element -> element instanceof Edge)
.filter(Objects::nonNull)
.map(edge -> (Edge) edge)
.filter(edge -> Objects.nonNull(edge.getSourceNode()) &&
Objects.nonNull(clonedElements.get(edge.getSourceNode().getUUID())) &&
Objects.nonNull(edge.getTargetNode()) &&
Objects.nonNull(clonedElements.get(edge.getTargetNode().getUUID())))
.map(edge -> canvasCommandFactory.cloneConnector(edge,
clonedElements.get(edge.getSourceNode().getUUID()),
clonedElements.get(edge.getTargetNode().getUUID()),
getCanvasHandler().getDiagram().getMetadata().getShapeSetId(),
cloneEdgeCallback(edge)))
.collect(Collectors.toList()));
return sessionCommandManager.execute(getCanvasHandler(), commandBuilder.build());
}
return new CanvasCommandResultBuilder().build();
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
@Override
public Glyph getGlyph(final AbstractCanvasHandler canvasHandler,
final String uuid) {
final String ssid = canvasHandler.getDiagram().getMetadata().getShapeSetId();
final ShapeFactory shapeFactory = canvasHandler.getShapeFactory(ssid);
return shapeFactory.getGlyph(getGlyphId(canvasHandler, uuid),
ToolboxGlyphConsumer.class);
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
private CanvasCommand<AbstractCanvasHandler> addNode(final CanvasHandler canvasHandler,
final Node<View<?>, Edge> sourceNode,
final Node<View<?>, Edge> targetNode) {
final Node parent = (Node) GraphUtils.getParent(sourceNode);
final String shapeSetId = canvasHandler.getDiagram().getMetadata().getShapeSetId();
if (null != parent) {
return canvasCommandFactory.addChildNode(parent,
targetNode,
shapeSetId);
}
return canvasCommandFactory.addNode(targetNode,
shapeSetId);
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
@Override
@SuppressWarnings("unchecked")
public ToolboxAction<AbstractCanvasHandler> onMouseClick(final AbstractCanvasHandler canvasHandler,
final String uuid,
final MouseClickEvent event) {
final String ssid = canvasHandler.getDiagram().getMetadata().getShapeSetId();
final Node<View<?>, Edge> sourceNode = (Node<View<?>, Edge>) CanvasLayoutUtils.getElement(canvasHandler,
uuid).asNode();
//deselect node to be morphed, to avoid showing toolbar while morphing
clearSelectionEventEvent.fire(new CanvasClearSelectionEvent(canvasHandler));
//delay is used to overcome the toolbar animation while morphing the node
final CommandResult<CanvasViolation> result =
sessionCommandManager.execute(canvasHandler,
commandFactory.morphNode(sourceNode,
morphDefinition,
targetDefinitionId,
ssid));
if (CommandUtils.isError(result)) {
LOGGER.log(Level.SEVERE,
result.toString());
} else {
CanvasLayoutUtils.fireElementSelectedEvent(selectionEvent,
canvasHandler,
uuid);
}
return this;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
protected void updateClientMetadata(final D diagram) {
if (null != diagram) {
final Metadata metadata = diagram.getMetadata();
if (null != metadata && isEmpty(metadata.getShapeSetId())) {
final String sId = shapeManager.getDefaultShapeSet(metadata.getDefinitionSetId()).getId();
metadata.setShapeSetId(sId);
}
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-client
@SuppressWarnings("unchecked")
public void setup() {
MockitoAnnotations.initMocks(this);
this.graph = new GraphImpl<>("graph",
new GraphNodeStoreImpl());
this.index = new MapIndex(graph,
new HashMap<>(),
new HashMap<>());
when(canvasHandler.getDiagram()).thenReturn(diagram);
when(canvasHandler.getCanvas()).thenReturn(canvas);
when(canvasHandler.getGraphExecutionContext()).thenReturn(context);
when(context.getGraphIndex()).thenReturn(index);
when(canvasHandler.getGraphIndex()).thenReturn(index);
when(diagram.getMetadata()).thenReturn(metadata);
when(diagram.getGraph()).thenReturn(graph);
when(metadata.getDefinitionSetId()).thenReturn(DEF_SET_ID);
when(metadata.getShapeSetId()).thenReturn(SHAPE_SET_ID);
when(metadata.getCanvasRootUUID()).thenReturn(CANVAS_ROOT_UUID);
when(node.getUUID()).thenReturn(UUID.randomUUID().toString());
when(parent.getUUID()).thenReturn(UUID.randomUUID().toString());
when(candidate.getUUID()).thenReturn(UUID.randomUUID().toString());
shapeUUID = UUID.randomUUID().toString();
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-widgets
@Before
@SuppressWarnings("unchecked")
public void setup() {
when(views.get()).thenReturn(view);
when(canvasHandler.getCanvas()).thenReturn(canvas);
when(canvasHandler.getDiagram()).thenReturn(diagram);
when(canvasHandler.getDiagram().getGraph()).thenReturn(graph);
when(diagram.getMetadata()).thenReturn(metadata);
when(metadata.getShapeSetId()).thenReturn(SHAPE_SET_ID);
when(textPropertyProviderFactory.getProvider(any(Element.class))).thenReturn(textPropertyProvider);
when(definitionUtils.getDefinitionManager()).thenReturn(definitionManager);
when(definitionManager.adapters()).thenReturn(adapterManager);
when(adapterManager.forDefinition()).thenReturn(definitionAdapter);
when(definitionAdapter.getId(anyObject())).thenReturn(DefinitionId.build("defId"));
when(shapeManager.getShapeSet(eq(SHAPE_SET_ID))).thenReturn(shapeSet);
when(shapeSet.getShapeFactory()).thenReturn(shapeFactory);
when(shapeFactory.getGlyph(eq("defId"))).thenReturn(glyph);
when(domGlyphRenderers.render(eq(glyph),
anyDouble(),
anyDouble())).thenReturn(isElement);
when(graph.nodes()).thenReturn(getMockNodes());
this.childrenTraverseProcessor = spy(new ChildrenTraverseProcessorImpl(new TreeWalkTraverseProcessorImpl()));
this.testedTree = createTestInstance();
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
final String ssid = canvasHandler.getDiagram().getMetadata().getShapeSetId();
final ShapeFactory shapeFactory = canvasHandler.getShapeFactory(ssid);
final ConnectorDragProxy.Item connectorDragItem = new ConnectorDragProxy.Item() {
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-client
public CommandResult<CanvasViolation> execute(final AbstractCanvasHandler context) {
final Diagram diagram = context.getDiagram();
final String shapeSetId = context.getDiagram().getMetadata().getShapeSetId();
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
throw new RuntimeException(" An edge must be into the outgoing edges list from a node.");
final String ssid = canvasHandler.getDiagram().getMetadata().getShapeSetId();
final CompositeCommand.Builder commandBuilder = new CompositeCommand.Builder()
.addCommand(commandFactory.addConnector(inNode,
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
log("Metadata defSetId = " + metadata.getDefinitionSetId());
log("Metadata profileId = " + metadata.getProfileId());
log("Metadata shapeSetId = " + metadata.getShapeSetId());
log("Metadata canvas root = " + metadata.getCanvasRootUUID());
log("Metadata title = " + metadata.getTitle());
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-backend-common
@Test
public void testDecodeTest1() throws Exception {
InputStream is = loadStream(TEST1);
Metadata metadata = tested.unmarshall(is);
assertNotNull(metadata);
assertEquals("defSet1",
metadata.getDefinitionSetId());
assertEquals("ss1",
metadata.getShapeSetId());
assertEquals("thumbData1",
metadata.getThumbData());
assertEquals("title1",
metadata.getTitle());
assertEquals("root1",
metadata.getCanvasRootUUID());
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-client-common
x,
y);
final String ssid = canvasHandler.getDiagram().getMetadata().getShapeSetId();
ebc.getElementCommands(node,
parent,
内容来源于网络,如有侵权,请联系作者删除!