Diagramming applications are commonly used to create flowcharts and other diagrams. When creating and editing a diagram, users often drag and drop shapes and connectors into the diagram, re-size shapes, add text, move shapes, insert shapes, flip and rotate shapes and portions of the diagram, as well as various other actions. In doing so, shapes and connectors often become misaligned and unevenly spaced apart. In an effort to create a professional and visually appealing end product, users may find it necessary to spend a significant amount of time nudging shapes and corresponding connectors around to properly align and space the shapes within the diagram.
It is with respect to these considerations and others that the disclosure made herein is presented.
Technologies are described herein for making minor corrections to the positions of shapes and regions, such as containers, in a diagram in order to properly align and space the shapes and regions while maintaining the existing layout to preserve the intent of the diagram creator. In particular, through the utilization of the concepts presented herein, a user may properly align and space shapes and regions in a diagram without manual manipulation of the shapes, regions, and connectors within the diagram. Any constraints placed on the layout by the characteristics of the regions, or by the direct connection of shapes and regions, are preserved during layout correction or manipulation. After correcting a diagram layout, the concepts presented herein allow a diagramming application to identify and resolve layout conflicts that might result from the realignment and spacing actions taken with respect to the shapes and regions.
According to one aspect presented herein, in response to receiving a request to correct a layout of a diagram having a number of shapes positioned within a list of regions, for each region, a corrected layout of shapes within the region is determined, and a minimum additional spacing around the corrected shape layout is determined. The minimum additional spacing is then used to determine corrections to the region boundaries. Accordingly, the diagram shapes and region boundaries are then sequentially repositioned for each region through the list of regions.
According to other aspects, virtual nodes are assigned to a corner of each region within a diagram having a list of regions. A dependency tree is created that defines parent and child relationships between the shapes and virtual nodes of the diagram, as well as associations between the shapes and virtual nodes according to the physical positions of the shapes in the diagram. The shapes and virtual nodes are then sequentially repositioned according to the dependency tree and any applicable layout rule.
According to yet another aspect, in response to a request to correct a diagram layout that includes at least two shapes directly glued to one another, a classification is assigned to each connection between shapes. A priority is then assigned according to the connection classifications. A dependency tree is created that defines parent and child relationships according to the physical positions of the shapes within the diagram. Finally, the shapes of the diagram are repositioned according to the dependency tree and the assigned connection priorities.
It should be appreciated that the above-described subject matter may also be implemented as a computer-controlled apparatus, a computer process, a computing system, or as an article of manufacture such as a computer-readable medium. These and various other features will be apparent from a reading of the following Detailed Description and a review of the associated drawings.
This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended that this Summary be used to limit the scope of the claimed subject matter. Furthermore, the claimed subject matter is not limited to implementations that solve any or all disadvantages noted in any part of this disclosure.
The following detailed description is directed to technologies for adjusting the positions of shapes within a diagram. As discussed briefly above, users often spend considerable time cleaning up a diagram during and after its creation. Layout features exist in diagramming applications that attempt to assist a user in placing shapes. However, traditional automated shape layout features typically attempt to place shapes on a page according to a pre-defined template, without regard to the actual placement of shapes by the user. For example, a typical automated shape layout feature might pick up the diagram created by the user and re-arrange all of the shapes according to a pre-defined flowchart template, organizational chart template, or any other selected diagram type. The fact that the user placed a particular shape to the right of another shape instead of in another relative position is not taken into account and is not preserved in the resulting layout. As a result, the meaning associated with the diagram is often lost.
Aspects of the disclosure provided herein allow for the repositioning of shapes within a diagram to correct minor alignment and spacing discrepancies while maintaining the general layout created by the user. In the following detailed description, references are made to the accompanying drawings that form a part hereof, and which are shown by way of illustration specific embodiments or examples. Referring now to the drawings, in which like numerals represent like elements through the several figures, aspects of a computing system and methodology for correcting shape positioning within a diagram will be described.
While the subject matter described herein is presented in the general context of program modules that execute in conjunction with the execution of an operating system and application programs on a computer system, those skilled in the art will recognize that other implementations may be performed in combination with other types of program modules. Generally, program modules include routines, programs, components, data structures, and other types of structures that perform particular tasks or implement particular abstract data types. Moreover, those skilled in the art will appreciate that the subject matter described herein may be practiced with other computer system configurations, including hand-held devices, multiprocessor systems, microprocessor-based or programmable consumer electronics, minicomputers, mainframe computers, and the like.
Turning now to
However, utilizing the embodiments described below, the user may select a single control that triggers a layout correction engine to apply one or more layout rules to reposition shapes within the diagram 100 to arrive at diagram 102, shown in
Alternatively, it should be appreciated that triggering the layout correction engine to reposition any shapes in a diagram through any requested action by the user may not only trigger the layout correction engine to perform the requested action (i.e., inserting a new shape), but also to reposition all of the shapes within the diagram to correct for misalignment and uneven spacing. In this alternative embodiment, inserting shape F into the diagram 200 would create a diagram similar to diagram 202, however all of the shapes A, B, F, C, and E would be realigned on a common horizontal axis and be evenly spaced apart, while shape D would be spaced an equivalent distance below shape C and be vertically aligned with shape C.
Having described some general concepts of the embodiments in context with the various layout correction requests shown in
In order to accurately reposition shapes within a diagram to correct layout issues while still preserving the user's original layout as closely as possible, the layout correction engine establishes relationships between the shapes, both from a parent-child perspective and from a relative position perspective. According to one embodiment, the placement tree 500 defines the parent-child relationships between the various shapes of the diagram. The placement tree 500 organizes the shapes in a parent-child manner such that each shape in the diagram appears only once in the placement tree 500 and has only one parent. In doing so, the layout correction engine resolves any ambiguity around multiple parents. For example, as seen in diagram 402, shape C has two parents, shapes B and D. The layout correction engine eliminates this ambiguity by selecting shape B as the parent of shape C, as seen in the placement tree 500.
If the diagram has loops, the layout correction engine will again resolve those loops so that each shape in the placement tree 500 has only one parent and the tree flows only downward or in a single direction. The layout correction engine will utilize a set of placement tree rules when creating the placement tree 500. These rules will assist the layout correction engine in choosing a single parent in a situation, such as that described above with respect to diagram 400, in which a shape has two or more incoming connectors, indicating more than one parent.
It should be appreciated that the placement tree rules may use any quantity and type of criteria for selecting a parent shape, including but not limited to shape characteristics, shape proximities, shape alignments, intervening shapes, and any other criteria. For example, the placement tree rules may guide the layout correction engine into selecting shape B of diagram 400 as the parent to shape C instead of shape D, since shape C is configured in-line with shapes B and E in the main diagram branch, while shape D is aligned below the main diagram branch.
In addition to establishing parent-child relationships, the placement tree 500 establishes an order in which a given shape's child shapes should be processed when repositioning shapes in a diagram. Similar to the determination discussed above as to which shape (shape B or shape D) to use as the parent of shape C, the layout correction engine utilizes the placement tree rules to determine the processing order of the two branches. For example, because shape C is part of the main diagram branch and has an associated child shape, shape E, the determination is made to process the branch of the placement tree 500 containing shape C prior to the branch of the placement tree 500 containing shape D.
For a connected diagram in which all shapes are connected to at least one other shape using a connector line, the connector lines are used to establish the parent-child relationships in the placement tree 500. However, there are often unconnected shapes within a diagram. One example includes text placed on the page to describe one or more shapes. According to one embodiment, for unconnected shapes, rules provide for a child relationship to be established from the nearest connected shape or from the nearest unconnected shape that already has a relationship defined in the placement tree 500. It should be appreciated that the rules may provide a limit as to how far an unconnected shape may be from another shape in order for the parent-child relationship to be established. Moreover, diagrams may not only include shapes that are connected via a connector line and unconnected shapes, but may also include shapes that are directly connected, or glued, to other shapes or regions within the diagram. Various embodiments with respect to this unique scenario will be shown and described in detail below with respect to
Returning to
It should be noted that the placement tree 500 is used to resolve any ambiguity about parent-child relationships in the diagram. The dependency tree 600 is built using the placement tree 500 and defines the parent-child relationships within the diagram and their positional relationships, including the offsets that define where each shape is positioned with respect to another shape. When placing the shapes during a layout corrective action, the layout correction engine will step through the dependency tree 600 in order, placing shapes according to the relationships and offsets of the dependency tree 600. It should be appreciated that although this disclosure describes layout correction with respect to the creation and utilization of a placement tree 500 and a dependency tree 600, according to alternative embodiments, the layout correction engine may resolve parent-child ambiguity as the dependency tree 600 is created, without specifically creating the placement tree 500.
According to one illustrative implementation, if a shape does not virtually overlap its parent or siblings, then if the shape is closer to or the same distance from its nearest sibling than to its parent and that sibling is closer to or the same distance from the parent than the shape is, then the shape is dependent on the sibling. Otherwise, the shape is dependent on its parent. It should be noted that shapes may be positionally dependent on siblings or parents. The manner in which shapes are connected in the diagram is not central to the creation of the dependency tree. In fact, various embodiments allow connected shapes to be dependent on unconnected shapes for positioning purposes.
After creating the placement tree 500 and the dependency tree 600, the layout correction engine utilizes the dependency tree 600 when applying the layout rules to correct the diagram layout per the request from the user. Given the dependency tree 600, the layout correction engine can determine how to move child shapes to follow their parent shapes when the parent shapes are repositioned, and when a given shape is repositioned, what other shape to compare its position to in order to determine exactly where to place it in the diagram.
As an example, when correcting the alignment and spacing of shapes A-E in diagram 400 of
According to one embodiment, when shape C follows shape B, all other shapes in the dependency tree 600 that are subordinate to shape B, specifically shapes C-E, follow shape B as well using the calculated offsets from the dependency tree 600. Continuing down the dependency tree 600, the layout correction engine next repositions shape C. Shape C is repositioned prior to shape D, since when creating the placement tree 500, the layout correction engine determined that the branch containing shape C should be processed prior to the branch containing shape D. The order is designated in the placement tree 500 as “1” and “2.” Shape C is then repositioned in alignment with and evenly spaced from shape B, which moves it down and to the left as shown in
Shape E is repositioned in alignment with and evenly spaced from shape C. Finally, it should be noted that according to the placement tree 500, shape D's parent is shape B. However, when building the dependency tree 600, it was determined that shape D's position is dependent on shape C. During dependency tree 600 calculation, the layout correction engine determined that shape D was closer to shape C and nearly lined up with shape C, so the determination was made that shape D's position is more related to shape C than to its parent, shape B. As a result, shape D is aligned with and evenly spaced from shape C, but in the same general direction as it was located in diagram 400, specifically below shape C. This information is available to the layout correction engine from the offset in the dependency tree 600 and is used to preserve the original layout configuration created by the user.
It should be understood that the principles described above with respect to correcting diagram layouts by creating and utilizing the placement tree 500 and the dependency tree 600 may be applied to repositioning diagram shapes while responding to a user request to modify the diagram, as discussed above with respect to
According to another implementation, when shape F is inserted into the diagram 200, the layout correction engine determines whether there is room to evenly space shape F from shape B without conflicting with shape C. If there is room, then shape F will be inserted without moving shape C and any subordinate shapes and the connectors will be modified as described above. However, if the layout correction engine determines that shape C is to be moved to make room for shape F, then shape C would be evenly spaced from shape F and the corresponding subordinate shapes would be moved as described above.
According to one implementation, shape C must depend on shape B when the dependency tree 600 is created in order to insert shape F between. The shapes between which the new shape will be inserted must depend on one another. Therefore, if shape F were inserted between shapes B and D, then a different dependency tree 600 would have to be created to ensure proper spacing and alignment of shape F from shape B and of shape D from shape F.
Similarly, just as the placement tree 500 and the dependency tree 600 creation and utilization allows for diagram layout correction upon the insertion of a new shape, the layout correction engine may utilize the placement tree 500 and the dependency tree 600 to flip or rotate diagrams as described above with respect to
Diagramming applications may allow for the grouping of shapes into regions. One example of a region is a container. Containers and other constrained regions may be identified by a box or other boundary surrounding the member shapes or via any other means for visually identifying a group of shapes. It is typically desirable that the region membership, or group of shapes assigned to the region, is preserved. It would not be desirable for a member shape to be repositioned outside of the region boundaries or for a non-member shape to be repositioned inside of the region boundaries.
For example, creating and applying the placement tree and dependency tree concepts described above to the shapes A-D of diagram 900, the layout correction engine aligns shapes A and B within the region 904, and then aligns shapes C and D to shapes A and B. According to one embodiment, regions attempt to follow the repositioning of shapes within the regions. In some cases, as shown in
There are situations in which simply moving and resizing the region to accommodate repositioning of member shapes within does not provide a desirable outcome. Turning to
The first type of shape is an entry node 1110. An entry node 1110 is a shape in the region whose parent shape is outside the region. Entry nodes 1110 have an associated entry direction that is determined according to the offset between the entry node 1110 and its parent. In diagram 1004, shapes E and G are entry nodes 1110 for the top boundary of the region 10006 since shapes E and G are positioned below parent shapes D and C, respectively. The second type of shape that affects the position of the region's boundaries is an exit node 1112. Exit nodes 1112 are shapes outside the region whose parent shapes are inside the region. In diagram 1004, shape H is an exit node 1112 since it is located outside of the region 1006 while its parent shape, shape G, is within the boundaries of the region 1006.
When traversing the dependency tree 600 and repositioning shapes, the size of a region and its boundaries are considered undetermined until an entry node 1110 is placed. When the layout correction engine places an entry node 1110, the layout correction engine calculates the size and position of the boundaries based on the entry nodes 1110, the parents of the exit nodes 1112, and the layout correction of the member shapes within. Once the boundaries of the region have been determined, the layout correction engine locks or otherwise fixes the boundaries.
The layout correction engine attempts to maintain the boundaries of the regions as compactly laid out as possible. To do so, excess movement of the boundaries is restricted. The layout correction engine identifies and tracks the entry nodes 1110 and exit nodes 1112, along with the size of their sub-trees, or set of shapes subordinate to a given shape. To determine the position of the top boundary of a region, the top boundary is placed at the lowest position that allows entry nodes 1110 entering from the top to be within the region and exit nodes 1112 leaving the top boundary to be outside the region. Doing so may not leave sufficient room for the shapes inside the region to all fit within the region. In these situations, the opposing boundary, which in this scenario is the bottom boundary, is adjusted to be a fixed distance from the top boundary that allows enough room inside the region to accommodate its member shapes.
It should be understood that an entry node 1110 can be offset from its parent in two directions. The entry node 1110 may only be considered an entry node 1110 for one side of the region. As an example, if in diagram 1000, shape D were more to the left, shape E could be an entry node for either the top or left boundaries since it would be offset down and to the right from shape D. In this situation, the layout correction engine calculates outcomes for both possibilities and selects the one that leaves the shapes with the least overall deviation from the original dependency tree 600. Doing so represents the smallest change in the relative offsets between parents and children.
As mentioned above, there are scenarios in which a diagram user would like to make adjustments to the shapes within a diagram, but the diagram imposes specific constraints on the positioning of the shapes. One typical example is when the diagram includes a list of regions, or overlapping lists of regions. Another example includes shapes that are glued directly to other shapes without the use of connecting lines. Various embodiments that manage diagram layout correction under these types of constraints will be described in detail below with respect to
Turning now to
According to various embodiments, the conflict resolution rules allow for shapes to interleave one another in order to best utilize the available diagram space, which may minimize the distance that one or more shapes must be moved to resolve a conflict.
It should be understood that according to various embodiments of the disclosure provided herein, unconnected shapes may or may not participate in layout corrections. According to the embodiment shown in
Referring now to
Accordingly, the logical operations described with respect to the various flow diagrams herein are referred to variously as states operations, structural devices, acts, or modules. These operations, structural devices, acts and modules may be implemented in software, in firmware, in special purpose digital logic, and any combination thereof. It should also be appreciated that more or fewer operations may be performed than shown in the figures and described herein. These operations may also be performed in a different order than those described herein.
The routine 1300 begins at operation 1302, where the layout correction engine receives a layout correction request from the user. As discussed above, this request may be triggered from the user's selection of a control via a user interface or may be triggered from an action taken by the user when building or editing a diagram (i.e. inserting a shape). From operation 1302, the routine 1300 continues to operation 1304, where the layout correction engine creates the placement tree 500 that resolves any ambiguity in establishing parent-child relationships amongst the shapes in the diagram. The routine 1300 continues to operation 1306, where the layout correction engine creates the dependency tree 600 that establishes positional relationships between shapes.
From operation 1306, the routine 1300 continues to operation 1308, where the layout correction engine calculates the offsets of each shape from their corresponding dependent shapes according to the dependency tree 600. It should be appreciated that this operation may occur during the creation of the dependency tree 600 and stored as a part of the dependency tree 600. The routine 1300 continues from operation 1308 to operation 1310, where the layout correction engine selects the first shape from the dependency tree 600 that will require repositioning. At operation 1312, the layout correction engine determines whether the selected shape is an entry node 1110 of a region. If the selected shape is an entry node 1110, then the routine 1300 proceeds to operation 1314, where the layout correction engine designates the shape as such to be used in setting the region boundaries as discussed above. From operation 1314, the routine continues to operation 1316 and continues as described below.
If at operation 1312, the layout correction engine determines that the selected shape is not an entry node 1110, then the routine proceeds to operation 1316, where the layout correction engine positions the shape according to the layout rules. As described in detail above, positioning the shape includes utilizing the dependency tree 600 to determine the positional offset of a shape from another shape from which it depends. The routine 1300 continues from operation 1316 to operation 1318, where the layout correction engine determines whether the shape is an exit node 1112. If the shape is an exit node 1112, then the routine 1300 proceeds to operation 1320, where the layout correction engine sets and locks the region boundaries around the entry node 1110, the parent of the exit node 1112, and any intervening member shapes. As described above, the layout correction engine may attempt to minimize the region's boundaries. The routine 1300 then continues to operation 1322 from operation 1320 and proceeds as described below.
However, if at operation 1318, the layout correction engine determines that the selected shape is not an exit node 1112 of a region, then the routine 1300 proceeds to operation 1322, where the layout correction engine determines whether the selected shape is the last shape in the dependency tree 600. If the selected shape is not the last shape in the dependency tree 600, then the routine 1300 proceeds to operation 1324, where the layout correction engine advances to the next shape in the dependency tree 600 and the routine 1300 returns to operation 1312 and continues as described above. However, if at operation 1322, the layout correction engine determines that the selected shape is the last shape in the dependency tree 600, then the routine 1300 proceeds to operation 1326, where the layout correction engine determines if there are any conflicts. As described above, conflicts may arise when one or more shapes or regions overlap and when a shape or region overlaps a page break. It should be appreciated that the conflict resolution rules may define any type of layout characteristic as a conflict and provide logic as to how the conflict is to be resolved.
If the layout correction engine determines that none of the repositioned shapes create a conflict, then the routine 1300 proceeds to operation 1330 and continues as described below. However, if at operation 1326, the layout correction engine determines that one or more repositioned shapes create a conflict, then the routine 1300 proceeds to operation 1328, where the layout correction engine repositions one or more shapes according to the conflict resolution rules. From operation 1328, the routine 1300 continues to operation 1330, where the layout correction engine determines whether there is a conflict corresponding to or within any regions. If there is not a region conflict, then the routine 1300 ends.
However, if the layout correction engine determines that there is a region conflict, then the routine 1300 proceeds to operation 1332, where the layout correction engine repositions one or more regions, or shapes within one or more regions, according to the conflict resolution rules. As described above, according to various embodiments, regional boundaries and shape membership issues are resolved during the shape placement process, which eliminates or minimizes conflicts of these types after the layout corrections have been made. For this reason, most region conflicts will occur as a result of a region overlapping a shape or from a shape overlapping a region after the layout corrections. After resolving the region conflicts at operation 1332, the routine 1300 ends.
As mentioned above, there are scenarios in which a diagram user would like to make adjustments to the shapes within a diagram layout, but the position of one or more shapes within the diagram is constrained due to region considerations. For example, it may be desirable that shapes within regions remain bound by the regions after layout is complete and that shapes not within a region are not added to a region as a result of a layout activity. Moreover, while regions can be moved and resized themselves, similar to the member shapes contained within, regions may also provide additional constraints on diagram layout. These constraints may include interior or exterior heading areas at one or more sides of the regions where member shapes are not to be placed, and margins around an interior or exterior perimeter of the regions that may further constrain diagram layout, such as allowing shapes to remain in the margin during layout or disallowing shapes to be added to the margin during layout.
A typical example of a diagram includes a list of regions, or overlapping lists of regions. With lists of regions, shapes are often placed within the various regions and interconnected within the regions and between regions. A list of regions may include any number of containers that abut one another to create a “list” of containers or regions. One embodiment that illustrates a list of regions is shown in
Because users of CFFs are often particularly sensitive to changes in the size and positioning of swimlanes and phases within the diagram, embodiments providing layout correction to lists of regions will be described in the context of CFFs. It should be understood, however, that the concepts presented herein with respect to correcting diagram layouts that include lists of regions are not limited to use with a CFF. Rather, any diagram having multiple adjacent regions, or lists of regions, may be manipulated in the manner described below.
Looking at
Without the constraints discussed above that are specific to the list of regions 1400, a layout correction to the list of regions 1400 might result in shape D being placed closer to shape C, which could unexpectedly reduce the size of region 1404 and/or expand the size of region 1406. Shape F might normally be placed close to shape E, but this could cause region 1408 to expand or move and otherwise interfere with regions 1406 and 1404. Instead, as seen in the corrected list of regions 1402 shown in
So, looking at
Generally, shape layout within lists of regions is accomplished by predicting the ideal results and using those results as constraints on the actual shape placement in order to provide a desired corrected layout while minimizing the changes made to the regions. To do this, the layout correction engine first analyzes the subsets of shapes in the placement tree 500 for each region, which are herein referred to as segments. For example, there are three segments within the list of regions 1400. The first segment includes shapes A, B, C, and E. The second segment includes shape D and the third segment includes shape F. The spacing considerations of each region are then considered according to the desired layout of the corresponding segments, taking into account constraints such as margins and headings. These layout predictions are then aggregated across the list of regions and used to constrain shape positions when performing the corrected layout.
Referring now to
At operation 1504, the layout correction engine identifies the first segment as including shapes A, B, C, and E since those shapes are members of the first swimlane, or region 1404. The routine 1500 continues from operation 1504 to operation 1506, where the layout correction engine determines the desired layout of the shapes of the first segment, without accounting for the constraints provided by any of the regions 1404, 1406, or 1408. The predicted layout of the segment shapes may be determined in a manner as described above with respect to the various embodiments, utilizing placement and dependency trees and layout rules. In this example, the shapes A, B, C, and E are to be evenly spaced from one another.
From operation 1506, the routine 1500 continues to operation 1508, where the layout correction engine creates a bounding box 1420 that encloses all of the shapes within the first segment. As seen in
In utilizing the bounding box 1420 concept, embodiments described herein improve the accuracy of the final layout. Using the layout concepts and capabilities described above, each segment can be separately laid out conceptually to create an estimation of the desired layout for that segment of shapes, which may be represented by the bounding box 1420. The layout correction engine may then create and utilize the bounding box 1420 for each segment to predict the final diagram layout and correct any broader conflicts prior to placing the shapes of the diagram. In this manner, the optimal layouts of the local, segment shapes are preserved while laying out the entire diagram.
Once the bounding box 1420 is created at operation 1508, the routine 1500 continues to operation 1510, where any corrections to the region are predicted based on the constraints of the region and the size and location of the bounding box 1420. Looking at the example shown in
Accordingly, for a list of regions, the layout correction engine may calculate the minimum additional spacing around the bounding box 1420 along an axis aligned with a flow direction of the list of regions, accounting for the margins 1412 of the regions, headings 1410 of the regions, spacing between shapes in each segment and shapes outside of the segment, and existing excess spacing in the regions along the axis of the list's flow direction. For a given segment, this analysis predicts shape positions and region boundary positions. According to various embodiments, if the predicted location of any of the region's boundaries would make the region smaller in that direction compared to the location before the layout correction, then the original position is to be used. Doing so prevents substantial compression or resizing of regions that may be contrary to a user's intent.
The routine 1500 continues from operation 1510 to operation 1512, where the layout correction engine determines whether the current region being analyzed for layout corrections is the last region in the list of regions. If not, then the routine 1500 returns to operation 1506 and the layout correction engine predicts the corrected layout of the next segment and corresponding region along the flow direction of the diagram as described above. However, if the layout correction engine determines at operation 1512 that the current region is the last region in the list of regions, then the routine proceeds to operation 1514.
It should be understood that the list of regions may include overlapping lists of regions, as shown in
Returning to
Turning now to
However, when the diagram includes one or more regions that provide constraints on the positioning of the member shapes, then the layout correction engine may have difficulty, without the concepts discussed below, in building acceptable trees that will result in the rotation or flipping of a CFF or other list of regions in a manner that minimizes any changes to the regions within the diagram. Accordingly, to guide the size and position of the regions and shapes, virtual nodes are established at the corners of the regions and are integrated into the placement and dependency tree construction. The requested rotation or flip action may then be performed with the transformed virtual nodes indicating the desired positions of the corners of each region. As will become clear from the example described below with respect to
Looking at
According to one embodiment of this disclosure, in order to maintain the sizing and positioning of the regions during rotation, the layout correction engine creates the virtual nodes 1614, which are located at the corners of the regions along at least two sides of the diagram. These virtual nodes 1614 have been numbered V1-V6, starting at the upper left corner of the first region 1604, down the vertical side of the grid through the first list of regions 1604, 1606, and 1608, and then across the horizontal side of the grid through the second list of regions 1610 and 1612. It should be appreciated that other numbering conventions are contemplated and that this disclosure is not limited to the specific locations and number of virtual nodes utilized by the layout correction engine. For example, according to other embodiments, the numbering convention for the virtual nodes 1614 could begin at any other corner of the overlapping list of regions 1600 and traverse either side of the grid, as well as the top or bottom sides of the grid.
Turning to
From operation 1804, the routine 1800 continues to operation 1806, where the placement tree is built. After building the corresponding dependency tree at operation 1808, the layout correction engine lays out the rotated or flipped overlapping list of regions according to the dependency tree and applicable layout rules at operation 1810. The routine 1800 continues to operation 1812, where the layout correction engine resolves any conflicts using the conflict resolution rules, and the routine 1800 ends.
As mentioned briefly above, there are scenarios in which a diagram user would like to make adjustments to the shapes within a diagram layout, but the position of one or more shapes within the diagram is constrained due the type of connection between shapes. More specifically, the diagramming application may allow a user to directly glue a shape to a connection point on another shape without the use of a connecting line. One example of this type of connection is shown in
According to some embodiments discussed above, the layout correction engine would avoid overlapping shapes when placing them. However, in some situations, shape overlap is desirable. One illustrative implementation includes business process modeling notation (“BPMN”) diagrams. Creators of BPMN and other diagrams can glue shapes to other shapes so that the overlapping shape follows the overlapped shape if the latter is moved. It would be undesirable in these situations for the layout correction engine to pull an overlapping shape from the overlapped shape to which it is glued when making layout corrections.
The concepts presented herein allow for layout corrections while maintaining the positioning of overlapping shapes with respect to one another. To do so, the layout correction engine classifies and prioritizes the connections in a diagram to determine the appropriate parent-child relationships and the order in which a given shape's children are processed. According to various embodiments, if a connection exists between shapes via a connecting line, then the connection is classified as a 1-D connection since the connection is accomplished using a one dimensional line. If a connection exists between shapes without the use of a connecting line, it is classified as a 2-D connection since the connection is accomplished directly between a pair of two dimensional shapes. As will be described below, these connections are further prioritized, which aids the layout correction engine in determining which connections take precedence when performing layout corrections such as spacing.
First, however,
It should be noted that for glued overlapping shapes, such as the 2-D connection between shapes B and C, the layout correction engine maintains the positioning of the overlapping shape on the overlapped shape to which it is glued. For example, as seen in
As stated above, the layout correction engine prioritizes the connections after classifying them as 1-D or 2-D. According to various embodiments, before prioritization, each connection is further classified as major or minor. To determine whether a connection is major or minor, the overall flow direction of the diagram is first determined with respect to the shapes participating in the layout. One method for determining a flow direction is according to the dimensions of a bounding box surrounding the participating shapes. The process flows in a direction from the root shape of the diagram in the direction of the longest side of the bounding box. With respect to
With respect to a 2-D connection, the overlapping shape may be considered the source shape that is glued to the overlapped shape, or target shape. A 2-D connection from a source shape to a target shape is considered major, while a 2-D connection from the target shape to the source shape is considered minor. According to one embodiment, when determining parent-child relationships and the order in which child shapes are processed, the following prioritization is used:
1) 2-D major connection
2) 1-D major connection
3) 1-D minor connection
4) 2-D minor connection
Looking again at
Turning to
Utilizing the concepts described herein, the layout correction engine might adjust the diagram 2100 using these connection classifications and prioritization to arrive at the corrected diagram 2102 shown in
To understand how the layout correction engine arrived at the corrected layout shown in diagram 2102, placement trees 2200 and 2202 shown in
However, utilizing the connection classification and prioritization implementation described above, the fact that shape D has two potential parents (shape A and shape C) would be resolved so that shape D depends from shape C as its parent as shown in the placement tree 2202 shown in
It should be appreciated that the present disclosure is not limited to the precise number and types of classifications and prioritizations described herein. Rather the examples given within this disclosure are to be construed as examples of a classification and prioritization technique that may be used by the layout correction engine to allow for the use of the layout correction techniques described above to provide a desirable result that is intended by the user.
Turning now to
The routine 2300 continues from operation 2306 to operation 2308, where the layout correction engine builds the appropriate placement and dependency trees, taking into account the connection priorities established at operation 2306. The routine 2300 continues to operation 2310, where the corrected layout is provided according to the dependency tree. Any conflicts are resolved according to conflict resolution rules at operation 2312, and the routine 2300 ends.
The computer architecture shown in
The mass storage device 2410 is connected to the CPU 2402 through a mass storage controller (not shown) connected to the bus 2404. The mass storage device 2410 and its associated computer-readable media provide non-volatile storage for the computer 2400. Although the description of computer-readable media contained herein refers to a mass storage device, such as a hard disk or CD-ROM drive, it should be appreciated by those skilled in the art that computer-readable media can be any available computer storage media that can be accessed by the computer 2400.
By way of example, and not limitation, computer-readable media may include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer-readable instructions, data structures, program modules or other data. For example, computer-readable media includes, but is not limited to, RAM, ROM, EPROM, EEPROM, flash memory or other solid state memory technology, CD-ROM, digital versatile disks (“DVD”), HD-DVD, BLU-RAY, or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by the computer 2400.
According to various embodiments, the computer 2400 may operate in a networked environment using logical connections to remote computers through a network such as the network 2420. The computer 2400 may connect to the network 2420 through a network interface unit 2406 connected to the bus 2404. It should be appreciated that the network interface unit 2406 may also be utilized to connect to other types of networks and remote computer systems. The computer 2400 may also include an input/output controller 2412 for receiving and processing input from a number of other devices, including a keyboard, mouse, or electronic stylus (not shown in
As mentioned briefly above, a number of program modules and data files may be stored in the mass storage device 2410 and RAM 2414 of the computer 2400, including an operating system 2418 suitable for controlling the operation of a networked desktop, laptop, or server computer. The mass storage device 2410 and RAM 2414 may also store one or more program modules. In particular, the mass storage device 2410 and the RAM 2414 may store a diagramming application 2422, the layout correction engine 2424, the conflict resolution rules 2426, the layout rules 2428, the placement tree rules 2430, and the dependency tree rules 2432, each of which was described in detail above. The mass storage device 2410 and the RAM 2414 may also store other types of program modules.
Based on the foregoing, it should be appreciated that technologies for correcting diagram layouts are provided herein. Utilizing the concepts disclosed above, a user will be able to enjoy multi-directional alignment and spacing of shapes in a diagram. The layout correction processes may occur automatically as the diagram is built or edited, through the selection of a single control, or through a minimal combination of controls, rather than requiring the user to manually nudge shapes around the diagram in an effort to clean up misalignments and uneven spacing. By repositioning shapes according to the current layout and offset between shapes, the embodiments provided herein can make minor corrections without destroying the general layout as created by the user. Specifically, using concepts described herein, region and shape correction involving complex constraints, such as those involving lists of regions and direct connection of shapes to other shapes and regions, may be provided in a manner that maintains the integrity of the diagram being adjusted to most closely satisfy the intent and desire of the user.
Although the subject matter presented herein has been described in language specific to computer structural features, methodological acts, and computer readable media, it is to be understood that the invention defined in the appended claims is not necessarily limited to the specific features, acts, or media described herein. Rather, the specific features, acts and mediums are disclosed as example forms of implementing the claims.
The subject matter described above is provided by way of illustration only and should not be construed as limiting. Various modifications and changes may be made to the subject matter described herein without following the example embodiments and applications illustrated and described, and without departing from the true spirit and scope of the present invention, which is set forth in the following claims.
This application is a continuation-in-part of co-pending U.S. utility application entitled “Correcting Positions of Shapes in a Diagram,” having Ser. No. 12/024,084, filed Jan. 31, 2008, which is entirely incorporated herein by reference.
Number | Name | Date | Kind |
---|---|---|---|
4933865 | Yamamoto et al. | Jun 1990 | A |
4953106 | Gansner et al. | Aug 1990 | A |
5437008 | Gay et al. | Jul 1995 | A |
5588108 | Kumar et al. | Dec 1996 | A |
5745122 | Gay et al. | Apr 1998 | A |
6374200 | Nakagawa | Apr 2002 | B1 |
6792593 | Takashima et al. | Sep 2004 | B2 |
7428724 | Pike et al. | Sep 2008 | B2 |
7555710 | Kobashi et al. | Jun 2009 | B2 |
7634725 | Nishikawa | Dec 2009 | B2 |
8332750 | Banyasad | Dec 2012 | B2 |
8489984 | Violet et al. | Jul 2013 | B1 |
8717383 | Coldicott | May 2014 | B2 |
8847986 | Theophil | Sep 2014 | B2 |
9128733 | Taron | Sep 2015 | B2 |
20030222921 | Rummel | Dec 2003 | A1 |
20060005158 | Pike et al. | Jan 2006 | A1 |
20060136825 | Cory et al. | Jun 2006 | A1 |
20060150168 | Mitchell et al. | Jul 2006 | A1 |
20060200759 | Agrawala | Sep 2006 | A1 |
20060209084 | Wong et al. | Sep 2006 | A1 |
20060209085 | Wong et al. | Sep 2006 | A1 |
20060253796 | Wang et al. | Nov 2006 | A1 |
20070089080 | Sakuraba | Apr 2007 | A1 |
20070103468 | Saini et al. | May 2007 | A1 |
20070162844 | Woodall et al. | Jul 2007 | A1 |
20070168858 | Gerhard et al. | Jul 2007 | A1 |
20070208996 | Berkner et al. | Sep 2007 | A1 |
20070266307 | Panditharadhya et al. | Nov 2007 | A1 |
20080012859 | Saillet et al. | Jan 2008 | A1 |
20080068398 | Nickolayev et al. | Mar 2008 | A1 |
20080282188 | Hays et al. | Nov 2008 | A1 |
20090089660 | Atkins et al. | Apr 2009 | A1 |
Number | Date | Country |
---|---|---|
1607522 | Apr 2005 | CN |
Entry |
---|
U.S. Notice of Allowance dated Mar. 13, 2013 in U.S. Appl. No. 12/024,084. |
U.S. Official Action dated Apr. 12, 2012 in U.S. Appl. No. 12/024,084. |
“Lay Out Shapes Automatically” Visio 2007 Nov. 9, 2006, downloaded from http://office.microsoft.com/en-us/visio-help/lay-out-shapes-automatically-HP001231170.aspx, 2 pp. |
U.S. Official Action dated Oct. 15, 2012 in U.S. Appl. No. 12/024,084. |
Seybold, et al., “An Effective Layout Adaptation Technique for a Graphical Modeling Tool”, Proceedings of the 25th International Conference on Software Engineering (ICSE'03), IEEE Computer Society 2003. pp. 2. |
“ConceptDraw 7 Pro for Mac”, BestShareware.net, 2007, pp. 1-4. |
Korotkov, “Automatic Layout of State Diagrams”, pp. 1-6. |
U.S. Official Action dated Oct. 28, 2011 in U.S. Appl. No. 12/024,084. |
“Tutorial: Modifying a container to support automatic layout”, Aug. 11, 2005, Graphical Modeling Framework, downloaded from http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.gmf.doc/tutorials/diagram/automaticLayout.html, 4 pages. |
Seybold, et al., “An Effective Layout Adaptation Technique for a Graphical Modeling Tool,” May 3-10, 2003, Proceedings of the 25th International Conference on Software Engineering (ICSE'03), 2 pages. |
Korotkov, “Automatic Layout of State Diagrams”, retrieved Jan. 17, 2008, from http://unimod.sourceforge.net/articies/glavout.pdf, pp. 1-6. |
Chinese Office Action mailed Nov. 4, 2014 for Chinese patent application No. 201110050518.2, a counterpart foreign application of U.S. Appl. No. 12/712,194, 13 pages. |
Chinese Office Action mailed Jun. 11, 2015 for Chinese patent application No. 201110050518.2, a counterpart foreign application of U.S. Appl. No. 12/712,194, 15 pages. |
Translated Chinese Office Action mailed Dec. 14, 2015 for Chinese patent application No. 201110050518.2, a counterpart foreign application of U.S. Appl. No. 12/712,194, 13 pages. |
Number | Date | Country | |
---|---|---|---|
20100153841 A1 | Jun 2010 | US |
Number | Date | Country | |
---|---|---|---|
Parent | 12024084 | Jan 2008 | US |
Child | 12712194 | US |