Changeset 32371 in osm for applications/editors/josm/plugins/seachart
- Timestamp:
- 2016-06-23T00:54:03+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/seachart
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/.settings/org.eclipse.jdt.core.prefs
r31569 r32371 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 9 org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate 3 10 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 11 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 4 12 org.eclipse.jdt.core.compiler.compliance=1.7 13 org.eclipse.jdt.core.compiler.debug.lineNumber=generate 14 org.eclipse.jdt.core.compiler.debug.localVariable=generate 15 org.eclipse.jdt.core.compiler.debug.sourceFile=generate 16 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning 5 17 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 18 org.eclipse.jdt.core.compiler.problem.autoboxing=ignore 19 org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning 20 org.eclipse.jdt.core.compiler.problem.deadCode=warning 21 org.eclipse.jdt.core.compiler.problem.deprecation=warning 22 org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled 23 org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled 24 org.eclipse.jdt.core.compiler.problem.discouragedReference=warning 25 org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore 6 26 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 27 org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore 28 org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore 29 org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled 30 org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore 31 org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning 32 org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning 33 org.eclipse.jdt.core.compiler.problem.forbiddenReference=error 34 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning 35 org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled 36 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning 37 org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning 38 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore 39 org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore 40 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning 41 org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore 42 org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore 43 org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled 44 org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore 45 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore 46 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled 47 org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore 48 org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore 49 org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning 50 org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning 51 org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore 52 org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning 53 org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error 54 org.eclipse.jdt.core.compiler.problem.nullReference=warning 55 org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error 56 org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning 57 org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning 58 org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore 59 org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore 60 org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore 61 org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore 62 org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning 63 org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning 64 org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore 65 org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning 66 org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning 67 org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore 68 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore 69 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled 70 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning 71 org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled 72 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled 73 org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled 74 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore 75 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning 76 org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled 77 org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning 78 org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning 79 org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore 80 org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning 81 org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore 82 org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore 83 org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore 84 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore 85 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled 86 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled 87 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled 88 org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore 89 org.eclipse.jdt.core.compiler.problem.unusedImport=warning 90 org.eclipse.jdt.core.compiler.problem.unusedLabel=warning 91 org.eclipse.jdt.core.compiler.problem.unusedLocal=warning 92 org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore 93 org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore 94 org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled 95 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled 96 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled 97 org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning 98 org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore 99 org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning 100 org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning 7 101 org.eclipse.jdt.core.compiler.source=1.7 -
applications/editors/josm/plugins/seachart/build.xml
r31044 r32371 4 4 <property name="commit.message" value="[Seachart] Publish new release"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value=" 7001"/>6 <property name="plugin.main.version" value="10279"/> 7 7 8 8 <property name="plugin.author" value="Malcolm Herring"/> -
applications/editors/josm/plugins/seachart/src/seachart/SeachartAction.java
r32088 r32371 10 10 package seachart; 11 11 12 import java.awt.event.*; 13 14 import javax.swing.*; 15 12 import java.awt.event.ActionEvent; 16 13 import java.util.Map.Entry; 17 14 15 import javax.swing.SwingUtilities; 16 17 import org.openstreetmap.josm.Main; 18 18 import org.openstreetmap.josm.actions.JosmAction; 19 import org.openstreetmap.josm.gui.MapView;20 import org.openstreetmap.josm.gui.MapView.EditLayerChangeListener;21 import org.openstreetmap.josm.gui.MapView.LayerChangeListener;22 import org.openstreetmap.josm.gui.layer.*;23 19 import org.openstreetmap.josm.data.Bounds; 24 20 import org.openstreetmap.josm.data.coor.LatLon; 25 21 import org.openstreetmap.josm.data.imagery.ImageryInfo; 26 import org.openstreetmap.josm.data.osm.*; 27 import org.openstreetmap.josm.data.osm.event.*; 28 import org.openstreetmap.josm.Main; 22 import org.openstreetmap.josm.data.osm.DataSet; 23 import org.openstreetmap.josm.data.osm.Node; 24 import org.openstreetmap.josm.data.osm.OsmPrimitiveType; 25 import org.openstreetmap.josm.data.osm.Relation; 26 import org.openstreetmap.josm.data.osm.RelationMember; 27 import org.openstreetmap.josm.data.osm.Way; 28 import org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent; 29 import org.openstreetmap.josm.data.osm.event.DataChangedEvent; 30 import org.openstreetmap.josm.data.osm.event.DataSetListener; 31 import org.openstreetmap.josm.data.osm.event.NodeMovedEvent; 32 import org.openstreetmap.josm.data.osm.event.PrimitivesAddedEvent; 33 import org.openstreetmap.josm.data.osm.event.PrimitivesRemovedEvent; 34 import org.openstreetmap.josm.data.osm.event.RelationMembersChangedEvent; 35 import org.openstreetmap.josm.data.osm.event.TagsChangedEvent; 36 import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent; 37 import org.openstreetmap.josm.gui.layer.LayerManager.LayerAddEvent; 38 import org.openstreetmap.josm.gui.layer.LayerManager.LayerChangeListener; 39 import org.openstreetmap.josm.gui.layer.LayerManager.LayerOrderChangeEvent; 40 import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent; 41 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent; 42 import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener; 43 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 29 44 30 45 import s57.S57map; 31 import s57.S57map.*; 32 33 public class SeachartAction extends JosmAction implements EditLayerChangeListener, LayerChangeListener { 46 47 public class SeachartAction extends JosmAction implements ActiveLayerChangeListener, LayerChangeListener { 34 48 private static String title = "SeaChart"; 35 49 private boolean isOpen = false; … … 86 100 87 101 @Override 88 public void activeLayerChange(Layer arg0, Layer arg1) {102 public void layerAdded(LayerAddEvent e) { 89 103 } 90 104 91 105 @Override 92 public void layerAdded(Layer arg0) { 93 } 94 95 @Override 96 public void layerRemoved(Layer arg0) { 97 if (arg0.getName().equals("SeaChart")) { 106 public void layerRemoving(LayerRemoveEvent e) { 107 if ("SeaChart".equals(e.getRemovedLayer().getName())) { 98 108 closeChartLayer(); 99 109 } 100 110 } 101 111 102 @Override 112 @Override 113 public void layerOrderChanged(LayerOrderChangeEvent e) { 114 } 115 116 @Override 103 117 public void actionPerformed(ActionEvent arg0) { 104 118 SwingUtilities.invokeLater(new Runnable() { … … 114 128 rendering = new ChartImage(new ImageryInfo("SeaChart")); 115 129 rendering.setBackgroundLayer(true); 116 Main.main.addLayer(rendering); 117 MapView.addEditLayerChangeListener(this); 118 MapView.addLayerChangeListener(this); 119 editLayerChanged(Main.main.getEditLayer(), Main.main.getEditLayer()); 130 Main.getLayerManager().addLayer(rendering); 131 Main.getLayerManager().addAndFireActiveLayerChangeListener(this); 132 Main.getLayerManager().addLayerChangeListener(this); 120 133 } 121 134 122 135 public void closeChartLayer() { 123 136 if (isOpen) { 124 MapView.removeEditLayerChangeListener(this);125 Ma pView.removeLayerChangeListener(this);126 Main. main.removeLayer(rendering);137 Main.getLayerManager().removeActiveLayerChangeListener(this); 138 Main.getLayerManager().removeLayerChangeListener(this); 139 Main.getLayerManager().removeLayer(rendering); 127 140 } 128 141 isOpen = false; … … 130 143 131 144 @Override 132 public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) { 145 public void activeOrEditLayerChanged(ActiveLayerChangeEvent e) { 146 OsmDataLayer oldLayer = e.getPreviousEditLayer(); 133 147 if (oldLayer != null) { 134 148 oldLayer.data.removeDataSetListener(dataSetListener); 135 149 } 150 OsmDataLayer newLayer = Main.getLayerManager().getEditLayer(); 136 151 if (newLayer != null) { 137 152 newLayer.data.addDataSetListener(dataSetListener);
Note:
See TracChangeset
for help on using the changeset viewer.