Changeset 33724 in osm for applications/editors/josm/plugins/seachart
- Timestamp:
- 2017-10-19T17:19:20+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/seachart/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/src/render/Signals.java
r32995 r33724 417 417 continue; 418 418 } 419 if (atts.containsKey(Att.LITRAD)) {420 radius = (Double) atts.get(Att.LITRAD).val;421 }422 419 if (atts.containsKey(Att.CATLIT)) { 423 420 ArrayList<CatLIT> cats = (ArrayList<CatLIT>) atts.get(Att.CATLIT).val; … … 434 431 if (satts == atts) 435 432 continue; 436 if (satts.containsKey(Att.LITRAD)) {437 srad = (Double) satts.get(Att.LITRAD).val;438 }439 433 if (srad == radius) { 440 434 ArrayList<CatLIT> scats = (ArrayList<CatLIT>) ((satts.containsKey(Att.CATLIT)) ? -
applications/editors/josm/plugins/seachart/src/s57/S57att.java
r32992 r33724 29 29 MEAWAT, MEANAM, OTHWAT, OTHNAM, REFLEV, SDRLEV, VCRLEV, SCHREF, USESHP, CURVHW, CURVLW, CURVMW, CURVOW, APTREF, SHPTYP, UPDMSG, ADDMRK, CATNMK, CATBRT, CATBUN, 30 30 CATCCL, CATCOM, CATHBR, CATRFD, CATTML, CATGAG, CATVTR, CATTAB, CATEXS, LG_SPD, LG_SPR, LG_BME, LG_LGS, LG_DRT, LG_WDP, LG_WDU, LG_REL, LG_FNC, LG_DES, LG_PBR, 31 LC_CSI, LC_CSE, LC_ASI, LC_ASE, LC_CCI, LC_CCE, LC_BM1, LC_BM2, LC_LG1, LC_LG2, LC_DR1, LC_DR2, LC_SP1, LC_SP2, LC_WD1, LC_WD2, LITRAD,CATCVR, HUNITS31 LC_CSI, LC_CSE, LC_ASI, LC_ASE, LC_CCI, LC_CCE, LC_BM1, LC_BM2, LC_LG1, LC_LG2, LC_DR1, LC_DR2, LC_SP1, LC_SP2, LC_WD1, LC_WD2, CATCVR, HUNITS 32 32 } 33 33 … … 145 145 AttStr.put(Att.CURVLW, "low_velocity"); AttStr.put(Att.CURVMW, "mean_velocity"); AttStr.put(Att.CURVOW, "other_velocity"); AttStr.put(Att.APTREF, "passing_time"); 146 146 AttStr.put(Att.CATCOM, "category"); AttStr.put(Att.CATCVR, "category"); AttStr.put(Att.CATEXS, "category"); AttStr.put(Att.SHPTYP, "ship"); 147 AttStr.put(Att.UPDMSG, "message"); AttStr.put(Att.LITRAD, "radius");147 AttStr.put(Att.UPDMSG, "message"); 148 148 } 149 149 … … 448 448 Quality.put(Obj.UNKOBJ, Att.QUASOU); } 449 449 450 private static final EnumMap<Obj, Att> Radius = new EnumMap<>(Obj.class); static { 451 Radius.put(Obj.UNKOBJ, Att.RADIUS); Radius.put(Obj.LIGHTS, Att.LITRAD); } 452 453 private static final EnumMap<Obj, Att> Range = new EnumMap<>(Obj.class); static { 450 private static final EnumMap<Obj, Att> Range = new EnumMap<>(Obj.class); static { 454 451 Range.put(Obj.UNKOBJ, Att.VALNMR); } 455 452 … … 595 592 StrAtt.put("operation", Operation); StrAtt.put("orientation", Orientation); StrAtt.put("passing_time", Passing_time); StrAtt.put("period", Period); StrAtt.put("period_end", Period_end); 596 593 StrAtt.put("period_start", Period_start); StrAtt.put("pilot_district", Pilot_district); StrAtt.put("position_quality", Position_quality); StrAtt.put("positional_accuracy", Positional_accuracy); 597 StrAtt.put("producing_country", Producing_country); StrAtt.put("product", Product); StrAtt.put("quality", Quality); StrAtt.put("ra dius", Radius); StrAtt.put("range", Range);594 StrAtt.put("producing_country", Producing_country); StrAtt.put("product", Product); StrAtt.put("quality", Quality); StrAtt.put("range", Range); 598 595 StrAtt.put("reference", Reference); StrAtt.put("reflectivity", Reflectivity); StrAtt.put("restriction", Restriction); StrAtt.put("schedule", Schedule); StrAtt.put("shape", Shape); 599 596 StrAtt.put("sector_end", Sector_end); StrAtt.put("sector_start", Sector_start); StrAtt.put("sequence", Sequence); StrAtt.put("shift", Shift); StrAtt.put("ship", Ship); -
applications/editors/josm/plugins/seachart/src/s57/S57osm.java
r32909 r33724 52 52 OSMtags.put("landuse=industrial", new KeyVal<>(Obj.BUAARE, Att.UNKATT, null, null)); OSMtags.put("landuse=commercial", new KeyVal<>(Obj.BUAARE, Att.UNKATT, null, null)); 53 53 OSMtags.put("landuse=retail", new KeyVal<>(Obj.BUAARE, Att.UNKATT, null, null)); OSMtags.put("landuse=residential", new KeyVal<>(Obj.BUAARE, Att.UNKATT, null, null)); 54 OSMtags.put("place=city", new KeyVal<>(Obj.BUAARE, Att.CATBUA, Conv.E, CatBUA.BUA_CITY)); OSMtags.put("place=town", new KeyVal<>(Obj.BUAARE, Att.CATBUA, Conv.E, CatBUA.BUA_TOWN));55 OSMtags.put("place=village", new KeyVal<>(Obj.BUAARE, Att.CATBUA, Conv.E, CatBUA.BUA_VLLG));56 54 } 57 55 -
applications/editors/josm/plugins/seachart/src/s57/S57val.java
r32907 r33724 1505 1505 keys.put(Att.LC_DR1, new S57key(Conv.F, null)); keys.put(Att.LC_DR2, new S57key(Conv.F, null)); keys.put(Att.LC_SP1, new S57key(Conv.F, null)); 1506 1506 keys.put(Att.LC_SP2, new S57key(Conv.F, null)); keys.put(Att.LC_WD1, new S57key(Conv.F, null)); keys.put(Att.LC_WD2, new S57key(Conv.F, null)); 1507 keys.put(Att. LITRAD, new S57key(Conv.F, null)); keys.put(Att.CATCVR, new S57key(Conv.E, Catcvr));1507 keys.put(Att.CATCVR, new S57key(Conv.E, Catcvr)); 1508 1508 } 1509 1509 -
applications/editors/josm/plugins/seachart/src/seachart/ChartImage.java
r33222 r33724 11 11 import javax.swing.Action; 12 12 13 import org.openstreetmap.josm. Main;13 import org.openstreetmap.josm.gui.MainApplication; 14 14 import org.openstreetmap.josm.data.Bounds; 15 15 import org.openstreetmap.josm.data.coor.LatLon; … … 70 70 @Override 71 71 public void paint(Graphics2D g2, MapView mv, Bounds bb) { 72 Rectangle rect = Main .map.mapView.getBounds();72 Rectangle rect = MainApplication.getMap().mapView.getBounds(); 73 73 Renderer.reRender(g2, rect, zoom, Math.pow(2, (zoom-12)), SeachartAction.map, this); 74 74 g2.setPaint(Color.black); … … 84 84 @Override 85 85 public void zoomChanged() { 86 if ((Main .map != null) && (Main.map.mapView != null)) {87 Bounds bounds = Main .map.mapView.getRealBounds();86 if ((MainApplication.getMap() != null) && (MainApplication.getMap().mapView != null)) { 87 Bounds bounds = MainApplication.getMap().mapView.getRealBounds(); 88 88 top = bounds.getMax().lat(); 89 89 bottom = bounds.getMin().lat(); 90 90 left = bounds.getMin().lon(); 91 91 right = bounds.getMax().lon(); 92 width = Main .map.mapView.getBounds().getWidth();93 height = Main .map.mapView.getBounds().getHeight();92 width = MainApplication.getMap().mapView.getBounds().getWidth(); 93 height = MainApplication.getMap().mapView.getBounds().getHeight(); 94 94 zoom = ((int) Math.min(18, Math.max(9, Math.round(Math.floor(Math.log(1024 / bounds.asRect().height) / Math.log(2)))))); 95 95 } … … 98 98 @Override 99 99 public Point2D.Double getPoint(Snode coord) { 100 return (Double) Main .map.mapView.getPoint2D(new LatLon(Math.toDegrees(coord.lat), Math.toDegrees(coord.lon)));100 return (Double) MainApplication.getMap().mapView.getPoint2D(new LatLon(Math.toDegrees(coord.lat), Math.toDegrees(coord.lon))); 101 101 } 102 102 103 103 @Override 104 104 public double mile(Feature feature) { 105 return 185000 / Main .map.mapView.getDist100Pixel();105 return 185000 / MainApplication.getMap().mapView.getDist100Pixel(); 106 106 } 107 107 -
applications/editors/josm/plugins/seachart/src/seachart/Seachart.java
r32907 r33724 2 2 package seachart; 3 3 4 import org.openstreetmap.josm. Main;4 import org.openstreetmap.josm.gui.MainApplication; 5 5 import org.openstreetmap.josm.gui.MainMenu; 6 6 import org.openstreetmap.josm.plugins.Plugin; … … 14 14 public Seachart(PluginInformation info) { 15 15 super(info); 16 MainMenu.add(Main .main.menu.imageryMenu, new SeachartAction());16 MainMenu.add(MainApplication.getMenu().imageryMenu, new SeachartAction()); 17 17 } 18 18 } -
applications/editors/josm/plugins/seachart/src/seachart/SeachartAction.java
r33105 r33724 7 7 import javax.swing.SwingUtilities; 8 8 9 import org.openstreetmap.josm. Main;9 import org.openstreetmap.josm.gui.MainApplication; 10 10 import org.openstreetmap.josm.actions.JosmAction; 11 11 import org.openstreetmap.josm.data.Bounds; … … 124 124 rendering = new ChartImage(new ImageryInfo("SeaChart")); 125 125 rendering.setBackgroundLayer(true); 126 Main .getLayerManager().addLayer(rendering);127 Main .getLayerManager().addAndFireActiveLayerChangeListener(this);128 Main .getLayerManager().addLayerChangeListener(this);126 MainApplication.getLayerManager().addLayer(rendering); 127 MainApplication.getLayerManager().addAndFireActiveLayerChangeListener(this); 128 MainApplication.getLayerManager().addLayerChangeListener(this); 129 129 } 130 130 … … 132 132 if (isOpen) { 133 133 try { 134 Main .getLayerManager().removeActiveLayerChangeListener(this);135 Main .getLayerManager().removeLayerChangeListener(this);136 Main .getLayerManager().removeLayer(rendering);134 MainApplication.getLayerManager().removeActiveLayerChangeListener(this); 135 MainApplication.getLayerManager().removeLayerChangeListener(this); 136 MainApplication.getLayerManager().removeLayer(rendering); 137 137 } catch (Exception e) { 138 138 // Assume that this can't be serious? … … 149 149 oldLayer.data.removeDataSetListener(dataSetListener); 150 150 } 151 OsmDataLayer newLayer = Main .getLayerManager().getEditLayer();151 OsmDataLayer newLayer = MainApplication.getLayerManager().getEditLayer(); 152 152 if (newLayer != null) { 153 153 newLayer.data.addDataSetListener(dataSetListener);
Note:
See TracChangeset
for help on using the changeset viewer.