Changeset 34464 in osm
- Timestamp:
- 2018-08-15T02:00:36+02:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/smed
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed/.settings/org.eclipse.jdt.core.prefs
r32699 r34464 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 9 12 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 10 13 org.eclipse.jdt.core.compiler.compliance=1.8 14 org.eclipse.jdt.core.compiler.problem.APILeak=warning 11 15 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning 12 16 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error … … 40 44 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore 41 45 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled 42 org.eclipse.jdt.core.compiler.problem.missingSerialVersion= warning46 org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore 43 47 org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore 44 48 org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning … … 46 50 org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore 47 51 org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning 52 org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning 48 53 org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error 49 54 org.eclipse.jdt.core.compiler.problem.nullReference=warning … … 52 57 org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning 53 58 org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore 59 org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning 54 60 org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore 55 61 org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore … … 68 74 org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled 69 75 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore 76 org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning 70 77 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning 71 78 org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled … … 74 81 org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore 75 82 org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning 83 org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning 84 org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled 85 org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info 76 86 org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore 77 87 org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore … … 81 91 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled 82 92 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled 93 org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore 83 94 org.eclipse.jdt.core.compiler.problem.unusedImport=warning 84 95 org.eclipse.jdt.core.compiler.problem.unusedLabel=warning -
applications/editors/josm/plugins/smed/build.xml
r34097 r34464 4 4 <property name="commit.message" value="New release"/> 5 5 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 6 <property name="plugin.main.version" value="1 2643"/>6 <property name="plugin.main.version" value="14153"/> 7 7 8 8 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/smed/src/seamarks/SeaMark.java
r33178 r34464 17 17 import javax.swing.JPanel; 18 18 19 import org.openstreetmap.josm.Main;20 19 import org.openstreetmap.josm.command.ChangePropertyCommand; 20 import org.openstreetmap.josm.data.UndoRedoHandler; 21 21 import org.openstreetmap.josm.data.osm.OsmPrimitive; 22 import org.openstreetmap.josm.spi.preferences.Config; 22 23 23 24 import messages.Messages; … … 1463 1464 public void parseMark(OsmPrimitive node) { 1464 1465 PanelMain.messageBar.setText(""); 1465 String str = Main.pref.get("smedplugin.IALA");1466 String str = Config.getPref().get("smedplugin.IALA"); 1466 1467 if (str.equals("C")) { 1467 1468 setRegion(Reg.C); … … 2020 2021 } 2021 2022 2022 dlg.panelMain.syncPanel();2023 SmedAction.panelMain.syncPanel(); 2023 2024 } 2024 2025 … … 2703 2704 if (getObject() != Obj.UNKOBJ) { 2704 2705 2705 Main.pref.put("smedplugin.IALA", getRegion() == Reg.C ? "C" : (getRegion() == Reg.B ? "B" : "A")); 2706 2706 Config.getPref().put("smedplugin.IALA", getRegion() == Reg.C ? "C" : (getRegion() == Reg.B ? "B" : "A")); 2707 2708 UndoRedoHandler undoRedo = UndoRedoHandler.getInstance(); 2707 2709 for (String str : node.getKeys().keySet()) { 2708 2710 if (str.trim().matches("^seamark:\\S+")) { 2709 Main.main.undoRedo.add(new ChangePropertyCommand(node, str, null));2711 undoRedo.add(new ChangePropertyCommand(node, str, null)); 2710 2712 } 2711 2713 } 2712 2714 2713 2715 if (!getName().isEmpty()) { 2714 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:name", getName()));2716 undoRedo.add(new ChangePropertyCommand(node, "seamark:name", getName())); 2715 2717 } 2716 2718 2717 2719 String objStr = ObjSTR.get(object); 2718 2720 if (objStr != null) { 2719 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:type", objStr));2721 undoRedo.add(new ChangePropertyCommand(node, "seamark:type", objStr)); 2720 2722 2721 2723 if (getShape() != Shp.FLOAT) { 2722 2724 String str = CatSTR.get(getCategory()); 2723 2725 if (str != null) { 2724 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":category", str));2726 undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":category", str)); 2725 2727 } 2726 2728 if ((getShape() != Shp.BUOY) && (getShape() != Shp.BEACON)) { 2727 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":shape", ShpSTR.get(getShape())));2729 undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":shape", ShpSTR.get(getShape()))); 2728 2730 } 2729 2731 } … … 2734 2736 str += (";" + ColSTR.get(getObjColour(i))); 2735 2737 } 2736 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour", str));2738 undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour", str)); 2737 2739 } 2738 2740 2739 2741 if (getObjPattern() != Pat.NOPAT) { 2740 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour_pattern",2742 undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":colour_pattern", 2741 2743 PatSTR.get(getObjPattern()))); 2742 2744 } 2743 2745 2744 2746 if (getFunc() != Fnc.UNKFNC) { 2745 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":function", FncSTR.get(getFunc())));2747 undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":function", FncSTR.get(getFunc()))); 2746 2748 } 2747 2749 … … 2750 2752 switch (region) { 2751 2753 case A: 2752 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "iala-a"));2754 undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "iala-a")); 2753 2755 break; 2754 2756 case B: 2755 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "iala-b"));2757 undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "iala-b")); 2756 2758 break; 2757 2759 case C: 2758 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "other"));2760 undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":system", "other")); 2759 2761 break; 2760 2762 default: … … 2763 2765 } 2764 2766 if (!getObjectHeight().isEmpty()) { 2765 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":height", getObjectHeight()));2767 undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":height", getObjectHeight())); 2766 2768 } 2767 2769 if (!getElevation().isEmpty()) { 2768 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":elevation", getElevation()));2770 undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":elevation", getElevation())); 2769 2771 } 2770 2772 if (!getChannel().isEmpty()) { 2771 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":channel", getChannel()));2773 undoRedo.add(new ChangePropertyCommand(node, "seamark:" + objStr + ":channel", getChannel())); 2772 2774 } 2773 2775 } 2774 2776 if (getTopmark() != Top.NOTOP) { 2775 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:shape", TopSTR.get(getTopmark())));2777 undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:shape", TopSTR.get(getTopmark()))); 2776 2778 if (getTopPattern() != Pat.NOPAT) { 2777 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:colour_pattern", PatSTR.get(getTopPattern())));2779 undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:colour_pattern", PatSTR.get(getTopPattern()))); 2778 2780 } 2779 2781 if (getTopColour(0) != Col.UNKCOL) { … … 2782 2784 str += (";" + ColSTR.get(getTopColour(i))); 2783 2785 } 2784 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:colour", str));2786 undoRedo.add(new ChangePropertyCommand(node, "seamark:topmark:colour", str)); 2785 2787 } 2786 2788 } … … 2790 2792 if (sectors.get(i)[0] != Col.UNKCOL) 2791 2793 if ((sectors.get(i)[15] != Col.UNKCOL) && ((String) sectors.get(i)[1]).contains("Al")) { 2792 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour",2794 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour", 2793 2795 (ColSTR.get(sectors.get(i)[0])) + ";" + ColSTR.get(sectors.get(i)[15]))); 2794 2796 } else { 2795 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour",2797 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":colour", 2796 2798 ColSTR.get(sectors.get(i)[0]))); 2797 2799 } 2798 2800 if (!((String) sectors.get(i)[1]).isEmpty()) { 2799 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":character", (String) sectors.get(i)[1]));2801 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":character", (String) sectors.get(i)[1])); 2800 2802 } else if (!((String) sectors.get(0)[1]).isEmpty()) { 2801 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":character", (String) sectors.get(0)[1]));2803 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":character", (String) sectors.get(0)[1])); 2802 2804 } 2803 2805 if (!((String) sectors.get(i)[2]).isEmpty()) { 2804 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":group", (String) sectors.get(i)[2]));2806 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":group", (String) sectors.get(i)[2])); 2805 2807 } else if (!((String) sectors.get(0)[2]).isEmpty()) { 2806 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":group", (String) sectors.get(0)[2]));2808 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":group", (String) sectors.get(0)[2])); 2807 2809 } 2808 2810 if (!((String) sectors.get(i)[3]).isEmpty()) { 2809 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sequence", (String) sectors.get(i)[3]));2811 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sequence", (String) sectors.get(i)[3])); 2810 2812 } else if (!((String) sectors.get(0)[3]).isEmpty()) { 2811 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sequence", (String) sectors.get(0)[3]));2813 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sequence", (String) sectors.get(0)[3])); 2812 2814 } 2813 2815 if (!((String) sectors.get(i)[4]).isEmpty()) { 2814 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":period", (String) sectors.get(i)[4]));2816 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":period", (String) sectors.get(i)[4])); 2815 2817 } else if (!((String) sectors.get(0)[4]).isEmpty()) { 2816 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":period", (String) sectors.get(0)[4]));2818 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":period", (String) sectors.get(0)[4])); 2817 2819 } 2818 2820 if (sectors.get(i)[5] != Lit.UNKLIT) { 2819 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category",2821 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category", 2820 2822 LitSTR.get(sectors.get(i)[5]))); 2821 2823 } else if (sectors.get(0)[5] != Lit.UNKLIT) { 2822 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category",2824 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":category", 2823 2825 LitSTR.get(sectors.get(0)[5]))); 2824 2826 } 2825 2827 if (!((String) sectors.get(i)[6]).isEmpty()) { 2826 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_start",2828 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_start", 2827 2829 (String) sectors.get(i)[6])); 2828 2830 } 2829 2831 if (!((String) sectors.get(i)[7]).isEmpty()) { 2830 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_end",2832 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":sector_end", 2831 2833 (String) sectors.get(i)[7])); 2832 2834 } 2833 2835 if (!((String) sectors.get(i)[8]).isEmpty()) { 2834 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":radius", (String) sectors.get(i)[8]));2836 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":radius", (String) sectors.get(i)[8])); 2835 2837 } else if (!((String) sectors.get(0)[8]).isEmpty()) { 2836 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":radius", (String) sectors.get(0)[8]));2838 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":radius", (String) sectors.get(0)[8])); 2837 2839 } 2838 2840 if (!((String) sectors.get(i)[9]).isEmpty()) { 2839 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":height", (String) sectors.get(i)[9]));2841 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":height", (String) sectors.get(i)[9])); 2840 2842 } else if (!((String) sectors.get(0)[9]).isEmpty()) { 2841 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":height", (String) sectors.get(0)[9]));2843 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":height", (String) sectors.get(0)[9])); 2842 2844 } 2843 2845 if (!((String) sectors.get(i)[10]).isEmpty()) { 2844 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":range", (String) sectors.get(i)[10]));2846 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":range", (String) sectors.get(i)[10])); 2845 2847 } else if (!((String) sectors.get(0)[10]).isEmpty()) { 2846 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":range", (String) sectors.get(0)[10]));2848 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":range", (String) sectors.get(0)[10])); 2847 2849 } 2848 2850 if (sectors.get(i)[11] != Vis.UNKVIS) { 2849 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility",2851 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility", 2850 2852 VisSTR.get(sectors.get(i)[11]))); 2851 2853 } else if (sectors.get(0)[11] != Vis.UNKVIS) { 2852 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility",2854 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":visibility", 2853 2855 VisSTR.get(sectors.get(0)[11]))); 2854 2856 } 2855 2857 if (sectors.get(i)[12] != Exh.UNKEXH) { 2856 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition",2858 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition", 2857 2859 ExhSTR.get(sectors.get(i)[12]))); 2858 2860 } else if (sectors.get(0)[12] != Exh.UNKEXH) { 2859 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition",2861 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":exhibition", 2860 2862 ExhSTR.get(sectors.get(0)[12]))); 2861 2863 } 2862 2864 if (!((String) sectors.get(i)[13]).isEmpty()) { 2863 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":orientation",2865 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":orientation", 2864 2866 (String) sectors.get(i)[13])); 2865 2867 } 2866 2868 if (!((String) sectors.get(i)[14]).isEmpty()) { 2867 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":multiple", (String) sectors.get(i)[14]));2869 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":multiple", (String) sectors.get(i)[14])); 2868 2870 } else if (!((String) sectors.get(0)[14]).isEmpty()) { 2869 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":multiple", (String) sectors.get(0)[14]));2871 undoRedo.add(new ChangePropertyCommand(node, "seamark:light" + secStr + ":multiple", (String) sectors.get(0)[14])); 2870 2872 } 2871 2873 } … … 2873 2875 if (getFogSound() != Fog.NOFOG) { 2874 2876 if (getFogSound() == Fog.FOGSIG) { 2875 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal", "yes"));2877 undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal", "yes")); 2876 2878 } else { 2877 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:category", FogSTR.get(getFogSound())));2879 undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:category", FogSTR.get(getFogSound()))); 2878 2880 } 2879 2881 if (!getFogGroup().isEmpty()) { 2880 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:group", getFogGroup()));2882 undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:group", getFogGroup())); 2881 2883 } 2882 2884 if (!getFogPeriod().isEmpty()) { 2883 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:period", getFogPeriod()));2885 undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:period", getFogPeriod())); 2884 2886 } 2885 2887 if (!getFogSequence().isEmpty()) { 2886 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:sequence", getFogSequence()));2888 undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:sequence", getFogSequence())); 2887 2889 } 2888 2890 if (!getFogRange().isEmpty()) { 2889 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:range", getFogRange()));2891 undoRedo.add(new ChangePropertyCommand(node, "seamark:fog_signal:range", getFogRange())); 2890 2892 } 2891 2893 } 2892 2894 2893 2895 if (RoType != Cat.NOROS) { 2894 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radio_station:category", CatSTR.get(getRadio())));2896 undoRedo.add(new ChangePropertyCommand(node, "seamark:radio_station:category", CatSTR.get(getRadio()))); 2895 2897 } 2896 2898 2897 2899 if (RaType != Rtb.NORTB) { 2898 2900 if (getRadar() == Rtb.REFLECTOR) { 2899 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_reflector", "yes"));2901 undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_reflector", "yes")); 2900 2902 } else { 2901 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:category", RtbSTR.get(getRadar())));2903 undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:category", RtbSTR.get(getRadar()))); 2902 2904 if (!getRaconGroup().isEmpty()) { 2903 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:group", getRaconGroup()));2905 undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:group", getRaconGroup())); 2904 2906 } 2905 2907 if (!getRaconPeriod().isEmpty()) { 2906 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:period", getRaconPeriod()));2908 undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:period", getRaconPeriod())); 2907 2909 } 2908 2910 if (!getRaconSequence().isEmpty()) { 2909 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sequence", getRaconSequence()));2911 undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sequence", getRaconSequence())); 2910 2912 } 2911 2913 if (!getRaconRange().isEmpty()) { 2912 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:range", getRaconRange()));2914 undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:range", getRaconRange())); 2913 2915 } 2914 2916 if ((!getRaconSector1().isEmpty()) && (!getRaconSector2().isEmpty())) { 2915 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sector_start", getRaconSector1()));2916 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sector_end", getRaconSector2()));2917 undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sector_start", getRaconSector1())); 2918 undoRedo.add(new ChangePropertyCommand(node, "seamark:radar_transponder:sector_end", getRaconSector2())); 2917 2919 } 2918 2920 } … … 2920 2922 2921 2923 if (!getInfo().isEmpty()) { 2922 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:information", getInfo()));2924 undoRedo.add(new ChangePropertyCommand(node, "seamark:information", getInfo())); 2923 2925 } 2924 2926 if (!getSource().isEmpty()) { 2925 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:source", getSource()));2927 undoRedo.add(new ChangePropertyCommand(node, "seamark:source", getSource())); 2926 2928 } 2927 2929 if (getStatus() != Sts.UNKSTS) { 2928 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:status", StsSTR.get(getStatus())));2930 undoRedo.add(new ChangePropertyCommand(node, "seamark:status", StsSTR.get(getStatus()))); 2929 2931 } 2930 2932 if (getConstr() != Cns.UNKCNS) { 2931 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:construction", CnsSTR.get(getConstr())));2933 undoRedo.add(new ChangePropertyCommand(node, "seamark:construction", CnsSTR.get(getConstr()))); 2932 2934 } 2933 2935 if (getConsp() != Con.UNKCON) { 2934 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:conspicuity", ConSTR.get(getConsp())));2936 undoRedo.add(new ChangePropertyCommand(node, "seamark:conspicuity", ConSTR.get(getConsp()))); 2935 2937 } 2936 2938 if (getRefl() != Con.UNKCON) { 2937 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:reflectivity", ConSTR.get(getRefl())));2939 undoRedo.add(new ChangePropertyCommand(node, "seamark:reflectivity", ConSTR.get(getRefl()))); 2938 2940 } 2939 2941 if (!getRef().isEmpty()) { 2940 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:reference", getRef()));2942 undoRedo.add(new ChangePropertyCommand(node, "seamark:reference", getRef())); 2941 2943 } 2942 2944 if (!getLightRef().isEmpty()) { 2943 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:light:reference", getLightRef()));2945 undoRedo.add(new ChangePropertyCommand(node, "seamark:light:reference", getLightRef())); 2944 2946 } 2945 2947 if (!getFixme().isEmpty()) { 2946 Main.main.undoRedo.add(new ChangePropertyCommand(node, "seamark:fixme", getFixme()));2948 undoRedo.add(new ChangePropertyCommand(node, "seamark:fixme", getFixme())); 2947 2949 } 2948 2950 } -
applications/editors/josm/plugins/smed/src/smed/SmedAction.java
r33054 r34464 6 6 import java.awt.Dimension; 7 7 import java.awt.event.ActionEvent; 8 import java.awt.event.WindowAdapter; 9 import java.awt.event.WindowEvent; 8 10 import java.util.Collection; 9 11 … … 13 15 14 16 import org.openstreetmap.josm.actions.JosmAction; 15 import org.openstreetmap.josm.data.SelectionChangedListener; 16 import org.openstreetmap.josm.data.osm.DataSet; 17 import org.openstreetmap.josm.data.osm.DataSelectionListener; 17 18 import org.openstreetmap.josm.data.osm.OsmPrimitive; 19 import org.openstreetmap.josm.data.osm.event.SelectionEventManager; 18 20 19 21 import messages.Messages; 20 22 import panels.PanelMain; 21 23 22 public class SmedAction extends JosmAction implements SelectionChangedListener {24 public class SmedAction extends JosmAction implements DataSelectionListener { 23 25 24 26 private static final long serialVersionUID = 1L; … … 53 55 editFrame = new JFrame(editor); 54 56 editFrame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); 55 editFrame.addWindowListener(new java.awt.event.WindowAdapter() {57 editFrame.addWindowListener(new WindowAdapter() { 56 58 @Override 57 public void windowClosing( java.awt.event.WindowEvent e) {59 public void windowClosing(WindowEvent e) { 58 60 closeDialog(); 59 61 } … … 70 72 panelMain.syncPanel(); 71 73 editFrame.add(panelMain); 72 DataSet.addSelectionListener(this); 73 74 // System.out.println("hello"); 74 SelectionEventManager.getInstance().addSelectionListener(this); 75 75 } 76 76 … … 84 84 85 85 @Override 86 public void selectionChanged( Collection<? extends OsmPrimitive> newSelection) {86 public void selectionChanged(SelectionChangeEvent event) { 87 87 OsmPrimitive nextNode = null; 88 selection = newSelection;88 selection = event.getSelection(); 89 89 90 90 for (OsmPrimitive osm : selection) {
Note:
See TracChangeset
for help on using the changeset viewer.