Changeset 34445 in osm for applications/editors/josm/plugins/ImportImagePlugin
- Timestamp:
- 2018-08-10T00:01:05+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/ImportImagePlugin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/ImportImagePlugin/.settings/org.eclipse.jdt.core.prefs
r32699 r34445 3 3 org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore 4 4 org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull 5 org.eclipse.jdt.core.compiler.annotation.nonnull.secondary= 5 6 org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault 7 org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary= 6 8 org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable 9 org.eclipse.jdt.core.compiler.annotation.nullable.secondary= 7 10 org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled 8 11 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled … … 13 16 org.eclipse.jdt.core.compiler.debug.localVariable=generate 14 17 org.eclipse.jdt.core.compiler.debug.sourceFile=generate 18 org.eclipse.jdt.core.compiler.doc.comment.support=enabled 19 org.eclipse.jdt.core.compiler.problem.APILeak=warning 15 20 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning 16 21 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error … … 36 41 org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning 37 42 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore 43 org.eclipse.jdt.core.compiler.problem.invalidJavadoc=warning 44 org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled 45 org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled 46 org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=enabled 47 org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=public 38 48 org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore 39 49 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning … … 42 52 org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled 43 53 org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore 54 org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning 55 org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled 56 org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public 57 org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags 58 org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning 59 org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled 60 org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled 61 org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public 44 62 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore 45 63 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled … … 50 68 org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore 51 69 org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning 70 org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning 52 71 org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error 53 72 org.eclipse.jdt.core.compiler.problem.nullReference=warning … … 56 75 org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning 57 76 org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore 77 org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning 58 78 org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore 59 79 org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore … … 72 92 org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled 73 93 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore 94 org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning 74 95 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning 75 96 org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled … … 78 99 org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore 79 100 org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning 101 org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning 102 org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled 103 org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info 80 104 org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore 81 105 org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore … … 85 109 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled 86 110 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled 111 org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore 87 112 org.eclipse.jdt.core.compiler.problem.unusedImport=warning 88 113 org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -
applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/ImageLayer.java
r34219 r34445 223 223 } catch (ArrayIndexOutOfBoundsException e) { 224 224 // TODO: prevents this to happen when displaying GeoTIFF images (see #7902) 225 e.printStackTrace();225 Logging.error(e); 226 226 } 227 227 -
applications/editors/josm/plugins/ImportImagePlugin/src/org/openstreetmap/josm/plugins/ImportImagePlugin/LayerPropertiesDialog.java
r34219 r34445 8 8 import java.awt.GridBagLayout; 9 9 import java.awt.Rectangle; 10 import java.awt.event.KeyAdapter; 10 11 import java.awt.event.KeyEvent; 11 12 import java.io.File; … … 31 32 import org.geotools.referencing.CRS; 32 33 import org.opengis.referencing.FactoryException; 33 import org.opengis.referencing.NoSuchAuthorityCodeException;34 34 import org.opengis.referencing.crs.CoordinateReferenceSystem; 35 35 import org.openstreetmap.josm.tools.Logging; … … 109 109 } 110 110 111 112 111 /** 113 112 * This method initializes this … … 118 117 this.setContentPane(getMainPanel()); 119 118 this.setPreferredSize(new Dimension(404, 485)); 120 121 119 } 122 120 … … 353 351 okButton.setBounds(new Rectangle(134, 5, 136, 31)); 354 352 okButton.setText("OK"); 355 okButton.addActionListener(new java.awt.event.ActionListener() { 356 @Override 357 public void actionPerformed(java.awt.event.ActionEvent e) { 358 setVisible(false); 359 dispose(); 360 } 361 }); 353 okButton.addActionListener(e -> { 354 setVisible(false); 355 dispose(); 356 }); 362 357 } 363 358 return okButton; … … 374 369 searchField.setBounds(new Rectangle(13, 111, 282, 20)); 375 370 searchField.setToolTipText("Enter keywords or EPSG codes"); 376 searchField.addKeyListener(new java.awt.event.KeyAdapter() {371 searchField.addKeyListener(new KeyAdapter() { 377 372 @Override 378 public void keyTyped( java.awt.event.KeyEvent e) {373 public void keyTyped(KeyEvent e) { 379 374 380 375 for (Iterator<String> iterator = supportedCRS.iterator(); iterator.hasNext();) { … … 430 425 useDefaultCRSButton.setBounds(new Rectangle(253, 54, 118, 28)); 431 426 useDefaultCRSButton.setText("Apply Default"); 432 useDefaultCRSButton.addActionListener(new java.awt.event.ActionListener() { 433 @Override 434 public void actionPerformed(java.awt.event.ActionEvent e) { 435 try { 436 437 setCursor(new Cursor(Cursor.WAIT_CURSOR)); 438 if (PluginOperations.defaultSourceCRS != null) { 439 imageLayer.resample(PluginOperations.defaultSourceCRS); 440 } else { 441 JOptionPane.showMessageDialog(getContentPane(), 442 "<html>No default reference system available.<br>Please select one from the list</html>"); 427 useDefaultCRSButton.addActionListener(e -> { 428 try { 429 setCursor(new Cursor(Cursor.WAIT_CURSOR)); 430 if (PluginOperations.defaultSourceCRS != null) { 431 imageLayer.resample(PluginOperations.defaultSourceCRS); 432 } else { 433 JOptionPane.showMessageDialog(getContentPane(), 434 "<html>No default reference system available.<br>Please select one from the list</html>"); 435 } 436 } catch (FactoryException | IOException e1) { 437 Logging.error(e1); 438 } finally { 439 setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); 443 440 } 444 445 } catch (NoSuchAuthorityCodeException e1) { 446 // TODO Auto-generated catch block 447 e1.printStackTrace(); 448 } catch (FactoryException e1) { 449 // TODO Auto-generated catch block 450 e1.printStackTrace(); 451 } catch (IOException e2) { 452 // TODO Auto-generated catch block 453 e2.printStackTrace(); 454 } finally { 455 setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); 456 } 457 } 458 }); 441 }); 459 442 } 460 443 return useDefaultCRSButton; … … 473 456 applySelectedCRSButton.setHorizontalTextPosition(SwingConstants.TRAILING); 474 457 applySelectedCRSButton.setText("<html>Apply<br>Selection</html>"); 475 applySelectedCRSButton.addActionListener(new java.awt.event.ActionListener() { 476 @Override 477 public void actionPerformed(java.awt.event.ActionEvent e) { 478 479 String selection = crsJList.getSelectedValue(); 480 String code = selection.substring(selection.indexOf("[-") + 2, selection.indexOf("-]")); 481 482 CoordinateReferenceSystem newRefSys = null; 483 try { 484 newRefSys = CRS.decode(code, eastingFirstCheckBox.isSelected()); 485 486 setCursor(new Cursor(Cursor.WAIT_CURSOR)); 487 488 imageLayer.resample(newRefSys); 489 490 } catch (NoSuchAuthorityCodeException e1) { 491 // TODO Auto-generated catch block 492 e1.printStackTrace(); 493 } catch (FactoryException e1) { 494 // TODO Auto-generated catch block 495 e1.printStackTrace(); 496 } catch (IOException e2) { 497 // TODO Auto-generated catch block 498 e2.printStackTrace(); 499 } finally { 500 setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); 501 } 502 } 503 }); 458 applySelectedCRSButton.addActionListener(e -> { 459 460 String selection = crsJList.getSelectedValue(); 461 String code = selection.substring(selection.indexOf("[-") + 2, selection.indexOf("-]")); 462 463 try { 464 CoordinateReferenceSystem newRefSys = CRS.decode(code, eastingFirstCheckBox.isSelected()); 465 setCursor(new Cursor(Cursor.WAIT_CURSOR)); 466 imageLayer.resample(newRefSys); 467 } catch (FactoryException | IOException e1) { 468 Logging.error(e1); 469 } finally { 470 setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); 471 } 472 }); 504 473 } 505 474 return applySelectedCRSButton; … … 516 485 setSelectedCRSAsDefaultButton.setBounds(new Rectangle(315, 300, 69, 61)); 517 486 setSelectedCRSAsDefaultButton.setText("<html>Set as<br>Default</html>"); 518 setSelectedCRSAsDefaultButton 519 .addActionListener(new java.awt.event.ActionListener() { 520 @Override 521 public void actionPerformed(java.awt.event.ActionEvent e) { 522 523 if (crsJList.getSelectedValue() != null) { 524 String selection = crsJList.getSelectedValue(); 525 String code = selection.substring(selection.indexOf("[-") + 2, selection.indexOf("-]")); 526 527 try { 528 PluginOperations.defaultSourceCRS = CRS.decode(code, eastingFirstCheckBox.isSelected()); 529 PluginOperations.defaultSourceCRSDescription = selection; 530 531 ImportImagePlugin.pluginProps.setProperty("default_crs_eastingfirst", 532 "" + eastingFirstCheckBox.isSelected()); 533 ImportImagePlugin.pluginProps.setProperty("default_crs_srid", code); 534 try (FileWriter fileWriter = new FileWriter(new File(ImportImagePlugin.PLUGINPROPERTIES_PATH))) { 535 ImportImagePlugin.pluginProps.store(fileWriter, null); 536 } 537 538 defaultCRSLabel.setText(selection); 539 540 } catch (IOException | FactoryException e2) { 541 Logging.error(e2); 487 setSelectedCRSAsDefaultButton.addActionListener(e -> { 488 if (crsJList.getSelectedValue() != null) { 489 String selection = crsJList.getSelectedValue(); 490 String code = selection.substring(selection.indexOf("[-") + 2, selection.indexOf("-]")); 491 492 try { 493 PluginOperations.defaultSourceCRS = CRS.decode(code, eastingFirstCheckBox.isSelected()); 494 PluginOperations.defaultSourceCRSDescription = selection; 495 496 ImportImagePlugin.pluginProps.setProperty("default_crs_eastingfirst", 497 "" + eastingFirstCheckBox.isSelected()); 498 ImportImagePlugin.pluginProps.setProperty("default_crs_srid", code); 499 try (FileWriter fileWriter = new FileWriter(new File(ImportImagePlugin.PLUGINPROPERTIES_PATH))) { 500 ImportImagePlugin.pluginProps.store(fileWriter, null); 542 501 } 543 } else { 544 JOptionPane.showMessageDialog(getContentPane(), "Please make a selection from the list."); 502 503 defaultCRSLabel.setText(selection); 504 505 } catch (IOException | FactoryException e2) { 506 Logging.error(e2); 545 507 } 508 } else { 509 JOptionPane.showMessageDialog(getContentPane(), "Please make a selection from the list."); 546 510 } 547 511 });
Note:
See TracChangeset
for help on using the changeset viewer.