Changeset 8897 in josm
- Timestamp:
- 2015-10-18T18:31:16+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/SplitWayAction.java
r8886 r8897 7 7 8 8 import java.awt.Component; 9 import java.awt.Grid Layout;9 import java.awt.GridBagLayout; 10 10 import java.awt.event.ActionEvent; 11 11 import java.awt.event.KeyEvent; … … 46 46 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 47 47 import org.openstreetmap.josm.tools.CheckParameterUtil; 48 import org.openstreetmap.josm.tools.GBC; 48 49 import org.openstreetmap.josm.tools.Shortcut; 49 50 import org.openstreetmap.josm.tools.Utils; … … 231 232 232 233 setButtonIcons(new String[]{"ok", "cancel"}); 233 final JPanel pane = new JPanel(new Grid Layout(2, 1));234 pane.add(new JLabel(getTitle()) );235 pane.add(list );234 final JPanel pane = new JPanel(new GridBagLayout()); 235 pane.add(new JLabel(getTitle()), GBC.eol().fill(GBC.HORIZONTAL)); 236 pane.add(list, GBC.eop().fill(GBC.HORIZONTAL)); 236 237 setContent(pane); 237 238 } … … 258 259 public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { 259 260 final Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); 260 ((JLabel) c).setText(tr("Segment {0}: {1}", index + 1, DefaultNameFormatter.getInstance().format((Way) value))); 261 final String name = DefaultNameFormatter.getInstance().format((Way) value); 262 // get rid of id from DefaultNameFormatter.decorateNameWithId() 263 final String nameWithoutId = name.replaceAll(" \\[id: -?\\d+\\]$", ""); 264 ((JLabel) c).setText(tr("Segment {0}: {1}", index + 1, nameWithoutId)); 261 265 return c; 262 266 }
Note:
See TracChangeset
for help on using the changeset viewer.