org.netbeans.api.visual.graph.layout.GraphLayout Java Examples

The following examples show how to use org.netbeans.api.visual.graph.layout.GraphLayout. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DependencyGraphScene.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@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();
}
 
Example #2
Source File: DependencyGraphScene.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override public void actionPerformed(ActionEvent e) {
    final GraphLayout layout = GraphLayoutFactory.createTreeGraphLayout(10, 10, 50, 50, false);
    GraphLayoutSupport.setTreeGraphLayoutRootNode(layout, DependencyGraphScene.this.rootNode);
    
    layout.layoutGraph(DependencyGraphScene.this);
    fitToZoomAfterLayout();
    
}
 
Example #3
Source File: LayoutFactory.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
        }
    };
}
 
Example #4
Source File: LayoutFactory.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a scene layout which performs a specified graph-oriented layout on a specified GraphPinScene.
 * @param graphPinScene the graph pin scene
 * @param graphLayout the graph layout
 * @return the scene layout
 */
public static <N,E> SceneLayout createSceneGraphLayout (final GraphPinScene<N,E,?> graphPinScene, final GraphLayout<N,E> graphLayout) {
    assert graphPinScene != null && graphLayout != null;
    return new SceneLayout(graphPinScene) {
        protected void performLayout () {
            graphLayout.layoutGraph (graphPinScene);
        }
    };
}
 
Example #5
Source File: AbegoTreeLayoutForNetbeansDemo.java    From treelayout with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
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();
}
 
Example #6
Source File: DependencyGraphScene.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override public void actionPerformed(ActionEvent e) {
   final GraphLayout layout = GraphLayoutFactory.createHierarchicalGraphLayout(DependencyGraphScene.this, DependencyGraphScene.this.isAnimated(), false);
   layout.layoutGraph(DependencyGraphScene.this);
    fitToZoomAfterLayout();
}