本文整理汇总了Java中org.netbeans.api.visual.graph.layout.GraphLayout类的典型用法代码示例。如果您正苦于以下问题:Java GraphLayout类的具体用法?Java GraphLayout怎么用?Java GraphLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GraphLayout类属于org.netbeans.api.visual.graph.layout包,在下文中一共展示了GraphLayout类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setSceneLayout
import org.netbeans.api.visual.graph.layout.GraphLayout; //导入依赖的package包/类
public void setSceneLayout(int newLayout) {
GraphLayout<CfgNode, CfgEdge> graphLayout = null;
switch (newLayout) {
case CfgEditorContext.LAYOUT_HIERARCHICALNODELAYOUT:
graphLayout = new HierarchicalNodeLayout(this);
break;
case CfgEditorContext.LAYOUT_HIERARCHICALCOMPOUNDLAYOUT:
graphLayout = new HierarchicalCompoundLayout(this);
break;
}
this.currentLayout = newLayout;
if (graphLayout != null) {
this.sceneLayout = LayoutFactory.createSceneGraphLayout(this, graphLayout);
}
getPreferences().putInt(PREFERENCE_LAYOUT, newLayout);
sceneLayout.invokeLayoutImmediately();
}
示例2: actionPerformed
import org.netbeans.api.visual.graph.layout.GraphLayout; //导入依赖的package包/类
@Override public void actionPerformed(ActionEvent e) {
final GraphLayout layout = GraphLayoutFactory.createTreeGraphLayout(10, 10, 50, 50, true);
GraphLayoutSupport.setTreeGraphLayoutRootNode(layout, DependencyGraphScene.this.rootNode);
layout.layoutGraph(DependencyGraphScene.this);
fitToZoomAfterLayout();
}
示例3: createSceneGraphLayout
import org.netbeans.api.visual.graph.layout.GraphLayout; //导入依赖的package包/类
/**
* Creates a scene layout which performs a specified graph-oriented layout on a specified GraphScene.
* @param graphScene the graph scene
* @param graphLayout the graph layout
* @return the scene layout
*/
public static <N,E> SceneLayout createSceneGraphLayout (final GraphScene<N,E> graphScene, final GraphLayout<N,E> graphLayout) {
assert graphScene != null && graphLayout != null;
return new SceneLayout(graphScene) {
protected void performLayout () {
graphLayout.layoutGraph (graphScene);
}
};
}
示例4: layoutScene_NetbeansStyle
import org.netbeans.api.visual.graph.layout.GraphLayout; //导入依赖的package包/类
private static void layoutScene_NetbeansStyle(
GraphScene<String, String> scene, String root) {
GraphLayout<String, String> graphLayout = GraphLayoutFactory
.createTreeGraphLayout(100, 100, 50, 50, true);
GraphLayoutSupport.setTreeGraphLayoutRootNode(graphLayout, root);
SceneLayout sceneLayout = LayoutFactory.createSceneGraphLayout(scene,
graphLayout);
sceneLayout.invokeLayoutImmediately();
}
示例5: SchemaScene
import org.netbeans.api.visual.graph.layout.GraphLayout; //导入依赖的package包/类
public SchemaScene()
{
mainLayer = new LayerWidget(this);
addChild(mainLayer);
connectionLayer = new LayerWidget(this);
addChild(connectionLayer);
router = RouterFactory.createOrthogonalSearchRouter(mainLayer, connectionLayer);
GraphLayout<SchemaClass, SchemaRelationship> graphLayout = GraphLayoutFactory.createOrthogonalGraphLayout(this, true);
SceneLayout sceneLayout = LayoutFactory.createSceneGraphLayout(this, graphLayout);
sceneLayout.invokeLayout();
}