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


Java LayoutFactory.createSceneGraphLayout方法代码示例

本文整理汇总了Java中org.netbeans.api.visual.layout.LayoutFactory.createSceneGraphLayout方法的典型用法代码示例。如果您正苦于以下问题:Java LayoutFactory.createSceneGraphLayout方法的具体用法?Java LayoutFactory.createSceneGraphLayout怎么用?Java LayoutFactory.createSceneGraphLayout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.netbeans.api.visual.layout.LayoutFactory的用法示例。


在下文中一共展示了LayoutFactory.createSceneGraphLayout方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: VMDGraphScene

import org.netbeans.api.visual.layout.LayoutFactory; //导入方法依赖的package包/类
/**
 * Creates a VMD graph scene with a specific color scheme.
 * @param scheme the color scheme
 */
public VMDGraphScene (VMDColorScheme scheme) {
    this.scheme = scheme;
    setKeyEventProcessingType (EventProcessingType.FOCUSED_WIDGET_AND_ITS_PARENTS);

    addChild (backgroundLayer);
    addChild (mainLayer);
    addChild (connectionLayer);
    addChild (upperLayer);

    router = RouterFactory.createOrthogonalSearchRouter (mainLayer, connectionLayer);

    getActions ().addAction (ActionFactory.createZoomAction ());
    getActions ().addAction (ActionFactory.createPanAction ());
    getActions ().addAction (ActionFactory.createRectangularSelectAction (this, backgroundLayer));

    sceneLayout = LayoutFactory.createSceneGraphLayout (this, new GridGraphLayout<String, String> ().setChecker (true));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:VMDGraphScene.java

示例2: setSceneLayout

import org.netbeans.api.visual.layout.LayoutFactory; //导入方法依赖的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

示例3: layoutScene

import org.netbeans.api.visual.layout.LayoutFactory; //导入方法依赖的package包/类
private static void layoutScene(GraphScene<String, String> scene,
		String root) {
	AbegoTreeLayoutForNetbeans<String, String> graphLayout = new AbegoTreeLayoutForNetbeans<String, String>(
			root, 100, 100, 50, 50, true);
	SceneLayout sceneLayout = LayoutFactory.createSceneGraphLayout(scene,
			graphLayout);
	sceneLayout.invokeLayoutImmediately();
}
 
开发者ID:abego,项目名称:treelayout,代码行数:9,代码来源:AbegoTreeLayoutForNetbeansDemo.java

示例4: layoutScene_NetbeansStyle

import org.netbeans.api.visual.layout.LayoutFactory; //导入方法依赖的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: DB_VMDGraph

import org.netbeans.api.visual.layout.LayoutFactory; //导入方法依赖的package包/类
public DB_VMDGraph(IDatabase db,String topCompName) {
    scene = new VMDGraphScene();
    this.db=db;
    this.topCompName = topCompName;
    highlighterErrorBorderAttr = BorderFactory.createLineBorder(3, Color.MAGENTA);
    emptyBorder = BorderFactory.createEmptyBorder();
    graphLayout = new GridGraphLayout<String, String> ();
    sceneGraphLayout = LayoutFactory.createSceneGraphLayout(scene, graphLayout);
    createTables();
    createEdges();
}
 
开发者ID:dbunibas,项目名称:BART,代码行数:12,代码来源:DB_VMDGraph.java

示例6: createScene

import org.netbeans.api.visual.layout.LayoutFactory; //导入方法依赖的package包/类
@Override
public Scene createScene(Dependency dependency) {
    LunaticDepScene scene = new LunaticDepScene();
    SceneLayout sceneLayout = LayoutFactory.createSceneGraphLayout(scene, graphLayout);
    scene.setSceneLayout(sceneLayout);
    populateScene(dependency, scene);
    return scene;
}
 
开发者ID:donatellosantoro,项目名称:Llunatic,代码行数:9,代码来源:TgdDepSceneGenerator.java

示例7: SchemaScene

import org.netbeans.api.visual.layout.LayoutFactory; //导入方法依赖的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

示例8: autoLayout

import org.netbeans.api.visual.layout.LayoutFactory; //导入方法依赖的package包/类
@Override
public void autoLayout() {
    SceneLayout sceneLayout = LayoutFactory.createSceneGraphLayout(this, new GridGraphLayout<NodeWidgetInfo, EdgeWidgetInfo>().setChecker(true));
    sceneLayout.invokeLayout();
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:6,代码来源:AbstractPModelerScene.java

示例9: populateDefault

import org.netbeans.api.visual.layout.LayoutFactory; //导入方法依赖的package包/类
private void populateDefault() {
        currentModel = OpenSimDB.getInstance().getCurrentModel();
        if (currentModel == null) return;
        scene.addNode("ground");
        GraphLayoutSupport.setTreeGraphLayoutRootNode (graphLayout, "ground");
        final SceneLayout sceneGraphLayout = LayoutFactory.createSceneGraphLayout (scene, graphLayout);
        WidgetAction editAction = ActionFactory.createEditAction (new MyEditProvider (sceneGraphLayout));
        scene.getActions().addAction (editAction);
        JointSet jnts = currentModel.getJointSet();
        int numJoints = jnts.getSize();
        for (int j=0; j<numJoints; j++ ){
            Joint jnt = jnts.get(j);
            String childFrameName = jnt.getChildFrame().findBaseFrame().getName();
            String parentFrameName = jnt.getParentFrame().findBaseFrame().getName();
            //LabelWidget bodyWidget= new LabelWidget(scene, "Body:"+bod.getName());
            Widget bodyWidget = scene.addNode(childFrameName);
            //bodyWidget.setPreferredLocation (new Point (b*30, b*50));
            bodyWidget.getActions().addAction (editAction);
            Widget jntWidget = scene.addNode(jnt.getName());
            jntWidget.setBorder(ModelGraphScene.getBORDER_0());
            //String edgeID = bod.getJoint().getName();
            String jntToParent = parentFrameName+ "_"+jnt.getName();
            scene.addEdge(jntToParent);
            scene.setEdgeSource (jntToParent, parentFrameName);
            scene.setEdgeTarget (jntToParent, jnt.getName());
            String jntToChild = childFrameName+ "_"+jnt.getName();
            scene.addEdge(jntToChild);
            scene.setEdgeSource (jntToChild, jnt.getName());
            scene.setEdgeTarget (jntToChild, childFrameName);
    }
        scene.validate();
        
        
        //add(scene.createSatelliteView(), BorderLayout.EAST); 
        sceneGraphLayout.invokeLayoutImmediately ();
        scene.validate();
        scene.getActions ().addAction (ActionFactory.createEditAction (new EditProvider() {
            public void edit (Widget widget) {
                // new implementation
                sceneGraphLayout.invokeLayoutImmediately ();
                // old implementation
//                new TreeGraphLayout<String, String> (TreeGraphLayoutTest.this, 100, 100, 50, 50, true).layout ("root");
            }
        }));

    }
 
开发者ID:opensim-org,项目名称:opensim-gui,代码行数:47,代码来源:topologyEditorTopComponent.java

示例10: createSceneLayout

import org.netbeans.api.visual.layout.LayoutFactory; //导入方法依赖的package包/类
private void createSceneLayout() {
    GridGraphLayout<JRLibNode, JRLibEdge> ggl = new GridGraphLayout<JRLibNode, JRLibEdge>();
    ggl.setChecker(true);
    sceneLayout = LayoutFactory.createSceneGraphLayout(this, ggl);
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:6,代码来源:JRLibScene.java


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