org.kie.workbench.common.stunner.core.graph.Edge.setContent()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(9.2k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中org.kie.workbench.common.stunner.core.graph.Edge.setContent()方法的一些代码示例,展示了Edge.setContent()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Edge.setContent()方法的具体详情如下:
包路径:org.kie.workbench.common.stunner.core.graph.Edge
类名称:Edge
方法名:setContent

Edge.setContent介绍

暂无

代码示例

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend

@SuppressWarnings("unchecked")
private void createChild(String uuid, Node parent, Node child, int parentIndex) {
  final Edge<Child, Node> edge = new EdgeImpl<>(uuid);
  edge.setContent(new Child());
  edge.setSourceNode(parent);
  edge.setTargetNode(child);
  if (parentIndex >= 0) {
    parent.getOutEdges().add(parentIndex, edge);
  } else {
    parent.getOutEdges().add(edge);
  }
  child.getInEdges().add(edge);
}

代码示例来源: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.stunner/kie-wb-common-stunner-core-common

@Before
@SuppressWarnings("unchecked")
public void setup() throws Exception {
  super.init();
  this.parent = mockNode(PARENT_UUID);
  this.candidate = mockNode(CANDIDATE_UUID);
  this.edge = new EdgeImpl<>(EDGE_UUID);
  this.edge.setContent(new Dock());
  this.edge.setSourceNode(parent);
  this.edge.setTargetNode(candidate);
  when(graphIndex.getNode(eq(PARENT_UUID))).thenReturn(parent);
  when(graphIndex.getNode(eq(CANDIDATE_UUID))).thenReturn(candidate);
  when(graphIndex.getEdge(eq(EDGE_UUID))).thenReturn(edge);
  when(parent.getOutEdges()).thenReturn(parentOutEdges);
  when(candidate.getInEdges()).thenReturn(candidateInEdges);
  parentOutEdges.add(edge);
  candidateInEdges.add(edge);
  this.tested = new UnDockNodeCommand(PARENT_UUID,
                    CANDIDATE_UUID);
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common

@Before
@SuppressWarnings("unchecked")
public void setUp() {
  controlPoint = ControlPoint.build(1, 4, 0);
  when(commandExecutionContext.getRuleManager()).thenReturn(ruleManager);
  content = new ViewConnectorImpl<>(mock(Object.class),
                   Bounds.create(0, 0, 10, 10));
  edge = new EdgeImpl<>("edge1");
  edge.setContent(content);
  content.setControlPoints(Collections.singletonList(controlPoint));
  tested = new UpdateControlPointPositionCommand(edge,
                          controlPoint,
                          TARGET_LOCATION);
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common

@Override
@SuppressWarnings("unchecked")
public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) {
  final CommandResult<RuleViolation> results = allow(context);
  if (!results.getType().equals(CommandResult.Type.ERROR)) {
    final Node<?, Edge> parent = getParent(context);
    final Node<?, Edge> candidate = getCandidate(context);
    final String uuid = UUID.uuid();
    final Edge<Child, Node> edge = new EdgeImpl<>(uuid);
    edge.setContent(new Child());
    edge.setSourceNode(parent);
    edge.setTargetNode(candidate);
    parent.getOutEdges().add(edge);
    candidate.getInEdges().add(edge);
    getMutableIndex(context).addEdge(edge);
  }
  return results;
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common

@Override
@SuppressWarnings("unchecked")
public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) {
  final CommandResult<RuleViolation> results = allow(context);
  if (!results.getType().equals(CommandResult.Type.ERROR)) {
    final Node<?, Edge> parent = getParent(context);
    final Node<?, Edge> candidate = getCandidate(context);
    final String uuid = UUID.uuid();
    final Edge<Dock, Node> edge = new EdgeImpl<>(uuid);
    edge.setContent(new Dock());
    edge.setSourceNode(parent);
    edge.setTargetNode(candidate);
    parent.getOutEdges().add(edge);
    candidate.getInEdges().add(edge);
    getMutableIndex(context).addEdge(edge);
  }
  return results;
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common

@Override
@SuppressWarnings("unchecked")
public CommandResult<RuleViolation> execute(final GraphCommandExecutionContext context) {
  final CommandResult<RuleViolation> results = allow(context);
  if (!results.getType().equals(CommandResult.Type.ERROR)) {
    final Node<?, Edge> parent = getParent(context);
    final Node<?, Edge> candidate = getCandidate(context);
    // TODO: Create a ParentEdgeFactory iface extending EdgeFactory using as content generics type Relationship
    final String uuid = UUID.uuid();
    final Edge<Parent, Node> edge = new EdgeImpl<>(uuid);
    edge.setContent(new Parent());
    edge.setSourceNode(parent);
    edge.setTargetNode(candidate);
    parent.getOutEdges().add(edge);
    candidate.getInEdges().add(edge);
    getMutableIndex(context).addEdge(edge);
  }
  return results;
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common

targetConnection = MagnetConnection.Builder.forElement(graphInstance.intermNode);
connectorContent.setTargetConnection(targetConnection);
graphInstance.edge1.setContent(connectorContent);
graphInstance.edge2.setContent(connectorContent);

代码示例来源:origin: org.kie.workbench/kie-wb-common-dmn-api

final Edge existingConnector = new EdgeImpl<>("edge1");
final ViewConnector existingConnectorView = mock(ViewConnector.class);
existingConnector.setContent(existingConnectorView);
when(existingConnectorView.getDefinition()).thenReturn(new Definition());

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-client

childEdge3.setTargetNode(child3);
parentEdge1.setContent(new Child());
parentEdge2.setContent(new Child());
parentEdge3.setContent(new Child());
childEdge1.setContent(new Child());
childEdge2.setContent(new Child());
childEdge3.setContent(new Child());

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-client

@Before
public void setup() {
  super.setup();
  this.parent = CommandTestUtils.makeNode("uuid1",
                      "parent",
                      10.0,
                      20.0,
                      50.0,
                      50.0);
  this.candidate = CommandTestUtils.makeNode("uuid2",
                        "candidate",
                        10.0,
                        20.0,
                        50.0,
                        50.0);
  this.command = new CaseManagementRemoveChildCommand(parent,
                            candidate);
  final Edge<Child, Node> edge = new EdgeImpl<>("edge1");
  edge.setContent(new Child());
  edge.setSourceNode(parent);
  edge.setTargetNode(candidate);
  parent.getOutEdges().add(edge);
  candidate.getInEdges().add(edge);
}

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend

stage1InEdge.setSourceNode(rootNode);
stage1InEdge.setTargetNode(stage1Node);
stage1InEdge.setContent(new Child());
rootNode.getOutEdges().add(stage1InEdge);
stage1Node.getInEdges().add(stage1InEdge);
task1InEdge.setSourceNode(stage1Node);
task1InEdge.setTargetNode(task1Node);
task1InEdge.setContent(new Child());
stage1Node.getOutEdges().add(task1InEdge);
task1Node.getInEdges().add(task1InEdge);
case1InEdge.setSourceNode(stage1Node);
case1InEdge.setTargetNode(case1Node);
case1InEdge.setContent(new Child());
stage1Node.getOutEdges().add(case1InEdge);
case1Node.getInEdges().add(case1InEdge);
stage2InEdge.setSourceNode(rootNode);
stage2InEdge.setTargetNode(stage2Node);
stage2InEdge.setContent(new Child());
rootNode.getOutEdges().add(stage2InEdge);
stage2Node.getInEdges().add(stage2InEdge);
case2InEdge.setSourceNode(stage2Node);
case2InEdge.setTargetNode(case2Node);
case2InEdge.setContent(new Child());
stage2Node.getOutEdges().add(case2InEdge);
case2Node.getInEdges().add(case2InEdge);

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend

stageInEdge.setSourceNode(rootNode);
stageInEdge.setTargetNode(stageNode);
stageInEdge.setContent(new Child());
rootNode.getOutEdges().add(stageInEdge);
stageNode.getInEdges().add(stageInEdge);
subcaseInEdge.setSourceNode(stageNode);
subcaseInEdge.setTargetNode(subcaseNode);
subcaseInEdge.setContent(new Child());
stageNode.getOutEdges().add(subcaseInEdge);
subcaseNode.getInEdges().add(subcaseInEdge);

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend

stageInEdge.setSourceNode(rootNode);
stageInEdge.setTargetNode(stageNode);
stageInEdge.setContent(new Child());
rootNode.getOutEdges().add(stageInEdge);
stageNode.getInEdges().add(stageInEdge);
subprocessInEdge.setSourceNode(stageNode);
subprocessInEdge.setTargetNode(subprocessNode);
subprocessInEdge.setContent(new Child());
stageNode.getOutEdges().add(subprocessInEdge);
subprocessNode.getInEdges().add(subprocessInEdge);

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend

stageInEdge.setSourceNode(rootNode);
stageInEdge.setTargetNode(stageNode);
stageInEdge.setContent(new Child());
rootNode.getOutEdges().add(stageInEdge);
stageNode.getInEdges().add(stageInEdge);
taskInEdge.setSourceNode(stageNode);
taskInEdge.setTargetNode(taskNode);
taskInEdge.setContent(new Child());
stageNode.getOutEdges().add(taskInEdge);
taskNode.getInEdges().add(taskInEdge);

代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-case-mgmt-backend

stageInEdge.setSourceNode(rootNode);
stageInEdge.setTargetNode(stageNode);
stageInEdge.setContent(new Child());
rootNode.getOutEdges().add(stageInEdge);
stageNode.getInEdges().add(stageInEdge);

相关文章