本文整理汇总了Java中org.netbeans.api.visual.layout.SceneLayout类的典型用法代码示例。如果您正苦于以下问题:Java SceneLayout类的具体用法?Java SceneLayout怎么用?Java SceneLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SceneLayout类属于org.netbeans.api.visual.layout包,在下文中一共展示了SceneLayout类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: layoutScene
import org.netbeans.api.visual.layout.SceneLayout; //导入依赖的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();
}
示例2: layoutScene_NetbeansStyle
import org.netbeans.api.visual.layout.SceneLayout; //导入依赖的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();
}
示例3: createScene
import org.netbeans.api.visual.layout.SceneLayout; //导入依赖的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;
}
示例4: SchemaScene
import org.netbeans.api.visual.layout.SceneLayout; //导入依赖的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();
}
示例5: autoLayout
import org.netbeans.api.visual.layout.SceneLayout; //导入依赖的package包/类
@Override
public void autoLayout() {
SceneLayout sceneLayout = LayoutFactory.createSceneGraphLayout(this, new GridGraphLayout<NodeWidgetInfo, EdgeWidgetInfo>().setChecker(true));
sceneLayout.invokeLayout();
}
示例6: populateDefault
import org.netbeans.api.visual.layout.SceneLayout; //导入依赖的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");
}
}));
}
示例7: MyEditProvider
import org.netbeans.api.visual.layout.SceneLayout; //导入依赖的package包/类
MyEditProvider(SceneLayout sceneGraphLayout){
this.sceneGraphLayout = sceneGraphLayout;
}
示例8: setSceneLayout
import org.netbeans.api.visual.layout.SceneLayout; //导入依赖的package包/类
public void setSceneLayout(SceneLayout sceneLayout) {
this.sceneLayout = sceneLayout;
layout();
}
示例9: getSceneLayout
import org.netbeans.api.visual.layout.SceneLayout; //导入依赖的package包/类
/**
* Get the SceneLayout implementation which wrappers the JUNG layout and
* lays out the widgets
*
* @return A SceneLayout
*/
public final SceneLayout getSceneLayout() {
return sceneLayout;
}