Changeset 969


Ignore:
Timestamp:
10/20/15 11:44:16 (9 years ago)
Author:
bln4
Message:

Added a rule to deal with the combination of daisy chaining and multiple arrows heading into one box.

The issue: with multiple arrows going into the same box we have the possibility of creating infinite loops.

The ideal solution: only follow the second arrow into a box if we can detect that no loop occurs.

The current solution: we only follow the second arrow into a box if that box does not have a exiting arrow.

What this means:
(+) We can have multiple arrows going into a single box safely
(+) Daisy chaining cannot cause a infinite loop
(-) We cannot repeat a daisy chained set of boxes. In other words; if we have a series of boxes connected by arrows; even if they don't form a loop; only one arrow going into the first of the boxes is followed; others are ignored.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/io/flowlayout/XGroupItem.java

    r968 r969  
    453453                                                if (xgroup_item != this) {
    454454                                                       
    455                                                         if(out_of_flow.contains(xgroup_item)) continue;
     455                                                        if(out_of_flow.contains(xgroup_item)) {
     456                                                                final Collection<Item> remaining_dots = new ArrayList<Item>(xgroup_item.remaining_item_list);
     457                                                                boolean hasExit = false;
     458                                                                for(final Item i : remaining_dots) {
     459                                                                        final List<Line> lines = i.getLines();
     460                                                                        if(lines.size() == 1 && lines.get(0).getStartItem() == i) {
     461                                                                                hasExit = true;
     462                                                                                break;
     463                                                                        }
     464                                                                }
     465                                                                if(hasExit) continue;
     466                                                        }
    456467                                                       
    457468                                                        out_of_flow.add(xgroup_item);
     
    519530        public void repositionOutOfFlowGroups(XGroupItem toplevel_xgroup)
    520531        {
    521                 Collection<XGroupItem> out_of_flow = new HashSet<XGroupItem>();
     532//              Collection<XGroupItem> out_of_flow = new HashSet<XGroupItem>();
     533                Collection<XGroupItem> out_of_flow = new ArrayList<XGroupItem>();
    522534
    523535                repositionOutOfFlowGroupsRecursive(toplevel_xgroup,out_of_flow);
Note: See TracChangeset for help on using the changeset viewer.