Changeset 29150 in osm for applications/editors/josm/plugins/smed2/src
- Timestamp:
- 2012-12-31T22:15:09+01:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/smed2/src
- Files:
-
- 1 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/s57/S57val.java
r29097 r29150 16 16 } 17 17 18 p rivateenum Conv { S, A, L, E, F, I }18 public enum Conv { S, A, L, E, F, I } 19 19 20 20 static class S57key { … … 587 587 Litvis.put(LitVIS.LIT_OBSC, new S57enum(7, "obscured")); Litvis.put(LitVIS.LIT_POBS, new S57enum(8, "part_obscured")); 588 588 } 589 public enum MarSYS { SYS_UNKN, SYS_IALA, SYS_IALB, SYS_NONE, SYS_OTHR, SYS_CEVN, SYS_RIWR }589 public enum MarSYS { SYS_UNKN, SYS_IALA, SYS_IALB, SYS_NONE, SYS_OTHR, SYS_CEVN, SYS_RIWR, SYS_BWR2, SYS_BNWR, SYS_PPWB } 590 590 private static final EnumMap<MarSYS, S57enum> Marsys = new EnumMap<MarSYS, S57enum>(MarSYS.class); static { Marsys.put(MarSYS.SYS_UNKN, new S57enum(0, "")); 591 591 Marsys.put(MarSYS.SYS_IALA, new S57enum(1, "iala-a")); Marsys.put(MarSYS.SYS_IALB, new S57enum(2, "iala-b")); Marsys.put(MarSYS.SYS_NONE, new S57enum(9, "none")); 592 592 Marsys.put(MarSYS.SYS_OTHR, new S57enum(10, "other")); Marsys.put(MarSYS.SYS_CEVN, new S57enum(11, "cevni")); Marsys.put(MarSYS.SYS_RIWR, new S57enum(12, "riwr")); 593 Marsys.put(MarSYS.SYS_BWR2, new S57enum(13, "bniwr2")); Marsys.put(MarSYS.SYS_BNWR, new S57enum(14, "bniwr")); Marsys.put(MarSYS.SYS_PPWB, new S57enum(15, "ppwbc")); 593 594 } 594 595 public enum NatCON { CON_UNKN, CON_MSNY, CON_CONC, CON_BDRS, CON_HSRF, CON_USRF, CON_WOOD, CON_METL, CON_GRP, CON_PNTD } … … 794 795 Catnmk.put(CatNMK.NMK_WLSA, new S57enum(79, "main_waterway_left_secondary_ahead")); Catnmk.put(CatNMK.NMK_WRSL, new S57enum(80, "main_waterway_right_secondary_left")); 795 796 Catnmk.put(CatNMK.NMK_WLSR, new S57enum(81, "main_waterway_left_secondary_right")); Catnmk.put(CatNMK.NMK_WRAL, new S57enum(82, "main_waterway_right_secondary_ahead_left")); 796 Catnmk.put(CatNMK.NMK_WLAR, new S57enum(83, "main_waterway_left_secondary waterway_ahead_right")); Catnmk.put(CatNMK.NMK_MWWC, new S57enum(84, "main_waterway_crossing"));797 Catnmk.put(CatNMK.NMK_WLAR, new S57enum(83, "main_waterway_left_secondary_ahead_right")); Catnmk.put(CatNMK.NMK_MWWC, new S57enum(84, "main_waterway_crossing")); 797 798 Catnmk.put(CatNMK.NMK_MWWJ, new S57enum(85, "main_waterway_junction")); Catnmk.put(CatNMK.NMK_MWAR, new S57enum(86, "main_waterway_ahead_right")); 798 799 Catnmk.put(CatNMK.NMK_MWAL, new S57enum(87, "main_waterway_ahead_left")); Catnmk.put(CatNMK.NMK_WARL, new S57enum(88, "main_waterway_ahead_right_secondary_left")); -
applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java
r29074 r29150 3 3 import java.awt.Dimension; 4 4 import java.awt.event.ActionEvent; 5 import java.util.Collection; 5 6 6 7 import javax.swing.JFrame; … … 10 11 import static org.openstreetmap.josm.tools.I18n.tr; 11 12 import org.openstreetmap.josm.actions.JosmAction; 13 import org.openstreetmap.josm.gui.MapView; 14 import org.openstreetmap.josm.gui.MapView.EditLayerChangeListener; 12 15 import org.openstreetmap.josm.gui.layer.ImageryLayer; 16 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 17 import org.openstreetmap.josm.data.SelectionChangedListener; 13 18 import org.openstreetmap.josm.data.imagery.ImageryInfo; 19 import org.openstreetmap.josm.data.osm.DataSet; 20 import org.openstreetmap.josm.data.osm.Node; 21 import org.openstreetmap.josm.data.osm.OsmPrimitive; 22 import org.openstreetmap.josm.data.osm.event.AbstractDatasetChangedEvent; 23 import org.openstreetmap.josm.data.osm.event.DataChangedEvent; 24 import org.openstreetmap.josm.data.osm.event.DataSetListener; 25 import org.openstreetmap.josm.data.osm.event.DataSetListenerAdapter; 26 import org.openstreetmap.josm.data.osm.event.DatasetEventManager.FireMode; 27 import org.openstreetmap.josm.data.osm.event.NodeMovedEvent; 28 import org.openstreetmap.josm.data.osm.event.PrimitivesAddedEvent; 29 import org.openstreetmap.josm.data.osm.event.PrimitivesRemovedEvent; 30 import org.openstreetmap.josm.data.osm.event.RelationMembersChangedEvent; 31 import org.openstreetmap.josm.data.osm.event.TagsChangedEvent; 32 import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent; 14 33 import org.openstreetmap.josm.Main; 15 34 … … 18 37 import panels.PanelMain; 19 38 20 public class Smed2Action extends JosmAction {39 public class Smed2Action extends JosmAction implements EditLayerChangeListener, SelectionChangedListener { 21 40 22 41 private static final long serialVersionUID = 1L; … … 28 47 public ImageryLayer rendering; 29 48 49 private final DataSetListener dataSetListener = new DataSetListener() { 50 51 @Override 52 public void dataChanged(DataChangedEvent e) { 53 System.out.println(e); 54 } 55 56 @Override 57 public void nodeMoved(NodeMovedEvent e) { 58 System.out.println(e); 59 } 60 61 @Override 62 public void otherDatasetChange(AbstractDatasetChangedEvent e) { 63 System.out.println(e); 64 } 65 66 @Override 67 public void primitivesAdded(PrimitivesAddedEvent e) { 68 System.out.println(e); 69 } 70 71 @Override 72 public void primitivesRemoved(PrimitivesRemovedEvent e) { 73 System.out.println(e); 74 } 75 76 @Override 77 public void relationMembersChanged(RelationMembersChangedEvent e) { 78 System.out.println(e); 79 } 80 81 @Override 82 public void tagsChanged(TagsChangedEvent e) { 83 System.out.println(e); 84 } 85 86 @Override 87 public void wayNodesChanged(WayNodesChangedEvent e) { 88 System.out.println(e); 89 } 90 }; 91 30 92 public Smed2Action() { 31 93 super(editor, "Smed2", editor, null, true); 94 MapView.addEditLayerChangeListener(this); // DataSet.addDataSetListener(DataListener); 95 DataSet.addSelectionListener(this); 32 96 } 33 97 … … 36 100 SwingUtilities.invokeLater(new Runnable() { 37 101 public void run() { 38 if (!isOpen) createFrame(); 39 else frame.toFront(); 40 isOpen = true; 102 if (!isOpen) 103 createFrame(); 104 else 105 frame.toFront(); 106 isOpen = true; 41 107 } 42 108 }); … … 63 129 panelS57.setVisible(false); 64 130 frame.add(panelS57); 65 System.out.println("hello");131 System.out.println("hello"); 66 132 rendering = ImageryLayer.create(new ImageryInfo("OpenSeaMap")); 67 Main.main.addLayer(rendering); 133 Main.main.addLayer(rendering); 68 134 } 69 135 … … 77 143 } 78 144 145 @Override 146 public void editLayerChanged(OsmDataLayer oldLayer, OsmDataLayer newLayer) { 147 if (oldLayer != null) { 148 oldLayer.data.removeDataSetListener(dataSetListener); 149 } 150 151 if (newLayer != null) { 152 newLayer.data.addDataSetListener(dataSetListener); 153 } 154 } 155 156 @Override 157 public void selectionChanged(Collection<? extends OsmPrimitive> arg0) { 158 // TODO Auto-generated method stub 159 160 } 161 79 162 }
Note:
See TracChangeset
for help on using the changeset viewer.