- Timestamp:
- 04/23/14 11:10:21 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/io/flowlayout/XGroupItem.java
r908 r910 23 23 { 24 24 enum FlowType { in_flow, out_of_flow_original, out_of_flow_faked_position }; 25 25 26 26 class MultiArrowHeadComparable implements Comparator<Item>{ 27 27 … … 111 111 112 112 XRawItem x_raw_item = new XRawItem(text_item); 113 // overspill can occur (and is acceptable) when raw-text item spills out of enclosing shape (such as a rectangle) 113 114 mapInItem(x_raw_item); 114 115 } … … 222 223 223 224 if ((y_index<0) || (y_index>=yitems_span_array.length)) { 224 int y_top = getBoundingYTop(); 225 int y_bot = y_top + yitems_span_array.length -1; 226 System.err.println("Error in getYOverlappingItemsSpan(): index out of bounds for value " + y); 227 System.err.println(" => Operation mapped into local array: y-top=" + y_top + ", y-bot=" + y_bot); 225 int y_top = getBoundingYTop(); 226 int y_bot = y_top + yitems_span_array.length -1; 227 228 System.err.println("Error in getYOverlappingItemsSpan(): index out of bounds for value " + y); 229 System.err.println(" => Operation mapped into local array: y-top=" + y_top + ", y-bot=" + y_bot); 230 228 231 return null; 229 232 } … … 231 234 } 232 235 236 protected int cropToTop(int y) { 237 int y_index = y - getBoundingYTop(); 238 239 if (y_index<0) { 240 y = getBoundingYTop(); 241 } 242 243 return y; 244 } 245 246 protected int cropToBot(int y) { 247 int y_index = y - getBoundingYTop(); 248 249 if (y_index>=yitems_span_array.length) { 250 y = getBoundingYBot(); 251 } 252 253 return y; 254 } 255 233 256 public void setYOverlappingItemsSpan(int y,YOverlappingItemsSpan yitems_span) 234 257 { … … 236 259 237 260 if ((y_index<0) || (y_index>=yitems_span_array.length)) { 238 int y_top = getBoundingYTop(); 239 int y_bot = y_top + yitems_span_array.length -1; 240 System.err.println("Error in setYOverlappingItemsSpan(): index out of bounds for value " + y); 241 System.err.println(" => Operation mapped into local array: y-top=" + y_top + ", y-bot=" + y_bot); 261 262 int y_top = getBoundingYTop(); 263 int y_bot = y_top + yitems_span_array.length -1; 264 265 System.err.println("Error in setYOverlappingItemsSpan(): index out of bounds for value " + y); 266 System.err.println(" => Operation mapped into local array: y-top=" + y_top + ", y-bot=" + y_bot); 267 242 268 return; 243 269 } … … 577 603 Point pt_to_check = new Point(item_to_check.getX(),item_to_check.getY()); 578 604 579 if (area_enclosed_polygon.isPerim ieterPoint(pt_to_check)) {605 if (area_enclosed_polygon.isPerimeterPoint(pt_to_check)) { 580 606 items_on_perimeter.add(item_to_check); 581 607 } … … 652 678 653 679 // Filter out enclosed-items points that are part of the polygon's perimeter 654 if (area_polygon.isPerim ieterPoint(enclosed_item.getPosition())) {680 if (area_polygon.isPerimeterPoint(enclosed_item.getPosition())) { 655 681 enclosed_item_list.remove(i); 656 682 } … … 678 704 679 705 for (int y=yt; y<=yb; y++) { 680 setYOverlappingItemsSpan(y,y_span_shadow); 706 707 setYOverlappingItemsSpan(y,y_span_shadow); 681 708 } 682 709 } … … 700 727 // Our shadow has run into another top-edged zone 701 728 // => need to extend the shadow to include this zone as well 702 // (making this encountered top-edge obsolete 729 // (making this encountered top-edge obsolete) 703 730 704 731 // Merge the newly encountered top-line in with the current one … … 741 768 int yb = xitem.getBoundingYBot(); 742 769 770 // top-edge over-spill can occur (and is acceptable) when (for example) the given xitem is a raw-text item 771 // that doesn't neatly fit in an enclosed area (i,e., is poking out the top of an enclosing rectangle) 772 yt = cropToTop(yt); // Only changes yt if in an over-spill situation 773 774 // similarly, bottom-edge over-spill can occur (and is acceptable) with a less than precise placed raw-text item 775 yb = cropToBot(yb); // Only changes yb if in an over-spill situation 776 743 777 // Merge into 'items_span' checking for overlaps (based on xitem's y-span) 744 778 … … 794 828 795 829 // Effectively after the shadow reference lookup this is the same 796 // as the above, with the need to worry about Step 2 (as no move is needed)830 // as the above, without the need to worry about Step 2 (as no move is needed) 797 831 798 832 YOverlappingItemsShadow y_item_span_shadow = (YOverlappingItemsShadow)item_span; … … 827 861 828 862 YOverlappingItemsTopEdge y_item_span_top_edge = new YOverlappingItemsTopEdge(xitem_line); 863 829 864 setYOverlappingItemsSpan(yt,y_item_span_top_edge); 830 865 831 866 castShadowIntoEmptySpace(y_item_span_top_edge, yt+1, yb); 832 833 867 } 834 868
Note:
See TracChangeset
for help on using the changeset viewer.