本文整理汇总了Java中org.eclipse.elk.core.options.CoreOptions类的典型用法代码示例。如果您正苦于以下问题:Java CoreOptions类的具体用法?Java CoreOptions怎么用?Java CoreOptions使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CoreOptions类属于org.eclipse.elk.core.options包,在下文中一共展示了CoreOptions类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: transform
import org.eclipse.elk.core.options.CoreOptions; //导入依赖的package包/类
public KNode transform(final IVariable variable) {
DebuKVizDialog.resetShown();
// Generate a top-level KNode and set some layout options
KNode graph = KGraphUtil.createInitializedNode();
graph.setProperty(CoreOptions.DIRECTION, Direction.DOWN);
graph.setProperty(LayeredOptions.NODE_PLACEMENT_STRATEGY, NodePlacementStrategy.LINEAR_SEGMENTS);
// Generate a transformation context
VariableTransformationContext context = new VariableTransformationContext();
// Start the mighty transformation!
try {
VariableTransformation.invokeFor(variable, graph, context);
} catch (DebugException e) {
StatusManager.getManager().handle(new Status(
Status.ERROR,
DebuKVizPlugin.PLUGIN_ID,
"Error accessing the Eclipse debug framework.",
e));
}
return graph;
}
示例2: buildProxyNode
import org.eclipse.elk.core.options.CoreOptions; //导入依赖的package包/类
/**
* Builds and returns a proxy node. Assumes that the builder's configuration is valid.
*
* @return the proxy node.
*/
private KNode buildProxyNode() {
// TODO Change gradient colors
// TODO Change size such that proxy nodes are big enough next to regular nodes
KNode node = KGraphUtil.createInitializedNode();
// Prepare rendering extensions
injectExtensions();
// Build the rendering
KRoundedRectangle rndRect = rendExt.addRoundedRectangle(node, 10, 10);
rendExt.setForeground(rndRect, colExt.getColor("gray"));
rendExt.setBackgroundGradient(
rndRect, colExt.getColor("#FFFFFF"), colExt.getColor("#F0F0F0"), 90);
rendExt.setShadow(
rndRect, colExt.getColor("black"), 4, 4);
// Set layout properties
node.setWidth(20);
node.setHeight(20);
node.setProperty(CoreOptions.NODE_SIZE_CONSTRAINTS, SizeConstraint.fixed());
return node;
}
示例3: buildRegularNode
import org.eclipse.elk.core.options.CoreOptions; //导入依赖的package包/类
/**
* Builds and returns a regular, non-proxy node. Assumes that the builder's configuration is valid.
*
* @return the regular node.
*/
private KNode buildRegularNode() {
KNode node = KGraphUtil.createInitializedNode();
node.copyProperties(layoutOptions);
// Create default input port
if (defaultInputPort) {
KPort port = KGraphUtil.createInitializedPort();
port.setNode(node);
port.setProperty(CoreOptions.PORT_SIDE, defaultInputPortSide);
context.setDefaultInputPort(node, port);
}
// Prepare rendering extensions
injectExtensions();
// Build the rendering
KContainerRendering container = addRegularNodeContainerRendering(node);
boolean nameAndTypeRendering = addRegularNodeNameAndTypeRendering(container);
addRegularNodeValueRendering(container, nameAndTypeRendering);
addRegularNodePropertiesRendering(container);
addRegularNodeHierarchyRendering(container);
return node;
}
示例4: applyLayout
import org.eclipse.elk.core.options.CoreOptions; //导入依赖的package包/类
public void applyLayout(Map<StateVertex, VertexView> nodeToShape, Set<StateVertex> movedVertice) {
Parameters params = new Parameters();
LayoutConfigurator configurator = new LayoutConfigurator();
configurator.configure(KNode.class)
.setProperty(CoreOptions.ALGORITHM, "org.eclipse.elk.layered")
.setProperty(LayeredOptions.LAYERING_STRATEGY, LayeringStrategy.COFFMAN_GRAHAM)
.setProperty(LayeredOptions.LAYERING_COFFMAN_GRAHAM_LAYER_BOUND, 5)
.setProperty(CoreOptions.SPACING_NODE, 50.0f)
.setProperty(VERTEX2SHAPE_MAP, nodeToShape);
params.addLayoutRun(configurator);
DiagramLayoutEngine.invokeLayout(workbenchPart, null, params);
}
示例5: createNode
import org.eclipse.elk.core.options.CoreOptions; //导入依赖的package包/类
private KNode createNode(final LayoutMapping mapping, final StateVertex nodeStateVertex, final KNode rootNode) {
KNode childLayoutNode = ElkUtil.createInitializedNode();
rootNode.getChildren().add(childLayoutNode);
KShapeLayout nodeLayout = childLayoutNode.getData(KShapeLayout.class);
nodeLayout.setSize(24, 24);
((KShapeLayout) nodeLayout).resetModificationFlag();
nodeLayout.setProperty(CoreOptions.NODE_SIZE_MINIMUM, new KVector(24, 24));
mapping.getGraphMap().put(childLayoutNode, nodeStateVertex);
return childLayoutNode;
}
示例6: buildPort
import org.eclipse.elk.core.options.CoreOptions; //导入依赖的package包/类
/**
* Build a port.
*
* @param portSide the side to assign to the new port
* @param index the index to assign to the new port
* @return a port
*/
private KPort buildPort(PortSide portSide, int index) {
KPort port = KGraphUtil.createInitializedPort();
port.setSize(5, 5);
port.setProperty(CoreOptions.PORT_SIDE, portSide);
port.setProperty(CoreOptions.PORT_INDEX, index);
KRectangle rectangle = renderingFactory.createKRectangle();
port.getData().add(rectangle);
rendExt.setForegroundInvisible(rectangle, true);
rendExt.setBackground(rectangle, colExt.getColor("#808080"));
return port;
}