本文整理汇总了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));
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}
示例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;
}
示例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();
}
示例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();
}
示例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");
}
}));
}
示例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);
}