This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 121525
Collapse All | Expand All

(-)Widget.java (+33 lines)
Line 338 Link Here
338
     * Reorders children within the child Widget array. Assists with z-order
339
     * operations on child Widgets.
340
     *
341
     * Child Widgets of parent are reordered in Array per the provided List of 
342
     * Integer
343
     *  
344
     * @param permutation List<Integer> consisting of new order. Each array slot
345
     * contains Integer value pointing to the old Objects index
346
     */
347
    public final void orderChildren(List<Integer> permutation) {
348
      
349
        assert permutation != null;
350
351
        if (parentWidget == null)
352
            return;
353
        List<Widget> widgets = parentWidget.children;
354
        
355
        assert permutation.size() == widgets.size();
356
        
357
        List<Widget> newOrder = new ArrayList<Widget>();
358
        for ( int j = 0 ; j < widgets.size(); j++) {
359
          Integer oldIndex = permutation.get(j);
360
          newOrder.add(widgets.get(oldIndex.intValue()));
361
        }
362
        
363
        widgets.clear();
364
        widgets.addAll(newOrder);
365
        
366
        revalidate ();
367
        parentWidget.revalidate ();
368
    }
369
    
370
    /**

Return to bug 121525