Changeset 32177 in osm for applications/editors/josm/plugins/roadsigns/src/org/openstreetmap
- Timestamp:
- 2016-05-13T21:25:10+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignInputDialog.java
r30738 r32177 24 24 import java.io.IOException; 25 25 import java.util.ArrayList; 26 import java.util.Arrays; 26 27 import java.util.Collection; 27 28 import java.util.Collections; … … 67 68 import org.openstreetmap.josm.data.osm.OsmPrimitive; 68 69 import org.openstreetmap.josm.gui.ExtendedDialog; 69 import org.openstreetmap.josm.gui.widgets.MultiSplitLayout; 70 import org.openstreetmap.josm.gui.widgets.MultiSplitLayout.Divider; 71 import org.openstreetmap.josm.gui.widgets.MultiSplitLayout.Leaf; 70 72 import org.openstreetmap.josm.gui.widgets.MultiSplitLayout.Node; 73 import org.openstreetmap.josm.gui.widgets.MultiSplitLayout.Split; 71 74 import org.openstreetmap.josm.gui.widgets.MultiSplitPane; 72 75 import org.openstreetmap.josm.plugins.roadsigns.RoadSignsPlugin.PresetMetaData; … … 179 182 180 183 private JComponent buildSignsPanel() { 181 String layoutDef =182 "(COLUMN "+183 "(ROW weight=0.3 (LEAF name=upperleft weight=1.0) upperright) "+184 "(ROW weight=0.5 (LEAF name=middleleft weight=0.5) (LEAF name=middleright weight=0.5)) "+185 "(LEAF name=bottom weight=0.2))";186 187 184 FlowLayout fLayout = new FlowLayout(FlowLayout.LEFT); 188 185 fLayout.setAlignOnBaseline(true); … … 201 198 multiSplitPane.getMultiSplitLayout().setModel(model); 202 199 multiSplitPane.getMultiSplitLayout().setFloatingDividers(false); 203 } catch (Exception ex) { 204 Node modelRoot = MultiSplitLayout.parseModel(layoutDef); 200 } catch (IOException ex) { 201 // (COLUMN 202 // (ROW weight=0.3 (LEAF name=upperleft weight=1.0) upperright) 203 // (ROW weight=0.5 (LEAF name=middleleft weight=0.5) (LEAF name=middleright weight=0.5)) 204 // (LEAF name=bottom weight=0.2)) 205 206 Split modelRoot = new Split(); 207 modelRoot.setRowLayout(false); 208 209 Split row1 = new Split(); 210 row1.setWeight(0.3); 211 Leaf upperleft = new Leaf("upperleft"); 212 upperleft.setWeight(1.0); 213 row1.setChildren(Arrays.asList(upperleft, new Divider(), new Leaf("upperright"))); 214 215 Split row2 = new Split(); 216 row2.setWeight(0.5); 217 Leaf middleleft = new Leaf("middleleft"); 218 middleleft.setWeight(0.5); 219 Leaf middleright = new Leaf("middleright"); 220 middleright.setWeight(0.5); 221 row2.setChildren(Arrays.asList(middleleft, new Divider(), middleright)); 222 223 Leaf bottom = new Leaf("bottom"); 224 bottom.setWeight(0.2); 225 226 modelRoot.setChildren(Arrays.asList(row1, new Divider(), row2, new Divider(), bottom)); 227 205 228 multiSplitPane.getMultiSplitLayout().setModel(modelRoot); 206 229 }
Note:
See TracChangeset
for help on using the changeset viewer.