Changeset 11017 in josm
- Timestamp:
- 2016-09-17T23:28:38+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/AbstractMergeAction.java
r10074 r11017 59 59 60 60 protected static Layer askTargetLayer(List<Layer> targetLayers) { 61 return askTargetLayer(targetLayers.toArray(new Layer[ 0]),61 return askTargetLayer(targetLayers.toArray(new Layer[targetLayers.size()]), 62 62 tr("Please select the target layer."), 63 63 tr("Select target layer"), -
trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java
r10714 r11017 12 12 import java.net.MalformedURLException; 13 13 import java.util.HashSet; 14 import java.util.List; 14 15 import java.util.Set; 15 16 … … 92 93 final WMSLayerTree tree = new WMSLayerTree(); 93 94 tree.updateTree(wms); 94 final JComboBox<String> formats = new JComboBox<>(wms.getFormats().toArray(new String[0])); 95 List<String> wmsFormats = wms.getFormats(); 96 final JComboBox<String> formats = new JComboBox<>(wmsFormats.toArray(new String[wmsFormats.size()])); 95 97 formats.setSelectedItem(wms.getPreferredFormats()); 96 98 formats.setToolTipText(tr("Select image format for WMS layer")); -
trunk/src/org/openstreetmap/josm/data/imagery/WMTSTileSource.java
r11015 r11017 163 163 SelectLayerDialog(Collection<Layer> layers) { 164 164 super(Main.parent, tr("Select WMTS layer"), new String[]{tr("Add layers"), tr("Cancel")}); 165 this.layers = layers.toArray(new Layer[ ]{});165 this.layers = layers.toArray(new Layer[layers.size()]); 166 166 //getLayersTable(layers, Main.getProjection()) 167 167 this.list = new JTable( -
trunk/src/org/openstreetmap/josm/gui/io/SaveLayersDialog.java
r10791 r11017 172 172 build(); 173 173 lblMessage.setText(msg); 174 lstLayers.setListData(infos.toArray(new SaveLayerInfo[ 0]));174 lstLayers.setListData(infos.toArray(new SaveLayerInfo[infos.size()])); 175 175 } 176 176 -
trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java
r10990 r11017 77 77 ret.add(new LayerSaveAsAction(this)); 78 78 ret.add(new BookmarkWmsAction()); 79 return ret.toArray(new Action[ ]{});79 return ret.toArray(new Action[ret.size()]); 80 80 } 81 81 -
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/CorrelateGpxWithImages.java
r10938 r11017 416 416 Collections.sort(vtTimezones); 417 417 418 JosmComboBox<String> cbTimezones = new JosmComboBox<>(vtTimezones.toArray(new String[ 0]));418 JosmComboBox<String> cbTimezones = new JosmComboBox<>(vtTimezones.toArray(new String[vtTimezones.size()])); 419 419 420 420 String tzId = Main.pref.get("geoimage.timezoneid", ""); … … 567 567 panelCb.add(new JLabel(tr("GPX track: "))); 568 568 569 cbGpx = new JosmComboBox<>(gpxLst.toArray(new GpxDataWrapper[ 0]));569 cbGpx = new JosmComboBox<>(gpxLst.toArray(new GpxDataWrapper[gpxLst.size()])); 570 570 if (defaultItem != null) { 571 571 cbGpx.setSelectedItem(defaultItem); -
trunk/src/org/openstreetmap/josm/gui/layer/gpx/DownloadWmsAlongTrackAction.java
r10364 r11017 123 123 return null; 124 124 } 125 return AbstractMergeAction.askTargetLayer(targetLayers.toArray(new AbstractTileSourceLayer[ 0]),125 return AbstractMergeAction.askTargetLayer(targetLayers.toArray(new AbstractTileSourceLayer[targetLayers.size()]), 126 126 tr("Please select the imagery layer."), 127 127 tr("Select imagery layer"), -
trunk/src/org/openstreetmap/josm/gui/preferences/imagery/AddWMSLayerPanel.java
r10634 r11017 7 7 import java.net.MalformedURLException; 8 8 import java.net.URL; 9 import java.util.List; 9 10 10 11 import javax.swing.DefaultComboBoxModel; … … 73 74 wms.attemptGetCapabilities(rawUrl.getText()); 74 75 tree.updateTree(wms); 75 formats.setModel(new DefaultComboBoxModel<>(wms.getFormats().toArray(new String[0]))); 76 List<String> wmsFormats = wms.getFormats(); 77 formats.setModel(new DefaultComboBoxModel<>(wmsFormats.toArray(new String[wmsFormats.size()]))); 76 78 formats.setSelectedItem(wms.getPreferredFormats()); 77 79 } catch (MalformedURLException ex1) { -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/CodeProjectionChoice.java
r10619 r11017 92 92 filter.getDocument().addDocumentListener(this); 93 93 94 selectionList = new JList<>(data.toArray(new String[ 0]));94 selectionList = new JList<>(data.toArray(new String[data.size()])); 95 95 selectionList.setModel(model); 96 96 JScrollPane scroll = new JScrollPane(selectionList); -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionPreference.java
r10611 r11017 2 2 package org.openstreetmap.josm.gui.preferences.projection; 3 3 4 import static org.openstreetmap.josm.data.SystemOfMeasurement.ALL_SYSTEMS; 4 5 import static org.openstreetmap.josm.tools.I18n.tr; 5 6 … … 271 272 private static final CollectionProperty PROP_SUB_PROJECTION = new CollectionProperty("projection.sub", null); 272 273 public static final StringProperty PROP_SYSTEM_OF_MEASUREMENT = new StringProperty("system_of_measurement", "Metric"); 273 private static final String[] unitsValues = (new ArrayList<>(SystemOfMeasurement.ALL_SYSTEMS.keySet())).toArray(new String[0]);274 private static final String[] unitsValues = ALL_SYSTEMS.keySet().toArray(new String[ALL_SYSTEMS.size()]); 274 275 private static final String[] unitsValuesTr = new String[unitsValues.length]; 275 276 static { … … 282 283 * Combobox with all projections available 283 284 */ 284 private final JosmComboBox<ProjectionChoice> projectionCombo = new JosmComboBox<>(projectionChoices.toArray(new ProjectionChoice[0])); 285 private final JosmComboBox<ProjectionChoice> projectionCombo = new JosmComboBox<>( 286 projectionChoices.toArray(new ProjectionChoice[projectionChoices.size()])); 285 287 286 288 /** -
trunk/src/org/openstreetmap/josm/gui/preferences/projection/UTMProjectionChoice.java
r9543 r11017 44 44 */ 45 45 public UTMProjectionChoice() { 46 super(tr("UTM"), /* NO-ICON */ "core:utm", cbEntries.toArray(new String[ 0]), tr("UTM Zone"));46 super(tr("UTM"), /* NO-ICON */ "core:utm", cbEntries.toArray(new String[cbEntries.size()]), tr("UTM Zone")); 47 47 } 48 48 -
trunk/src/org/openstreetmap/josm/gui/preferences/shortcut/PrefJPanel.java
r10853 r11017 225 225 cbAlt.setText(ALT); // see above for why no tr() 226 226 tfKey.setAction(action); 227 tfKey.setModel(new DefaultComboBoxModel<>(keyList.values().toArray(new String[ 0])));227 tfKey.setModel(new DefaultComboBoxModel<>(keyList.values().toArray(new String[keyList.size()]))); 228 228 cbMeta.setAction(action); 229 229 cbMeta.setText(META); // see above for why no tr() -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Combo.java
r9665 r11017 49 49 } 50 50 51 combobox = new JosmComboBox<>(lhm.values().toArray(new PresetListEntry[ 0]));51 combobox = new JosmComboBox<>(lhm.values().toArray(new PresetListEntry[lhm.size()])); 52 52 component = combobox; 53 53 combobox.setRenderer(getListCellRenderer()); -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/MultiSelect.java
r10670 r11017 26 26 @Override 27 27 protected void addToPanelAnchor(JPanel p, String def, boolean presetInitiallyMatches) { 28 list = new ConcatenatingJList(delimiter, lhm.values().toArray(new PresetListEntry[ 0]));28 list = new ConcatenatingJList(delimiter, lhm.values().toArray(new PresetListEntry[lhm.size()])); 29 29 component = list; 30 30 ListCellRenderer<PresetListEntry> renderer = getListCellRenderer(); -
trunk/src/org/openstreetmap/josm/gui/tagging/presets/items/Text.java
r10626 r11017 106 106 } else { 107 107 // the objects have different values 108 JosmComboBox<String> comboBox = new JosmComboBox<>(usage.values.toArray(new String[ 0]));108 JosmComboBox<String> comboBox = new JosmComboBox<>(usage.values.toArray(new String[usage.values.size()])); 109 109 comboBox.setEditable(true); 110 110 comboBox.setEditor(textField); -
trunk/src/org/openstreetmap/josm/gui/widgets/NativeFileChooser.java
r11015 r11017 56 56 // https://bugs.openjdk.java.net/browse/JDK-4811090 : Extend awt filedialog 57 57 // https://bugs.openjdk.java.net/browse/JDK-6192906 : Add more features to java.awt.FileDialog 58 return fileFilters.toArray(new FileFilter[ 0]);58 return fileFilters.toArray(new FileFilter[fileFilters.size()]); 59 59 } 60 60
Note:
See TracChangeset
for help on using the changeset viewer.