Ignore:
Timestamp:
10/11/08 00:11:49 (16 years ago)
Author:
bjn8
Message:

Added accurate position of tracks when anchored in groups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/items/ItemUtils.java

    r311 r365  
    964964
    965965        }
     966       
     967        /**
     968         * Extracts widgets from an item list.
     969         *
     970         * @param items
     971         *              Items to extract from. Must not be null.
     972         *
     973         * @return
     974         *              List of (unique)widgets in items. Never null.
     975         */
     976        public static List<InteractiveWidget> extractWidgets(List<Item> items) {
     977                assert(items != null);
     978               
     979                List<InteractiveWidget> iWidgets = new LinkedList<InteractiveWidget>();
     980               
     981                for (Item i : items) {
     982                        if (i instanceof WidgetEdge) {
     983                                WidgetEdge we = (WidgetEdge)i;
     984                                if (!iWidgets.contains(we.getWidgetSource()))
     985                                        iWidgets.add(we.getWidgetSource());
     986                        } else if (i instanceof WidgetCorner) {
     987                                WidgetCorner wc = (WidgetCorner)i;
     988                                if (!iWidgets.contains(wc.getWidgetSource()))
     989                                        iWidgets.add(wc.getWidgetSource());
     990                        }
     991                }
     992               
     993                return iWidgets;
     994        }
     995       
    966996}
Note: See TracChangeset for help on using the changeset viewer.