Show
Ignore:
Timestamp:
07/25/08 06:49:03 (6 months ago)
Author:
risto.yrjana@…
Message:

Corrected rendering order, works in Safari but broken in FF

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • incubator/widgets/coordinatelayout/src/com/itmill/toolkit/tests/tickets/Ticket1267.java

    r4980 r5117  
    77import com.itmill.toolkit.data.Property.ValueChangeListener; 
    88import com.itmill.toolkit.ui.CheckBox; 
     9import com.itmill.toolkit.ui.Component; 
    910import com.itmill.toolkit.ui.CoordinateLayout; 
    1011import com.itmill.toolkit.ui.GridLayout; 
     
    1920public class Ticket1267 extends Application { 
    2021 
    21     final int[] values = new int[6]; 
    2222    final CoordinateLayout layout = new CoordinateLayout(); 
    23     final Table table = new Table(); 
    24  
    25     public void updateCoords() { 
    26         Coordinates newCoord = layout.new Coordinates(values[0], values[1], 
    27                 values[2], values[3], values[4], values[5]); 
    28         newCoord.setUnitsPercent(true, true, true, true, true, true); 
    29         layout.setCoordinates(table, newCoord); 
    30     } 
     23    Table table = new Table("Test table"); 
    3124 
    3225    public void init() { 
     
    3528 
    3629        SplitPanel sPanel = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL); 
    37         Panel right = new Panel(); 
    38  
    39         final GridLayout rightLayout = new GridLayout(3, 6); 
    4030 
    4131        table.setPageLength(10); 
     
    6555        table.setSizeFull(); 
    6656        layout.addComponent(table); 
     57        layout.setCoordinates(table, layout.new Coordinates("0,-1,-1,0,-1,-1")); 
    6758 
    6859        Coordinates xy1 = layout.new Coordinates("0, -1, -1, 0, 20%, -1"); 
     
    9586         */ 
    9687 
     88        sPanel.addComponent(layout); 
     89 
     90        sPanel.addComponent(getControlPanel(table)); 
     91 
     92        sPanel.setSplitPosition(75); 
     93 
     94        main.setLayout(sPanel); 
     95        setMainWindow(main); 
     96    } 
     97 
     98    public Panel getControlPanel(final Component c) { 
     99        Panel newPanel = new Panel("Controls for " + c.getCaption()); 
     100        newPanel.setLayout(new GridLayout(3, 6)); 
     101 
     102        final int[] values = new int[6]; 
    97103        Arrays.fill(values, -1); 
    98104 
     
    139145                        sliderArray[j].setEnabled(false); 
    140146                        labelArray[j].setEnabled(false); 
    141                         updateCoords(); 
     147 
     148                        Coordinates newCoord = layout.new Coordinates( 
     149                                values[0], values[1], values[2], values[3], 
     150                                values[4], values[5]); 
     151                        newCoord.setUnitsPercent(true, true, true, true, true, 
     152                                true); 
     153                        layout.setCoordinates(c, newCoord); 
    142154                    } 
    143155                } 
     
    148160                    Double newValue = (Double) event.getProperty().getValue(); 
    149161                    values[j] = (int) newValue.doubleValue(); 
    150                     updateCoords(); 
     162 
     163                    Coordinates newCoord = layout.new Coordinates(values[0], 
     164                            values[1], values[2], values[3], values[4], 
     165                            values[5]); 
     166                    newCoord 
     167                            .setUnitsPercent(true, true, true, true, true, true); 
     168                    layout.setCoordinates(c, newCoord); 
    151169                    labelArray[j].setValue(new Integer(values[j])); 
    152170                } 
     
    155173 
    156174        for (int i = 0; i < sliderArray.length; i++) { 
    157             rightLayout.addComponent(checkBoxArray[i]); 
    158             rightLayout.addComponent(sliderArray[i]); 
    159             rightLayout.addComponent(labelArray[i]); 
     175            newPanel.addComponent(checkBoxArray[i]); 
     176            newPanel.addComponent(sliderArray[i]); 
     177            newPanel.addComponent(labelArray[i]); 
    160178        } 
    161179 
    162         sPanel.addComponent(layout); 
    163         right.setLayout(rightLayout); 
    164         sPanel.addComponent(right); 
    165  
    166         sPanel.setSplitPosition(75); 
    167  
    168         main.setLayout(sPanel); 
    169         setMainWindow(main); 
     180        return newPanel; 
    170181    } 
    171182}