当前位置: 首页>>代码示例>>Java>>正文


Java GraphLayout类代码示例

本文整理汇总了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();
    }
 
开发者ID:arodchen,项目名称:MaxSim,代码行数:23,代码来源:CfgScene.java

示例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();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:DependencyGraphScene.java

示例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);
        }
    };
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:LayoutFactory.java

示例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();
}
 
开发者ID:abego,项目名称:treelayout,代码行数:10,代码来源:AbegoTreeLayoutForNetbeansDemo.java

示例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();
}
 
开发者ID:terraframe,项目名称:Runway-SDK,代码行数:12,代码来源:SchemaScene.java


注:本文中的org.netbeans.api.visual.graph.layout.GraphLayout类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。