本文整理了Java中org.kie.workbench.common.stunner.core.graph.Graph.getContent()
方法的一些代码示例,展示了Graph.getContent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.getContent()
方法的具体详情如下:
包路径:org.kie.workbench.common.stunner.core.graph.Graph
类名称:Graph
方法名:getContent
暂无
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Override
public void startGraphTraversal(final Graph graph) {
if (graph.getContent() instanceof DefinitionSet) {
callback.startGraphTraversal(graph);
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@SuppressWarnings("unchecked")
protected void doStartGraphTraversal(final Graph graph,
final K callback) {
if (graph.getContent() instanceof View) {
callback.startGraphTraversal(graph);
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@Override
public void startGraphTraversal(final Graph<DefinitionSet, Node<View, Edge>> graph) {
if (graph == null) {
error("Graph is null!");
} else {
final DefinitionSet view = graph.getContent();
log(indent + "Graph UUID: " + graph.getUUID());
log(indent + " Graph Starting nodes");
log(indent + " ====================");
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-project-client
protected Overview open() {
final ProjectMetadata metadata = mock(ProjectMetadata.class);
final Overview overview = mock(Overview.class);
when(diagram.getMetadata()).thenReturn(metadata);
when(metadata.getTitle()).thenReturn(TITLE);
when(metadata.getOverview()).thenReturn(overview);
final Graph graph = mock(Graph.class);
final DefinitionSet definitionSet = mock(DefinitionSet.class);
when(diagram.getGraph()).thenReturn(graph);
when(graph.getContent()).thenReturn(definitionSet);
presenter.open(diagram);
return overview;
}
代码示例来源: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
@SuppressWarnings("unchecked")
public static List<String> getParentIds(final DefinitionManager definitionManager,
final Graph<? extends DefinitionSet, ? extends Node> graph,
final Element<?> element) {
final List<String> result = new ArrayList<>(5);
Element<?> p = element;
while (p instanceof Node && p.getContent() instanceof Definition) {
p = getParent((Node<? extends Definition<?>, ? extends Edge>) p);
if (null != p) {
final Object definition = ((Definition) p.getContent()).getDefinition();
final String id = definitionManager.adapters().forDefinition().getId(definition).value();
result.add(id);
}
}
final String graphId = graph.getContent().getDefinition();
result.add(graphId);
return result;
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
private RuleSet getRuleSet(final Graph<? extends DefinitionSet, ?> graph) {
final String defSetId = graph.getContent().getDefinition();
final Object definitionSet = definitionManager.definitionSets().getDefinitionSetById(defSetId);
return definitionManager.adapters().forRules().getRuleSet(definitionSet);
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-core-common
@SuppressWarnings("unchecked")
public void init() {
MockitoAnnotations.initMocks(this);
when(graph.getUUID()).thenReturn(GRAPH_UUID);
when(graph.getContent()).thenReturn(graphContent);
when(graph.nodes()).thenReturn(graphNodes);
when(definitionManager.adapters()).thenReturn(adapterManager);
when(adapterManager.registry()).thenReturn(adapterRegistry);
when(adapterManager.forDefinition()).thenReturn(definitionAdapter);
when(adapterManager.forProperty()).thenReturn(propertyAdapter);
when(adapterRegistry.getDefinitionAdapter(any(Class.class))).thenReturn(definitionAdapter);
when(adapterRegistry.getPropertyAdapter(any(Class.class))).thenReturn(propertyAdapter);
when(graphCommandExecutionContext.getDefinitionManager()).thenReturn(definitionManager);
when(graphCommandExecutionContext.getFactoryManager()).thenReturn(factoryManager);
when(graphCommandExecutionContext.getRuleManager()).thenReturn(ruleManager);
when(graphCommandExecutionContext.getGraphIndex()).thenReturn(graphIndex);
when(graphCommandExecutionContext.getRuleSet()).thenReturn(ruleSet);
when(graphIndex.getGraph()).thenReturn(graph);
when(ruleManager.evaluate(any(RuleSet.class),
any(RuleEvaluationContext.class))).thenReturn(EMPTY_VIOLATIONS);
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-widgets
when(diagram.getMetadata()).thenReturn(metadata);
when(diagram.getGraph()).thenReturn(graph);
when(graph.getContent()).thenReturn(graphContent);
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-project-client
when(placeRequest.getIdentifier()).thenReturn(ProjectDiagramEditorStub.EDITOR_ID);
when(diagram.getGraph()).thenReturn(graph);
when(graph.getContent()).thenReturn(definitionSetContent);
when(stunnerPreferencesRegistr.get(StunnerPreferences.class)).thenReturn(preferences);
when(preferences.getDiagramEditorPreferences()).thenReturn(diagramEditorPreferences);
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-backend-common
is);
DiagramFactory<M, ?> factory = factoryManager.registry().getDiagramFactory(graph.getContent().getDefinition(),
getMetadataType());
return (D) factory.build(name,
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-backend-common
when(graph.getContent()).thenReturn(graphContent);
when(graphContent.getDefinition()).thenReturn(DEFINITION_SET);
内容来源于网络,如有侵权,请联系作者删除!