GraphLibraryHierarchicalLayoutUpdate01APIReview

Adding Invert and Spacing Configuration to Hierarchical Layout API Review

Submitter: Kris.Richards@Sun.COM

Type: Fast Track

Short Description

There are certain graphs which demand that the hierarchical layout be inverted (target above source). One such graph would be a UML class diagram. For this reason I propose adding a static call to the GraphLayoutFactory to allow for an "inverted" flag to be provided. The default behavior sets inverted to false.

Another call to be added the the GraphLayoutFactory would include "inverted", "horizontal spacing", and "layer spacing" (vertical). The default all remain the same.

Target Milestone

NetBeans 6.5

Dependencies

There are currently no dependencies on this addition. These new classes depend only on standard JDK classes.

Change in Current Architecture

There are no changes to the current architecture.

Use Cases

  1. User wants to invert the graph layout to have targets on top and sources below.
  2. User wants to configure the spacing (horizontal and vertical) of the hierarchical layout.


Summary of Changes

Add two static calls to the GraphLayoutFactory:

    public static <N, E> GraphLayout<N, E> createHierarchicalGraphLayout(GraphScene<N, E> graphScene, boolean animate, boolean inverted) {
        return new HierarchicalLayout(graphScene, animate, inverted);
    }

    public static <N, E> GraphLayout<N, E> createHierarchicalGraphLayout(GraphScene<N, E> graphScene, boolean animate, boolean inverted,
            int xOffset, int layerOffset) {
        return new HierarchicalLayout(graphScene, animate, inverted, xOffset, layerOffset);
    }

apichanges.xml

<change id="GraphLayoutFactory.createHierarchicalGraphLayout">
            <api name="general"/>
            <summary>GraphLayoutFactory.createHierarchicalGraphLayout added two additional
            calls to allow configuration of inverted and layout spacing.
            </summary>
            <version major="2" minor="13"/>
            <date day="24" month="6" year="2008"/>
            <author login="krichard"/>
            <compatibility addition="yes"/>
            <description>
                There are certain graphs which demand that the hierarchical layout 
                be inverted (target above source). One such graph would be a UML 
                class diagram. For this reason I propose adding a static call to 
                the GraphLayoutFactory to allow for an "inverted" flag to be provided. 
                The default behavior sets inverted to false.
                
                Another call to be added the the GraphLayoutFactory would include 
                "inverted", "horizontal spacing", and "layer spacing" (vertical). 
                The default all remain the same.
            </description>
            <class package="org.netbeans.api.visual.graph.layout" name="GraphLayoutFactory" link="yes"/>
            <issue number="138104"/>
</change>

Impacted Interfaces

none outside of GraphLayoutFactory

Change Sets

changeset 85547 6acb18c54ab5
changeset 85545 39aaad0e2dd4

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo