Changeset 5258 for incubator/widgets/coordinatelayout/src/com/itmill/toolkit/tests/tickets/Ticket1267.java
- Timestamp:
- 08/25/08 10:51:54 (5 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
incubator/widgets/coordinatelayout/src/com/itmill/toolkit/tests/tickets/Ticket1267.java
r5215 r5258 14 14 import com.itmill.toolkit.ui.GridLayout; 15 15 import com.itmill.toolkit.ui.Label; 16 import com.itmill.toolkit.ui.Layout; 16 17 import com.itmill.toolkit.ui.OrderedLayout; 17 18 import com.itmill.toolkit.ui.Panel; 19 import com.itmill.toolkit.ui.Select; 18 20 import com.itmill.toolkit.ui.Slider; 19 21 import com.itmill.toolkit.ui.Table; … … 23 25 public class Ticket1267 extends Application { 24 26 25 final CoordinateLayout layout = new CoordinateLayout();27 final CoordinateLayout coordinateLayout = new CoordinateLayout(); 26 28 27 29 public void init() { … … 32 34 // SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL); 33 35 34 layout.setBorders(true); 36 coordinateLayout.setMargin(true); 37 coordinateLayout.setMargin(true, true, true, true); 35 38 36 39 // Setup table … … 60 63 } 61 64 62 layout.addComponent(table); 63 table.setSizeFull(); 64 layout.setCoordinates(table, new CoordinateLayout.Coordinates( 65 "0,0,0,0,-1,-1")); 65 coordinateLayout.addComponent(table); 66 coordinateLayout.setCoordinates(table, 67 new CoordinateLayout.Coordinates("0,0,-1,-1")); 66 68 67 69 CoordinateLayout.Coordinates xy = new CoordinateLayout.Coordinates(40, … … 69 71 xy.setUnitsPercent(true, true, true, true, false, false); 70 72 71 layout.addComponent(72 new TextField("Caption","TextField with a caption"), xy);73 coordinateLayout.addComponent(new TextField("Caption", 74 "TextField with a caption"), xy); 73 75 74 76 final DateField dateField = new DateField("Removal test"); 75 layout.addComponent(dateField);77 // coordinateLayout.addComponent(dateField); 76 78 77 79 final Panel panel = new Panel("TestPanel"); 78 layout.addComponent(panel, "-1,0,0%,-1,-1,-1%"); 80 // coordinateLayout.addComponent(panel, "0,-1,-1,-1,-1,0"); 81 82 final Layout ol = new OrderedLayout(); 83 ol.addComponent(new Select("Select inside layouts", table 84 .getContainerDataSource())); 85 ol.addComponent(new Select("Select inside layouts", table 86 .getContainerDataSource())); 87 ol.addComponent(new Select("Select inside layouts", table 88 .getContainerDataSource())); 89 90 // CoordinateLayout.Coordinates xy2 = new CoordinateLayout.Coordinates( 91 // "-1,-1,0,0,200,200"); 92 // coordinateLayout.addComponent(ol, xy2); 79 93 80 94 Button b1 = new Button("Add contents to panel"); … … 93 107 public void buttonClick(Button.ClickEvent e) { 94 108 if (bottom) { 95 layout.sendToTop(panel);109 coordinateLayout.sendToTop(panel); 96 110 bottom = false; 97 111 } else { 98 layout.sendToBottom(panel);112 coordinateLayout.sendToBottom(panel); 99 113 bottom = true; 100 114 } … … 105 119 b3.addListener(new Button.ClickListener() { 106 120 public void buttonClick(Button.ClickEvent e) { 107 layout.setBorders(!layout.hasBorders());121 coordinateLayout.setBorders(!coordinateLayout.hasBorders()); 108 122 } 109 123 }); … … 113 127 public void buttonClick(Button.ClickEvent e) { 114 128 e.getButton().setEnabled(false); 115 layout.removeComponent(dateField);129 coordinateLayout.removeComponent(dateField); 116 130 } 117 131 }); … … 120 134 b5.addListener(new Button.ClickListener() { 121 135 public void buttonClick(Button.ClickEvent e) { 122 layout.requestRepaint();123 } 124 }); 125 126 // Setup layout for splitpanel136 coordinateLayout.requestRepaint(); 137 } 138 }); 139 140 // Setup coordinateLayout for right 127 141 OrderedLayout right = new OrderedLayout(); 128 142 right.addComponent(getControlPanel(table)); … … 134 148 right.addComponent(b5); 135 149 136 // sPanel.addComponent( layout);150 // sPanel.addComponent(coordinateLayout); 137 151 // sPanel.addComponent(right); 138 152 // … … 143 157 ExpandLayout mainLayout = new ExpandLayout( 144 158 ExpandLayout.ORIENTATION_HORIZONTAL); 145 mainLayout.addComponent( layout);159 mainLayout.addComponent(coordinateLayout); 146 160 mainLayout.addComponent(right); 147 161 main.setLayout(mainLayout); … … 207 221 newCoord.setUnitsPercent(true, true, true, true, true, 208 222 true); 209 layout.setCoordinates(c, newCoord);223 coordinateLayout.setCoordinates(c, newCoord); 210 224 } 211 225 } … … 222 236 newCoord 223 237 .setUnitsPercent(true, true, true, true, true, true); 224 layout.setCoordinates(c, newCoord);238 coordinateLayout.setCoordinates(c, newCoord); 225 239 labelArray[j].setValue(new Integer(values[j])); 226 240 }
