GLConnectionWidgetLayoutConstraintsAPIReview

New Constraints for the Graph Library Connection Widget Layout

Submitter: Trey Spiva

Type: Fast Track
Target Milestone: Netbeans 6.5

Short Description

The current connection widget layout constraints are made up of two pieces of information. The first piece of information specifies the location of a child on the connection widget. The second piece of information is alignment information. The valid alignment values are specified by the LayoutFactory.ConnectionWidgetLayoutAlignment enumeration.

When a widget is moved around the scene the alignment should be adjusted. However, the current alignment values are static. Therefore, a few more constraints need to be added to allow the ConectionWidgetLayout to adjust the alignment correctly.

Dependencies

UML is associating labels to connection widgets. However, when the node is being moved around the diagram the label's position is being messed up. This is because of the limitations of the Connection Layout constraints.

Tracking Issue

Issue 128348

Change in Current Architecture

Following enumeration values will be added to LayoutFactory.ConnectionWidgetLayoutAlignment.

  • CENTER_SOURCE: The center point of the child will be aligned with the center point of the connection widget, and the child will always be on the source end of the connection widget.
  • CENTER_TARGET: The center point of the child will be aligned with the center point of the connection widget, and the child will always be on the target end of the connection widget.
  • BOTTOM_SOURCE: The child widget will be on the source end of the widget, and below the specified location on the connection widget.
  • BOTTOM_TARGET: The child widget will be on the target end of the widget, and below the specified location on the connection widget.
  • TOP_SOURCE: The child widget will be on the source end of the widget, and above the specified location on the connection widget.
  • TOP_TARGET: The child widget will be on the target end of the widget, and above the specified location on the connection widget.
  • LEFT_SOURCE: The child widget will be on the source end of the widget, and on the left side of the specified location on the connection widget.
  • RIGHT_SOURCE: The child widget will be on the source end of the widget, and on the right side of the specified location on the connection widget.
  • LEFT_SOURCE: The child widget will be on the target end of the widget, and on the left side of the specified location on the connection widget.
  • RIGHT_SOURCE: The child widget will be on the target end of the widget, and on the right side of the specified location on the connection widget.

The implementation of the ConnectionWidgetLayout is not part of the public API, but it will also have to be modified to handle the new constraints.

Summary of Changes

New values will have to be added to the enumeration LayoutFactory.ConnectionWidgetLayoutAlignment.

Impacted Interfaces

  • LayoutFactory.ConnectionWidgetLayoutAlignment.

Changes to the apichanges.xml

       <change>
            <api name="general"/>
            <summary>New Connection Widget Layout Constraints Introduced</summary>
            <version major="2" minor="13"/>
            <date day="22" month="4" year="2008"/>
            <author login="tspiva"/>
            <compatibility addition="yes"/>
            <description>
                ConnectionWidgetLayout constraints specify where a child component should be 
                placed in releationship to the connection widget.  However simply stating left, 
                right is not enough when nodes can be moved.  The new constraints specify which
                connection end instead of left, right top, and bottom.
            </description>
            <class package="org.netbeans.api.visual.layout" name="LayoutFactory" link="yes"/>
            <issue number="128348"/>
        </change>

Change Sets

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