Changeset 30532 in osm for applications/editors/josm
- Timestamp:
- 2014-07-14T04:18:06+02:00 (10 years ago)
- Location:
- applications/editors/josm/plugins
- Files:
-
- 7 added
- 137 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/DirectDownload/src/org/openstreetmap/josm/plugins/directdownload/DownloadDataGui.java
r29776 r30532 128 128 return handler.getResult(); 129 129 } catch (java.net.MalformedURLException e) { 130 Main.error(e); 130 131 JOptionPane.showMessageDialog(null, tr("Invalid URL {0}", urlString)); 131 132 } catch (java.io.IOException e) { 133 Main.error(e); 132 134 JOptionPane.showMessageDialog(null, tr("Error fetching URL {0}", urlString)); 133 135 } catch (SAXException e) { 136 Main.error(e); 134 137 JOptionPane.showMessageDialog(null, tr("Error parsing data from URL {0}", urlString)); 135 } catch(ParserConfigurationException pce) { 138 } catch (ParserConfigurationException e) { 139 Main.error(e); 136 140 JOptionPane.showMessageDialog(null, tr("Error parsing data from URL {0}", urlString)); 137 141 } -
applications/editors/josm/plugins/DirectUpload/src/org/openstreetmap/josm/plugins/DirectUpload/UploadDataGui.java
r30260 r30532 95 95 private HistoryComboBox descriptionField; 96 96 private HistoryComboBox tagsField; 97 private JComboBox visibilityCombo;97 private JComboBox<String> visibilityCombo; 98 98 99 99 // Constants used when generating upload request … … 130 130 visibilityLabel.setToolTipText(tr("Defines the visibility of your trace for other OSM users.")); 131 131 132 visibilityCombo = new JComboBox ();132 visibilityCombo = new JComboBox<>(); 133 133 visibilityCombo.setEditable(false); 134 134 for(visibility v : visibility.values()) { -
applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileDialog.java
r30381 r30532 63 63 private final JLabel totalTimeLabel; 64 64 private final JLabel distLabel; 65 private final JComboBox trackCombo;65 private final JComboBox<IElevationProfile> trackCombo; 66 66 private final JButton zoomButton; 67 67 … … 170 170 zoomButton.setEnabled(false); 171 171 172 trackCombo = new JComboBox (new TrackModel());172 trackCombo = new JComboBox<>(new TrackModel()); 173 173 trackCombo.setPreferredSize(new Dimension(200, 24)); // HACK! 174 174 trackCombo.setEnabled(false); // we have no model on startup … … 254 254 * that the model has changed. 255 255 */ 256 @SuppressWarnings("unchecked") // TODO: Can be removed in Java 1.7257 256 private void updateView() { 258 257 if (model == null) { … … 410 409 } 411 410 412 @SuppressWarnings("rawtypes") // TODO: Can be removed in Java 1.7 413 class TrackModel implements ComboBoxModel { 411 class TrackModel implements ComboBoxModel<IElevationProfile> { 414 412 private Collection<ListDataListener> listeners; 415 413 … … 445 443 446 444 @Override 447 public ObjectgetSelectedItem() {445 public IElevationProfile getSelectedItem() { 448 446 if (model == null) return null; 449 447 … … 460 458 } 461 459 } 462 463 460 } 464 461 } -
applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawConfigDialog.java
r29453 r30532 44 44 // tr("Autosimplify and save"),tr("Simplify and wait"),tr("Simplify and save"), 45 45 // tr("Save as is")}); 46 JComboBox combo1=new JComboBox(new String[]{tr("Autosimplify"),46 JComboBox<String> combo1=new JComboBox<>(new String[]{tr("Autosimplify"), 47 47 tr("Simplify with initial epsilon"),tr("Save as is")}); 48 48 JCheckBox snapCb=new JCheckBox(tr("Snap to nodes")); -
applications/editors/josm/plugins/HouseNumberTaggingTool/src/org/openstreetmap/josm/plugins/housenumbertool/TagDialog.java
r30172 r30532 89 89 private JCheckBox housenumberEnabled; 90 90 private JSlider housenumberChangeSequence; 91 private JComboBox building;91 private JComboBox<String> building; 92 92 private JRadioButton streetRadio; 93 93 private JRadioButton placeRadio; … … 139 139 140 140 Arrays.sort(buildingStrings); 141 building = new JComboBox (buildingStrings);141 building = new JComboBox<>(buildingStrings); 142 142 building.setSelectedItem(dto.getBuilding()); 143 143 building.setMaximumRowCount(50); -
applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LayerPropertiesDialog.java
r29854 r30532 66 66 private JTextField searchField = null; 67 67 private JScrollPane crsListScrollPane = null; 68 private JList crsJList = null;68 private JList<String> crsJList = null; 69 69 private JButton useDefaultCRSButton = null; 70 70 private JButton applySelectedCRSButton = null; … … 406 406 * @return javax.swing.JList 407 407 */ 408 private JList getCrsJList() {408 private JList<String> getCrsJList() { 409 409 if (crsJList == null) { 410 crsJList = new JList (supportedCRS);410 crsJList = new JList<>(supportedCRS); 411 411 crsJList.addListSelectionListener(new ListSelectionHandler()); 412 412 } -
applications/editors/josm/plugins/OsmInspectorPlugin/.settings/org.eclipse.jdt.core.prefs
r30416 r30532 1 1 eclipse.preferences.version=1 2 org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled 3 org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore 4 org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull 5 org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault 6 org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable 7 org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled 2 8 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 9 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 4 10 org.eclipse.jdt.core.compiler.compliance=1.7 11 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning 5 12 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 13 org.eclipse.jdt.core.compiler.problem.autoboxing=ignore 14 org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning 15 org.eclipse.jdt.core.compiler.problem.deadCode=warning 16 org.eclipse.jdt.core.compiler.problem.deprecation=warning 17 org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled 18 org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled 19 org.eclipse.jdt.core.compiler.problem.discouragedReference=warning 20 org.eclipse.jdt.core.compiler.problem.emptyStatement=warning 6 21 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 22 org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore 23 org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore 24 org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled 25 org.eclipse.jdt.core.compiler.problem.fieldHiding=warning 26 org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning 27 org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning 28 org.eclipse.jdt.core.compiler.problem.forbiddenReference=error 29 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning 30 org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled 31 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning 32 org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning 33 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore 34 org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore 35 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning 36 org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore 37 org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore 38 org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled 39 org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore 40 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore 41 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled 42 org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore 43 org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore 44 org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning 45 org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning 46 org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore 47 org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning 48 org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error 49 org.eclipse.jdt.core.compiler.problem.nullReference=warning 50 org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error 51 org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning 52 org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning 53 org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore 54 org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore 55 org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore 56 org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore 57 org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning 58 org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning 59 org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore 60 org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore 61 org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore 62 org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore 63 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore 64 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled 65 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning 66 org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled 67 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled 68 org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled 69 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore 70 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning 71 org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled 72 org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning 73 org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning 74 org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore 75 org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning 76 org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore 77 org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore 78 org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore 79 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore 80 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled 81 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled 82 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled 83 org.eclipse.jdt.core.compiler.problem.unusedImport=warning 84 org.eclipse.jdt.core.compiler.problem.unusedLabel=warning 85 org.eclipse.jdt.core.compiler.problem.unusedLocal=warning 86 org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning 87 org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore 88 org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled 89 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled 90 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled 91 org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning 92 org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore 93 org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning 94 org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning 7 95 org.eclipse.jdt.core.compiler.source=1.7 -
applications/editors/josm/plugins/OsmInspectorPlugin/src/org/openstreetmap/josm/plugins/osminspector/gui/OsmInspectorDialog.java
r29547 r30532 13 13 import javax.swing.DefaultListModel; 14 14 import javax.swing.JList; 15 import javax.swing.JScrollBar;16 15 import javax.swing.JScrollPane; 17 16 import javax.swing.ListSelectionModel; 18 17 import javax.swing.ScrollPaneConstants; 19 import javax.swing.ScrollPaneLayout;20 18 import javax.swing.event.ListSelectionEvent; 21 19 import javax.swing.event.ListSelectionListener; … … 38 36 39 37 private OsmInspectorLayer layer; 40 private JList bugsList;38 private JList<String> bugsList; 41 39 private OsmInspectorNextAction actNext; 42 40 private OsmInspectorPrevAction actPrev; 43 private DefaultListModel model;41 private DefaultListModel<String> model; 44 42 45 43 private OsmInspectorBugInfoDialog bugInfoDialog; 46 /**47 *48 */49 private static final long serialVersionUID = 5465011236663660394L;50 51 44 52 45 public void updateNextPrevAction(OsmInspectorLayer l) { … … 61 54 Main.map.addToggleDialog(this, true); 62 55 63 model = new DefaultListModel ();56 model = new DefaultListModel<>(); 64 57 refreshModel(); 65 bugsList = new JList (model);58 bugsList = new JList<>(model); 66 59 bugsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 67 60 bugsList.setLayoutOrientation(JList.VERTICAL_WRAP); … … 125 118 KeyEvent.VK_K, Shortcut.CTRL_SHIFT); 126 119 Main.registerActionShortcut(actNext, snext); 127 128 120 } 129 121 … … 135 127 } 136 128 } 137 138 129 } 139 130 … … 168 159 public void hideNotify() { 169 160 if (dialogsPanel != null) { 170 // TODO Auto-generated method stub171 161 super.hideNotify(); 172 162 } … … 176 166 ListSelectionListener { 177 167 178 /**179 *180 */181 private static final long serialVersionUID = 123266015594117296L;182 168 private OsmInspectorLayer layer; 183 169 … … 203 189 @Override 204 190 public void valueChanged(ListSelectionEvent arg0) { 205 // TODO Auto-generated method stub206 207 191 } 208 192 } … … 218 202 ListSelectionListener { 219 203 220 /**221 *222 */223 private static final long serialVersionUID = 1L;224 204 private OsmInspectorLayer layer; 225 205 … … 227 207 super("prev"); 228 208 layer = (OsmInspectorLayer) inspector; 229 230 209 } 231 210 … … 246 225 @Override 247 226 public void valueChanged(ListSelectionEvent e) { 248 // TODO Auto-generated method stub249 250 227 } 251 228 } … … 253 230 @Override 254 231 public void mouseClicked(MouseEvent e) { 255 // TODO Auto-generated method stub256 257 232 } 258 233 259 234 @Override 260 235 public void mouseEntered(MouseEvent e) { 261 // TODO Auto-generated method stub262 263 236 } 264 237 265 238 @Override 266 239 public void mouseExited(MouseEvent e) { 267 // TODO Auto-generated method stub268 269 240 } 270 241 271 242 @Override 272 243 public void mousePressed(MouseEvent e) { 273 // TODO Auto-generated method stub274 275 244 } 276 245 277 246 @Override 278 247 public void mouseReleased(MouseEvent e) { 279 // TODO Auto-generated method stub280 281 248 } 282 249 … … 288 255 refreshBugList(); 289 256 } 290 291 257 } 292 258 293 259 private void refreshBugList() { 294 260 bugsList.clearSelection(); 295 bugsList = new JList(model); 296 261 bugsList = new JList<>(model); 297 262 } 298 263 … … 317 282 318 283 } 319 320 284 } -
applications/editors/josm/plugins/addrinterpolation/src/org/openstreetmap/josm/plugins/AddrInterpolation/AddrInterpolationDialog.java
r30067 r30532 93 93 private boolean interpolationMethodSet = false; 94 94 95 96 95 // NOTE: The following 2 arrays must match in number of elements and position 97 96 // Tag values for map (Except that 'Numeric' is replaced by actual # on map) … … 99 98 String[] addrInterpolationStrings = { tr("Odd"), tr("Even"), tr("All"), tr("Alphabetic"), tr("Numeric") }; // Translatable names for display 100 99 private final int NumericIndex = 4; 101 private JComboBox addrInterpolationList = null;100 private JComboBox<String> addrInterpolationList = null; 102 101 103 102 // NOTE: The following 2 arrays must match in number of elements and position 104 103 String[] addrInclusionTags = { "actual", "estimate", "potential" }; // Tag values for map 105 104 String[] addrInclusionStrings = { tr("Actual"), tr("Estimate"), tr("Potential") }; // Translatable names for display 106 private JComboBox addrInclusionList = null; 107 108 105 private JComboBox<String> addrInclusionList = null; 109 106 110 107 // For tracking edit changes as group for undo … … 121 118 122 119 ShowDialog(editControlsPane, name); 123 124 } 125 126 120 } 127 121 128 122 private void ShowDialog(JPanel editControlsPane, String name) { … … 160 154 } 161 155 162 163 164 156 // Create edit control items and return JPanel on which they reside 165 157 private JPanel CreateEditControls() { … … 172 164 173 165 editControlsPane.setBorder(BorderFactory.createEmptyBorder(15,15,15,15)); 174 175 166 176 167 String streetName = selectedStreet.get("name"); … … 204 195 205 196 JLabel numberingLabel = new JLabel(tr("Numbering Scheme:")); 206 addrInterpolationList = new JComboBox (addrInterpolationStrings);197 addrInterpolationList = new JComboBox<>(addrInterpolationStrings); 207 198 208 199 JLabel incrementLabel = new JLabel(tr("Increment:")); … … 217 208 218 209 JLabel inclusionLabel = new JLabel(tr("Accuracy:")); 219 addrInclusionList = new JComboBox (addrInclusionStrings);210 addrInclusionList = new JComboBox<>(addrInclusionStrings); 220 211 addrInclusionList.setSelectedIndex(lastAccuracyIndex); 221 212 … … 239 230 } 240 231 241 242 243 232 JPanel optionPanel = CreateOptionalFields(); 244 233 c.gridx = 0; … … 248 237 249 238 editControlsPane.add(optionPanel, c); 250 251 239 252 240 KeyAdapter enterProcessor = new KeyAdapter() { … … 257 245 dialog.dispose(); 258 246 } 259 260 247 } 261 248 } … … 267 254 addrInterpolationList.addKeyListener(enterProcessor); 268 255 incrementTextField.addKeyListener(enterProcessor); 269 270 256 271 257 // Watch when Interpolation Method combo box is selected so that … … 282 268 }); 283 269 284 285 270 // Watch when Interpolation Method combo box is changed so that 286 271 // Numeric increment box can be enabled or disabled. … … 292 277 }); 293 278 294 295 279 editControlsPane.add(cbConvertToHouseNumbers, c); 296 297 298 280 299 281 if (houseNumberNodes.size() > 0) { … … 305 287 editControlsPane.add(new UrlLabel("http://wiki.openstreetmap.org/wiki/JOSM/Plugins/AddrInterpolation", 306 288 tr("More information about this feature"),2), c); 307 308 289 309 290 c.gridx = 0; … … 332 313 } 333 314 334 335 336 315 // Call after both starting and ending housenumbers have been entered - usually when 337 316 // combo box gets focus. … … 368 347 } 369 348 } 370 371 372 349 } else { 373 350 // Test for possible alpha … … 392 369 // Did not detect alpha 393 370 return false; 394 395 } 396 371 } 397 372 return true; 398 399 } 400 401 373 } 402 374 403 375 // Set Interpolation Method combo box to method specified by 'currentMethod' (an OSM key value) … … 423 395 } 424 396 425 426 397 // Set Inclusion Method combo box to method specified by 'currentMethod' (an OSM key value) 427 398 private void SelectInclusion(String currentMethod) { … … 435 406 } 436 407 addrInclusionList.setSelectedIndex(currentIndex); 437 438 } 439 440 408 } 441 409 442 410 // Create optional control fields in a group box … … 485 453 AddEditControlRows(optionalTextLabels, optionalEditFields, editControlsPane); 486 454 487 488 489 455 JPanel optionPanel = new JPanel(new BorderLayout()); 490 456 Border groupBox = BorderFactory.createEtchedBorder(); … … 498 464 } 499 465 500 501 502 466 // Populate dialog for any possible existing settings if editing an existing Address interpolation way 503 467 private void GetExistingMapKeys() { 504 505 468 506 469 // Check all nodes for optional addressing data … … 538 501 CheckNodeForAddressTags(firstNode); 539 502 CheckNodeForAddressTags(lastNode); 540 541 } 542 543 544 545 } 546 503 } 504 } 547 505 548 506 // Check for any existing address data. If found, … … 571 529 lastFullAddress = value; 572 530 } 573 574 } 575 576 531 } 577 532 578 533 // Look for a possible 'associatedStreet' type of relation for selected street … … 609 564 } 610 565 } 611 612 } 613 } 614 566 } 567 } 615 568 } 616 569 617 570 return ""; 618 571 } 619 620 572 621 573 // We can proceed only if there is both a named way (the 'street') and … … 668 620 } 669 621 } 670 671 622 } 672 623 … … 697 648 } 698 649 699 700 650 return isValid; 701 651 } 702 703 652 704 653 /** … … 728 677 } 729 678 730 731 732 679 public void actionPerformed(ActionEvent e) { 733 680 if ("ok".equals(e.getActionCommand())) { … … 735 682 dialog.dispose(); 736 683 } 737 738 684 } else if ("cancel".equals(e.getActionCommand())) { 739 685 dialog.dispose(); 740 741 } 742 } 743 744 686 } 687 } 745 688 746 689 // For Alpha interpolation, return base string … … 757 700 } 758 701 759 760 702 private char LastChar(String strValue) { 761 703 if (strValue.length() > 0) { … … 767 709 } 768 710 769 770 711 // Test for valid positive long int 771 private boolean isLong( String input ) 772 { 712 private boolean isLong( String input ) { 773 713 try 774 714 { … … 791 731 return p.matcher(s).matches(); 792 732 } 793 794 733 795 734 private void InterpolateAlphaSection(int startNodeIndex, int endNodeIndex, String endValueString, … … 828 767 LatLon newHouseNumberPosition = lastHouseNode.getCoor().interpolate(toNode.getCoor(), proportion); 829 768 830 831 832 769 Node newHouseNumberNode = new Node(newHouseNumberPosition); 833 770 currentChar++; … … 850 787 } 851 788 } 852 853 854 } 855 789 } 856 790 857 791 private void CreateAlphaInterpolation(String startValueString, String endValueString) { … … 889 823 // End nodes do not actually contain housenumber value yet (command has not executed), so use user-entered value 890 824 InterpolateAlphaSection(startIndex, addrInterpolationWay.getNodesCount()-1, endValueString, startingChar, endingChar); 891 892 } 893 825 } 894 826 895 827 private double CalculateSegmentLengths(int startNodeIndex, int endNodeIndex, double segmentLengths[]) { … … 905 837 } 906 838 return totalLength; 907 908 } 909 839 } 910 840 911 841 private void InterpolateNumericSection(int startNodeIndex, int endNodeIndex, … … 913 843 long increment) { 914 844 915 916 845 int nSegments =endNodeIndex - startNodeIndex; 917 846 … … 920 849 // Total length of address interpolation way section 921 850 double totalLength= CalculateSegmentLengths(startNodeIndex, endNodeIndex, segmentLengths); 922 923 851 924 852 int nHouses = (int)((endingAddr - startingAddr) / increment) -1; … … 956 884 lastHouseNode = newHouseNumberNode; 957 885 958 959 886 segmentLengths[currentSegment] -= distanceNeeded; // Track amount used 960 887 nHouses -- ; 961 888 } 962 889 } 963 964 965 } 966 890 } 967 891 968 892 private void CreateNumericInterpolation(String startValueString, String endValueString, long increment) { … … 970 894 long startingAddr = Long.parseLong( startValueString ); 971 895 long endingAddr = Long.parseLong( endValueString ); 972 973 896 974 897 // Search for possible anchors from the 2nd node to 2nd from last, interpolating between each anchor … … 1000 923 } 1001 924 1002 1003 925 // Called if user has checked "Convert to House Numbers" checkbox. 1004 926 private void ConvertWayToHousenumbers(String selectedMethod, String startValueString, String endValueString, … … 1011 933 1012 934 CreateAlphaInterpolation(startValueString, endValueString); 1013 1014 935 1015 936 } else { … … 1021 942 } 1022 943 CreateNumericInterpolation(startValueString, endValueString, increment); 1023 1024 } 1025 944 } 1026 945 1027 946 RemoveAddressInterpolationWay(); 1028 947 1029 948 } 1030 1031 949 1032 950 private void RemoveAddressInterpolationWay() { … … 1044 962 1045 963 addrInterpolationWay = null; 1046 1047 } 1048 1049 964 } 1050 965 1051 966 private boolean ValidateAndSave() { … … 1084 999 } else if (selectedMethod.equals("all")) { 1085 1000 1086 } else if (selectedMethod.equals("alphabetic")) {1001 } else if (selectedMethod.equals("alphabetic")) { 1087 1002 errorMessage = ValidateAlphaAddress(startValueString, endValueString); 1088 1003 1089 } else if (selectedMethod.equals("Numeric")) {1004 } else if (selectedMethod.equals("Numeric")) { 1090 1005 1091 1006 if (!ValidNumericIncrementString(incrementString, startAddr, endAddr)) { 1092 1007 errorMessage = tr("Expected valid number for increment"); 1093 1008 } 1094 1095 1009 } 1096 1010 if (!errorMessage.equals("")) { … … 1125 1039 currentDataSet.clearSelection(lastNode); // Workaround for JOSM Bug #3838 1126 1040 } 1127 1128 1041 1129 1042 String interpolationTagValue = selectedMethod; … … 1151 1064 } 1152 1065 1153 1154 1155 1066 if (streetRelationButton.isSelected()) { 1156 1067 … … 1167 1078 } 1168 1079 } 1169 1170 1080 1171 1081 // For all nodes, add to relation and … … 1199 1109 } 1200 1110 1201 1202 1111 private boolean ValidNumericIncrementString(String incrementString, long startingAddr, long endingAddr) { 1203 1112 … … 1215 1124 return true; 1216 1125 } 1217 1218 1219 1126 1220 1127 // Create Associated Street relation, add street, and add to list of commands to perform … … 1228 1135 } 1229 1136 1230 1231 1232 1137 // Read from dialog text box, removing leading and trailing spaces 1233 1138 // Return the string, or null for a zero length string … … 1243 1148 } 1244 1149 1245 1246 1150 // Test if relation contains specified member 1247 1151 // If not already present, it is added … … 1263 1167 } 1264 1168 } 1265 1266 1267 1169 1268 1170 // Check alphabetic style address … … 1316 1218 errorMessage = tr("Starting address letter must be less than ending address letter"); 1317 1219 } 1318 1319 1220 } 1320 1221 1321 1222 return errorMessage; 1322 1223 } 1323 1324 1325 1224 1326 1225 // Convert string addresses to numeric, with error check … … 1353 1252 } 1354 1253 1355 1356 1357 1254 private String GetInterpolationMethod() { 1358 1255 int selectedIndex = addrInterpolationList.getSelectedIndex(); 1359 1256 return addrInterpolationTags[selectedIndex]; 1360 1257 } 1361 1362 1258 1363 1259 private String GetInclusionMethod() { … … 1366 1262 return addrInclusionTags[selectedIndex]; 1367 1263 } 1368 1369 1370 1371 1372 1373 1374 1375 1264 } 1376 1377 -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java
r29801 r30532 414 414 communeList[i + 1] = listOfCommunes.elementAt(i).substring(listOfCommunes.elementAt(i).indexOf(">")+1); 415 415 } 416 JComboBox inputCommuneList = new JComboBox(communeList);416 JComboBox<String> inputCommuneList = new JComboBox<>(communeList); 417 417 p.add(inputCommuneList, GBC.eol().fill(GBC.HORIZONTAL).insets(10, 0, 0, 0)); 418 418 JOptionPane pane = new JOptionPane(p, JOptionPane.INFORMATION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null) { … … 432 432 private int selectFeuilleDialog() { 433 433 JPanel p = new JPanel(new GridBagLayout()); 434 Vector<String> ImageNames = new Vector<String>();434 Vector<String> imageNames = new Vector<String>(); 435 435 for (PlanImage src : listOfFeuilles) { 436 ImageNames.add(src.name);437 } 438 JComboBox inputFeuilleList = new JComboBox(ImageNames);436 imageNames.add(src.name); 437 } 438 JComboBox<String> inputFeuilleList = new JComboBox<>(imageNames); 439 439 p.add(inputFeuilleList, GBC.eol().fill(GBC.HORIZONTAL).insets(10, 0, 0, 0)); 440 440 JOptionPane pane = new JOptionPane(p, JOptionPane.INFORMATION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null); -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java
r30481 r30532 37 37 private JCheckBox drawBoundaries = new JCheckBox(tr("Draw boundaries of downloaded data.")); 38 38 39 private JComboBox imageInterpolationMethod = new JComboBox();39 private JComboBox<String> imageInterpolationMethod = new JComboBox<>(); 40 40 41 41 private JCheckBox disableImageCropping = new JCheckBox(tr("Disable image cropping during georeferencing.")); … … 95 95 static final String DEFAULT_GRAB_MULTIPLIER = Scale.SQUARE_100M.value; 96 96 97 /** 98 * Constructs a new {@code CadastrePreferenceSetting}. 99 */ 97 100 public CadastrePreferenceSetting() { 98 101 super("cadastrewms.gif", I18n.tr("French cadastre WMS"), … … 104 107 ); 105 108 } 106 107 109 108 110 public void addGui(final PreferenceTabbedPane gui) { -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CheckSourceUploadHook.java
r23190 r30532 32 32 public class CheckSourceUploadHook implements UploadHook 33 33 { 34 /** Serializable ID */35 private static final long serialVersionUID = -1;36 34 37 35 /** … … 82 80 JTextField tf = new JTextField(CadastrePlugin.source); 83 81 p.add(tf, GBC.eol()); 84 JList l = new JList(sel.toArray());82 JList<OsmPrimitive> l = new JList<>(sel.toArray(new OsmPrimitive[0])); 85 83 l.setCellRenderer(renderer); 86 84 l.setVisibleRowCount(l.getModel().getSize() < 6 ? l.getModel().getSize() : 10); … … 91 89 Main.main.undoRedo.add(new ChangePropertyCommand(sel, "source", tf.getText())); 92 90 } 93 94 91 } 95 92 } 96 -
applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionNewLocation.java
r28887 r30532 69 69 + "Use the syntax and punctuation known by www.cadastre.gouv.fr .</html>")); 70 70 JLabel labelDepartement = new JLabel(tr("Departement")); 71 final JComboBox inputDepartement = new JComboBox();71 final JComboBox<String> inputDepartement = new JComboBox<>(); 72 72 for (int i=1; i<departements.length; i+=2) { 73 73 inputDepartement.addItem(departements[i]); -
applications/editors/josm/plugins/colorscheme/src/at/dallermassl/josm/plugin/colorscheme/ColorSchemePreference.java
r29854 r30532 39 39 private static final String PREF_KEY_SCHEMES_NAMES = PREF_KEY_SCHEMES_PREFIX + "names"; 40 40 public static final String PREF_KEY_COLOR_PREFIX = "color."; 41 private JList schemesList;42 private DefaultListModel listModel;41 private JList<String> schemesList; 42 private DefaultListModel<String> listModel; 43 43 private List<String>colorKeys; 44 44 private ColorPreference colorPreference; … … 50 50 } 51 51 52 53 /* (non-Javadoc)54 * @see org.openstreetmap.josm.gui.preferences.PreferenceSetting#addGui(org.openstreetmap.josm.gui.preferences.PreferenceDialog)55 */56 52 @Override 57 53 public void addGui(final PreferenceTabbedPane gui) { … … 62 58 colorKeys = new ArrayList<String>(colorMap.keySet()); 63 59 Collections.sort(colorKeys); 64 listModel = new DefaultListModel ();65 schemesList = new JList (listModel);60 listModel = new DefaultListModel<>(); 61 schemesList = new JList<>(listModel); 66 62 String schemes = Main.pref.get(PREF_KEY_SCHEMES_NAMES); 67 63 StringTokenizer st = new StringTokenizer(schemes, ";"); -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/Preferences.java
r27863 r30532 2 2 3 3 4 import java.awt.event.ActionEvent; 5 import java.awt.event.ActionListener; 6 7 import javax.swing.DefaultComboBoxModel; 8 import javax.swing.GroupLayout; 9 import javax.swing.JCheckBox; 10 import javax.swing.JComboBox; 11 import javax.swing.JLabel; 4 12 import javax.swing.JPanel; 13 import javax.swing.JTextField; 14 import javax.swing.event.ChangeEvent; 15 import javax.swing.event.ChangeListener; 5 16 6 17 import org.openstreetmap.josm.Main; … … 70 81 private void initComponents() { 71 82 72 mainPanel = new javax.swing.JPanel();73 addNewTagCheckBox = new javax.swing.JCheckBox();74 addNewTagKeyField = new javax.swing.JTextField();75 jLabel1 = new javax.swing.JLabel();76 addNewTagValueField = new javax.swing.JTextField();77 jLabel2 = new javax.swing.JLabel();78 optimizeComboBox = new javax.swing.JComboBox();79 buildingCheckBox = new javax.swing.JCheckBox();83 mainPanel = new JPanel(); 84 addNewTagCheckBox = new JCheckBox(); 85 addNewTagKeyField = new JTextField(); 86 jLabel1 = new JLabel(); 87 addNewTagValueField = new JTextField(); 88 jLabel2 = new JLabel(); 89 optimizeComboBox = new JComboBox<>(); 90 buildingCheckBox = new JCheckBox(); 80 91 81 92 thisPanel.setLayout(new java.awt.GridLayout(1, 0)); 82 93 83 94 addNewTagCheckBox.setText("Novým primitivám přidávat tag:"); 84 addNewTagCheckBox.addChangeListener(new javax.swing.event.ChangeListener() {85 public void stateChanged( javax.swing.event.ChangeEvent evt) {95 addNewTagCheckBox.addChangeListener(new ChangeListener() { 96 public void stateChanged(ChangeEvent evt) { 86 97 addNewTagChanged(evt); 87 98 } 88 99 }); 89 addNewTagCheckBox.addActionListener(new java.awt.event.ActionListener() {90 public void actionPerformed( java.awt.event.ActionEvent evt) {100 addNewTagCheckBox.addActionListener(new ActionListener() { 101 public void actionPerformed(ActionEvent evt) { 91 102 addNewTagCheckBoxActionPerformed(evt); 92 103 } … … 103 114 jLabel2.setText("Optimalizovat algoritmus přiřazování:"); 104 115 105 optimizeComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "pro rychlejší odezvu", "menší spotřebu paměti" }));116 optimizeComboBox.setModel(new DefaultComboBoxModel<>(new String[] { "pro rychlejší odezvu", "menší spotřebu paměti" })); 106 117 optimizeComboBox.setSelectedIndex(1); 107 118 optimizeComboBox.setEnabled(false); 108 119 109 120 buildingCheckBox.setText("Nově polygonům přidávat tag \"building=yes\""); 110 buildingCheckBox.addChangeListener(new javax.swing.event.ChangeListener() {111 public void stateChanged( javax.swing.event.ChangeEvent evt) {121 buildingCheckBox.addChangeListener(new ChangeListener() { 122 public void stateChanged(ChangeEvent evt) { 112 123 buildingCheckBoxaddNewTagChanged(evt); 113 124 } … … 119 130 }); 120 131 121 javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);132 javax.swing.GroupLayout mainPanelLayout = new GroupLayout(mainPanel); 122 133 mainPanel.setLayout(mainPanelLayout); 123 134 mainPanelLayout.setHorizontalGroup( … … 213 224 private javax.swing.JLabel jLabel2; 214 225 private javax.swing.JPanel mainPanel; 215 private javax.swing.JComboBox optimizeComboBox;226 private javax.swing.JComboBox<String> optimizeComboBox; 216 227 // End of variables declaration//GEN-END:variables 217 228 -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/addressdatabase/ElementWithHouses.java
r23190 r30532 57 57 return houses; 58 58 } 59 60 61 62 59 } -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/ConflictResolver.java
r29854 r30532 87 87 candLabel = new javax.swing.JLabel(); 88 88 mainZoomButton = new javax.swing.JButton(); 89 mainField = new javax.swing.JComboBox ();90 candField = new javax.swing.JComboBox ();89 mainField = new javax.swing.JComboBox<>(); 90 candField = new javax.swing.JComboBox<>(); 91 91 candPickButton = new javax.swing.JButton(); 92 92 mainPickButton = new javax.swing.JButton(); … … 123 123 }); 124 124 125 mainField.setModel(new javax.swing.DefaultComboBoxModel (new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));125 mainField.setModel(new javax.swing.DefaultComboBoxModel<Object>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" })); 126 126 mainField.setRenderer(new UniversalListRenderer()); 127 127 128 candField.setModel(new javax.swing.DefaultComboBoxModel (new String[] { " " }));128 candField.setModel(new javax.swing.DefaultComboBoxModel<Object>(new String[] { " " })); 129 129 candField.setRenderer(new UniversalListRenderer()); 130 130 … … 236 236 r.unOverwrite(prim, r.translate(prim)); 237 237 238 ComboBoxModel model = candField.getModel();238 ComboBoxModel<Object> model = candField.getModel(); 239 239 for (int i = 0; i < model.getSize(); i++) { 240 240 AddressElement elem = (AddressElement) model.getElementAt(i); … … 253 253 r.unOverwrite(r.translate(elem), elem); 254 254 255 ComboBoxModel model = candField.getModel();255 ComboBoxModel<Object> model = candField.getModel(); 256 256 for (int i = 0; i < model.getSize(); i++) { 257 257 OsmPrimitive prim = (OsmPrimitive) model.getElementAt(i); … … 279 279 280 280 // Variables declaration - do not modify//GEN-BEGIN:variables 281 private javax.swing.JComboBox candField;281 private javax.swing.JComboBox<Object> candField; 282 282 private javax.swing.JLabel candLabel; 283 283 private javax.swing.JButton candPickButton; 284 284 private javax.swing.JButton candZoomButton; 285 private javax.swing.JComboBox mainField;285 private javax.swing.JComboBox<Object> mainField; 286 286 private javax.swing.JLabel mainLabel; 287 287 private javax.swing.JPanel mainPanel; … … 325 325 326 326 private ConflictsModel conflictModel = new ConflictsModel(); 327 private class ConflictsModel implements ComboBoxModel {327 private class ConflictsModel implements ComboBoxModel<Object> { 328 328 329 329 ArrayList<AddressElement> elements = new ArrayList<AddressElement>(); … … 473 473 conflPrims.addAll(Reasoner.getInstance().getCandidates(selElem)); 474 474 Collections.sort(conflPrims, PrimUtils.comparator); 475 candField.setModel(new CandidatesModel<O smPrimitive>(conflPrims));475 candField.setModel(new CandidatesModel<Object>(conflPrims)); 476 476 477 477 } else if (selected instanceof OsmPrimitive) { … … 480 480 conflElems.addAll(Reasoner.getInstance().getCandidates(selElem)); 481 481 Collections.sort(conflElems); 482 candField.setModel(new CandidatesModel< AddressElement>(conflElems));482 candField.setModel(new CandidatesModel<Object>(conflElems)); 483 483 484 484 } else { 485 candField.setModel(new DefaultComboBoxModel ());485 candField.setModel(new DefaultComboBoxModel<>()); 486 486 candZoomButton.setEnabled(false); 487 487 reassignButton.setEnabled(false); … … 512 512 } 513 513 514 private class CandidatesModel<E> implements ComboBoxModel {514 private class CandidatesModel<E> implements ComboBoxModel<E> { 515 515 516 516 Set<ListDataListener> listeners = new HashSet<ListDataListener>(); … … 540 540 } else 541 541 reassignButton.setEnabled(false); 542 543 544 542 } 545 543 … … 552 550 } 553 551 554 public ObjectgetElementAt(int index) {552 public E getElementAt(int index) { 555 553 if (index < primitives.size()) 556 554 return primitives.get(index); -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/FactoryDialog.java
r30346 r30532 121 121 122 122 for (int i=0; i<houseModel.getSize(); i++) 123 if (houseModel.get HouseAt(i) == house) {123 if (houseModel.getElementAt(i) == house) { 124 124 houseList.setSelectedIndex(i); 125 125 houseList.ensureIndexIsVisible(i); … … 159 159 index++; // Initial kick to do at least one move. 160 160 House current; 161 while ( (current = houseModel.get HouseAt(index))!= null161 while ( (current = houseModel.getElementAt(index)) != null 162 162 && Reasoner.getInstance().translate(current) != null) 163 163 index++; … … 262 262 mainPanel = new javax.swing.JPanel(); 263 263 jScrollPane1 = new javax.swing.JScrollPane(); 264 houseList = new javax.swing.JList ();264 houseList = new javax.swing.JList<>(); 265 265 keepOddityCheckBox = new javax.swing.JCheckBox(); 266 266 relocateButton = new javax.swing.JButton(); 267 streetComboBox = new javax.swing.JComboBox ();267 streetComboBox = new javax.swing.JComboBox<>(); 268 268 269 269 setLayout(new java.awt.GridLayout(1, 0)); 270 271 houseList.setModel(new javax.swing.AbstractListModel () {270 /* 271 houseList.setModel(new javax.swing.AbstractListModel<String>() { 272 272 String[] strings = { " " }; 273 273 @Override 274 274 public int getSize() { return strings.length; } 275 275 @Override 276 public ObjectgetElementAt(int i) { return strings[i]; }277 }); 276 public String getElementAt(int i) { return strings[i]; } 277 });*/ 278 278 houseList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); 279 279 houseList.setEnabled(false); … … 349 349 350 350 // Variables declaration - do not modify//GEN-BEGIN:variables 351 private javax.swing.JList houseList;351 private javax.swing.JList<House> houseList; 352 352 private javax.swing.JScrollPane jScrollPane1; 353 353 private javax.swing.JCheckBox keepOddityCheckBox; 354 354 private javax.swing.JPanel mainPanel; 355 355 private javax.swing.JButton relocateButton; 356 private javax.swing.JComboBox streetComboBox;356 private javax.swing.JComboBox<ElementWithHouses> streetComboBox; 357 357 // End of variables declaration//GEN-END:variables 358 358 … … 370 370 private class StreetListRenderer extends DefaultListCellRenderer { 371 371 @Override 372 public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {372 public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { 373 373 Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); 374 374 … … 398 398 399 399 @Override 400 public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {400 public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { 401 401 Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); 402 402 … … 467 467 //============================================================================== 468 468 469 private class StreetListModel extends HalfCookedComboBoxModel {469 private class StreetListModel extends HalfCookedComboBoxModel<ElementWithHouses> { 470 470 471 471 private ElementWithHouses selected = null; … … 499 499 500 500 @Override 501 public ObjectgetElementAt(int index) {501 public ElementWithHouses getElementAt(int index) { 502 502 if (parent == null) return null; 503 503 … … 528 528 //============================================================================== 529 529 530 private class HouseListModel extends HalfCookedListModel 530 private class HouseListModel extends HalfCookedListModel<House> 531 531 implements ReasonerListener { 532 532 … … 544 544 } 545 545 546 public House getHouseAt(int index) { 546 @Override 547 public House getElementAt(int index) { 547 548 if (streetComboBox.getSelectedItem() == null) return null; 548 549 ElementWithHouses selected … … 555 556 556 557 @Override 557 public Object getElementAt(int index) {558 return getHouseAt(index);559 }560 561 @Override562 558 public void primitiveChanged(OsmPrimitive prim) {} 563 559 @Override -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/LocationSelector.java
r29854 r30532 66 66 initLocationHints(); 67 67 68 DefaultComboBoxModel regions = new DefaultComboBoxModel(Database.getInstance().regions.toArray());68 DefaultComboBoxModel<Region> regions = new DefaultComboBoxModel<>(Database.getInstance().regions.toArray(new Region[0])); 69 69 regionHlIndex = reshuffleListItems(regions, hlRegions); 70 70 oblastComboBox.setModel(regions); … … 173 173 * beginning, return number of moved items. 174 174 */ 175 176 private int reshuffleListItems(DefaultComboBoxModel list, final ArrayList<AddressElement> hlList) { 175 private <E> int reshuffleListItems(DefaultComboBoxModel<E> list, final ArrayList<AddressElement> hlList) { 177 176 int curHlIndex = 0; 178 177 179 178 for (int i = 0; i < list.getSize(); i++) 180 179 for (int j = 0; j < hlList.size(); j++) { 181 Objectt = list.getElementAt(i);180 E t = list.getElementAt(i); 182 181 if (t == hlList.get(j)) { 183 182 list.removeElementAt(i); … … 199 198 200 199 mainPanel = new javax.swing.JPanel(); 201 oblastComboBox = new javax.swing.JComboBox ();202 suburbComboBox = new javax.swing.JComboBox ();203 vitociComboBox = new javax.swing.JComboBox ();200 oblastComboBox = new javax.swing.JComboBox<>(); 201 suburbComboBox = new javax.swing.JComboBox<>(); 202 vitociComboBox = new javax.swing.JComboBox<>(); 204 203 obecLabel = new javax.swing.JLabel(); 205 204 castObceLabel = new javax.swing.JLabel(); … … 298 297 if (oblast == null) return; 299 298 300 DefaultComboBoxModel vitocis = new DefaultComboBoxModel(oblast.getViToCis().toArray());299 DefaultComboBoxModel<ViToCi> vitocis = new DefaultComboBoxModel<>(oblast.getViToCis().toArray(new ViToCi[0])); 301 300 vitociHlIndex = reshuffleListItems(vitocis, hlViToCis); 302 301 vitociComboBox.setModel(vitocis); … … 312 311 313 312 if (obec.getSuburbs().size() > 0) { 314 Object[] suburbs = new Object[obec.getSuburbs().size() + 1];313 ElementWithStreets[] suburbs = new ElementWithStreets[obec.getSuburbs().size() + 1]; 315 314 for (int i=0; i<obec.getSuburbs().size(); i++) 316 315 suburbs[i] = obec.getSuburbs().get(i); 317 316 suburbs[obec.getSuburbs().size()] = obec; 318 DefaultComboBoxModel suburbsList = new DefaultComboBoxModel(suburbs);317 DefaultComboBoxModel<ElementWithStreets> suburbsList = new DefaultComboBoxModel<>(suburbs); 319 318 suburbHlIndex = reshuffleListItems(suburbsList, hlSuburbs); 320 319 suburbComboBox.setModel(suburbsList); 321 320 suburbComboBox.setSelectedItem(suburbsList.getElementAt(0)); 322 321 } else 323 suburbComboBox.setModel(new DefaultComboBoxModel ());322 suburbComboBox.setModel(new DefaultComboBoxModel<ElementWithStreets>()); 324 323 325 324 suburbComboBox.setEnabled(suburbComboBox.getModel().getSize() > 1); … … 353 352 private javax.swing.JPanel mainPanel; 354 353 private javax.swing.JLabel obecLabel; 355 private javax.swing.JComboBox oblastComboBox;354 private javax.swing.JComboBox<Region> oblastComboBox; 356 355 private javax.swing.JLabel oblastLabel; 357 private javax.swing.JComboBox suburbComboBox;358 private javax.swing.JComboBox vitociComboBox;356 private javax.swing.JComboBox<ElementWithStreets> suburbComboBox; 357 private javax.swing.JComboBox<ViToCi> vitociComboBox; 359 358 // End of variables declaration//GEN-END:variables 360 359 … … 362 361 @Override 363 362 public Component getListCellRendererComponent( 364 JList list, Object value, int index,363 JList<?> list, Object value, int index, 365 364 boolean isSelected, boolean cellHasFocus) { 366 365 … … 383 382 private class SuburbRenderer extends AddressElementRenderer { 384 383 @Override 385 public Component getListCellRendererComponent(JList list, Object value,384 public Component getListCellRendererComponent(JList<?> list, Object value, 386 385 int index, boolean isSelected, boolean cellHasFocus) { 387 386 Component c = super.getListCellRendererComponent(list, value, -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/PointManipulatorDialog.java
r29727 r30532 197 197 changeLocationButton = new javax.swing.JButton(); 198 198 jScrollPane1 = new javax.swing.JScrollPane(); 199 proposalList = new javax.swing.JList ();200 matchesComboBox = new javax.swing.JComboBox ();199 proposalList = new javax.swing.JList<>(); 200 matchesComboBox = new javax.swing.JComboBox<>(); 201 201 jLabel6 = new javax.swing.JLabel(); 202 202 statusLabel = new javax.swing.JLabel(); … … 236 236 jScrollPane1.setViewportView(proposalList); 237 237 238 matchesComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "" }));238 //matchesComboBox.setModel(new javax.swing.DefaultComboBoxModel<String>(new String[] { "" })); 239 239 matchesComboBox.addItemListener(new java.awt.event.ItemListener() { 240 240 public void itemStateChanged(java.awt.event.ItemEvent evt) { … … 307 307 private void proposalListKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_proposalListKeyReleased 308 308 if (evt.getKeyCode() == KeyEvent.VK_DELETE) { 309 for (Object o : proposalList.getSelectedValues ())309 for (Object o : proposalList.getSelectedValuesList()) 310 310 proposalContainer.removeProposal((Proposal) o); 311 311 } … … 341 341 private javax.swing.JTextField locationEdit; 342 342 private javax.swing.JPanel mainPanel; 343 private javax.swing.JComboBox matchesComboBox;344 private javax.swing.JList proposalList;343 private javax.swing.JComboBox<AddressElement> matchesComboBox; 344 private javax.swing.JList<Proposal> proposalList; 345 345 private javax.swing.JLabel statusLabel; 346 346 // End of variables declaration//GEN-END:variables … … 349 349 * Container for all Houses, which match the given 'alternatenumber'. 350 350 */ 351 private class MatchesComboBoxModel extends HalfCookedComboBoxModel {351 private class MatchesComboBoxModel extends HalfCookedComboBoxModel<AddressElement> { 352 352 353 353 private List<AddressElement> matches = null; … … 379 379 } 380 380 381 public Object getElementAt(int index) {381 public AddressElement getElementAt(int index) { 382 382 if (matches == null) return null; 383 383 if (index >= matches.size()) return null; -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/databaseeditors/StreetEditor.java
r29854 r30532 37 37 38 38 nameField.setText(street.getName()); 39 houseList.setModel(new DefaultComboBoxModel (street.getHouses().toArray()));39 houseList.setModel(new DefaultComboBoxModel<>(street.getHouses().toArray(new House[0]))); 40 40 houseList.setCellRenderer(new UniversalListRenderer()); 41 41 … … 72 72 jLabel3 = new javax.swing.JLabel(); 73 73 jScrollPane1 = new javax.swing.JScrollPane(); 74 houseList = new javax.swing.JList ();74 houseList = new javax.swing.JList<>(); 75 75 parentEditButton = new javax.swing.JButton(); 76 76 houseEditButton = new javax.swing.JButton(); … … 163 163 assert selectedHouse != null; 164 164 if (EditorFactory.editHouse(selectedHouse)) 165 houseList.setModel(new DefaultComboBoxModel (street.getHouses().toArray()));165 houseList.setModel(new DefaultComboBoxModel<>(street.getHouses().toArray(new House[0]))); 166 166 }//GEN-LAST:event_houseEditButtonActionPerformed 167 167 … … 175 175 // Variables declaration - do not modify//GEN-BEGIN:variables 176 176 private javax.swing.JButton houseEditButton; 177 private javax.swing.JList houseList;177 private javax.swing.JList<House> houseList; 178 178 private javax.swing.JLabel jLabel1; 179 179 private javax.swing.JLabel jLabel2; -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/databaseeditors/SuburbEditor.java
r29854 r30532 39 39 parentEditButton.setEnabled(EditorFactory.isEditable(parent)); 40 40 41 houseList.setModel(new DefaultComboBoxModel (suburb.getHouses().toArray()));41 houseList.setModel(new DefaultComboBoxModel<>(suburb.getHouses().toArray(new House[0]))); 42 42 houseList.setCellRenderer(new UniversalListRenderer()); 43 43 … … 46 46 houseListChanged(null); 47 47 48 streetList.setModel(new DefaultComboBoxModel (suburb.getStreets().toArray()));48 streetList.setModel(new DefaultComboBoxModel<>(suburb.getStreets().toArray(new Street[0]))); 49 49 streetList.setCellRenderer(new UniversalListRenderer()); 50 50 … … 81 81 jLabel3 = new javax.swing.JLabel(); 82 82 jScrollPane1 = new javax.swing.JScrollPane(); 83 houseList = new javax.swing.JList ();83 houseList = new javax.swing.JList<>(); 84 84 parentEditButton = new javax.swing.JButton(); 85 85 houseEditButton = new javax.swing.JButton(); 86 86 jScrollPane2 = new javax.swing.JScrollPane(); 87 streetList = new javax.swing.JList ();87 streetList = new javax.swing.JList<>(); 88 88 streetEditButton = new javax.swing.JButton(); 89 89 jLabel4 = new javax.swing.JLabel(); … … 212 212 assert selectedHouse != null; 213 213 if (EditorFactory.editHouse(selectedHouse)) 214 houseList.setModel(new DefaultComboBoxModel (suburb.getHouses().toArray()));214 houseList.setModel(new DefaultComboBoxModel<>(suburb.getHouses().toArray(new House[0]))); 215 215 }//GEN-LAST:event_houseEditButtonActionPerformed 216 216 … … 223 223 assert selectedStreet != null; 224 224 if (EditorFactory.editStreet(selectedStreet)) 225 streetList.setModel(new DefaultComboBoxModel (suburb.getStreets().toArray()));225 streetList.setModel(new DefaultComboBoxModel<>(suburb.getStreets().toArray(new Street[0]))); 226 226 }//GEN-LAST:event_streetEditButtonActionPerformed 227 227 … … 229 229 // Variables declaration - do not modify//GEN-BEGIN:variables 230 230 private javax.swing.JButton houseEditButton; 231 private javax.swing.JList houseList;231 private javax.swing.JList<House> houseList; 232 232 private javax.swing.JLabel jLabel1; 233 233 private javax.swing.JLabel jLabel2; … … 242 242 private javax.swing.JTextField parentField; 243 243 private javax.swing.JButton streetEditButton; 244 private javax.swing.JList streetList;244 private javax.swing.JList<Street> streetList; 245 245 // End of variables declaration//GEN-END:variables 246 246 -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/HalfCookedComboBoxModel.java
r15585 r30532 16 16 * @author Radomír Černoch, radomir.cernoch@gmail.com 17 17 */ 18 public abstract class HalfCookedComboBoxModel implements ComboBoxModel{18 public abstract class HalfCookedComboBoxModel<E> implements ComboBoxModel<E> { 19 19 20 20 List<ListDataListener> listeners = new ArrayList<ListDataListener>(); 21 21 22 @Override 22 23 public void addListDataListener(ListDataListener l) { 23 24 listeners.add(l); 24 25 } 25 26 27 @Override 26 28 public void removeListDataListener(ListDataListener l) { 27 29 listeners.remove(l); -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/gui/utils/HalfCookedListModel.java
r15585 r30532 16 16 * @author Radomír Černoch, radomir.cernoch@gmail.com 17 17 */ 18 public abstract class HalfCookedListModel implements ListModel{18 public abstract class HalfCookedListModel<E> implements ListModel<E> { 19 19 20 20 List<ListDataListener> listeners = new ArrayList<ListDataListener>(); 21 21 22 @Override 22 23 public void addListDataListener(ListDataListener l) { 23 24 listeners.add(l); 24 25 } 25 26 27 @Override 26 28 public void removeListDataListener(ListDataListener l) { 27 29 listeners.remove(l); -
applications/editors/josm/plugins/czechaddress/src/org/openstreetmap/josm/plugins/czechaddress/proposal/ProposalContainer.java
r15584 r30532 23 23 * @see Proposal 24 24 */ 25 public class ProposalContainer implements ListModel, Comparable<ProposalContainer> { 26 25 public class ProposalContainer implements ListModel<Proposal>, Comparable<ProposalContainer> { 27 26 28 27 /** … … 65 64 * The list of proposals to be applied to encapsulated primitive. 66 65 */ 67 protected List<Proposal> proposals 68 = new ArrayList<Proposal>(); 66 protected List<Proposal> proposals = new ArrayList<Proposal>(); 69 67 70 68 /** … … 184 182 } 185 183 184 @Override 186 185 public int getSize() { 187 186 return proposals.size(); 188 187 } 189 188 190 public Object getElementAt(int index) { 189 @Override 190 public Proposal getElementAt(int index) { 191 191 return proposals.get(index); 192 192 } 193 193 194 @Override 194 195 public void addListDataListener(ListDataListener l) { 195 196 listeners.add(l); 196 197 } 197 198 199 @Override 198 200 public void removeListDataListener(ListDataListener l) { 199 201 listeners.remove(l); 200 202 } 201 203 204 @Override 202 205 public int compareTo(ProposalContainer o) { 203 206 return PrimUtils.comparator.compare(this.target, o.target); 204 207 } 205 206 208 } -
applications/editors/josm/plugins/editgpx/src/org/openstreetmap/josm/plugins/editgpx/GPXLayerImportAction.java
r28204 r30532 37 37 class GPXLayerImportAction extends AbstractAction { 38 38 39 40 private static final long serialVersionUID = 5794897888911798168L;41 39 private EditGpxData data; 42 40 public Object importing = new Object(); //used for synchronization … … 54 52 public void activateImport() { 55 53 Box panel = Box.createVerticalBox(); 56 DefaultListModel dModel= new DefaultListModel();54 DefaultListModel<GpxLayer> dModel = new DefaultListModel<>(); 57 55 58 final JList layerList = new JList(dModel);56 final JList<GpxLayer> layerList = new JList<>(dModel); 59 57 Collection<Layer> data = Main.map.mapView.getAllLayers(); 60 58 int layerCnt = 0; … … 62 60 for (Layer l : data){ 63 61 if(l instanceof GpxLayer){ 64 dModel.addElement( l);62 dModel.addElement((GpxLayer) l); 65 63 layerCnt++; 66 64 } … … 69 67 layerList.setSelectionInterval(0, layerCnt-1); 70 68 layerList.setCellRenderer(new DefaultListCellRenderer(){ 71 @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {69 @Override public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { 72 70 Layer layer = (Layer)value; 73 71 JLabel label = (JLabel)super.getListCellRendererComponent(list, … … 104 102 } 105 103 synchronized(importing) { 106 for (Object o : layerList.getSelectedValues()) { 107 GpxLayer gpx = (GpxLayer )o; 104 for (GpxLayer gpx : layerList.getSelectedValuesList()) { 108 105 this.data.load(gpx.data); 109 106 } -
applications/editors/josm/plugins/globalsat/src/org/kaintoch/gps/globalsat/dg100/Response.java
r29854 r30532 12 12 * 13 13 */ 14 public class Response 14 public class Response<E> 15 15 { 16 16 final static public byte typeFileInfo = (byte)0xBB; … … 23 23 private int nextIdx = 0; 24 24 private Dg100Config config = null; 25 private List data = new ArrayList(100);25 private List<E> data = new ArrayList<>(100); 26 26 private long id = 0; 27 27 … … 35 35 * @param resp 36 36 */ 37 static public Response parseResponse(byte resp[], int len)37 static public Response<?> parseResponse(byte resp[], int len) 38 38 { 39 39 ByteBuffer buf = ByteBuffer.wrap(resp); 40 40 byte respType = buf.get(4); 41 Response response = new Response(respType);42 41 buf.position(5); 43 42 if (respType == typeFileInfo) // file info 44 43 { 44 Response<FileInfoRec> response = new Response<>(respType); 45 45 int cntInfoCur = buf.getShort(); 46 46 int nextIdx = buf.getShort(); … … 52 52 response.addRec(fileInfoRec); 53 53 } 54 return response; 54 55 } 55 56 else if (respType == typeGpsRec) // gps recs 56 57 { 58 Response<GpsRec> response = new Response<>(respType); 57 59 int recType = 2; 58 60 // read part 1 … … 85 87 recType = gpsRec.getDg100TypeOfNextRec(); 86 88 } 89 return response; 87 90 } 88 91 else if (respType == typeConfig) // config 89 92 { 93 Response<?> response = new Response<>(respType); 90 94 Dg100Config config = new Dg100Config(buf); 91 95 response.config = config; 96 return response; 92 97 } 93 98 else if (respType == typeId) // id 94 99 { 100 Response<?> response = new Response<>(respType); 95 101 response.id = 0; 96 102 for (int ii = 0 ; ii < 8 ; ++ii) … … 99 105 response.id = response.id * 10 + digit; 100 106 } 107 return response; 101 108 } 102 109 else 103 110 { 111 return new Response<>(respType); 104 112 } 105 return response;106 113 } 107 114 108 private void addRec( Objectobj)115 private void addRec(E obj) 109 116 { 110 117 data.add(obj); 111 118 } 112 119 113 public List getRecs()120 public List<E> getRecs() 114 121 { 115 122 return data; -
applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatConfigDialog.java
r29854 r30532 5 5 6 6 import static org.openstreetmap.josm.tools.I18n.tr; 7 import gnu.io.CommPortIdentifier;8 7 9 8 import java.awt.Dimension; … … 13 12 import java.awt.event.ActionListener; 14 13 import java.awt.event.KeyEvent; 15 import java.util.LinkedList;16 import java.util.List;17 14 18 15 import javax.swing.BoxLayout; 19 16 import javax.swing.ButtonGroup; 20 17 import javax.swing.JCheckBox; 21 import javax.swing.JComboBox;22 18 import javax.swing.JLabel; 23 19 import javax.swing.JOptionPane; … … 28 24 import org.kaintoch.gps.globalsat.dg100.Dg100Config; 29 25 import org.openstreetmap.josm.Main; 30 31 26 32 27 /** … … 55 50 } 56 51 57 58 59 // the JOptionPane that contains this dialog. required for the closeDialog() method.60 private JOptionPane optionPane;61 private JCheckBox delete;62 private JComboBox portCombo;63 52 private JRadioButton formatPosOnly = new JRadioButton(tr("Position only")); 64 53 private JRadioButton formatPosTDS = new JRadioButton(tr("Position, Time, Date, Speed")); … … 79 68 private JTextField cMeters = new IntegerTextField(); 80 69 81 private JLabel memUsage = new JLabel();82 83 70 private JCheckBox disableLogDist, disableLogSpeed; 84 71 private JTextField minLogDist, minLogSpeed; 85 72 86 private List<CommPortIdentifier> ports = new LinkedList<CommPortIdentifier>();87 88 73 private Dg100Config conf; 89 90 74 91 75 public GlobalsatConfigDialog(Dg100Config config) { … … 326 310 327 311 /** 328 * Has to be called after this dialog has been added to a JOptionPane.329 * @param optionPane330 */331 public void setOptionPane(JOptionPane optionPane) {332 this.optionPane = optionPane;333 }334 335 /**336 312 * Get the selected configuration. 337 313 */ -
applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatDg100.java
r26509 r30532 50 50 51 51 /** delete file: A0 A2 00 02 BC 01 00 BD B0 B3 */ 52 private static byte dg100CmdSwitch2Nmea[] =52 /*private static byte dg100CmdSwitch2Nmea[] = 53 53 { (byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x18, (byte) 0x81, 54 54 (byte) 0x02, (byte) 0x01, (byte) 0x01, (byte) 0x00, (byte) 0x01, … … 58 58 (byte) 0x00, (byte) 0x25, (byte) 0x80, (byte) 0x00, (byte) 0x00, 59 59 (byte) 0xB0, (byte) 0xB3 60 }; 60 };*/ 61 61 /** delete file: A0 A2 00 02 BC 01 00 BD B0 B3 */ 62 private static byte dg100CmdEnterGMouse[] =62 /*private static byte dg100CmdEnterGMouse[] = 63 63 { (byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x02, (byte) 0xBC 64 64 , (byte) 0x01, (byte) 0x00, (byte) 0xBD, (byte) 0xB0, (byte) 0xB3 65 }; 65 };*/ 66 66 /** delete file: A0 A2 00 03 BA FF FF 02 B8 B0 B3 */ 67 67 private static byte dg100CmdDelFile[] = … … 104 104 }; 105 105 /** read config: A0 A2 00 01 BF 00 BF B0 B3 */ 106 private static byte dg100CmdGetId[] =106 /*private static byte dg100CmdGetId[] = 107 107 { (byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x01, (byte) 0xBF 108 , (byte) 0x00, (byte) 0xBF, (byte) 0xB0, (byte) 0xB3 }; 108 , (byte) 0x00, (byte) 0xBF, (byte) 0xB0, (byte) 0xB3 };*/ 109 109 /** read config: A0 A2 00 01 BF 00 BF B0 B3 */ 110 private static byte dg100CmdSetId[] =110 /*private static byte dg100CmdSetId[] = 111 111 { (byte) 0xA0, (byte) 0xA2, (byte) 0x00, (byte) 0x09, (byte) 0xC0 112 112 , (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00 113 113 , (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00 114 , (byte) 0x00, (byte) 0xC0, (byte) 0xB0, (byte) 0xB3}; 114 , (byte) 0x00, (byte) 0xC0, (byte) 0xB0, (byte) 0xB3};*/ 115 115 116 116 private byte[] response = new byte[65536]; … … 187 187 } 188 188 try{ 189 Response response =sendCmdDelFiles();189 sendCmdDelFiles(); 190 190 }catch(Exception e){ 191 191 throw new ConnectionException(e); … … 220 220 try{ 221 221 do{ 222 Response response = sendCmdGetFileInfo(nextIdx);222 Response<FileInfoRec> response = sendCmdGetFileInfo(nextIdx); 223 223 nextIdx = response.getNextIdx(); 224 224 result.addAll(response.getRecs()); … … 232 232 public List<GpsRec> readGpsRecList(List<FileInfoRec> fileInfoList) throws ConnectionException 233 233 { 234 int cnt = 0;235 234 List<GpsRec> result = new ArrayList<GpsRec>(200); 236 235 237 236 try{ 238 237 for(FileInfoRec fileInfoRec:fileInfoList){ 239 cnt++; 240 Response response = sendCmdGetGpsRecs(fileInfoRec.getIdx()); 238 Response<GpsRec> response = sendCmdGetGpsRecs(fileInfoRec.getIdx()); 241 239 result.addAll(response.getRecs()); 242 240 } … … 247 245 } 248 246 249 private Response sendCmdDelFiles() throws IOException, UnsupportedCommOperationException247 private Response<?> sendCmdDelFiles() throws IOException, UnsupportedCommOperationException 250 248 { 251 249 System.out.println("deleting data..."); … … 254 252 } 255 253 256 private Response sendCmdGetFileInfo(int idx) throws IOException, UnsupportedCommOperationException 254 @SuppressWarnings("unchecked") 255 private Response<FileInfoRec> sendCmdGetFileInfo(int idx) throws IOException, UnsupportedCommOperationException 257 256 { 258 257 byte[] src = dg100CmdGetFileInfo; … … 262 261 updateCheckSum(buf); 263 262 int len = sendCmd(src, response, -1); 264 return Response.parseResponse(response, len);265 } 266 267 private Response sendCmdGetConfig() throws IOException, UnsupportedCommOperationException263 return (Response<FileInfoRec>) Response.parseResponse(response, len); 264 } 265 266 private Response<?> sendCmdGetConfig() throws IOException, UnsupportedCommOperationException 268 267 { 269 268 byte[] src = dg100CmdGetConfig; … … 277 276 connect(); 278 277 } 279 Response response = sendCmdGetConfig(); 280 return response.getConfig(); 278 return sendCmdGetConfig().getConfig(); 281 279 }catch(Exception e){ 282 280 throw new ConnectionException(e); 283 281 } 284 282 } 285 286 283 287 284 private void sendCmdSetConfig(Dg100Config config) throws IOException, UnsupportedCommOperationException … … 310 307 } 311 308 312 private Response sendCmdGetGpsRecs(int idx) throws IOException, UnsupportedCommOperationException 309 @SuppressWarnings("unchecked") 310 private Response<GpsRec> sendCmdGetGpsRecs(int idx) throws IOException, UnsupportedCommOperationException 313 311 { 314 312 byte[] src = dg100CmdGetGpsRecs; … … 318 316 updateCheckSum(buf); 319 317 int len = sendCmd(src, response, 2074); 320 return Response.parseResponse(response, len);318 return (Response<GpsRec>) Response.parseResponse(response, len); 321 319 } 322 320 -
applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatImportDialog.java
r29854 r30532 10 10 import java.awt.event.ActionListener; 11 11 import java.util.Enumeration; 12 import java.util.LinkedList;13 import java.util.List;14 12 15 13 import javax.swing.JButton; … … 33 31 public class GlobalsatImportDialog extends JPanel { 34 32 35 // the JOptionPane that contains this dialog. required for the closeDialog() method.36 private JOptionPane optionPane;37 33 private JCheckBox delete; 38 private JComboBox portCombo; 39 private List<CommPortIdentifier> ports = new LinkedList<CommPortIdentifier>(); 34 private JComboBox<CommPortIdentifier> portCombo; 40 35 41 36 public GlobalsatImportDialog() { … … 45 40 setLayout(new GridBagLayout()); 46 41 47 portCombo = new JComboBox ();48 portCombo.setRenderer(new ListCellRenderer (){49 public java.awt.Component getListCellRendererComponent(JList list, Objecto, int x, boolean a, boolean b){50 String value = ((CommPortIdentifier)o).getName();42 portCombo = new JComboBox<>(); 43 portCombo.setRenderer(new ListCellRenderer<CommPortIdentifier>(){ 44 public java.awt.Component getListCellRendererComponent(JList<? extends CommPortIdentifier> list, CommPortIdentifier o, int x, boolean a, boolean b){ 45 String value = o.getName(); 51 46 if(value == null){ 52 47 value = "null"; … … 103 98 JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION); 104 99 JDialog dlg = pane.createDialog(Main.parent, tr("Configure Device")); 105 dialog.setOptionPane(pane);106 100 dlg.setVisible(true); 107 101 if(((Integer)pane.getValue()) == JOptionPane.OK_OPTION){ … … 140 134 portCombo.removeAllItems(); 141 135 142 Enumeration e = CommPortIdentifier.getPortIdentifiers();136 Enumeration<?> e = CommPortIdentifier.getPortIdentifiers(); 143 137 for(e = CommPortIdentifier.getPortIdentifiers(); e.hasMoreElements(); ){ 144 138 CommPortIdentifier port = (CommPortIdentifier)e.nextElement(); … … 163 157 return (CommPortIdentifier)portCombo.getSelectedItem(); 164 158 } 165 /**166 * Has to be called after this dialog has been added to a JOptionPane.167 * @param optionPane168 */169 public void setOptionPane(JOptionPane optionPane) {170 this.optionPane = optionPane;171 }172 159 } -
applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatPlugin.java
r27852 r30532 7 7 import java.awt.event.KeyEvent; 8 8 import java.io.IOException; 9 import java.util.Enumeration;10 9 11 10 import javax.swing.JDialog; … … 86 85 } 87 86 88 89 87 GlobalsatImportAction importAction; 90 88 public GlobalsatPlugin(PluginInformation info) { … … 92 90 boolean error = false; 93 91 try{ 94 Enumeration e =CommPortIdentifier.getPortIdentifiers();92 CommPortIdentifier.getPortIdentifiers(); 95 93 }catch(java.lang.UnsatisfiedLinkError e){ 96 94 error = true; … … 114 112 JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION); 115 113 JDialog dlg = pane.createDialog(Main.parent, tr("Import")); 116 dialog.setOptionPane(pane);117 114 dlg.setVisible(true); 118 115 if(((Integer)pane.getValue()) == JOptionPane.OK_OPTION){ -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/GraphViewDialog.java
r29854 r30532 52 52 private final LinkedHashMap<String, ColorScheme> availableColorSchemes; 53 53 54 55 54 private final GraphViewPreferences preferences; 56 55 private final GraphViewPlugin plugin; 57 56 58 private final JComboBox rulesetComboBox;59 private final JComboBox bookmarkComboBox;60 private final JComboBox colorSchemeComboBox;57 private final JComboBox<String> rulesetComboBox; 58 private final JComboBox<String> bookmarkComboBox; 59 private final JComboBox<String> colorSchemeComboBox; 61 60 62 61 /** … … 111 110 selectionPanel.add(rulesetLabel); 112 111 113 rulesetComboBox = new JComboBox ();112 rulesetComboBox = new JComboBox<>(); 114 113 rulesetComboBox.addActionListener(rulesetActionListener); 115 114 gbcComboBox.gridy = 0; … … 125 124 selectionPanel.add(bookmarkLabel); 126 125 127 bookmarkComboBox = new JComboBox ();126 bookmarkComboBox = new JComboBox<>(); 128 127 bookmarkComboBox.addActionListener(bookmarkActionListener); 129 128 gbcComboBox.gridy = 1; … … 139 138 selectionPanel.add(colorSchemeLabel); 140 139 141 colorSchemeComboBox = new JComboBox ();140 colorSchemeComboBox = new JComboBox<>(); 142 141 for (String colorSchemeName : availableColorSchemes.keySet()) { 143 142 colorSchemeComboBox.addItem(colorSchemeName); … … 285 284 286 285 bookmarkComboBox.addActionListener(bookmarkActionListener); 287 288 286 } 289 290 287 } -
applications/editors/josm/plugins/graphview/src/org/openstreetmap/josm/plugins/graphview/plugin/dialogs/GraphViewPreferenceEditor.java
r27863 r30532 57 57 private JButton selectRulesetFolderButton; 58 58 59 private JComboBox bookmarkComboBox;59 private JComboBox<String> bookmarkComboBox; 60 60 private JButton editBookmarkButton; 61 61 private JButton deleteBookmarkButton; … … 174 174 vehiclePanel.setLayout(new BoxLayout(vehiclePanel, BoxLayout.Y_AXIS)); 175 175 176 bookmarkComboBox = new JComboBox ();176 bookmarkComboBox = new JComboBox<>(); 177 177 vehiclePanel.add(bookmarkComboBox); 178 178 -
applications/editors/josm/plugins/imageryadjust/src/imageryadjust/ImageryAdjustMapMode.java
r29609 r30532 165 165 166 166 @Override 167 public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,167 public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, 168 168 boolean cellHasFocus) { 169 169 Layer layer = (Layer) value; … … 186 186 if (adjustableLayers.size()==0) return null; 187 187 if (adjustableLayers.size()==1) return adjustableLayers.get(0); 188 JComboBox layerList = new JComboBox();188 JComboBox<Layer> layerList = new JComboBox<>(); 189 189 layerList.setRenderer(new LayerListCellRenderer()); 190 layerList.setModel(new DefaultComboBoxModel (adjustableLayers.toArray()));190 layerList.setModel(new DefaultComboBoxModel<Layer>(adjustableLayers.toArray(new Layer[0]))); 191 191 layerList.setSelectedIndex(0); 192 192 -
applications/editors/josm/plugins/imagerycache/.settings/org.eclipse.jdt.core.prefs
r30416 r30532 1 1 eclipse.preferences.version=1 2 org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled 3 org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore 4 org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull 5 org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault 6 org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable 7 org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled 2 8 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 9 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 4 10 org.eclipse.jdt.core.compiler.compliance=1.7 11 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning 5 12 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 13 org.eclipse.jdt.core.compiler.problem.autoboxing=ignore 14 org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning 15 org.eclipse.jdt.core.compiler.problem.deadCode=warning 16 org.eclipse.jdt.core.compiler.problem.deprecation=warning 17 org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled 18 org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled 19 org.eclipse.jdt.core.compiler.problem.discouragedReference=warning 20 org.eclipse.jdt.core.compiler.problem.emptyStatement=warning 6 21 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 22 org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore 23 org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore 24 org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled 25 org.eclipse.jdt.core.compiler.problem.fieldHiding=warning 26 org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning 27 org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning 28 org.eclipse.jdt.core.compiler.problem.forbiddenReference=error 29 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning 30 org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled 31 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning 32 org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning 33 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore 34 org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore 35 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning 36 org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore 37 org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore 38 org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled 39 org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore 40 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore 41 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled 42 org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore 43 org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore 44 org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning 45 org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning 46 org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore 47 org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning 48 org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error 49 org.eclipse.jdt.core.compiler.problem.nullReference=warning 50 org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error 51 org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning 52 org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning 53 org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore 54 org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore 55 org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore 56 org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore 57 org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning 58 org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning 59 org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore 60 org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore 61 org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore 62 org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore 63 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore 64 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled 65 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning 66 org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled 67 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled 68 org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled 69 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore 70 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning 71 org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled 72 org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning 73 org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning 74 org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore 75 org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning 76 org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore 77 org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore 78 org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore 79 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore 80 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled 81 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled 82 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled 83 org.eclipse.jdt.core.compiler.problem.unusedImport=warning 84 org.eclipse.jdt.core.compiler.problem.unusedLabel=warning 85 org.eclipse.jdt.core.compiler.problem.unusedLocal=warning 86 org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning 87 org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore 88 org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled 89 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled 90 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled 91 org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning 92 org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore 93 org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning 94 org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning 7 95 org.eclipse.jdt.core.compiler.source=1.7 -
applications/editors/josm/plugins/imagerycache/src/org/mapdb/AsyncWriteEngine.java
r29484 r30532 49 49 protected Throwable writerFailedException = null; 50 50 51 52 protected final LongConcurrentHashMap<Fun.Tuple2<Object,Serializer>> items = new LongConcurrentHashMap<Fun.Tuple2<Object, Serializer>>(); 51 protected final LongConcurrentHashMap<Fun.Tuple2<Object,Serializer<Object>>> items = new LongConcurrentHashMap<>(); 53 52 54 53 protected final Thread newRecidsThread = new Thread("MapDB prealloc #"+threadNum){ … … 73 72 74 73 for(;;){ 75 LongMap.LongMapIterator<Fun.Tuple2<Object,Serializer >> iter = items.longMapIterator();74 LongMap.LongMapIterator<Fun.Tuple2<Object,Serializer<Object>>> iter = items.longMapIterator(); 76 75 77 76 if(!iter.moveToNext()){ … … 87 86 while(iter.moveToNext()){ 88 87 long recid = iter.key(); 89 Fun.Tuple2<Object,Serializer > value = iter.value();88 Fun.Tuple2<Object,Serializer<Object>> value = iter.value(); 90 89 if(value.a==DELETED){ 91 90 AsyncWriteEngine.super.delete(recid, value.b); … … 107 106 Utils.lock(writeLocks,recid); 108 107 try{ 109 Fun.Tuple2<Object,Serializer > value = iter.value();108 Fun.Tuple2<Object,Serializer<Object>> value = iter.value(); 110 109 if(value.a==DELETED){ 111 110 AsyncWriteEngine.super.delete(recid, value.b); … … 165 164 } 166 165 166 @SuppressWarnings("unchecked") 167 167 @Override 168 168 public <A> A get(long recid, Serializer<A> serializer) { … … 172 172 try{ 173 173 checkState(); 174 Fun.Tuple2<Object,Serializer > item = items.get(recid);174 Fun.Tuple2<Object,Serializer<Object>> item = items.get(recid); 175 175 if(item!=null){ 176 176 if(item.a == DELETED) return null; … … 187 187 } 188 188 189 @SuppressWarnings({ "rawtypes", "unchecked" }) 189 190 @Override 190 191 public <A> void update(long recid, A value, Serializer<A> serializer) { … … 206 207 } 207 208 209 @SuppressWarnings({ "unchecked", "rawtypes" }) 208 210 @Override 209 211 public <A> boolean compareAndSwap(long recid, A expectedOldValue, A newValue, Serializer<A> serializer) { … … 212 214 try{ 213 215 checkState(); 214 Fun.Tuple2<Object, Serializer > existing = items.get(recid);216 Fun.Tuple2<Object, Serializer<Object>> existing = items.get(recid); 215 217 A oldValue = existing!=null? (A) existing.a : super.get(recid, serializer); 216 218 if(oldValue == expectedOldValue || (oldValue!=null && oldValue.equals(expectedOldValue))){ … … 226 228 } 227 229 230 @SuppressWarnings("unchecked") 228 231 @Override 229 232 public <A> void delete(long recid, Serializer<A> serializer) { … … 245 248 shutdownCondition.await(); 246 249 247 248 250 super.close(); 249 251 } catch (InterruptedException e) { … … 251 253 } 252 254 } 253 254 255 255 256 256 protected WeakReference<Engine> parentEngineWeakRef = null; … … 302 302 } 303 303 } 304 305 304 } -
applications/editors/josm/plugins/imagerycache/src/org/mapdb/BTreeKeySerializer.java
r29484 r30532 18 18 static final class BasicKeySerializer extends BTreeKeySerializer<Object> { 19 19 20 protected final Serializer defaultSerializer;20 protected final Serializer<Object> defaultSerializer; 21 21 22 BasicKeySerializer(Serializer defaultSerializer) {22 BasicKeySerializer(Serializer<Object> defaultSerializer) { 23 23 this.defaultSerializer = defaultSerializer; 24 24 } -
applications/editors/josm/plugins/imagerycache/src/org/mapdb/BTreeMap.java
r29484 r30532 275 275 } 276 276 277 278 277 protected final Serializer<BNode> nodeSerializer = new Serializer<BNode>() { 279 278 @Override … … 298 297 } 299 298 } 300 301 } 302 299 } 303 300 304 301 final boolean left = value.keys()[0] == null; 305 302 final boolean right = value.keys()[value.keys().length-1] == null; 306 307 303 308 304 final int header; … … 334 330 } 335 331 336 337 338 332 out.write(header); 339 333 out.write(value.keys().length); … … 346 340 Utils.packLong(out, child); 347 341 } 348 349 350 342 351 343 keySerializer.serialize(out,left?1:0, -
applications/editors/josm/plugins/imagerycache/src/org/mapdb/Bind.java
r29363 r30532 4 4 import java.util.Map; 5 5 import java.util.NavigableSet; 6 import java.util.Set;7 6 import java.util.concurrent.ConcurrentMap; 8 7 … … 21 20 public Iterator<K1> iterator() { 22 21 //use range query to get all values 22 @SuppressWarnings("unchecked") 23 23 final Iterator<Fun.Tuple2<K2,K1>> iter = 24 ((NavigableSet)secondaryKeys) //cast is workaround for generics24 secondaryKeys 25 25 .subSet( 26 Fun.t2(secondaryKey, null), //NULL represents lower bound, everything is larger than null27 Fun.t2(secondaryKey, Fun.HI) // HI is upper bound everything is smaller then HI26 Fun.t2(secondaryKey,(K1)null), //NULL represents lower bound, everything is larger than null 27 Fun.t2(secondaryKey,(K1)Fun.HI) // HI is upper bound everything is smaller then HI 28 28 ).iterator(); 29 29 … … 59 59 } 60 60 61 public static void size(MapWithModificationListenermap, final Atomic.Long size){61 public static <K,V> void size(MapWithModificationListener<K, V> map, final Atomic.Long size){ 62 62 //set initial value first if necessary 63 63 if(size.get() == 0 && map.isEmpty()) 64 64 size.set(map.size()); //TODO long overflow? 65 65 66 map.addModificationListener(new MapListener () {66 map.addModificationListener(new MapListener<K, V>() { 67 67 @Override 68 68 public void update(Object key, Object oldVal, Object newVal) { -
applications/editors/josm/plugins/imagerycache/src/org/mapdb/CacheLRU.java
r29484 r30532 78 78 Utils.lock(locks,recid); 79 79 Engine engine = getWrappedEngine(); 80 LongMap cache2 = checkClosed(cache);80 LongMap<Object> cache2 = checkClosed(cache); 81 81 Object oldValue = cache.get(recid); 82 82 if(oldValue == expectedOldValue || oldValue.equals(expectedOldValue)){ … … 94 94 } 95 95 } 96 97 96 98 97 @SuppressWarnings("rawtypes") -
applications/editors/josm/plugins/imagerycache/src/org/mapdb/EngineWrapper.java
r29484 r30532 14 14 * limitations under the License. 15 15 */ 16 17 16 package org.mapdb; 18 19 17 20 18 import java.io.IOError; … … 26 24 import java.util.concurrent.ConcurrentLinkedQueue; 27 25 28 29 26 /** 30 27 * EngineWrapper adapter. It implements all methods on Engine interface. … … 293 290 } 294 291 295 296 292 /** 297 293 * check if Record Instances were not modified while in cache. 298 294 * Usuful to diagnose strange problems with Instance Cache. 299 295 */ 300 public static class ImmutabilityCheckEngine extends EngineWrapper {301 302 protected static class Item {303 final Serializer serializer;304 final Objectitem;296 public static class ImmutabilityCheckEngine extends EngineWrapper { 297 298 protected static class Item<E> { 299 final Serializer<E> serializer; 300 final E item; 305 301 final int oldChecksum; 306 302 307 public Item(Serializer serializer, Objectitem) {303 public Item(Serializer<E> serializer, E item) { 308 304 if(item==null || serializer==null) throw new AssertionError("null"); 309 305 this.serializer = serializer; … … 313 309 } 314 310 315 private int checksum() {311 private int checksum() { 316 312 try { 317 313 DataOutput2 out = new DataOutput2(); … … 324 320 } 325 321 326 void check() {322 void check() { 327 323 int newChecksum = checksum(); 328 324 if(oldChecksum!=newChecksum) throw new AssertionError("Record instance was modified: \n "+item+"\n "+serializer); … … 330 326 } 331 327 332 protected LongConcurrentHashMap<Item > items = new LongConcurrentHashMap<Item>();328 protected LongConcurrentHashMap<Item<?>> items = new LongConcurrentHashMap<>(); 333 329 334 330 protected ImmutabilityCheckEngine(Engine engine) { … … 338 334 @Override 339 335 public <A> A get(long recid, Serializer<A> serializer) { 340 Item item = items.get(recid);336 Item<?> item = items.get(recid); 341 337 if(item!=null) item.check(); 342 338 A ret = super.get(recid, serializer); 343 if(ret!=null) items.put(recid, new Item (serializer,ret));339 if(ret!=null) items.put(recid, new Item<A>(serializer,ret)); 344 340 return ret; 345 341 } … … 348 344 public <A> long put(A value, Serializer<A> serializer) { 349 345 long ret = super.put(value, serializer); 350 if(value!=null) items.put(ret, new Item (serializer,value));346 if(value!=null) items.put(ret, new Item<A>(serializer,value)); 351 347 return ret; 352 348 } … … 354 350 @Override 355 351 public <A> void update(long recid, A value, Serializer<A> serializer) { 356 Item item = items.get(recid);352 Item<?> item = items.get(recid); 357 353 if(item!=null) item.check(); 358 354 super.update(recid, value, serializer); 359 if(value!=null) items.put(recid, new Item(serializer,value)); 360 } 361 355 if(value!=null) items.put(recid, new Item<A>(serializer,value)); 356 } 357 358 @SuppressWarnings({ "unchecked", "rawtypes" }) 362 359 @Override 363 360 public <A> boolean compareAndSwap(long recid, A expectedOldValue, A newValue, Serializer<A> serializer) { 364 Item item = items.get(recid);361 Item<?> item = items.get(recid); 365 362 if(item!=null) item.check(); 366 363 boolean ret = super.compareAndSwap(recid, expectedOldValue, newValue, serializer); … … 372 369 public void close() { 373 370 super.close(); 374 for(Iterator<Item > iter = items.valuesIterator(); iter.hasNext();){371 for(Iterator<Item<?>> iter = items.valuesIterator(); iter.hasNext();){ 375 372 iter.next().check(); 376 373 } … … 378 375 } 379 376 } 380 381 377 382 378 /** Engine wrapper with all methods synchronized on global lock, useful to diagnose concurrency issues.*/ … … 442 438 } 443 439 } 444 445 440 } -
applications/editors/josm/plugins/imagerycache/src/org/mapdb/Queues.java
r29484 r30532 40 40 } 41 41 42 @SuppressWarnings("unchecked") 42 43 @Override 43 44 public Node<E> deserialize(DataInput in, int available) throws IOException { … … 71 72 protected static final class Node<E>{ 72 73 74 @SuppressWarnings({ "unchecked", "rawtypes" }) 73 75 protected static final Node EMPTY = new Node(0L, null); 74 76 … … 302 304 } 303 305 306 @SuppressWarnings("unchecked") 304 307 static <E> Stack<E> getStack(Engine engine, Serializer<Serializer> serializerSerializer, long rootRecid){ 305 308 StackRoot root = engine.get(rootRecid, new StackRootSerializer(serializerSerializer)); … … 323 326 } 324 327 328 @SuppressWarnings("unchecked") 325 329 @Override 326 330 public boolean add(E item){ … … 337 341 } 338 342 343 @SuppressWarnings("unchecked") 339 344 @Override 340 345 public E poll(){ … … 416 421 } 417 422 423 @SuppressWarnings("unchecked") 418 424 static <E> long createQueue(Engine engine, Serializer<Serializer> serializerSerializer, Serializer<E> serializer){ 419 425 long headerRecid = engine.put(0L, Serializer.LONG_SERIALIZER); … … 426 432 } 427 433 428 434 @SuppressWarnings("unchecked") 429 435 static <E> Queue<E> getQueue(Engine engine, Serializer<Serializer> serializerSerializer, long rootRecid){ 430 436 QueueRoot root = engine.get(rootRecid, new QueueRootSerializer(serializerSerializer)); … … 439 445 protected final long size; 440 446 447 @SuppressWarnings("unchecked") 441 448 public CircularQueue(Engine engine, Serializer serializer, long headRecid, long headInsertRecid, long size) { 442 449 super(engine, serializer, headRecid); … … 445 452 } 446 453 454 @SuppressWarnings("unchecked") 447 455 @Override 448 456 public boolean add(Object o) { … … 545 553 } 546 554 555 @SuppressWarnings({ "rawtypes", "unchecked" }) 547 556 static <E> long createCircularQueue(Engine engine, Serializer<Serializer> serializerSerializer, Serializer<E> serializer, long size){ 548 557 if(size<2) throw new IllegalArgumentException(); -
applications/editors/josm/plugins/imagerycache/src/org/mapdb/SerializerBase.java
r29484 r30532 354 354 /** classes bellow need object stack, so initialize it if not alredy initialized*/ 355 355 if (objectStack == null) { 356 objectStack = new FastArrayList ();356 objectStack = new FastArrayList<>(); 357 357 objectStack.add(obj); 358 358 } … … 1065 1065 1066 1066 if (objectStack == null) 1067 objectStack = new FastArrayList ();1067 objectStack = new FastArrayList<>(); 1068 1068 int oldObjectStackSize = objectStack.size(); 1069 1069 … … 1112 1112 break; 1113 1113 case SERIALIZER_COMPRESSION_WRAPPER: 1114 ret = CompressLZF.CompressionWrapper((Serializer ) deserialize(is, objectStack));1114 ret = CompressLZF.CompressionWrapper((Serializer<?>) deserialize(is, objectStack)); 1115 1115 break; 1116 1116 default: -
applications/editors/josm/plugins/imagerycache/src/org/mapdb/SerializerPojo.java
r29363 r30532 542 542 static{ 543 543 try{ 544 Class clazz = Class.forName("sun.reflect.ReflectionFactory");544 Class<?> clazz = Class.forName("sun.reflect.ReflectionFactory"); 545 545 if(clazz!=null){ 546 546 Method getReflectionFactory = clazz.getMethod("getReflectionFactory"); … … 582 582 * If non of these works we fallback into usual reflection which requires an no-arg constructor 583 583 */ 584 @SuppressWarnings( "restriction")584 @SuppressWarnings({ "restriction", "unchecked" }) 585 585 protected <T> T createInstanceSkippinkConstructor(Class<T> clazz) 586 586 throws NoSuchMethodException, InvocationTargetException, IllegalAccessException, InstantiationException { -
applications/editors/josm/plugins/imagerycache/src/org/mapdb/SnapshotEngine.java
r29484 r30532 36 36 protected final ReentrantReadWriteLock snapshotsLock = new ReentrantReadWriteLock(); 37 37 38 @SuppressWarnings("unchecked") 38 39 @Override 39 40 public <A> long put(A value, Serializer<A> serializer) { … … 50 51 } 51 52 53 @SuppressWarnings("unchecked") 52 54 @Override 53 55 public <A> boolean compareAndSwap(long recid, A expectedOldValue, A newValue, Serializer<A> serializer) { … … 66 68 } 67 69 70 @SuppressWarnings("unchecked") 68 71 @Override 69 72 public <A> void update(long recid, A value, Serializer<A> serializer) { … … 85 88 } 86 89 90 @SuppressWarnings("unchecked") 87 91 @Override 88 92 public <A> void delete(long recid, Serializer<A> serializer) { … … 130 134 131 135 136 @SuppressWarnings("unchecked") 132 137 @Override 133 138 public <A> A get(long recid, Serializer<A> serializer) { -
applications/editors/josm/plugins/imagerycache/src/org/mapdb/TxMaker.java
r29363 r30532 11 11 public class TxMaker { 12 12 13 @SuppressWarnings("unchecked") 13 14 protected static final Fun.Tuple2<Object, Serializer> DELETED = new Fun.Tuple2(null, Serializer.STRING_SERIALIZER); 14 15 … … 62 63 protected Set<Long> newItems = new LinkedHashSet<Long>(); 63 64 64 65 65 protected TxEngine(Engine engine) { 66 66 super(engine); … … 79 79 } 80 80 81 @SuppressWarnings("unchecked") 81 82 @Override 82 83 public <A> A get(long recid, Serializer<A> serializer) { … … 93 94 } 94 95 96 @SuppressWarnings({ "rawtypes", "unchecked" }) 95 97 @Override 96 98 public <A> void update(long recid, A value, Serializer<A> serializer) { … … 128 130 } 129 131 132 @SuppressWarnings({ "unchecked", "rawtypes" }) 130 133 @Override 131 134 public void commit() { … … 144 147 engine.commit(); 145 148 } 146 147 149 } 148 150 … … 163 165 newItems = null; 164 166 } 165 166 167 } 167 168 … … 171 172 } 172 173 } 173 174 175 174 } -
applications/editors/josm/plugins/junctionchecking/src/org/openstreetmap/josm/plugins/JunctionChecker/junctionchecking/JunctionChecker.java
r25501 r30532 122 122 */ 123 123 private ArrayList<HashSet<Channel>> checkJunctionCandidates(ArrayList<HashSet<Channel>> junctioncandidates){ 124 ArrayList<HashSet<Channel>> junctions = (ArrayList<HashSet<Channel>>) junctioncandidates.clone(); 124 @SuppressWarnings("unchecked") 125 ArrayList<HashSet<Channel>> junctions = (ArrayList<HashSet<Channel>>) junctioncandidates.clone(); 125 126 for (int i = 0; i < junctioncandidates.size(); i++) { 126 127 for (int j = 0; j < junctioncandidates.size(); j++) { -
applications/editors/josm/plugins/lakewalker/src/org/openstreetmap/josm/plugins/lakewalker/StringEnumConfigurer.java
r23190 r30532 44 44 protected String[] validValues; 45 45 protected String[] transValues; 46 protected JComboBox box;46 protected JComboBox<String> box; 47 47 protected Box panel; 48 48 protected String tooltipText = ""; … … 68 68 panel = Box.createHorizontalBox(); 69 69 panel.add(new JLabel(name)); 70 box = new JComboBox (transValues);70 box = new JComboBox<>(transValues); 71 71 box.setToolTipText(tooltipText); 72 72 box.setMaximumSize(new Dimension(box.getMaximumSize().width,box.getPreferredSize().height)); -
applications/editors/josm/plugins/mapdust/.classpath
r30416 r30532 4 4 <classpathentry including="conf/|images/" kind="src" path=""/> 5 5 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> 6 <classpathentry kind="lib" path="lib/gson-1.5.jar"/>7 6 <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/> 7 <classpathentry kind="lib" path="lib/gson-2.2.4.jar"/> 8 8 <classpathentry kind="output" path="build/classes"/> 9 9 </classpath> -
applications/editors/josm/plugins/mapdust/.settings/org.eclipse.jdt.core.prefs
r30416 r30532 1 1 eclipse.preferences.version=1 2 org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled 3 org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore 4 org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull 5 org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault 6 org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable 7 org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled 2 8 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 9 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 … … 7 13 org.eclipse.jdt.core.compiler.debug.localVariable=generate 8 14 org.eclipse.jdt.core.compiler.debug.sourceFile=generate 15 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning 9 16 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 17 org.eclipse.jdt.core.compiler.problem.autoboxing=ignore 18 org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning 19 org.eclipse.jdt.core.compiler.problem.deadCode=warning 20 org.eclipse.jdt.core.compiler.problem.deprecation=warning 21 org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled 22 org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled 23 org.eclipse.jdt.core.compiler.problem.discouragedReference=warning 24 org.eclipse.jdt.core.compiler.problem.emptyStatement=warning 10 25 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 26 org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore 27 org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore 28 org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled 29 org.eclipse.jdt.core.compiler.problem.fieldHiding=warning 30 org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning 31 org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning 32 org.eclipse.jdt.core.compiler.problem.forbiddenReference=error 33 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning 34 org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled 35 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning 36 org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning 37 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore 38 org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore 39 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning 40 org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore 41 org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore 42 org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled 43 org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore 44 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore 45 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled 46 org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore 47 org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore 48 org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning 49 org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning 50 org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore 51 org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning 52 org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error 53 org.eclipse.jdt.core.compiler.problem.nullReference=warning 54 org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error 55 org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning 56 org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning 57 org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore 58 org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore 59 org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore 60 org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore 61 org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning 62 org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning 63 org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore 64 org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore 65 org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore 66 org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore 67 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore 68 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled 69 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning 70 org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled 71 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled 72 org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled 73 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore 74 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning 75 org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled 76 org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning 77 org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning 78 org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore 79 org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning 80 org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore 81 org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore 82 org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore 83 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore 84 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled 85 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled 86 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled 87 org.eclipse.jdt.core.compiler.problem.unusedImport=warning 88 org.eclipse.jdt.core.compiler.problem.unusedLabel=warning 89 org.eclipse.jdt.core.compiler.problem.unusedLocal=warning 90 org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning 91 org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore 92 org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled 93 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled 94 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled 95 org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning 96 org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore 97 org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning 98 org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning 11 99 org.eclipse.jdt.core.compiler.source=1.7 -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/MapdustActionUploaderException.java
r25591 r30532 36 36 */ 37 37 public class MapdustActionUploaderException extends Exception { 38 39 /** Serial version UID */40 private static final long serialVersionUID = -6128820229665805478L;41 38 42 39 /** -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/adapter/DisplayMenu.java
r25591 r30532 31 31 import java.awt.event.MouseAdapter; 32 32 import java.awt.event.MouseEvent; 33 33 34 import javax.swing.JList; 34 35 import javax.swing.JPopupMenu; 36 37 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug; 35 38 36 39 … … 48 51 49 52 /** The list of bugs */ 50 private JList listBugs;53 private JList<MapdustBug> listBugs; 51 54 52 55 /** … … 61 64 * @param menu The <code>JPopupMenu</code> object 62 65 */ 63 public DisplayMenu(JList listBugs, JPopupMenu menu) {66 public DisplayMenu(JList<MapdustBug> listBugs, JPopupMenu menu) { 64 67 this.listBugs = listBugs; 65 68 this.menu = menu; -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/adapter/WindowClose.java
r25591 r30532 45 45 */ 46 46 public class WindowClose extends WindowAdapter { 47 48 /** Serial version UID */49 47 50 48 /** A <code>AbstractDialog</code> object */ -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteActionList.java
r25591 r30532 55 55 public class ExecuteActionList extends MapdustExecuteAction implements 56 56 MapdustUpdateObservable { 57 58 /** Serial version UID */59 private static final long serialVersionUID = -7487830542214611774L;60 57 61 58 /** List of MapdustRefreshObserver objects */ -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/ExecuteCloseBug.java
r25828 r30532 64 64 public class ExecuteCloseBug extends MapdustExecuteAction implements 65 65 MapdustBugObservable, MapdustActionObservable { 66 67 /** Serial version UID */68 private static final long serialVersionUID = 3468827127588061014L;69 66 70 67 /** The list of Mapdust bug observers */ -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/action/execute/MapdustExecuteAction.java
r25828 r30532 44 44 */ 45 45 public abstract class MapdustExecuteAction extends AbstractAction { 46 47 /** Serial version UID */48 private static final long serialVersionUID = 4318259806647818543L;49 46 50 47 /** The abstract dialog object */ -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/dialog/CreateBugDialog.java
r25828 r30532 28 28 package org.openstreetmap.josm.plugins.mapdust.gui.component.dialog; 29 29 30 31 30 import java.awt.Color; 32 31 import java.awt.Font; … … 34 33 import java.awt.Point; 35 34 import java.awt.Rectangle; 35 36 36 import javax.swing.JButton; 37 37 import javax.swing.JComboBox; … … 41 41 import javax.swing.JTextField; 42 42 import javax.swing.WindowConstants; 43 43 44 import org.openstreetmap.josm.Main; 44 45 import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin; … … 49 50 import org.openstreetmap.josm.plugins.mapdust.gui.component.renderer.ComboBoxRenderer; 50 51 import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil; 52 import org.openstreetmap.josm.plugins.mapdust.service.value.BugType; 51 53 import org.openstreetmap.josm.tools.ImageProvider; 52 53 54 54 55 /** … … 71 72 72 73 /** The combo-box for the bug types */ 73 private JComboBox cbbType;74 private JComboBox<BugType> cbbType; 74 75 75 76 /** The nickname label */ … … 248 249 * @return the cbbType 249 250 */ 250 public JComboBox getCbbType() {251 public JComboBox<BugType> getCbbType() { 251 252 return cbbType; 252 253 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/ActionListModel.java
r25591 r30532 40 40 * @version $Revision$ 41 41 */ 42 public class ActionListModel extends AbstractListModel {42 public class ActionListModel extends AbstractListModel<MapdustAction> { 43 43 44 44 /** The serial version UID */ … … 73 73 */ 74 74 @Override 75 public ObjectgetElementAt(int index) {75 public MapdustAction getElementAt(int index) { 76 76 if (index >= 0 && index < list.size()) { 77 77 return list.get(index); … … 89 89 return (list != null ? list.size() : 0); 90 90 } 91 92 91 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/BugsListModel.java
r25591 r30532 28 28 package org.openstreetmap.josm.plugins.mapdust.gui.component.model; 29 29 30 31 30 import java.util.List; 32 31 import javax.swing.AbstractListModel; 33 32 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug; 34 35 33 36 34 /** … … 40 38 * 41 39 */ 42 public class BugsListModel extends AbstractListModel {40 public class BugsListModel extends AbstractListModel<MapdustBug> { 43 41 44 42 /** The serial version UID */ … … 71 69 */ 72 70 @Override 73 public ObjectgetElementAt(int index) {71 public MapdustBug getElementAt(int index) { 74 72 if (index >= 0 && index < bugs.size()) { 75 73 return bugs.get(index); … … 94 92 this.fireContentsChanged(this, 0, bugs.size() - 1); 95 93 } 96 97 94 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/CommentListModel.java
r25591 r30532 40 40 * 41 41 */ 42 public class CommentListModel implements ListModel {42 public class CommentListModel implements ListModel<MapdustComment> { 43 43 44 44 /** The list of <code>MapdustBug</code> objects */ … … 68 68 */ 69 69 @Override 70 public Object getElementAt(int index) {70 public MapdustComment getElementAt(int index) { 71 71 if (index > 0 && index < comments.length) { 72 72 return comments[index]; -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/model/TypesListModel.java
r27874 r30532 28 28 package org.openstreetmap.josm.plugins.mapdust.gui.component.model; 29 29 30 31 30 import javax.swing.AbstractListModel; 32 31 import javax.swing.ComboBoxModel; 33 32 import org.openstreetmap.josm.plugins.mapdust.service.value.BugType; 34 35 33 36 34 /** … … 40 38 * @version $Revision$ 41 39 */ 42 public class TypesListModel extends AbstractListModel implements ComboBoxModel{40 public class TypesListModel extends AbstractListModel<BugType> implements ComboBoxModel<BugType> { 43 41 44 42 /** The serial version UID */ … … 65 63 */ 66 64 @Override 67 public ObjectgetElementAt(int index) {65 public BugType getElementAt(int index) { 68 66 return types[index]; 69 67 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustActionPanel.java
r25591 r30532 28 28 package org.openstreetmap.josm.plugins.mapdust.gui.component.panel; 29 29 30 import static org.openstreetmap.josm.tools.I18n.tr; 30 31 31 import static org.openstreetmap.josm.tools.I18n.tr;32 32 import java.awt.BorderLayout; 33 33 import java.util.List; 34 34 35 import javax.swing.AbstractAction; 35 36 import javax.swing.JList; … … 37 38 import javax.swing.JScrollPane; 38 39 import javax.swing.JToggleButton; 40 39 41 import org.openstreetmap.josm.plugins.mapdust.MapdustPlugin; 40 42 import org.openstreetmap.josm.plugins.mapdust.gui.action.execute.ExecuteActionList; … … 42 44 import org.openstreetmap.josm.plugins.mapdust.gui.component.util.ComponentUtil; 43 45 import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustAction; 44 45 46 46 47 /** … … 52 53 public class MapdustActionPanel extends JPanel { 53 54 54 /** The serial version UID */55 private static final long serialVersionUID = -6648507056357610823L;56 57 55 /** The scroll pane */ 58 56 private JScrollPane cmpActionList; 59 57 60 58 /** The JList containing the MapDust action objects */ 61 private JList actionJList;59 private JList<MapdustAction> actionJList; 62 60 63 61 /** The list of <code>MapdustAction</code> objects */ … … 113 111 cmpActionList.getViewport().setView(actionJList); 114 112 cmpActionList.invalidate(); 115 116 113 } 117 114 … … 133 130 this.actionList = actionList; 134 131 } 135 136 132 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/panel/MapdustBugListPanel.java
r25839 r30532 79 79 80 80 /** The list of bugs */ 81 private JList mapdustBugsJList;81 private JList<MapdustBug> mapdustBugsJList; 82 82 83 83 /** The scroll pane for the <code>MapdustBug</code>s */ … … 163 163 String text = " No bugs in the current view for the selected"; 164 164 text += " filters!"; 165 JList textJList = new JList(new String[] { text });165 JList<String> textJList = new JList<>(new String[] { text }); 166 166 textJList.setBorder(new LineBorder(Color.black, 1, false)); 167 167 textJList.setCellRenderer(new BugListCellRenderer()); … … 192 192 String text = " No bugs in the current view for the selected"; 193 193 text += " filters!"; 194 JList textJList = new JList(new String[] { text });194 JList<String> textJList = new JList<>(new String[] { text }); 195 195 textJList.setBorder(new LineBorder(Color.black, 1, false)); 196 196 textJList.setCellRenderer(new BugListCellRenderer()); … … 198 198 } else { 199 199 if (mapdustBugsJList == null) { 200 mapdustBugsJList = ComponentUtil.createJList(mapdustBugsList, 201 menu); 200 mapdustBugsJList = ComponentUtil.createJList(mapdustBugsList, menu); 202 201 mapdustBugsJList.addListSelectionListener(this); 203 202 DisplayMenu adapter = new DisplayMenu(mapdustBugsJList, menu); … … 349 348 * @return the listBugs 350 349 */ 351 public JList getMapdustBugsJList() {350 public JList<MapdustBug> getMapdustBugsJList() { 352 351 return mapdustBugsJList; 353 352 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/ActionListCellRenderer.java
r25591 r30532 28 28 package org.openstreetmap.josm.plugins.mapdust.gui.component.renderer; 29 29 30 31 30 import java.awt.Component; 32 31 import java.awt.Font; … … 39 38 import org.openstreetmap.josm.tools.ImageProvider; 40 39 41 42 40 /** 43 41 * Cell renderer for the <code>MapdustAction</code> objects. … … 47 45 */ 48 46 public class ActionListCellRenderer extends DefaultListCellRenderer { 49 50 /** The serial version UID */51 private static final long serialVersionUID = 7552949107018269769L;52 47 53 48 /** … … 61 56 */ 62 57 @Override 63 public Component getListCellRendererComponent(JList list, Object value,58 public Component getListCellRendererComponent(JList<?> list, Object value, 64 59 int index, boolean isSelected, boolean hasFocus) { 65 60 JLabel label = (JLabel) super.getListCellRendererComponent(list, value, -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/BugListCellRenderer.java
r25591 r30532 61 61 */ 62 62 @Override 63 public Component getListCellRendererComponent(JList list, Object value,63 public Component getListCellRendererComponent(JList<?> list, Object value, 64 64 int index, boolean isSelected, boolean hasFocus) { 65 65 JLabel label =(JLabel) super.getListCellRendererComponent(list, value, -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/renderer/ComboBoxRenderer.java
r27874 r30532 28 28 package org.openstreetmap.josm.plugins.mapdust.gui.component.renderer; 29 29 30 31 30 import java.awt.Component; 32 31 import java.awt.Font; … … 39 38 import org.openstreetmap.josm.tools.ImageProvider; 40 39 41 42 40 /** 43 41 * Cell renderer for the <code>MapdustBug</code> types. … … 45 43 * @author Bea 46 44 */ 47 public class ComboBoxRenderer implements ListCellRenderer {45 public class ComboBoxRenderer implements ListCellRenderer<BugType> { 48 46 49 47 /** The default renderer */ … … 61 59 */ 62 60 @Override 63 public Component getListCellRendererComponent(JList list, Object value,61 public Component getListCellRendererComponent(JList<? extends BugType> list, BugType type, 64 62 int index, boolean isSelected, boolean cellHasFocus) { 65 63 JLabel label = (JLabel) defaultRenderer.getListCellRendererComponent( 66 list, value, index, isSelected, cellHasFocus); 67 if (value instanceof BugType) { 68 BugType type = (BugType) value; 69 String iconPath = "bugs/normal/open_" + type.getKey() + ".png"; 70 String text = type.getValue(); 71 ImageIcon icon = ImageProvider.get(iconPath); 72 label.setIcon(icon); 73 label.setText(text); 74 label.setFont( new Font("Times New Roman", Font.BOLD, 12)); 75 } 64 list, type, index, isSelected, cellHasFocus); 65 String iconPath = "bugs/normal/open_" + type.getKey() + ".png"; 66 String text = type.getValue(); 67 ImageIcon icon = ImageProvider.get(iconPath); 68 label.setIcon(icon); 69 label.setText(text); 70 label.setFont( new Font("Times New Roman", Font.BOLD, 12)); 76 71 return label; 77 72 } 78 79 73 } -
applications/editors/josm/plugins/mapdust/src/org/openstreetmap/josm/plugins/mapdust/gui/component/util/ComponentUtil.java
r25828 r30532 30 30 31 31 import static org.openstreetmap.josm.tools.I18n.tr; 32 32 33 import java.awt.Color; 33 34 import java.awt.Component; … … 35 36 import java.awt.Rectangle; 36 37 import java.util.List; 38 37 39 import javax.swing.AbstractAction; 38 40 import javax.swing.Action; … … 52 54 import javax.swing.SwingConstants; 53 55 import javax.swing.border.LineBorder; 56 54 57 import org.openstreetmap.josm.plugins.mapdust.gui.component.model.ActionListModel; 55 58 import org.openstreetmap.josm.plugins.mapdust.gui.component.model.BugsListModel; … … 58 61 import org.openstreetmap.josm.plugins.mapdust.gui.component.renderer.BugListCellRenderer; 59 62 import org.openstreetmap.josm.plugins.mapdust.gui.value.MapdustAction; 63 import org.openstreetmap.josm.plugins.mapdust.service.value.BugType; 60 64 import org.openstreetmap.josm.plugins.mapdust.service.value.MapdustBug; 61 65 import org.openstreetmap.josm.tools.ImageProvider; … … 211 215 * @return A <code>JScrollPane</code> object 212 216 */ 213 public static JScrollPane createJScrollPane(JList list) {217 public static JScrollPane createJScrollPane(JList<?> list) { 214 218 JScrollPane jScrollPane = new JScrollPane(); 215 219 jScrollPane.setViewportView(list); … … 224 228 * @return A <code>JList</code> object 225 229 */ 226 public static JList createJList(List<MapdustAction> list) {227 final JList jList = new JList(new ActionListModel(list));230 public static JList<MapdustAction> createJList(List<MapdustAction> list) { 231 final JList<MapdustAction> jList = new JList<>(new ActionListModel(list)); 228 232 jList.setBorder(new LineBorder(Color.black, 1, false)); 229 233 jList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); … … 240 244 * @return A <code>JList</code> 241 245 */ 242 public static JList createJList(List<MapdustBug> bugsList, 243 final JPopupMenu menu) { 244 final JList jList = new JList(new BugsListModel(bugsList)); 246 public static JList<MapdustBug> createJList(List<MapdustBug> bugsList, final JPopupMenu menu) { 247 final JList<MapdustBug> jList = new JList<>(new BugsListModel(bugsList)); 245 248 jList.setBorder(new LineBorder(Color.black, 1, false)); 246 249 jList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); … … 296 299 * @return A <code>JComboBox</code> object 297 300 */ 298 public static JComboBox createJComboBox(Rectangle bounds,299 ListCellRenderer renderer, Color backgroundColor) {300 JComboBox jComboBox = new JComboBox(new TypesListModel());301 public static JComboBox<BugType> createJComboBox(Rectangle bounds, 302 ListCellRenderer<BugType> renderer, Color backgroundColor) { 303 JComboBox<BugType> jComboBox = new JComboBox<>(new TypesListModel()); 301 304 jComboBox.setSelectedIndex(0); 302 305 jComboBox.setBackground(backgroundColor); -
applications/editors/josm/plugins/measurement/src/org/openstreetmap/josm/plugins/measurement/MeasurementLayer.java
r30353 r30532 41 41 import org.openstreetmap.josm.tools.ImageProvider; 42 42 43 44 43 /** 45 44 * This is a layer that draws a grid … … 206 205 } 207 206 208 209 207 private class GPXLayerImportAction extends AbstractAction { 210 208 … … 212 210 * The data model for the list component. 213 211 */ 214 private DefaultListModel model = new DefaultListModel();212 private DefaultListModel<GpxLayer> model = new DefaultListModel<>(); 215 213 216 214 /** … … 224 222 public void actionPerformed(ActionEvent e) { 225 223 Box panel = Box.createVerticalBox(); 226 final JList layerList = new JList(model);224 final JList<GpxLayer> layerList = new JList<>(model); 227 225 Collection<Layer> data = Main.map.mapView.getAllLayers(); 228 226 Layer lastLayer = null; … … 231 229 for (Layer l : data){ 232 230 if(l instanceof GpxLayer){ 233 model.addElement( l);231 model.addElement((GpxLayer) l); 234 232 lastLayer = l; 235 233 layerCnt++; … … 242 240 243 241 layerList.setCellRenderer(new DefaultListCellRenderer(){ 244 @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {242 @Override public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { 245 243 Layer layer = (Layer)value; 246 244 JLabel label = (JLabel)super.getListCellRendererComponent(list, … … 293 291 } 294 292 } 295 296 293 } -
applications/editors/josm/plugins/merge-overlap/src/mergeoverlap/MyCombinePrimitiveResolverDialog.java
r30034 r30532 953 953 getActionMap().put("selectPreviousColumnCell", selectPreviousColumnCellAction); 954 954 955 setRowHeight((int)new JComboBox ().getPreferredSize().getHeight());955 setRowHeight((int)new JComboBox<Object>().getPreferredSize().getHeight()); 956 956 } 957 957 … … 1376 1376 ((MultiValueCellEditor)getColumnModel().getColumn(2).getCellEditor()).addNavigationListeners(this); 1377 1377 1378 setRowHeight((int)new JComboBox ().getPreferredSize().getHeight());1378 setRowHeight((int)new JComboBox<Object>().getPreferredSize().getHeight()); 1379 1379 } 1380 1380 -
applications/editors/josm/plugins/mirrored_download/src/mirrored_download/MirroredDownloadAction.java
r30162 r30532 117 117 static class MirroredDownloadDialog extends DownloadDialog { 118 118 119 protected JComboBox /*<String>*/overpassType;119 protected JComboBox<String> overpassType; 120 120 protected HistoryComboBox overpassQuery; 121 121 private static MirroredDownloadDialog instance; … … 137 137 @Override 138 138 protected void buildMainPanelAboveDownloadSelections(JPanel pnl) { 139 overpassType = new JComboBox /*<String>*/(new String[]{"*", "node", "way", "relation"});139 overpassType = new JComboBox<>(new String[]{"*", "node", "way", "relation"}); 140 140 pnl.add(new JLabel(tr("Object type: ")), GBC.std().insets(5, 5, 5, 5)); 141 141 pnl.add(overpassType, GBC.eol().fill(GridBagConstraints.HORIZONTAL)); -
applications/editors/josm/plugins/mirrored_download/src/mirrored_download/UrlSelectionDialog.java
r30495 r30532 31 31 private JDialog jDialog = null; 32 32 private JTabbedPane tabbedPane = null; 33 private JComboBox cbSelectUrl = null;33 private JComboBox<String> cbSelectUrl = null; 34 34 private JCheckBox cbAddMeta = null; 35 35 … … 60 60 contentPane.add(label); 61 61 62 cbSelectUrl = new JComboBox ();62 cbSelectUrl = new JComboBox<>(); 63 63 cbSelectUrl.setEditable(true); 64 64 -
applications/editors/josm/plugins/namemanager/src/org/openstreetmap/josm/plugins/namemanager/dialog/NameManagerDialog.java
r25594 r30532 77 77 private List<Way> waysInsideSelectedArea; 78 78 private JTabbedPane tabPanel; 79 private JComboBox country;79 private JComboBox<String> country; 80 80 private JLabel labelLevel1; 81 81 private JTextField level1; … … 138 138 buildings.setSelected(false); 139 139 JLabel labelCountry = new JLabel(" " + tr(COUNTRY)); 140 country = new JComboBox ();140 country = new JComboBox<>(); 141 141 labelLevel1 = new JLabel(" level1"); 142 142 level1 = new JTextField(); -
applications/editors/josm/plugins/nearclick/.project
r29853 r30532 11 11 </arguments> 12 12 </buildCommand> 13 <buildCommand>14 <name>org.eclipse.pde.ManifestBuilder</name>15 <arguments>16 </arguments>17 </buildCommand>18 <buildCommand>19 <name>org.eclipse.pde.SchemaBuilder</name>20 <arguments>21 </arguments>22 </buildCommand>23 13 </buildSpec> 24 14 <natures> 25 15 <nature>org.eclipse.jdt.core.javanature</nature> 26 <nature>org.eclipse.pde.PluginNature</nature>27 16 </natures> 28 17 </projectDescription> -
applications/editors/josm/plugins/opendata/.settings/org.eclipse.jdt.core.prefs
r30416 r30532 1 1 eclipse.preferences.version=1 2 org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled 3 org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore 4 org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull 5 org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault 6 org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable 7 org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled 2 8 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 9 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 … … 18 24 org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore 19 25 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 26 org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore 20 27 org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore 21 28 org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled … … 31 38 org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore 32 39 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning 40 org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore 33 41 org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore 42 org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled 34 43 org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore 35 44 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore … … 40 49 org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning 41 50 org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore 51 org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning 52 org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error 42 53 org.eclipse.jdt.core.compiler.problem.nullReference=warning 54 org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error 55 org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning 43 56 org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning 44 57 org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore 45 58 org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore 46 59 org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore 47 org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore 60 org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore 61 org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning 62 org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning 48 63 org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning 49 org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments= ignore64 org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning 50 65 org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning 51 66 org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore … … 55 70 org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled 56 71 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled 72 org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled 57 73 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore 58 74 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning 59 75 org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled 60 org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore 76 org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning 77 org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning 61 78 org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore 62 79 org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning … … 77 94 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled 78 95 org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning 96 org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore 79 97 org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning 80 98 org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/datasets/WayCombiner.java
r30340 r30532 56 56 57 57 // remove duplicates, preserving order 58 ways = new LinkedHashSet< Way>(ways);58 ways = new LinkedHashSet<>(ways); 59 59 60 60 // try to build a new way which includes all the combined … … 71 71 TagCollection wayTags = TagCollection.unionOfAllPrimitives(ways); 72 72 73 List<Way> reversedWays = new LinkedList< Way>();74 List<Way> unreversedWays = new LinkedList< Way>();73 List<Way> reversedWays = new LinkedList<>(); 74 List<Way> unreversedWays = new LinkedList<>(); 75 75 for (Way w: ways) { 76 76 if ((path.indexOf(w.getNode(0)) + 1) == path.lastIndexOf(w.getNode(1))) { … … 99 99 // if there are still reversed ways with direction-dependent tags, reverse their tags 100 100 if (!reversedWays.isEmpty()) { 101 List<Way> unreversedTagWays = new ArrayList< Way>(ways);101 List<Way> unreversedTagWays = new ArrayList<>(ways); 102 102 unreversedTagWays.removeAll(reversedWays); 103 103 ReverseWayTagCorrector reverseWayTagCorrector = new ReverseWayTagCorrector(); 104 List<Way> reversedTagWays = new ArrayList< Way>();104 List<Way> reversedTagWays = new ArrayList<>(); 105 105 Collection<Command> changePropertyCommands = null; 106 106 for (Way w : reversedWays) { … … 149 149 } 150 150 151 LinkedList<Way> deletedWays = new LinkedList< Way>(ways);151 LinkedList<Way> deletedWays = new LinkedList<>(ways); 152 152 deletedWays.remove(targetWay); 153 153 -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/gui/ModulePreference.java
r30340 r30532 219 219 return false; 220 220 if (model.isActiveModulesChanged()) { 221 LinkedList<String> l = new LinkedList< String>(model.getSelectedModuleNames());221 LinkedList<String> l = new LinkedList<>(model.getSelectedModuleNames()); 222 222 Collections.sort(l); 223 223 Main.pref.putCollection(PREF_MODULES, l); … … 446 446 static private class ModuleConfigurationSitesPanel extends JPanel { 447 447 448 private DefaultListModel model;448 private DefaultListModel<String> model; 449 449 450 450 protected void build() { 451 451 setLayout(new GridBagLayout()); 452 452 add(new JLabel(tr("Add Open Data Module description URL.")), GBC.eol()); 453 model = new DefaultListModel ();453 model = new DefaultListModel<>(); 454 454 for (String s : OdPreferenceSetting.getModuleSites()) { 455 455 model.addElement(s); 456 456 } 457 final JList list = new JList(model);457 final JList<String> list = new JList<>(model); 458 458 add(new JScrollPane(list), GBC.std().fill()); 459 459 JPanel buttons = new JPanel(new GridBagLayout()); … … 519 519 public List<String> getUpdateSites() { 520 520 if (model.getSize() == 0) return Collections.emptyList(); 521 List<String> ret = new ArrayList< String>(model.getSize());521 List<String> ret = new ArrayList<>(model.getSize()); 522 522 for (int i=0; i< model.getSize();i++){ 523 ret.add( (String)model.get(i));523 ret.add(model.get(i)); 524 524 } 525 525 return ret; -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/gui/ModulePreferencesModel.java
r30340 r30532 20 20 import org.openstreetmap.josm.plugins.opendata.core.modules.ModuleInformation; 21 21 22 /**23 * TODO24 *25 */26 22 public class ModulePreferencesModel extends Observable implements OdConstants { 27 private final ArrayList<ModuleInformation> availableModules = new ArrayList< ModuleInformation>();28 private final ArrayList<ModuleInformation> displayedModules = new ArrayList< ModuleInformation>();29 private final HashMap<ModuleInformation, Boolean> selectedModulesMap = new HashMap< ModuleInformation, Boolean>();30 private Set<String> pendingDownloads = new HashSet< String>();23 private final ArrayList<ModuleInformation> availableModules = new ArrayList<>(); 24 private final ArrayList<ModuleInformation> displayedModules = new ArrayList<>(); 25 private final HashMap<ModuleInformation, Boolean> selectedModulesMap = new HashMap<>(); 26 private Set<String> pendingDownloads = new HashSet<>(); 31 27 private String filterExpression; 32 28 private final Set<String> currentActiveModules; … … 37 33 38 34 public ModulePreferencesModel() { 39 currentActiveModules = new HashSet< String>();35 currentActiveModules = new HashSet<>(); 40 36 currentActiveModules.addAll(getModules(currentActiveModules)); 41 37 } … … 66 62 sort(); 67 63 filterDisplayedModules(filterExpression); 68 Set<String> activeModules = new HashSet< String>();64 Set<String> activeModules = new HashSet<>(); 69 65 activeModules.addAll(getModules(activeModules)); 70 66 for (ModuleInformation pi: availableModules) { … … 101 97 sort(); 102 98 filterDisplayedModules(filterExpression); 103 Set<String> activeModules = new HashSet< String>();99 Set<String> activeModules = new HashSet<>(); 104 100 activeModules.addAll(getModules(activeModules)); 105 101 for (ModuleInformation pi: availableModules) { … … 120 116 */ 121 117 public List<ModuleInformation> getSelectedModules() { 122 List<ModuleInformation> ret = new LinkedList< ModuleInformation>();118 List<ModuleInformation> ret = new LinkedList<>(); 123 119 for (ModuleInformation pi: availableModules) { 124 120 if (selectedModulesMap.get(pi) == null) { … … 138 134 */ 139 135 public Set<String> getSelectedModuleNames() { 140 Set<String> ret = new HashSet< String>();136 Set<String> ret = new HashSet<>(); 141 137 for (ModuleInformation pi: getSelectedModules()) { 142 138 ret.add(pi.name); … … 177 173 */ 178 174 public List<ModuleInformation> getModulesScheduledForUpdateOrDownload() { 179 List<ModuleInformation> ret = new ArrayList< ModuleInformation>();175 List<ModuleInformation> ret = new ArrayList<>(); 180 176 for (String module: pendingDownloads) { 181 177 ModuleInformation pi = getModuleInformation(module); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/NeptuneReader.java
r30340 r30532 76 76 public static final String OSM_FERRY = "ferry"; 77 77 78 private static final List<URL> schemas = new ArrayList< URL>();78 private static final List<URL> schemas = new ArrayList<>(); 79 79 static { 80 80 schemas.add(NeptuneReader.class.getResource(NEPTUNE_XSD)); … … 83 83 private ChouettePTNetworkType root; 84 84 85 private final Map<String, OsmPrimitive> tridentObjects = new HashMap< String, OsmPrimitive>();85 private final Map<String, OsmPrimitive> tridentObjects = new HashMap<>(); 86 86 87 87 public static final boolean acceptsXmlNeptuneFile(File file) { … … 133 133 JAXBContext jc = JAXBContext.newInstance(packageName, NeptuneReader.class.getClassLoader()); 134 134 Unmarshaller u = jc.createUnmarshaller(); 135 JAXBElement<T> doc = (JAXBElement<T>)u.unmarshal(inputStream); 135 @SuppressWarnings("unchecked") 136 JAXBElement<T> doc = (JAXBElement<T>)u.unmarshal(inputStream); 136 137 return doc.getValue(); 137 138 } -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/NetworkReader.java
r30340 r30532 45 45 * File readers 46 46 */ 47 public static final Map<String, Class<? extends AbstractReader>> FILE_READERS = new HashMap< String, Class<? extends AbstractReader>>();47 public static final Map<String, Class<? extends AbstractReader>> FILE_READERS = new HashMap<>(); 48 48 static { 49 49 FILE_READERS.put(CSV_EXT, CsvReader.class); … … 58 58 } 59 59 60 public static final Map<String, Class<? extends AbstractReader>> FILE_AND_ARCHIVE_READERS = new HashMap< String, Class<? extends AbstractReader>>(FILE_READERS);60 public static final Map<String, Class<? extends AbstractReader>> FILE_AND_ARCHIVE_READERS = new HashMap<>(FILE_READERS); 61 61 static { 62 62 FILE_AND_ARCHIVE_READERS.put(ZIP_EXT, ZipReader.class); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/ProjectionChooser.java
r30340 r30532 18 18 import org.openstreetmap.josm.tools.GBC; 19 19 20 @SuppressWarnings("serial")21 20 public class ProjectionChooser extends ExtendedDialog { 22 21 … … 29 28 * Combobox with all projections available 30 29 */ 31 private final JComboBox projectionCombo = new JComboBox(ProjectionPreference.getProjectionChoices().toArray()); 30 private final JComboBox<ProjectionChoice> projectionCombo = new JComboBox<>( 31 ProjectionPreference.getProjectionChoices().toArray(new ProjectionChoice[0])); 32 32 33 33 public ProjectionChooser(Component parent) { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/ArchiveReader.java
r30340 r30532 59 59 60 60 final File temp = OdUtils.createTempDir(); 61 final List<File> candidates = new ArrayList< File>();61 final List<File> candidates = new ArrayList<>(); 62 62 63 63 try { … … 70 70 71 71 if (promptUser && candidates.size() > 1) { 72 DialogPrompter<CandidateChooser> prompt = new DialogPrompter () {72 DialogPrompter<CandidateChooser> prompt = new DialogPrompter<CandidateChooser>() { 73 73 @Override 74 74 protected CandidateChooser buildDialog() { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/archive/CandidateChooser.java
r30340 r30532 27 27 private final JPanel projPanel = new JPanel(new GridBagLayout()); 28 28 29 //private final Map<JCheckBox, File> checkBoxes = new HashMap<JCheckBox, File>(); 30 private final JComboBox fileCombo; 29 private final JComboBox<File> fileCombo; 31 30 32 31 public CandidateChooser(Component parent, List<File> candidates) { … … 37 36 38 37 @Override 39 public Component getListCellRendererComponent(JList list, Object value,38 public Component getListCellRendererComponent(JList<?> list, Object value, 40 39 int index, boolean isSelected, boolean cellHasFocus) { 41 40 super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); … … 49 48 protected CandidateChooser(Component parent, String title, String[] buttonTexts, List<File> candidates) { 50 49 super(parent, title, buttonTexts); 51 this.fileCombo = new JComboBox (candidates.toArray());50 this.fileCombo = new JComboBox<>(candidates.toArray(new File[0])); 52 51 this.fileCombo.setRenderer(new Renderer()); 53 52 addGui(candidates); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/AbstractMapInfoReader.java
r30340 r30532 75 75 76 76 protected void parseColumns(String[] words) { 77 columns = new ArrayList< String>();77 columns = new ArrayList<>(); 78 78 numcolumns = Integer.parseInt(words[1]); 79 79 } -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/DefaultShpHandler.java
r30340 r30532 38 38 39 39 private static final List<Pair<org.opengis.referencing.datum.Ellipsoid, Ellipsoid>> 40 ellipsoids = new ArrayList< Pair<org.opengis.referencing.datum.Ellipsoid, Ellipsoid>>();40 ellipsoids = new ArrayList<>(); 41 41 static { 42 42 ellipsoids.add(new Pair<org.opengis.referencing.datum.Ellipsoid, Ellipsoid>(DefaultEllipsoid.GRS80, Ellipsoid.GRS80)); … … 44 44 } 45 45 46 protected static final Double get(ParameterValueGroup values, ParameterDescriptor desc) {46 protected static final Double get(ParameterValueGroup values, ParameterDescriptor<?> desc) { 47 47 return (Double) values.parameter(desc.getName().getCode()).getValue(); 48 48 } … … 64 64 return CRS.findMathTransform(getCrsFor(sourceCRS.getName().getCode()), targetCRS, lenient); 65 65 } else if (sourceCRS instanceof AbstractDerivedCRS && sourceCRS.getName().getCode().equalsIgnoreCase("Lambert_Conformal_Conic")) { 66 List<MathTransform> result = new ArrayList< MathTransform>();66 List<MathTransform> result = new ArrayList<>(); 67 67 AbstractDerivedCRS crs = (AbstractDerivedCRS) sourceCRS; 68 68 MathTransform transform = crs.getConversionFromBase().getMathTransform(); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GeographicReader.java
r30340 r30532 72 72 73 73 public GeographicReader(GeographicHandler handler, GeographicHandler[] defaultHandlers) { 74 this.nodes = new HashMap< LatLon, Node>();74 this.nodes = new HashMap<>(); 75 75 this.handler = handler; 76 76 this.defaultHandlers = defaultHandlers; … … 256 256 257 257 if (findSimiliarCrs) { 258 List<CoordinateReferenceSystem> candidates = new ArrayList< CoordinateReferenceSystem>();258 List<CoordinateReferenceSystem> candidates = new ArrayList<>(); 259 259 260 260 // Find matching CRS with Bursa Wolf parameters in EPSG database -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/GmlReader.java
r30340 r30532 144 144 145 145 private void parseFeatureMember(Component parent) throws XMLStreamException, GeoCrsException, FactoryException, UserCancelException, GeoMathTransformException, MismatchedDimensionException, TransformException { 146 List<OsmPrimitive> list = new ArrayList< OsmPrimitive>();146 List<OsmPrimitive> list = new ArrayList<>(); 147 147 Way way = null; 148 148 Node node = null; 149 Map<String, String> tags = new HashMap< String, String>();149 Map<String, String> tags = new HashMap<>(); 150 150 while (parser.hasNext()) { 151 151 int event = parser.next(); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/KmlReader.java
r30340 r30532 45 45 46 46 private XMLStreamReader parser; 47 private Map<LatLon, Node> nodes = new HashMap< LatLon, Node>();47 private Map<LatLon, Node> nodes = new HashMap<>(); 48 48 49 49 public KmlReader(XMLStreamReader parser) { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/geographic/ShpReader.java
r30508 r30532 9 9 import java.io.IOException; 10 10 import java.io.InputStream; 11 import java.io.Serializable; 11 12 import java.nio.charset.Charset; 12 13 import java.nio.charset.IllegalCharsetNameException; … … 56 57 57 58 private final ShpHandler handler; 58 private final Set<OsmPrimitive> featurePrimitives = new HashSet< OsmPrimitive>();59 private final Set<OsmPrimitive> featurePrimitives = new HashSet<>(); 59 60 60 61 public ShpReader(ShpHandler handler) { … … 174 175 try { 175 176 if (file != null) { 176 Map params = new HashMap();177 Map<String, Serializable> params = new HashMap<>(); 177 178 Charset charset = null; 178 179 params.put(ShapefileDataStoreFactory.URLP.key, file.toURI().toURL()); … … 194 195 if (charset != null) { 195 196 Main.info("Using charset "+charset); 196 params.put(ShapefileDataStoreFactory.DBFCHARSET.key, charset );197 params.put(ShapefileDataStoreFactory.DBFCHARSET.key, charset.name()); 197 198 } 198 DataStore dataStore = new ShapefileDataStoreFactory().createDataStore(params); //FIXME199 DataStore dataStore = new ShapefileDataStoreFactory().createDataStore(params); 199 200 if (dataStore == null) { 200 201 throw new IOException(tr("Unable to find a data store for file {0}", file.getName())); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/OdsReader.java
r30340 r30532 65 65 } 66 66 67 List<String> result = new ArrayList< String>();67 List<String> result = new ArrayList<>(); 68 68 boolean allFieldsBlank = true; 69 69 for (TableTableCell cell : row.getAllCells()) { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/SpreadSheetReader.java
r30340 r30532 97 97 System.out.println("Header: "+Arrays.toString(header)); 98 98 99 Map<ProjectionPatterns, List<CoordinateColumns>> projColumns = new HashMap< ProjectionPatterns, List<CoordinateColumns>>();99 Map<ProjectionPatterns, List<CoordinateColumns>> projColumns = new HashMap<>(); 100 100 101 101 for (int i = 0; i<header.length; i++) { … … 103 103 List<CoordinateColumns> columns = projColumns.get(pp); 104 104 if (columns == null) { 105 projColumns.put(pp, columns = new ArrayList< CoordinateColumns>());105 projColumns.put(pp, columns = new ArrayList<>()); 106 106 } 107 107 CoordinateColumns col = columns.isEmpty() ? null : columns.get(columns.size()-1); … … 116 116 } 117 117 118 final List<CoordinateColumns> columns = new ArrayList< CoordinateColumns>();118 final List<CoordinateColumns> columns = new ArrayList<>(); 119 119 120 120 for (ProjectionPatterns pp : projColumns.keySet()) { … … 180 180 } 181 181 182 final Map<CoordinateColumns, EastNorth> ens = new HashMap< CoordinateColumns, EastNorth>();183 final Map<CoordinateColumns, Node> nodes = new HashMap< CoordinateColumns, Node>();182 final Map<CoordinateColumns, EastNorth> ens = new HashMap<>(); 183 final Map<CoordinateColumns, Node> nodes = new HashMap<>(); 184 184 for (CoordinateColumns c : columns) { 185 185 nodes.put(c, new Node()); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/io/tabular/XlsReader.java
r30340 r30532 56 56 Row row = sheet.getRow(rowIndex++); 57 57 if (row != null) { 58 List<String> result = new ArrayList< String>();58 List<String> result = new ArrayList<>(); 59 59 for (Cell cell : row) { 60 60 switch (cell.getCellType()) { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/layers/OdDataLayer.java
r30340 r30532 124 124 @Override 125 125 public Action[] getMenuEntries() { 126 List<Action> result = new ArrayList< Action>();126 List<Action> result = new ArrayList<>(); 127 127 for (Action entry : super.getMenuEntries()) { 128 128 result.add(entry); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/layers/OdDiffLayer.java
r30340 r30532 31 31 super(name); 32 32 this.dataLayer = dataLayer; 33 this.differentPrimitives = new ArrayList< Pair<OsmPrimitive,OsmPrimitive>>();34 this.onlyInTlsPrimitives = new ArrayList< OsmPrimitive>();35 this.onlyInOsmPrimitives = new ArrayList< OsmPrimitive>();33 this.differentPrimitives = new ArrayList<>(); 34 this.onlyInTlsPrimitives = new ArrayList<>(); 35 this.onlyInOsmPrimitives = new ArrayList<>(); 36 36 initDiff(dataLayer.data, dataLayer.osmLayer.data); 37 37 } … … 44 44 onlyInTlsPrimitives.add(p1); 45 45 } else if (!dataLayer.handler.equals(p1, p2)) { 46 differentPrimitives.add(new Pair< OsmPrimitive, OsmPrimitive>(p1, p2));46 differentPrimitives.add(new Pair<>(p1, p2)); 47 47 } 48 48 } -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/layers/OdOsmDataLayer.java
r30340 r30532 41 41 if (nodes != null) { 42 42 for (Node n : nodes) { 43 List<OsmPrimitive> refferingAllowedWays = new ArrayList< OsmPrimitive>();43 List<OsmPrimitive> refferingAllowedWays = new ArrayList<>(); 44 44 for (OsmPrimitive referrer : n.getReferrers()) { 45 45 if (referrer instanceof Way && !dataLayer.handler.isForbidden(referrer)) { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/licenses/License.java
r30340 r30532 17 17 public static final LOOL LOOL = new LOOL(); 18 18 19 private final Map<String, URL> urls = new HashMap< String, URL>();20 private final Map<String, URL> summaryURLs = new HashMap< String, URL>();19 private final Map<String, URL> urls = new HashMap<>(); 20 private final Map<String, URL> summaryURLs = new HashMap<>(); 21 21 22 22 private Icon icon; -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/AbstractModule.java
r30340 r30532 19 19 public abstract class AbstractModule implements Module, OdConstants { 20 20 21 protected final List<Class<? extends AbstractDataSetHandler>> handlers = new ArrayList< Class <? extends AbstractDataSetHandler>>();21 protected final List<Class<? extends AbstractDataSetHandler>> handlers = new ArrayList<>(); 22 22 23 private final List<AbstractDataSetHandler> instanciatedHandlers = new ArrayList< AbstractDataSetHandler>();23 private final List<AbstractDataSetHandler> instanciatedHandlers = new ArrayList<>(); 24 24 25 25 protected final ModuleInformation info; … … 46 46 @Override 47 47 public SourceProvider getMapPaintStyleSourceProvider() { 48 final List<SourceEntry> sources = new ArrayList< SourceEntry>();48 final List<SourceEntry> sources = new ArrayList<>(); 49 49 for (AbstractDataSetHandler handler : getInstanciatedHandlers()) { 50 50 ExtendedSourceEntry src; … … 83 83 @Override 84 84 public SourceProvider getPresetSourceProvider() { 85 final List<SourceEntry> sources = new ArrayList< SourceEntry>();85 final List<SourceEntry> sources = new ArrayList<>(); 86 86 for (AbstractDataSetHandler handler : getInstanciatedHandlers()) { 87 87 if (handler != null && handler.getTaggingPreset() != null) { … … 99 99 @Override 100 100 public final List<AbstractDataSetHandler> getNewlyInstanciatedHandlers() { 101 List<AbstractDataSetHandler> result = new ArrayList< AbstractDataSetHandler>();101 List<AbstractDataSetHandler> result = new ArrayList<>(); 102 102 for (Class<? extends AbstractDataSetHandler> handlerClass : handlers) { 103 103 if (handlerClass != null) { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleDownloadTask.java
r30436 r30532 32 32 */ 33 33 public class ModuleDownloadTask extends PleaseWaitRunnable{ 34 private final Collection<ModuleInformation> toUpdate = new LinkedList< ModuleInformation>();35 private final Collection<ModuleInformation> failed = new LinkedList< ModuleInformation>();36 private final Collection<ModuleInformation> downloaded = new LinkedList< ModuleInformation>();34 private final Collection<ModuleInformation> toUpdate = new LinkedList<>(); 35 private final Collection<ModuleInformation> failed = new LinkedList<>(); 36 private final Collection<ModuleInformation> downloaded = new LinkedList<>(); 37 37 //private Exception lastException; 38 38 private boolean canceled; -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleHandler.java
r30340 r30532 61 61 * All installed and loaded modules (resp. their main classes) 62 62 */ 63 public final static Collection<Module> moduleList = new LinkedList< Module>();63 public final static Collection<Module> moduleList = new LinkedList<>(); 64 64 65 65 /** 66 66 * Add here all ClassLoader whose resource should be searched. 67 67 */ 68 private static final List<ClassLoader> sources = new LinkedList< ClassLoader>();68 private static final List<ClassLoader> sources = new LinkedList<>(); 69 69 70 70 static { … … 198 198 public static ClassLoader createClassLoader(Collection<ModuleInformation> modules) { 199 199 // iterate all modules and collect all libraries of all modules: 200 List<URL> allModuleLibraries = new LinkedList< URL>();200 List<URL> allModuleLibraries = new LinkedList<>(); 201 201 File moduleDir = OdPlugin.getInstance().getModulesDirectory(); 202 202 for (ModuleInformation info : modules) { … … 269 269 monitor.beginTask(tr("Loading modules ...")); 270 270 monitor.subTask(tr("Checking module preconditions...")); 271 List<ModuleInformation> toLoad = new LinkedList< ModuleInformation>();271 List<ModuleInformation> toLoad = new LinkedList<>(); 272 272 for (ModuleInformation pi: modules) { 273 273 if (checkLoadPreconditions(parent, modules, pi)) { … … 316 316 return null; 317 317 } 318 HashMap<String, ModuleInformation> ret = new HashMap< String, ModuleInformation>();318 HashMap<String, ModuleInformation> ret = new HashMap<>(); 319 319 for (ModuleInformation pi: task.getAvailableModules()) { 320 320 ret.put(pi.name, pi); … … 358 358 */ 359 359 public static List<ModuleInformation> buildListOfModulesToLoad(Component parent) { 360 Set<String> modules = new HashSet< String>();360 Set<String> modules = new HashSet<>(); 361 361 modules.addAll(Main.pref.getCollection(PREF_MODULES, new LinkedList<String>())); 362 362 if (System.getProperty("josm."+PREF_MODULES) != null) { … … 364 364 } 365 365 Map<String, ModuleInformation> infos = loadLocallyAvailableModuleInformation(null); 366 List<ModuleInformation> ret = new LinkedList< ModuleInformation>();366 List<ModuleInformation> ret = new LinkedList<>(); 367 367 for (Iterator<String> it = modules.iterator(); it.hasNext();) { 368 368 String module = it.next(); … … 448 448 // filter modules which actually have to be updated 449 449 // 450 Collection<ModuleInformation> modulesToUpdate = new ArrayList< ModuleInformation>();450 Collection<ModuleInformation> modulesToUpdate = new ArrayList<>(); 451 451 for(ModuleInformation pi: modules) { 452 452 if (pi.isUpdateRequired()) { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleInformation.java
r30340 r30532 46 46 public String iconPath; 47 47 public ImageIcon icon; 48 public List<URL> libraries = new LinkedList< URL>();49 public final Map<String, String> attr = new TreeMap< String, String>();48 public List<URL> libraries = new LinkedList<>(); 49 public final Map<String, String> attr = new TreeMap<>(); 50 50 51 51 /** … … 245 245 * @return the loaded class 246 246 */ 247 @SuppressWarnings("unchecked") 247 248 public Class<? extends Module> loadClass(ClassLoader classLoader) throws ModuleException { 248 249 if (className == null) … … 265 266 public static Collection<String> getModuleLocations() { 266 267 Collection<String> locations = Main.pref.getAllPossiblePreferenceDirs(); 267 Collection<String> all = new ArrayList< String>(locations.size());268 Collection<String> all = new ArrayList<>(locations.size()); 268 269 for (String s : locations) { 269 270 all.add(s+"plugins/opendata/modules"); -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ModuleListParser.java
r30340 r30532 58 58 */ 59 59 public List<ModuleInformation> parse(InputStream in) throws ModuleListParseException{ 60 List<ModuleInformation> ret = new LinkedList< ModuleInformation>();60 List<ModuleInformation> ret = new LinkedList<>(); 61 61 BufferedReader r = null; 62 62 try { -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ReadLocalModuleInformationTask.java
r30436 r30532 18 18 import org.openstreetmap.josm.io.OsmTransferException; 19 19 import org.openstreetmap.josm.tools.ImageProvider; 20 import org.openstreetmap.josm.tools.Utils;21 20 import org.xml.sax.SAXException; 22 21 … … 41 40 public ReadLocalModuleInformationTask() { 42 41 super(tr("Reading local module information.."), false); 43 availableModules = new HashMap< String, ModuleInformation>();42 availableModules = new HashMap<>(); 44 43 } 45 44 46 45 public ReadLocalModuleInformationTask(ProgressMonitor monitor) { 47 46 super(tr("Reading local module information.."),monitor, false); 48 availableModules = new HashMap< String, ModuleInformation>();47 availableModules = new HashMap<>(); 49 48 } 50 49 … … 225 224 */ 226 225 public List<ModuleInformation> getAvailableModules() { 227 return new ArrayList< ModuleInformation>(availableModules.values());226 return new ArrayList<>(availableModules.values()); 228 227 } 229 228 -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/modules/ReadRemoteModuleInformationTask.java
r30436 r30532 53 53 this.sites = Collections.emptySet(); 54 54 } 55 availableModules = new LinkedList< ModuleInformation>();55 availableModules = new LinkedList<>(); 56 56 57 57 } … … 297 297 298 298 // collect old cache files and remove if no longer in use 299 List<File> siteCacheFiles = new LinkedList< File>();299 List<File> siteCacheFiles = new LinkedList<>(); 300 300 for (String location : ModuleInformation.getModuleLocations()) { 301 301 File [] f = new File(location).listFiles( -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/util/NamesFrUtils.java
r30340 r30532 31 31 32 32 private static Map<String, String> initDictionary() { 33 Map<String, String> result = new HashMap< String, String>();33 Map<String, String> result = new HashMap<>(); 34 34 try { 35 35 BufferedReader reader = new BufferedReader(new InputStreamReader( -
applications/editors/josm/plugins/opendata/src/org/openstreetmap/josm/plugins/opendata/core/util/OdUtils.java
r30340 r30532 29 29 30 30 public static final String[] stripQuotesAndExtraChars(String[] split, String sep) { 31 List<String> result = new ArrayList< String>();31 List<String> result = new ArrayList<>(); 32 32 boolean append = false; 33 33 for (int i = 0; i<split.length; i++) { -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbBugListCellRenderer.java
r25474 r30532 41 41 import org.openstreetmap.josm.plugins.osb.OsbPlugin; 42 42 43 public class OsbBugListCellRenderer implements ListCellRenderer {43 public class OsbBugListCellRenderer implements ListCellRenderer<OsbListItem> { 44 44 45 45 private Color background = Color.WHITE; 46 46 private Color altBackground = new Color(250, 250, 220); 47 47 48 public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,48 public Component getListCellRendererComponent(JList<? extends OsbListItem> list, OsbListItem item, int index, boolean isSelected, 49 49 boolean cellHasFocus) { 50 50 … … 64 64 } 65 65 66 OsbListItem item = (OsbListItem) value;67 66 Node n = item.getNode(); 68 67 Icon icon = null; … … 86 85 return label; 87 86 } 88 89 87 } -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbDialog.java
r30004 r30532 93 93 private static final long serialVersionUID = 1L; 94 94 private JPanel bugListPanel, queuePanel; 95 private DefaultListModel bugListModel;96 private JList bugList;97 private JList queueList;95 private DefaultListModel<OsbListItem> bugListModel; 96 private JList<OsbListItem> bugList; 97 private JList<OsbAction> queueList; 98 98 private OsbPlugin osbPlugin; 99 99 private boolean fireSelectionChanged = true; … … 120 120 add(bugListPanel, BorderLayout.CENTER); 121 121 122 bugListModel = new DefaultListModel ();123 bugList = new JList (bugListModel);122 bugListModel = new DefaultListModel<>(); 123 bugList = new JList<>(bugListModel); 124 124 bugList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); 125 125 bugList.addListSelectionListener(this); … … 180 180 queuePanel = new JPanel(new BorderLayout()); 181 181 queuePanel.setName(tr("Queue")); 182 queueList = new JList (getActionQueue());182 queueList = new JList<>(getActionQueue()); 183 183 queueList.setCellRenderer(new OsbQueueListCellRenderer()); 184 184 queuePanel.add(new JScrollPane(queueList), BorderLayout.CENTER); … … 241 241 public synchronized void update(final DataSet dataset) { 242 242 // create a new list model 243 bugListModel = new DefaultListModel ();243 bugListModel = new DefaultListModel<>(); 244 244 List<Node> sortedList = new ArrayList<Node>(dataset.getNodes()); 245 245 Collections.sort(sortedList, new BugComparator()); … … 253 253 254 254 public void valueChanged(ListSelectionEvent e) { 255 if (bugList.getSelectedValues ().length == 0) {255 if (bugList.getSelectedValuesList().isEmpty()) { 256 256 addComment.setEnabled(false); 257 257 closeIssue.setEnabled(false); … … 260 260 261 261 List<OsmPrimitive> selected = new ArrayList<OsmPrimitive>(); 262 for (Object listItem : bugList.getSelectedValues ()) {262 for (Object listItem : bugList.getSelectedValuesList()) { 263 263 Node node = ((OsbListItem) listItem).getNode(); 264 264 selected.add(node); -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbQueueListCellRenderer.java
r30004 r30532 43 43 import org.openstreetmap.josm.plugins.osb.gui.action.OsbAction; 44 44 45 public class OsbQueueListCellRenderer implements ListCellRenderer {45 public class OsbQueueListCellRenderer implements ListCellRenderer<OsbAction> { 46 46 47 47 private Color background = Color.WHITE; 48 48 private Color altBackground = new Color(250, 250, 220); 49 49 50 public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, 50 @Override 51 public Component getListCellRendererComponent(JList<? extends OsbAction> list, OsbAction action, int index, boolean isSelected, 51 52 boolean cellHasFocus) { 52 53 … … 62 63 } 63 64 64 OsbAction action = (OsbAction) value;65 65 Icon icon = null; 66 66 if(action instanceof AddCommentAction) { -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/action/ActionQueue.java
r22684 r30532 5 5 import javax.swing.AbstractListModel; 6 6 7 public class ActionQueue extends AbstractListModel {7 public class ActionQueue extends AbstractListModel<OsbAction> { 8 8 9 9 private LinkedList<OsbAction> queue = new LinkedList<OsbAction>(); … … 25 25 } 26 26 27 public boolean remove(O bjecto) {27 public boolean remove(OsbAction o) { 28 28 int index = queue.indexOf(o); 29 29 if(index >= 0) { … … 52 52 } 53 53 54 public Object getElementAt(int index) { 54 @Override 55 public OsbAction getElementAt(int index) { 55 56 return queue.get(index); 56 57 } 57 58 59 @Override 58 60 public int getSize() { 59 61 return queue.size(); -
applications/editors/josm/plugins/pdfimport/src/pdfimport/LoadPdfDialog.java
r29803 r30532 120 120 * Combobox with all projections available 121 121 */ 122 private JComboBox projectionCombo;122 private JComboBox<ProjectionChoice> projectionCombo; 123 123 private JButton projectionPreferencesButton; 124 124 private JTextField minXField; … … 247 247 c.gridheight = 1;c.gridwidth = 1;c.weightx =1; c.weighty = 1; c.fill = GridBagConstraints.BOTH; 248 248 249 this.projectionCombo = new JComboBox ();249 this.projectionCombo = new JComboBox<>(); 250 250 for (ProjectionChoice p: ProjectionPreference.getProjectionChoices()) { 251 251 this.projectionCombo.addItem(p); -
applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java
r30462 r30532 12 12 import java.io.IOException; 13 13 import java.nio.file.Files; 14 import java.nio.file.Path;15 import java.nio.file.Paths;16 14 import java.text.DecimalFormat; 17 15 import java.util.ArrayList; … … 77 75 cont.add(new JLabel(tr("Write position information into the exif header of the following files:")), GBC.eol()); 78 76 79 DefaultListModel listModel = new DefaultListModel();77 DefaultListModel<String> listModel = new DefaultListModel<>(); 80 78 DecimalFormat dFormatter = new DecimalFormat("###0.000000"); 81 79 for (ImageEntry e : images) { … … 84 82 } 85 83 86 JList entryList = new JList(listModel);84 JList<String> entryList = new JList<>(listModel); 87 85 88 86 JScrollPane scroll = new JScrollPane(entryList); … … 101 99 102 100 final String[] mTimeModeArray = {"----", tr("to gps time"), tr("to previous value (unchanged mtime)")}; 103 final JComboBox mTimeMode = new JComboBox(mTimeModeArray);101 final JComboBox<String> mTimeMode = new JComboBox<>(mTimeModeArray); 104 102 { 105 103 String mTimeModePref = Main.pref.get(MTIME_MODE, null); -
applications/editors/josm/plugins/public_transport/src/public_transport/GTFSImporterDialog.java
r29854 r30532 28 28 private JDialog jDialog = null; 29 29 private JTabbedPane tabbedPane = null; 30 private JComboBox cbStoptype = null;30 private JComboBox<TransText> cbStoptype = null; 31 31 private JList tracksList = null; 32 32 private JTextField tfGPSTimeStart = null; … … 68 68 contentPane.add(label); 69 69 70 cbStoptype = new JComboBox ();70 cbStoptype = new JComboBox<>(); 71 71 cbStoptype.setEditable(false); 72 72 for(String type : stoptypes) … … 481 481 public static double parseTime(String s) 482 482 { 483 double result = 0;484 483 if ((s.charAt(2) != ':') || (s.charAt(2) != ':') 485 484 || (s.length() < 8)) -
applications/editors/josm/plugins/public_transport/src/public_transport/RoutePatternAction.java
r29859 r30532 398 398 private static JDialog jDialog = null; 399 399 private static JTabbedPane tabbedPane = null; 400 private static DefaultListModel relsListModel = null;400 private static DefaultListModel<RouteReference> relsListModel = null; 401 401 private static TagTableModel requiredTagsData = null; 402 402 private static CustomCellEditorTable requiredTagsTable = null; … … 410 410 private static StoplistTableModel stoplistData = null; 411 411 private static JTable stoplistTable = null; 412 private static JList relsList = null;412 private static JList<RouteReference> relsList = null; 413 413 private static JCheckBox cbRight = null; 414 414 private static JCheckBox cbLeft = null; … … 418 418 private static Vector< RelationMember > markedWays = new Vector< RelationMember >(); 419 419 private static Vector< RelationMember > markedNodes = new Vector< RelationMember >(); 420 421 private static Relation copy = null;422 420 423 421 public RoutePatternAction() { … … 470 468 contentPane.add(headline); 471 469 472 relsListModel = new DefaultListModel ();473 relsList = new JList (relsListModel);470 relsListModel = new DefaultListModel<>(); 471 relsList = new JList<>(relsListModel); 474 472 JScrollPane rpListSP = new JScrollPane(relsList); 475 473 String[] data = {"1", "2", "3", "4", "5", "6"}; … … 584 582 rowContent.add("route"); 585 583 requiredTagsData.addRow(rowContent); 586 JComboBox comboBox = new JComboBox();584 JComboBox<String> comboBox = new JComboBox<>(); 587 585 comboBox.addItem("route"); 588 586 requiredTagsTable.setCellEditor(0, 1, new DefaultCellEditor(comboBox)); … … 592 590 rowContent.add(1, "bus"); 593 591 requiredTagsData.addRow(rowContent); 594 /*JComboBox*/ comboBox = new JComboBox ();592 /*JComboBox*/ comboBox = new JComboBox<>(); 595 593 comboBox.addItem("bus"); 596 594 comboBox.addItem("trolleybus"); … … 743 741 itineraryTable.setModel(itineraryData); 744 742 /*JScrollPane*/ tableSP = new JScrollPane(itineraryTable); 745 /*JComboBox*/ comboBox = new JComboBox ();743 /*JComboBox*/ comboBox = new JComboBox<>(); 746 744 comboBox.addItem(""); 747 745 comboBox.addItem("forward"); … … 867 865 stoplistTable.setModel(stoplistData); 868 866 /*JScrollPane*/ tableSP = new JScrollPane(stoplistTable); 869 /*JComboBox*/ comboBox = new JComboBox ();867 /*JComboBox*/ comboBox = new JComboBox<>(); 870 868 comboBox.addItem(""); 871 869 comboBox.addItem("forward_stop"); … … 1109 1107 Vector< RelationMember > itemsToReflect = new Vector< RelationMember >(); 1110 1108 Vector< RelationMember > otherItems = new Vector< RelationMember >(); 1111 int insPos = itineraryTable.getSelectedRow();1112 1109 1113 1110 // Temp 1114 1111 Node firstNode = null; 1115 Node lastNode = null;1112 //Node lastNode = null; 1116 1113 1117 1114 for (int i = 0; i < currentRoute.getMembersCount(); ++i) … … 1136 1133 firstNode = item.getWay().getNode(0); 1137 1134 } 1138 lastNode = item.getWay().getNode(item.getWay().getNodesCount() - 1);1135 //lastNode = item.getWay().getNode(item.getWay().getNodesCount() - 1); 1139 1136 } 1140 1137 else if (item.isNode()) -
applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterAction.java
r30358 r30532 38 38 { 39 39 private static StopImporterDialog dialog = null; 40 private static DefaultListModel tracksListModel = null;40 private static DefaultListModel<TrackReference> tracksListModel = null; 41 41 private static GpxData data = null; 42 42 private static TrackReference currentTrack = null; … … 62 62 } 63 63 64 public DefaultListModel getTracksListModel()64 public DefaultListModel<TrackReference> getTracksListModel() 65 65 { 66 66 if (tracksListModel == null) 67 tracksListModel = new DefaultListModel ();67 tracksListModel = new DefaultListModel<>(); 68 68 return tracksListModel; 69 69 } -
applications/editors/josm/plugins/public_transport/src/public_transport/StopImporterDialog.java
r29859 r30532 33 33 private JDialog jDialog = null; 34 34 private JTabbedPane tabbedPane = null; 35 private JComboBox cbStoptype = null;36 private JList tracksList = null;35 private JComboBox<TransText> cbStoptype = null; 36 private JList<TrackReference> tracksList = null; 37 37 private JTextField tfGPSTimeStart = null; 38 38 private JTextField tfStopwatchStart = null; … … 80 80 contentPane.add(label); 81 81 82 DefaultListModel tracksListModel = controller.getTracksListModel();83 tracksList = new JList (tracksListModel);82 DefaultListModel<TrackReference> tracksListModel = controller.getTracksListModel(); 83 tracksList = new JList<>(tracksListModel); 84 84 JScrollPane rpListSP = new JScrollPane(tracksList); 85 85 String[] data = {"1", "2", "3", "4", "5", "6"}; … … 114 114 contentPane.add(label); 115 115 116 cbStoptype = new JComboBox ();116 cbStoptype = new JComboBox<>(); 117 117 cbStoptype.setEditable(false); 118 118 for(String type : stoptypes) … … 640 640 { 641 641 stoplistTable.setModel(model); 642 JComboBox comboBox = new JComboBox();642 JComboBox<TransText> comboBox = new JComboBox<>(); 643 643 comboBox.addItem(new TransText(null)); 644 644 comboBox.addItem(new TransText(marktr("yes"))); … … 661 661 { 662 662 waypointTable.setModel(model); 663 JComboBox comboBox = new JComboBox();663 JComboBox<TransText> comboBox = new JComboBox<>(); 664 664 comboBox.addItem(new TransText(null)); 665 665 comboBox.addItem(new TransText(marktr("yes"))); -
applications/editors/josm/plugins/reltoolbox/src/relcontext/RelContextDialog.java
r30145 r30532 137 137 138 138 final MouseListener relationMouseAdapter = new ChosenRelationMouseAdapter(); 139 final JComboBox roleBox = new JComboBox();139 final JComboBox<String> roleBox = new JComboBox<>(); 140 140 roleBoxModel = new RoleComboBoxModel(roleBox); 141 141 roleBox.setModel(roleBoxModel); … … 620 620 setEnabled(newRelation != null); 621 621 } 622 622 } 623 623 624 private class RoleComboBoxModel extends AbstractListModel implements ComboBoxModel{624 private class RoleComboBoxModel extends AbstractListModel<String> implements ComboBoxModel<String> { 625 625 private List<String> roles = new ArrayList<String>(); 626 626 private int selectedIndex = -1; 627 private JComboBox combobox;627 private JComboBox<String> combobox; 628 628 private String membersRole; 629 629 private final String EMPTY_ROLE = tr("<empty>"); 630 630 private final String ANOTHER_ROLE = tr("another..."); 631 631 632 public RoleComboBoxModel( JComboBox combobox ) {632 public RoleComboBoxModel( JComboBox<String> combobox ) { 633 633 super(); 634 634 this.combobox = combobox; … … 708 708 } 709 709 710 public ObjectgetElementAt( int index ) {710 public String getElementAt( int index ) { 711 711 return getRole(index); 712 712 } -
applications/editors/josm/plugins/reltoolbox/src/relcontext/actions/FindRelationAction.java
r28857 r30532 37 37 panel.add(searchField, BorderLayout.NORTH); 38 38 final FindRelationListModel relationsData = new FindRelationListModel(); 39 final JList relationsList = new JList(relationsData);39 final JList<Relation> relationsList = new JList<>(relationsData); 40 40 relationsList.setSelectionModel(relationsData.getSelectionModel()); 41 41 relationsList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); … … 167 167 * I admit, some of it was copypasted from {@link org.openstreetmap.josm.gui.dialogs.RelationListDialog.RelationListModel}. 168 168 */ 169 protected class FindRelationListModel extends AbstractListModel {169 protected class FindRelationListModel extends AbstractListModel<Relation> { 170 170 private final ArrayList<Relation> relations = new ArrayList<Relation>(); 171 171 private DefaultListSelectionModel selectionModel; … … 184 184 } 185 185 186 public Relation getRelation( int idx ) { 187 return relations.get(idx); 188 } 189 186 @Override 190 187 public int getSize() { 191 188 return relations.size(); 192 189 } 193 190 194 public Object getElementAt( int index ) { 195 return getRelation(index); 191 @Override 192 public Relation getElementAt( int index ) { 193 return relations.get(index); 196 194 } 197 195 198 196 public void setRelations(Collection<Relation> relations) { 199 197 int selectedIndex = selectionModel.getMinSelectionIndex(); 200 Relation sel = selectedIndex < 0 ? null : get Relation(selectedIndex);198 Relation sel = selectedIndex < 0 ? null : getElementAt(selectedIndex); 201 199 202 200 this.relations.clear(); -
applications/editors/josm/plugins/roadsigns/src/org/openstreetmap/josm/plugins/roadsigns/RoadSignInputDialog.java
r30034 r30532 545 545 if (rowIndex == -1 || colIndex == -1) 546 546 return null; 547 int realColumnIndex = convertColumnIndexToModel(colIndex);547 //int realColumnIndex = convertColumnIndexToModel(colIndex); 548 548 return (String) getValueAt(rowIndex, colIndex); 549 549 } … … 623 623 List<String> values = new ArrayList<String>(); 624 624 List<String> conditions = new ArrayList<String>(); 625 String ident;625 //String ident; 626 626 public TagEvaluater(Tag t) { 627 627 key = t.key.evaluate(env); 628 628 default_value = t.value.evaluate(env); 629 ident = t.ident;629 //ident = t.ident; 630 630 } 631 631 … … 858 858 859 859 private List<PresetMetaData> presetsData; 860 private JComboBox selectionBox;860 private JComboBox<PresetMetaData> selectionBox; 861 861 JRadioButton rbAll, rbUseful; 862 862 … … 865 865 presetsData = RoadSignsPlugin.getAvailablePresetsMetaData(); 866 866 867 selectionBox = new JComboBox (presetsData.toArray());867 selectionBox = new JComboBox<>(presetsData.toArray(new PresetMetaData[0])); 868 868 String code = Main.pref.get("plugin.roadsigns.preset.selection", null); 869 869 if (code != null) { -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingDialog.java
r30361 r30532 52 52 public class RoutingDialog extends ToggleDialog { 53 53 54 private final DefaultListModel model;55 private JList jList = null;54 private final DefaultListModel<String> model; 55 private JList<String> jList = null; 56 56 private JScrollPane jScrollPane = null; 57 57 … … 64 64 super(tr("Routing"), "routing", tr("Open a list of routing nodes"), 65 65 Shortcut.registerShortcut("subwindow:routing", tr("Toggle: {0}", tr("Routing")), KeyEvent.VK_R, Shortcut.ALT_CTRL_SHIFT), 150); 66 model = new DefaultListModel ();66 model = new DefaultListModel<>(); 67 67 createLayout(getJScrollPane(), false, null); 68 68 } … … 88 88 * @return javax.swing.JList 89 89 */ 90 private JList getJList() {90 private JList<String> getJList() { 91 91 if (jList == null) { 92 jList = new JList ();92 jList = new JList<>(); 93 93 jList.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT); 94 94 jList.setModel(model); -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/gui/RoutingPreferenceDialog.java
r30361 r30532 110 110 JPanel p = new JPanel(new GridBagLayout()); 111 111 p.add(new JLabel(tr("Weight")), GBC.std().insets(0, 0, 5, 0)); 112 JComboBox key = new JComboBox();112 JComboBox<String> key = new JComboBox<>(); 113 113 for (OsmWayTypes pk : OsmWayTypes.values()) 114 114 key.addItem(pk.getTag()); -
applications/editors/josm/plugins/smed/src/panels/PanelLights.java
r29894 r30532 18 18 public JLabel categoryLabel; 19 19 20 public JComboBox landCatBox;20 public JComboBox<String> landCatBox; 21 21 public EnumMap<Cat, Integer> landCats = new EnumMap<Cat, Integer>(Cat.class); 22 22 private ActionListener alLandCatBox = new ActionListener() { … … 31 31 } 32 32 }; 33 public JComboBox trafficCatBox;33 public JComboBox<String> trafficCatBox; 34 34 public EnumMap<Cat, Integer> trafficCats = new EnumMap<Cat, Integer>(Cat.class); 35 35 private ActionListener alTrafficCatBox = new ActionListener() { … … 44 44 } 45 45 }; 46 public JComboBox warningCatBox;46 public JComboBox<String> warningCatBox; 47 47 public EnumMap<Cat, Integer> warningCats = new EnumMap<Cat, Integer>(Cat.class); 48 48 private ActionListener alWarningCatBox = new ActionListener() { … … 57 57 } 58 58 }; 59 public JComboBox platformCatBox;59 public JComboBox<String> platformCatBox; 60 60 public EnumMap<Cat, Integer> platformCats = new EnumMap<Cat, Integer>(Cat.class); 61 61 private ActionListener alPlatformCatBox = new ActionListener() { … … 70 70 } 71 71 }; 72 public JComboBox pilotCatBox;72 public JComboBox<String> pilotCatBox; 73 73 public EnumMap<Cat, Integer> pilotCats = new EnumMap<Cat, Integer>(Cat.class); 74 74 private ActionListener alPilotCatBox = new ActionListener() { … … 83 83 } 84 84 }; 85 public JComboBox rescueCatBox;85 public JComboBox<String> rescueCatBox; 86 86 public EnumMap<Cat, Integer> rescueCats = new EnumMap<Cat, Integer>(Cat.class); 87 87 private ActionListener alRescueCatBox = new ActionListener() { … … 96 96 } 97 97 }; 98 public JComboBox radioCatBox;98 public JComboBox<String> radioCatBox; 99 99 public EnumMap<Cat, Integer> radioCats = new EnumMap<Cat, Integer>(Cat.class); 100 100 private ActionListener alRadioCatBox = new ActionListener() { … … 109 109 } 110 110 }; 111 public JComboBox radarCatBox;111 public JComboBox<String> radarCatBox; 112 112 public EnumMap<Cat, Integer> radarCats = new EnumMap<Cat, Integer>(Cat.class); 113 113 private ActionListener alRadarCatBox = new ActionListener() { … … 123 123 }; 124 124 public JLabel functionLabel; 125 public JComboBox functionBox;125 public JComboBox<String> functionBox; 126 126 public EnumMap<Fnc, Integer> functions = new EnumMap<Fnc, Integer>(Fnc.class); 127 127 private ActionListener alfunctionBox = new ActionListener() { … … 261 261 functionLabel.setVisible(false); 262 262 263 functionBox = new JComboBox ();263 functionBox = new JComboBox<>(); 264 264 functionBox.setBounds(new Rectangle(5, 110, 160, 18)); 265 265 add(functionBox); … … 281 281 categoryLabel.setVisible(false); 282 282 283 landCatBox = new JComboBox ();283 landCatBox = new JComboBox<>(); 284 284 landCatBox.setBounds(new Rectangle(5, 142, 160, 18)); 285 285 add(landCatBox); … … 308 308 landCatBox.setVisible(false); 309 309 310 trafficCatBox = new JComboBox ();310 trafficCatBox = new JComboBox<>(); 311 311 trafficCatBox.setBounds(new Rectangle(5, 140, 160, 20)); 312 312 add(trafficCatBox); … … 325 325 trafficCatBox.setVisible(false); 326 326 327 warningCatBox = new JComboBox ();327 warningCatBox = new JComboBox<>(); 328 328 warningCatBox.setBounds(new Rectangle(5, 140, 160, 20)); 329 329 add(warningCatBox); … … 347 347 warningCatBox.setVisible(false); 348 348 349 platformCatBox = new JComboBox ();349 platformCatBox = new JComboBox<>(); 350 350 platformCatBox.setBounds(new Rectangle(5, 140, 160, 20)); 351 351 add(platformCatBox); … … 364 364 platformCatBox.setVisible(false); 365 365 366 pilotCatBox = new JComboBox ();366 pilotCatBox = new JComboBox<>(); 367 367 pilotCatBox.setBounds(new Rectangle(5, 140, 160, 20)); 368 368 add(pilotCatBox); … … 374 374 pilotCatBox.setVisible(false); 375 375 376 rescueCatBox = new JComboBox ();376 rescueCatBox = new JComboBox<>(); 377 377 rescueCatBox.setBounds(new Rectangle(5, 140, 160, 20)); 378 378 add(rescueCatBox); … … 391 391 rescueCatBox.setVisible(false); 392 392 393 radioCatBox = new JComboBox ();393 radioCatBox = new JComboBox<>(); 394 394 radioCatBox.setBounds(new Rectangle(5, 140, 160, 20)); 395 395 add(radioCatBox); … … 429 429 radioCatBox.setVisible(false); 430 430 431 radarCatBox = new JComboBox ();431 radarCatBox = new JComboBox<>(); 432 432 radarCatBox.setBounds(new Rectangle(5, 140, 160, 20)); 433 433 add(radarCatBox); -
applications/editors/josm/plugins/smed/src/panels/PanelLit.java
r29894 r30532 39 39 }; 40 40 public JLabel visibilityLabel; 41 public JComboBox visibilityBox;41 public JComboBox<String> visibilityBox; 42 42 public EnumMap<Vis, Integer> visibilities = new EnumMap<Vis, Integer>(Vis.class); 43 43 private ActionListener alVisibility = new ActionListener() { … … 79 79 }; 80 80 public JLabel categoryLabel; 81 public JComboBox categoryBox;81 public JComboBox<String> categoryBox; 82 82 public EnumMap<Lit, Integer> categories = new EnumMap<Lit, Integer>(Lit.class); 83 83 private ActionListener alCategory = new ActionListener() { … … 115 115 }; 116 116 public JLabel exhibitionLabel; 117 public JComboBox exhibitionBox;117 public JComboBox<String> exhibitionBox; 118 118 public EnumMap<Exh, Integer> exhibitions = new EnumMap<Exh, Integer>(Exh.class); 119 119 private ActionListener alExhibition = new ActionListener() { … … 209 209 categoryLabel.setBounds(new Rectangle(185, 0, 165, 20)); 210 210 add(categoryLabel); 211 categoryBox = new JComboBox ();211 categoryBox = new JComboBox<>(); 212 212 categoryBox.setBounds(new Rectangle(185, 20, 165, 20)); 213 213 add(categoryBox); … … 235 235 visibilityLabel.setBounds(new Rectangle(185, 40, 165, 20)); 236 236 add(visibilityLabel); 237 visibilityBox = new JComboBox ();237 visibilityBox = new JComboBox<>(); 238 238 visibilityBox.setBounds(new Rectangle(185, 60, 165, 20)); 239 239 add(visibilityBox); … … 247 247 exhibitionLabel.setBounds(new Rectangle(280, 80, 70, 20)); 248 248 add(exhibitionLabel); 249 exhibitionBox = new JComboBox ();249 exhibitionBox = new JComboBox<>(); 250 250 exhibitionBox.setBounds(new Rectangle(280, 100, 70, 20)); 251 251 add(exhibitionBox); -
applications/editors/josm/plugins/smed/src/panels/PanelMore.java
r29894 r30532 44 44 }; 45 45 public JLabel statusLabel; 46 public JComboBox statusBox;46 public JComboBox<String> statusBox; 47 47 public EnumMap<Sts, Integer> statuses = new EnumMap<Sts, Integer>(Sts.class); 48 48 private ActionListener alStatus = new ActionListener() { … … 56 56 }; 57 57 public JLabel constrLabel; 58 public JComboBox constrBox;58 public JComboBox<String> constrBox; 59 59 public EnumMap<Cns, Integer> constructions = new EnumMap<Cns, Integer>(Cns.class); 60 60 private ActionListener alConstr = new ActionListener() { … … 68 68 }; 69 69 public JLabel conLabel; 70 public JComboBox conBox;70 public JComboBox<String> conBox; 71 71 public EnumMap<Con, Integer> conspicuities = new EnumMap<Con, Integer>(Con.class); 72 72 private ActionListener alCon = new ActionListener() { … … 80 80 }; 81 81 public JLabel reflLabel; 82 public JComboBox reflBox;82 public JComboBox<String> reflBox; 83 83 public EnumMap<Con, Integer> reflectivities = new EnumMap<Con, Integer>(Con.class); 84 84 private ActionListener alRefl = new ActionListener() { … … 235 235 statusLabel.setBounds(new Rectangle(250, 0, 100, 20)); 236 236 add(statusLabel); 237 statusBox = new JComboBox ();237 statusBox = new JComboBox<>(); 238 238 statusBox.setBounds(new Rectangle(250, 20, 100, 20)); 239 239 addStsItem("", Sts.UNKSTS); … … 262 262 constrLabel.setBounds(new Rectangle(250, 40, 100, 20)); 263 263 add(constrLabel); 264 constrBox = new JComboBox ();264 constrBox = new JComboBox<>(); 265 265 constrBox.setBounds(new Rectangle(250, 60, 100, 20)); 266 266 addCnsItem("", Cns.UNKCNS); … … 280 280 conLabel.setBounds(new Rectangle(250, 80, 100, 20)); 281 281 add(conLabel); 282 conBox = new JComboBox ();282 conBox = new JComboBox<>(); 283 283 conBox.setBounds(new Rectangle(250, 100, 100, 20)); 284 284 addConItem("", Con.UNKCON); … … 291 291 reflLabel.setBounds(new Rectangle(250, 120, 100, 20)); 292 292 add(reflLabel); 293 reflBox = new JComboBox ();293 reflBox = new JComboBox<>(); 294 294 reflBox.setBounds(new Rectangle(250, 140, 100, 20)); 295 295 addReflItem("", Con.UNKCON); … … 361 361 return button; 362 362 } 363 364 363 } -
applications/editors/josm/plugins/smed/src/panels/PanelRadar.java
r29894 r30532 28 28 } 29 29 }; 30 private JComboBox radioCatBox;30 private JComboBox<String> radioCatBox; 31 31 private EnumMap<Cat, Integer> radioCats = new EnumMap<Cat, Integer>(Cat.class); 32 32 private ActionListener alRadioCatBox = new ActionListener() { … … 175 175 add(aisButton); 176 176 177 radioCatBox = new JComboBox ();177 radioCatBox = new JComboBox<>(); 178 178 radioCatBox.setBounds(new Rectangle(210, 40, 150, 20)); 179 179 add(radioCatBox); -
applications/editors/josm/plugins/smed/src/panels/PanelSectors.java
r29894 r30532 36 36 } 37 37 }; 38 public JComboBox colourBox;38 public JComboBox<ImageIcon> colourBox; 39 39 public EnumMap<Col, ImageIcon> colours = new EnumMap<Col, ImageIcon>(Col.class); 40 public JComboBox visibilityBox;40 public JComboBox<String> visibilityBox; 41 41 public EnumMap<Vis, String> visibilities = new EnumMap<Vis, String>(Vis.class); 42 public JComboBox exhibitionBox;42 public JComboBox<String> exhibitionBox; 43 43 public EnumMap<Exh, String> exhibitions = new EnumMap<Exh, String>(Exh.class); 44 44 … … 74 74 75 75 TableColumn colColumn = table.getColumnModel().getColumn(1); 76 colourBox = new JComboBox ();76 colourBox = new JComboBox<>(); 77 77 addColItem(new ImageIcon(getClass().getResource("/images/DelButton.png")), Col.UNKCOL); 78 78 addColItem(new ImageIcon(getClass().getResource("/images/WhiteButton.png")), Col.WHITE); … … 87 87 88 88 TableColumn visColumn = table.getColumnModel().getColumn(12); 89 visibilityBox = new JComboBox ();89 visibilityBox = new JComboBox<>(); 90 90 addVisibItem("", Vis.UNKVIS); 91 91 addVisibItem(Messages.getString("Intensified"), Vis.INTEN); … … 95 95 96 96 TableColumn exhColumn = table.getColumnModel().getColumn(13); 97 exhibitionBox = new JComboBox ();97 exhibitionBox = new JComboBox<>(); 98 98 addExhibItem("", Exh.UNKEXH); 99 99 addExhibItem(Messages.getString("24h"), Exh.H24); -
applications/editors/josm/plugins/smed/src/panels/PanelSpec.java
r30294 r30532 17 17 private SmedAction dlg; 18 18 public JLabel categoryLabel; 19 public JComboBox categoryBox;19 public JComboBox<String> categoryBox; 20 20 public EnumMap<Cat, Integer> categories = new EnumMap<Cat, Integer>(Cat.class); 21 21 private ActionListener alCategoryBox = new ActionListener() { … … 28 28 } 29 29 }; 30 public JComboBox mooringBox;30 public JComboBox<String> mooringBox; 31 31 public EnumMap<Cat, Integer> moorings = new EnumMap<Cat, Integer>(Cat.class); 32 32 private ActionListener alMooringBox = new ActionListener() { … … 173 173 categoryLabel.setBounds(new Rectangle(5, 125, 160, 18)); 174 174 add(categoryLabel); 175 categoryBox = new JComboBox ();175 categoryBox = new JComboBox<>(); 176 176 categoryBox.setBounds(new Rectangle(5, 142, 160, 18)); 177 177 add(categoryBox); … … 196 196 addCatItem(Messages.getString("FerryCross"), Cat.SPM_FRRY); 197 197 addCatItem(Messages.getString("Anchorage"), Cat.SPM_ANCH); 198 mooringBox = new JComboBox ();198 mooringBox = new JComboBox<>(); 199 199 mooringBox.setBounds(new Rectangle(5, 142, 160, 18)); 200 200 add(mooringBox); -
applications/editors/josm/plugins/tagging-preset-tester/src/org/openstreetmap/josm/plugins/taggingpresettester/TaggingCellRenderer.java
r29725 r30532 16 16 17 17 final public class TaggingCellRenderer extends DefaultListCellRenderer { 18 @Override public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {18 @Override public Component getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { 19 19 TaggingPreset a = null; 20 20 if (value instanceof TaggingPreset) -
applications/editors/josm/plugins/tracer2/.classpath
r30047 r30532 2 2 <classpath> 3 3 <classpathentry kind="src" path="src"/> 4 <classpathentry kind="src" path="test/src"/> 5 <!-- <classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/> 6 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> 7 <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/> 8 <classpathentry kind="lib" path="/JOSM/dist/josm-custom.jar" sourcepath="/JOSM/src"/> 9 <classpathentry kind="lib" path="/JOSM/test/build" sourcepath="/JOSM/test/functional"/> 10 <classpathentry kind="lib" path="test/config"/> 11 <classpathentry kind="output" path="build"/> --> 4 <classpathentry combineaccessrules="false" kind="src" path="/JOSM"/> 5 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> 6 <classpathentry kind="output" path="bin"/> 12 7 </classpath> -
applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamDialog.java
r30049 r30532 56 56 private JTextField m_oDescription = new JTextField(); 57 57 private JTextArea m_oUrl = new JTextArea(5,5); 58 private JComboBox m_oTileSize;59 private JComboBox m_oResolution;58 private JComboBox<String> m_oTileSize; 59 private JComboBox<String> m_oResolution; 60 60 //private JTextField m_oSkipBottom = new JTextField(); 61 private JComboBox m_oMode;61 private JComboBox<String> m_oMode; 62 62 private JTextField m_oThreshold = new JTextField(); 63 private JComboBox m_oPointsPerCircle;63 private JComboBox<String> m_oPointsPerCircle; 64 64 private JTextField m_oTag = new JTextField(); 65 65 private JTextField m_oPreferredValues = new JTextField(); … … 112 112 } 113 113 114 private void loadComboBox( JComboBox c, String strValue, String[] astrValues ) {114 private void loadComboBox( JComboBox<?> c, String strValue, String[] astrValues ) { 115 115 int pos = 0; 116 116 for ( String str: astrValues ) { … … 123 123 } 124 124 125 private String saveComboBox( JComboBox c, String[] astrValues ) {125 private String saveComboBox( JComboBox<?> c, String[] astrValues ) { 126 126 return astrValues[c.getSelectedIndex()]; 127 127 } … … 140 140 setButtonIcons(new String[] { "ok.png", "cancel.png" }); 141 141 142 m_oTileSize = new JComboBox (m_astrTileSize);143 m_oResolution = new JComboBox (m_astrResolution);144 m_oMode = new JComboBox (m_astrMode);145 m_oPointsPerCircle = new JComboBox (m_astrPointsPerCircle);142 m_oTileSize = new JComboBox<>(m_astrTileSize); 143 m_oResolution = new JComboBox<>(m_astrResolution); 144 m_oMode = new JComboBox<>(m_astrMode); 145 m_oPointsPerCircle = new JComboBox<>(m_astrPointsPerCircle); 146 146 147 147 load(); -
applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/preferences/ServerParamSelectDialog.java
r30049 r30532 34 34 public class ServerParamSelectDialog extends JPanel { 35 35 36 /** 37 * 38 */ 39 private static final long serialVersionUID = 5655941545321036641L; 40 41 private JComboBox m_oComboBox; 36 private JComboBox<String> m_oComboBox; 42 37 List<ServerParam> m_listServerParam; 43 38 private boolean m_bShow = true; … … 74 69 i++; 75 70 } 76 m_oComboBox = new JComboBox (astr);71 m_oComboBox = new JComboBox<>(astr); 77 72 m_oComboBox.setSelectedIndex(pos); 78 73 -
applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/TurnRestrictionLegEditorTest.java
r23192 r30532 15 15 import javax.swing.JPanel; 16 16 import javax.swing.JScrollPane; 17 import javax.swing.JTextArea;18 17 19 18 import org.openstreetmap.josm.data.coor.LatLon; … … 35 34 public class TurnRestrictionLegEditorTest extends JFrame { 36 35 37 private JTextArea taTest;38 36 private TurnRestrictionLegEditor editor; 39 37 private TurnRestrictionEditorModel model; 40 private JList lstObjects;41 private DefaultListModel listModel;38 private JList<OsmPrimitive> lstObjects; 39 private DefaultListModel<OsmPrimitive> listModel; 42 40 private DataSet dataSet; 43 44 41 45 42 protected JPanel buildLegEditorPanel() { … … 76 73 protected JPanel buildObjectListPanel() { 77 74 JPanel pnl = new JPanel(new BorderLayout()); 78 listModel = new DefaultListModel ();79 pnl.add(new JScrollPane(lstObjects = new JList (listModel)), BorderLayout.CENTER);75 listModel = new DefaultListModel<>(); 76 pnl.add(new JScrollPane(lstObjects = new JList<>(listModel)), BorderLayout.CENTER); 80 77 lstObjects.setCellRenderer(new OsmPrimitivRenderer()); 81 78 -
applications/editors/josm/plugins/turnrestrictions/test/src/org/openstreetmap/josm/plugins/turnrestrictions/editor/ViaListTest.java
r23192 r30532 21 21 * 22 22 */ 23 public class ViaListTest extends JFrame{23 public class ViaListTest extends JFrame { 24 24 25 private ViaList lstVias;26 25 private TurnRestrictionEditorModel model; 27 private JList lstJOSMSelection;28 29 26 30 27 protected void build() { 31 28 DataSet ds = new DataSet(); 32 OsmDataLayer layer =new OsmDataLayer(ds, "test", null);29 OsmDataLayer layer =new OsmDataLayer(ds, "test", null); 33 30 // mock a controler 34 31 NavigationControler controler = new NavigationControler() { … … 54 51 55 52 DefaultListSelectionModel selectionModel = new DefaultListSelectionModel(); 56 c.add( lstVias =new ViaList(new ViaListModel(model, selectionModel), selectionModel), gc);53 c.add(new ViaList(new ViaListModel(model, selectionModel), selectionModel), gc); 57 54 58 55 gc.gridx = 1; 59 c.add( lstJOSMSelection = new JList(), gc);56 c.add(new JList<>(), gc); 60 57 61 58 setSize(600,600); -
applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/EdgeWeightedDigraph.java
r28116 r30532 21 21 * <i>Algorithms, 4th Edition</i> by Robert Sedgewick and Kevin Wayne. 22 22 */ 23 24 25 26 23 public class EdgeWeightedDigraph { 27 24 private final int V; … … 32 29 * Create an empty edge-weighted digraph with V vertices. 33 30 */ 31 @SuppressWarnings("unchecked") 34 32 public EdgeWeightedDigraph(int V) { 35 33 if (V < 0) throw new RuntimeException("Number of vertices must be nonnegative"); … … 102 100 } 103 101 104 105 102 /** 106 103 * Add the edge e to this digraph. … … 111 108 E++; 112 109 } 113 114 110 115 111 /** … … 144 140 } 145 141 146 147 148 142 /** 149 143 * Return a string representation of this graph. … … 162 156 return s.toString(); 163 157 } 164 165 /**166 * Test client.167 */168 // public static void main(String[] args) {169 // In in = new In(args[0]);170 // EdgeWeightedDigraph G = new EdgeWeightedDigraph(in);171 // StdOut.println(G);172 // }173 174 158 } -
applications/editors/josm/plugins/utilsplugin2/src/edu/princeton/cs/algs4/IndexMinPQ.java
r28116 r30532 19 19 private Key[] keys; // keys[i] = priority of i 20 20 21 @SuppressWarnings("unchecked") 21 22 public IndexMinPQ(int NMAX) { 22 23 keys = (Key[]) new Comparable[NMAX + 1]; // make this of length NMAX?? … … 186 187 } 187 188 } 188 189 190 // public static void main(String[] args) {191 // // insert a bunch of strings192 // String[] strings = { "it", "was", "the", "best", "of", "times", "it", "was", "the", "worst" };193 //194 // IndexMinPQ<String> pq = new IndexMinPQ<String>(strings.length);195 // for (int i = 0; i < strings.length; i++) {196 // pq.insert(i, strings[i]);197 // }198 //199 // // delete and print each key200 // while (!pq.isEmpty()) {201 // int i = pq.delMin();202 // StdOut.println(i + " " + strings[i]);203 // }204 // StdOut.println();205 //206 // // reinsert the same strings207 // for (int i = 0; i < strings.length; i++) {208 // pq.insert(i, strings[i]);209 // }210 //211 // // print each key using the iterator212 // for (int i : pq) {213 // StdOut.println(i + " " + strings[i]);214 // }215 // while (!pq.isEmpty()) {216 // pq.delMin();217 // }218 //219 // }220 189 } -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/ChooseURLAction.java
r29769 r30532 54 54 } 55 55 final JLabel label1=new JLabel(tr("Please select one of custom URLs (configured in Preferences)")); 56 final JList list1=new JList(names);56 final JList<String> list1=new JList<>(names); 57 57 final JTextField editField=new JTextField(); 58 58 final JCheckBox check1=new JCheckBox(tr("Ask every time")); -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/replacegeometry/ReplaceGeometryUtils.java
r30177 r30532 8 8 import java.util.Arrays; 9 9 import java.util.Collection; 10 import java.util.Collections; 10 11 import java.util.HashMap; 11 12 import java.util.HashSet; … … 13 14 import java.util.List; 14 15 import java.util.Map; 15 import java.util.Set;16 16 17 17 import javax.swing.JOptionPane; … … 24 24 import org.openstreetmap.josm.command.DeleteCommand; 25 25 import org.openstreetmap.josm.command.MoveCommand; 26 import org.openstreetmap.josm.corrector.UserCancelException; 26 27 import org.openstreetmap.josm.data.coor.LatLon; 27 28 import org.openstreetmap.josm.data.osm.Node; … … 29 30 import org.openstreetmap.josm.data.osm.Relation; 30 31 import org.openstreetmap.josm.data.osm.RelationMember; 31 import org.openstreetmap.josm.data.osm.RelationToChildReference;32 32 import org.openstreetmap.josm.data.osm.TagCollection; 33 33 import org.openstreetmap.josm.data.osm.Way; 34 34 import org.openstreetmap.josm.gui.DefaultNameFormatter; 35 import org.openstreetmap.josm.gui.Notification; 35 36 import org.openstreetmap.josm.gui.conflict.tags.CombinePrimitiveResolverDialog; 36 import org.openstreetmap.josm.gui.conflict.tags.TagConflictResolutionUtil;37 37 38 38 import edu.princeton.cs.algs4.AssignmentProblem; 39 import org.openstreetmap.josm.gui.Notification;40 import static org.openstreetmap.josm.tools.I18n.tr;41 39 42 40 /** … … 45 43 */ 46 44 public final class ReplaceGeometryUtils { 47 private static final String TITLE = tr("Replace Geometry");48 45 /** 49 46 * Replace new or uploaded object with new object … … 168 165 169 166 // merge tags 170 Collection<Command> tagResolutionCommands = getTagConflictResolutionCommands(subjectNode, referenceObject); 171 if (tagResolutionCommands == null) { 167 try { 168 commands.addAll(getTagConflictResolutionCommands(subjectNode, referenceObject)); 169 } catch (UserCancelException e) { 172 170 // user canceled tag merge dialog 173 171 return null; 174 172 } 175 commands.addAll(tagResolutionCommands);176 173 177 174 // replace sacrificial node in way with node that is being upgraded … … 254 251 255 252 // merge tags 256 Collection<Command> tagResolutionCommands = getTagConflictResolutionCommands(referenceWay, subjectWay); 257 if (tagResolutionCommands == null) { 253 try { 254 commands.addAll(getTagConflictResolutionCommands(referenceWay, subjectWay)); 255 } catch (UserCancelException e) { 258 256 // user canceled tag merge dialog 259 257 return null; 260 258 } 261 commands.addAll(tagResolutionCommands);262 259 263 260 // Prepare a list of nodes that are not used anywhere except in the way … … 452 449 * @param source object tags are merged from 453 450 * @param target object tags are merged to 454 * @return 455 */ 456 protected static List<Command> getTagConflictResolutionCommands(OsmPrimitive source, OsmPrimitive target) { 457 // determine if the same key in each object has different values 458 boolean keysWithMultipleValues; 459 Set<OsmPrimitive> set = new HashSet<OsmPrimitive>(); 460 set.add(source); 461 set.add(target); 462 TagCollection tagCol = TagCollection.unionOfAllPrimitives(set); 463 Set<String> keys = tagCol.getKeysWithMultipleValues(); 464 keysWithMultipleValues = !keys.isEmpty(); 465 451 * @return The list of {@link Command commands} needed to apply resolution actions. 452 * @throws UserCancelException If the user cancelled a dialog. 453 */ 454 protected static List<Command> getTagConflictResolutionCommands(OsmPrimitive source, OsmPrimitive target) throws UserCancelException { 466 455 Collection<OsmPrimitive> primitives = Arrays.asList(source, target); 467 468 Set<RelationToChildReference> relationToNodeReferences = RelationToChildReference.getRelationToChildReferences(primitives);469 470 // build the tag collection471 TagCollection tags = TagCollection.unionOfAllPrimitives(primitives);472 TagConflictResolutionUtil.combineTigerTags(tags);473 TagConflictResolutionUtil.normalizeTagCollectionBeforeEditing(tags, primitives);474 TagCollection tagsToEdit = new TagCollection(tags);475 TagConflictResolutionUtil.completeTagCollectionForEditing(tagsToEdit);476 477 456 // launch a conflict resolution dialog, if necessary 478 CombinePrimitiveResolverDialog dialog = CombinePrimitiveResolverDialog.getInstance(); 479 dialog.getTagConflictResolverModel().populate(tagsToEdit, tags.getKeysWithMultipleValues()); 480 dialog.getRelationMemberConflictResolverModel().populate(relationToNodeReferences); 481 dialog.setTargetPrimitive(target); 482 dialog.prepareDefaultDecisions(); 483 484 // conflict resolution is necessary if there are conflicts in the merged tags 485 // or if both objects have relation memberships 486 if (keysWithMultipleValues || 487 (!RelationToChildReference.getRelationToChildReferences(source).isEmpty() && 488 !RelationToChildReference.getRelationToChildReferences(target).isEmpty())) { 489 dialog.setVisible(true); 490 if (dialog.isCanceled()) { 491 return null; 492 } 493 } 494 return dialog.buildResolutionCommands(); 495 } 496 457 return CombinePrimitiveResolverDialog.launchIfNecessary( 458 TagCollection.unionOfAllPrimitives(primitives), primitives, Collections.singleton(target)); 459 } 497 460 498 461 /** -
applications/editors/josm/plugins/waypoint_search/src/org/openstreetmap/josm/plugins/waypointSearch/SelectWaypointDialog.java
r27467 r30532 17 17 import static org.openstreetmap.josm.tools.I18n.tr; 18 18 19 20 19 public class SelectWaypointDialog extends ToggleDialog implements KeyListener, MouseListener { 21 20 22 21 private JTextField searchPattern = new JTextField(20); 23 private DefaultListModel listModel = new DefaultListModel();24 private JList searchResult = new JList(listModel);22 private DefaultListModel<String> listModel = new DefaultListModel<>(); 23 private JList<String> searchResult = new JList<>(listModel); 25 24 private List<Marker> SearchResultObjectCache = new ArrayList<Marker>(); 26 25 private boolean first_time_search = true; 27 26 private Engine engine = new Engine(); 28 29 27 30 28 public SelectWaypointDialog(String name, String iconName, String tooltip, … … 33 31 build(); 34 32 } 35 36 33 37 34 protected void build() { … … 60 57 createLayout(panel, false, null); 61 58 } 62 63 64 59 65 60 public void updateSearchResults(){ … … 76 71 } 77 72 } 78 79 73 80 74 @Override … … 82 76 // TODO Auto-generated method stub 83 77 } 84 85 78 86 79 @Override … … 90 83 } 91 84 92 93 85 @Override 94 86 public void keyTyped(KeyEvent arg0) { 95 87 first_time_search = false; 96 88 } 97 98 89 99 90 @Override … … 108 99 } 109 100 110 111 101 @Override 112 102 public void mouseEntered(MouseEvent arg0) { 113 // TODO Auto-generated method stub114 115 103 } 116 117 104 118 105 @Override 119 106 public void mouseExited(MouseEvent arg0) { 120 // TODO Auto-generated method stub121 122 107 } 123 124 108 125 109 @Override … … 128 112 searchPattern.selectAll(); 129 113 } 130 131 114 } 132 133 115 134 116 @Override 135 117 public void mouseReleased(MouseEvent arg0) { 136 // TODO Auto-generated method stub137 138 118 } 139 119 } -
applications/editors/josm/plugins/wikipedia/src/org/wikipedia/WikipediaToggleDialog.java
r30100 r30532 60 60 final StringProperty wikipediaLang = new StringProperty("wikipedia.lang", LanguageInfo.getJOSMLocaleCode().substring(0, 2)); 61 61 final Set<String> articles = new HashSet<String>(); 62 final DefaultListModel model = new DefaultListModel();63 final JList list = new JList(model) {62 final DefaultListModel<WikipediaEntry> model = new DefaultListModel<>(); 63 final JList<WikipediaEntry> list = new JList<WikipediaEntry>(model) { 64 64 65 65 { … … 84 84 85 85 @Override 86 public JLabel getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {86 public JLabel getListCellRendererComponent(JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) { 87 87 JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); 88 88 final WikipediaEntry entry = (WikipediaEntry) value;
Note:
See TracChangeset
for help on using the changeset viewer.