Changeset 30150 in osm
- Timestamp:
- 2013-12-25T11:40:00+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/smed2/src
- Files:
-
- 1 deleted
- 10 edited
- 1 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/panels/PanelMain.java
r30037 r30150 22 22 import s57.S57att.Att; 23 23 import s57.S57obj.Obj; 24 import s eamap.Renderer;25 import seamap.SeaMap.*;24 import s57.S57map.*; 25 import render.Renderer; 26 26 import smed2.Smed2Action; 27 27 … … 48 48 int returnVal = ifc.showOpenDialog(Main.parent); 49 49 if (returnVal == JFileChooser.APPROVE_OPTION) { 50 Smed2Action.panelS57.startImport(ifc.getSelectedFile());50 // xxx.startImport(ifc.getSelectedFile()); 51 51 } else { 52 52 messageBar.setText(""); … … 64 64 int returnVal = efc.showOpenDialog(Main.parent); 65 65 if (returnVal == JFileChooser.APPROVE_OPTION) { 66 Smed2Action.panelS57.startExport(efc.getSelectedFile());66 // xxx.startExport(efc.getSelectedFile()); 67 67 } else { 68 68 messageBar.setText(""); … … 113 113 decode.setBounds(0, 0, 480, 420); 114 114 decode.setTabSize(1); 115 //add(decode);115 add(decode); 116 116 } 117 117 -
applications/editors/josm/plugins/smed2/src/panels/ShowFrame.java
r30036 r30150 12 12 import org.openstreetmap.josm.data.osm.OsmPrimitive; 13 13 14 import seamap.MapContext;15 import seamap.Renderer;16 import s eamap.SeaMap;17 import s eamap.SeaMap.*;14 import render.MapContext; 15 import render.Renderer; 16 import s57.S57map; 17 import s57.S57map.*; 18 18 19 19 public class ShowFrame extends JFrame { 20 20 21 S eaMap showMap;21 S57map showMap; 22 22 Picture picture; 23 23 24 24 class Picture extends JPanel implements MapContext { 25 25 26 public void drawPicture(OsmPrimitive osm, S eaMap map) {26 public void drawPicture(OsmPrimitive osm, S57map map) { 27 27 long id; 28 28 Feature feature; … … 30 30 id = osm.getUniqueId(); 31 31 feature = map.index.get(id); 32 showMap = new S eaMap();32 showMap = new S57map(); 33 33 showMap.nodes = map.nodes; 34 34 showMap.edges = map.edges; … … 66 66 } 67 67 68 public void showFeature(OsmPrimitive osm, S eaMap map) {68 public void showFeature(OsmPrimitive osm, S57map map) { 69 69 picture.drawPicture(osm, map); 70 70 } -
applications/editors/josm/plugins/smed2/src/render/MapContext.java
r30025 r30150 1 package seamap;1 package render; 2 2 3 3 import java.awt.geom.Point2D; 4 4 5 import s eamap.SeaMap.*;5 import s57.S57map.*; 6 6 7 7 public interface MapContext { -
applications/editors/josm/plugins/smed2/src/render/Renderer.java
r30123 r30150 8 8 */ 9 9 10 package seamap;10 package render; 11 11 12 12 import java.awt.*; … … 17 17 18 18 import s57.S57val.*; 19 import s eamap.SeaMap;20 import s eamap.SeaMap.*;21 import s eamap.SeaMap.Area;19 import s57.S57map; 20 import s57.S57map.*; 21 import s57.S57map.Area; 22 22 import symbols.Areas; 23 import symbols.Harbours;24 23 import symbols.Symbols; 25 24 import symbols.Symbols.*; … … 29 28 public static final double symbolScale[] = { 256.0, 128.0, 64.0, 32.0, 16.0, 8.0, 4.0, 2.0, 1.0, 0.61, 0.372, 0.227, 0.138, 0.0843, 0.0514, 0.0313, 0.0191, 0.0117, 0.007, 0.138 }; 30 29 31 public static final Color Yland = new Color(0x50b0ff);32 public static final Color Mline = new Color(0xc480ff);33 public static final Color Msymb = new Color(0xa30075);34 35 30 static final EnumMap<ColCOL, Color> bodyColours = new EnumMap<ColCOL, Color>(ColCOL.class); 36 31 static { … … 67 62 68 63 static MapContext context; 69 static S eaMap map;64 static S57map map; 70 65 static double sScale; 71 66 static Graphics2D g2; 72 67 static int zoom; 73 68 74 public static void reRender(Graphics2D g, int z, double factor, S eaMap m, MapContext c) {69 public static void reRender(Graphics2D g, int z, double factor, S57map m, MapContext c) { 75 70 g2 = g; 76 71 zoom = z; … … 82 77 g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP); 83 78 g2.setStroke(new BasicStroke(0, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)); 84 Rules.rules( map, zoom);79 Rules.rules(); 85 80 } 86 81 } … … 525 520 Point2D curr = new Point2D.Double(); 526 521 Point2D succ = new Point2D.Double(); 527 boolean gap = true;528 522 boolean piv = false; 529 523 double len = 0; … … 539 533 if (first) { 540 534 curr = succ = next; 541 // gap = (space > 0); 542 // len = gap ? psize * space * 0.5 : psize; 535 // len = psize; 543 536 first = false; 544 537 } else { … … 559 552 succ = new Point2D.Double(curr.getX() + (len * Math.cos(angle)), curr.getY() + (len * Math.sin(angle))); 560 553 } 561 if (!gap) {562 554 // Symbols.drawSymbol(g2, symbol, sScale, curr.getX(), curr.getY(), new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.atan2((succ.getY() - curr.getY()), (succ.getX() - curr.getX())) + Math.toRadians(90))), null); 563 }564 gap = false;565 555 curr = succ; 566 556 // len = psize; -
applications/editors/josm/plugins/smed2/src/render/Rules.java
r30123 r30150 8 8 */ 9 9 10 package seamap;10 package render; 11 11 12 12 import java.awt.Color; … … 20 20 import s57.S57att.*; 21 21 import s57.S57obj.*; 22 import s eamap.Renderer.*;23 import seamap.SeaMap.*;22 import s57.S57map.*; 23 import render.Renderer.*; 24 24 import symbols.*; 25 25 import symbols.Symbols.*; … … 27 27 public class Rules { 28 28 29 static SeaMap map; 30 static int zoom; 29 public static final Color Yland = new Color(0x50b0ff); 30 public static final Color Mline = new Color(0xc480ff); 31 public static final Color Msymb = new Color(0xa30075); 31 32 32 33 static String getName(Feature feature) { … … 106 107 } 107 108 108 public static void rules (SeaMap m, int z) { 109 map = m; 110 zoom = z; 109 public static void rules () { 111 110 ArrayList<Feature> objects; 112 if ((objects = map.features.get(Obj.SLCONS)) != null) for (Feature feature : objects) shoreline(feature);113 if ((objects = map.features.get(Obj.PIPSOL)) != null) for (Feature feature : objects) pipelines(feature);114 if ((objects = map.features.get(Obj.CBLSUB)) != null) for (Feature feature : objects) cables(feature);115 if ((objects = map.features.get(Obj.PIPOHD)) != null) for (Feature feature : objects) pipelines(feature);116 if ((objects = map.features.get(Obj.CBLOHD)) != null) for (Feature feature : objects) cables(feature);117 if ((objects = map.features.get(Obj.TSEZNE)) != null) for (Feature feature : objects) separation(feature);118 if ((objects = map.features.get(Obj.TSSCRS)) != null) for (Feature feature : objects) separation(feature);119 if ((objects = map.features.get(Obj.TSSRON)) != null) for (Feature feature : objects) separation(feature);120 if ((objects = map.features.get(Obj.TSELNE)) != null) for (Feature feature : objects) separation(feature);121 if ((objects = map.features.get(Obj.TSSLPT)) != null) for (Feature feature : objects) separation(feature);122 if ((objects = map.features.get(Obj.TSSBND)) != null) for (Feature feature : objects) separation(feature);123 if ((objects = map.features.get(Obj.ISTZNE)) != null) for (Feature feature : objects) separation(feature);124 if ((objects = map.features.get(Obj.SNDWAV)) != null) for (Feature feature : objects) areas(feature);125 if ((objects = map.features.get(Obj.OSPARE)) != null) for (Feature feature : objects) areas(feature);126 if ((objects = map.features.get(Obj.FAIRWY)) != null) for (Feature feature : objects) areas(feature);127 if ((objects = map.features.get(Obj.DRGARE)) != null) for (Feature feature : objects) areas(feature);128 if ((objects = map.features.get(Obj.RESARE)) != null) for (Feature feature : objects) areas(feature);129 if ((objects = map.features.get(Obj.SPLARE)) != null) for (Feature feature : objects) areas(feature);130 if ((objects = map.features.get(Obj.SEAARE)) != null) for (Feature feature : objects) areas(feature);131 if ((objects = map.features.get(Obj.OBSTRN)) != null) for (Feature feature : objects) obstructions(feature);132 if ((objects = map.features.get(Obj.UWTROC)) != null) for (Feature feature : objects) obstructions(feature);133 if ((objects = map.features.get(Obj.MARCUL)) != null) for (Feature feature : objects) areas(feature);134 if ((objects = map.features.get(Obj.WTWAXS)) != null) for (Feature feature : objects) waterways(feature);135 if ((objects = map.features.get(Obj.RECTRC)) != null) for (Feature feature : objects) transits(feature);136 if ((objects = map.features.get(Obj.NAVLNE)) != null) for (Feature feature : objects) transits(feature);137 if ((objects = map.features.get(Obj.HRBFAC)) != null) for (Feature feature : objects) harbours(feature);138 if ((objects = map.features.get(Obj.ACHARE)) != null) for (Feature feature : objects) harbours(feature);139 if ((objects = map.features.get(Obj.ACHBRT)) != null) for (Feature feature : objects) harbours(feature);140 if ((objects = map.features.get(Obj.BERTHS)) != null) for (Feature feature : objects) harbours(feature);141 if ((objects = map.features.get(Obj.LOKBSN)) != null) for (Feature feature : objects) locks(feature);142 if ((objects = map.features.get(Obj.LKBSPT)) != null) for (Feature feature : objects) locks(feature);143 if ((objects = map.features.get(Obj.GATCON)) != null) for (Feature feature : objects) locks(feature);144 if ((objects = map.features.get(Obj.DISMAR)) != null) for (Feature feature : objects) distances(feature);145 if ((objects = map.features.get(Obj.HULKES)) != null) for (Feature feature : objects) ports(feature);146 if ((objects = map.features.get(Obj.CRANES)) != null) for (Feature feature : objects) ports(feature);147 if ((objects = map.features.get(Obj.LNDMRK)) != null) for (Feature feature : objects) landmarks(feature);148 if ((objects = map.features.get(Obj.BUISGL)) != null) for (Feature feature : objects) harbours(feature);149 if ((objects = map.features.get(Obj.MORFAC)) != null) for (Feature feature : objects) moorings(feature);150 if ((objects = map.features.get(Obj.NOTMRK)) != null) for (Feature feature : objects) notices(feature);151 if ((objects = map.features.get(Obj.SMCFAC)) != null) for (Feature feature : objects) marinas(feature);152 if ((objects = map.features.get(Obj.BRIDGE)) != null) for (Feature feature : objects) bridges(feature);153 if ((objects = map.features.get(Obj.PILPNT)) != null) for (Feature feature : objects) lights(feature);154 if ((objects = map.features.get(Obj.LITMIN)) != null) for (Feature feature : objects) lights(feature);155 if ((objects = map.features.get(Obj.LITMAJ)) != null) for (Feature feature : objects) lights(feature);156 if ((objects = map.features.get(Obj.LIGHTS)) != null) for (Feature feature : objects) lights(feature);157 if ((objects = map.features.get(Obj.SISTAT)) != null) for (Feature feature : objects) stations(feature);158 if ((objects = map.features.get(Obj.SISTAW)) != null) for (Feature feature : objects) stations(feature);159 if ((objects = map.features.get(Obj.CGUSTA)) != null) for (Feature feature : objects) stations(feature);160 if ((objects = map.features.get(Obj.RDOSTA)) != null) for (Feature feature : objects) stations(feature);161 if ((objects = map.features.get(Obj.RADSTA)) != null) for (Feature feature : objects) stations(feature);162 if ((objects = map.features.get(Obj.RSCSTA)) != null) for (Feature feature : objects) stations(feature);163 if ((objects = map.features.get(Obj.PILBOP)) != null) for (Feature feature : objects) stations(feature);164 if ((objects = map.features.get(Obj.WTWGAG)) != null) for (Feature feature : objects) gauges(feature);165 if ((objects = map.features.get(Obj.OFSPLF)) != null) for (Feature feature : objects) platforms(feature);166 if ((objects = map.features.get(Obj.WRECKS)) != null) for (Feature feature : objects) wrecks(feature);167 if ((objects = map.features.get(Obj.LITVES)) != null) for (Feature feature : objects) floats(feature);168 if ((objects = map.features.get(Obj.LITFLT)) != null) for (Feature feature : objects) floats(feature);169 if ((objects = map.features.get(Obj.BOYINB)) != null) for (Feature feature : objects) floats(feature);170 if ((objects = map.features.get(Obj.BOYLAT)) != null) for (Feature feature : objects) buoys(feature);171 if ((objects = map.features.get(Obj.BOYCAR)) != null) for (Feature feature : objects) buoys(feature);172 if ((objects = map.features.get(Obj.BOYISD)) != null) for (Feature feature : objects) buoys(feature);173 if ((objects = map.features.get(Obj.BOYSAW)) != null) for (Feature feature : objects) buoys(feature);174 if ((objects = map.features.get(Obj.BOYSPP)) != null) for (Feature feature : objects) buoys(feature);175 if ((objects = map.features.get(Obj.BOYWTW)) != null) for (Feature feature : objects) buoys(feature);176 if ((objects = map.features.get(Obj.BCNLAT)) != null) for (Feature feature : objects) beacons(feature);177 if ((objects = map.features.get(Obj.BCNCAR)) != null) for (Feature feature : objects) beacons(feature);178 if ((objects = map.features.get(Obj.BCNISD)) != null) for (Feature feature : objects) beacons(feature);179 if ((objects = map.features.get(Obj.BCNSAW)) != null) for (Feature feature : objects) beacons(feature);180 if ((objects = map.features.get(Obj.BCNSPP)) != null) for (Feature feature : objects) beacons(feature);181 if ((objects = map.features.get(Obj.BCNWTW)) != null) for (Feature feature : objects) beacons(feature);111 if ((objects = Renderer.map.features.get(Obj.SLCONS)) != null) for (Feature feature : objects) shoreline(feature); 112 if ((objects = Renderer.map.features.get(Obj.PIPSOL)) != null) for (Feature feature : objects) pipelines(feature); 113 if ((objects = Renderer.map.features.get(Obj.CBLSUB)) != null) for (Feature feature : objects) cables(feature); 114 if ((objects = Renderer.map.features.get(Obj.PIPOHD)) != null) for (Feature feature : objects) pipelines(feature); 115 if ((objects = Renderer.map.features.get(Obj.CBLOHD)) != null) for (Feature feature : objects) cables(feature); 116 if ((objects = Renderer.map.features.get(Obj.TSEZNE)) != null) for (Feature feature : objects) separation(feature); 117 if ((objects = Renderer.map.features.get(Obj.TSSCRS)) != null) for (Feature feature : objects) separation(feature); 118 if ((objects = Renderer.map.features.get(Obj.TSSRON)) != null) for (Feature feature : objects) separation(feature); 119 if ((objects = Renderer.map.features.get(Obj.TSELNE)) != null) for (Feature feature : objects) separation(feature); 120 if ((objects = Renderer.map.features.get(Obj.TSSLPT)) != null) for (Feature feature : objects) separation(feature); 121 if ((objects = Renderer.map.features.get(Obj.TSSBND)) != null) for (Feature feature : objects) separation(feature); 122 if ((objects = Renderer.map.features.get(Obj.ISTZNE)) != null) for (Feature feature : objects) separation(feature); 123 if ((objects = Renderer.map.features.get(Obj.SNDWAV)) != null) for (Feature feature : objects) areas(feature); 124 if ((objects = Renderer.map.features.get(Obj.OSPARE)) != null) for (Feature feature : objects) areas(feature); 125 if ((objects = Renderer.map.features.get(Obj.FAIRWY)) != null) for (Feature feature : objects) areas(feature); 126 if ((objects = Renderer.map.features.get(Obj.DRGARE)) != null) for (Feature feature : objects) areas(feature); 127 if ((objects = Renderer.map.features.get(Obj.RESARE)) != null) for (Feature feature : objects) areas(feature); 128 if ((objects = Renderer.map.features.get(Obj.SPLARE)) != null) for (Feature feature : objects) areas(feature); 129 if ((objects = Renderer.map.features.get(Obj.SEAARE)) != null) for (Feature feature : objects) areas(feature); 130 if ((objects = Renderer.map.features.get(Obj.OBSTRN)) != null) for (Feature feature : objects) obstructions(feature); 131 if ((objects = Renderer.map.features.get(Obj.UWTROC)) != null) for (Feature feature : objects) obstructions(feature); 132 if ((objects = Renderer.map.features.get(Obj.MARCUL)) != null) for (Feature feature : objects) areas(feature); 133 if ((objects = Renderer.map.features.get(Obj.WTWAXS)) != null) for (Feature feature : objects) waterways(feature); 134 if ((objects = Renderer.map.features.get(Obj.RECTRC)) != null) for (Feature feature : objects) transits(feature); 135 if ((objects = Renderer.map.features.get(Obj.NAVLNE)) != null) for (Feature feature : objects) transits(feature); 136 if ((objects = Renderer.map.features.get(Obj.HRBFAC)) != null) for (Feature feature : objects) harbours(feature); 137 if ((objects = Renderer.map.features.get(Obj.ACHARE)) != null) for (Feature feature : objects) harbours(feature); 138 if ((objects = Renderer.map.features.get(Obj.ACHBRT)) != null) for (Feature feature : objects) harbours(feature); 139 if ((objects = Renderer.map.features.get(Obj.BERTHS)) != null) for (Feature feature : objects) harbours(feature); 140 if ((objects = Renderer.map.features.get(Obj.LOKBSN)) != null) for (Feature feature : objects) locks(feature); 141 if ((objects = Renderer.map.features.get(Obj.LKBSPT)) != null) for (Feature feature : objects) locks(feature); 142 if ((objects = Renderer.map.features.get(Obj.GATCON)) != null) for (Feature feature : objects) locks(feature); 143 if ((objects = Renderer.map.features.get(Obj.DISMAR)) != null) for (Feature feature : objects) distances(feature); 144 if ((objects = Renderer.map.features.get(Obj.HULKES)) != null) for (Feature feature : objects) ports(feature); 145 if ((objects = Renderer.map.features.get(Obj.CRANES)) != null) for (Feature feature : objects) ports(feature); 146 if ((objects = Renderer.map.features.get(Obj.LNDMRK)) != null) for (Feature feature : objects) landmarks(feature); 147 if ((objects = Renderer.map.features.get(Obj.BUISGL)) != null) for (Feature feature : objects) harbours(feature); 148 if ((objects = Renderer.map.features.get(Obj.MORFAC)) != null) for (Feature feature : objects) moorings(feature); 149 if ((objects = Renderer.map.features.get(Obj.NOTMRK)) != null) for (Feature feature : objects) notices(feature); 150 if ((objects = Renderer.map.features.get(Obj.SMCFAC)) != null) for (Feature feature : objects) marinas(feature); 151 if ((objects = Renderer.map.features.get(Obj.BRIDGE)) != null) for (Feature feature : objects) bridges(feature); 152 if ((objects = Renderer.map.features.get(Obj.PILPNT)) != null) for (Feature feature : objects) lights(feature); 153 if ((objects = Renderer.map.features.get(Obj.LITMIN)) != null) for (Feature feature : objects) lights(feature); 154 if ((objects = Renderer.map.features.get(Obj.LITMAJ)) != null) for (Feature feature : objects) lights(feature); 155 if ((objects = Renderer.map.features.get(Obj.LIGHTS)) != null) for (Feature feature : objects) lights(feature); 156 if ((objects = Renderer.map.features.get(Obj.SISTAT)) != null) for (Feature feature : objects) stations(feature); 157 if ((objects = Renderer.map.features.get(Obj.SISTAW)) != null) for (Feature feature : objects) stations(feature); 158 if ((objects = Renderer.map.features.get(Obj.CGUSTA)) != null) for (Feature feature : objects) stations(feature); 159 if ((objects = Renderer.map.features.get(Obj.RDOSTA)) != null) for (Feature feature : objects) stations(feature); 160 if ((objects = Renderer.map.features.get(Obj.RADSTA)) != null) for (Feature feature : objects) stations(feature); 161 if ((objects = Renderer.map.features.get(Obj.RSCSTA)) != null) for (Feature feature : objects) stations(feature); 162 if ((objects = Renderer.map.features.get(Obj.PILBOP)) != null) for (Feature feature : objects) stations(feature); 163 if ((objects = Renderer.map.features.get(Obj.WTWGAG)) != null) for (Feature feature : objects) gauges(feature); 164 if ((objects = Renderer.map.features.get(Obj.OFSPLF)) != null) for (Feature feature : objects) platforms(feature); 165 if ((objects = Renderer.map.features.get(Obj.WRECKS)) != null) for (Feature feature : objects) wrecks(feature); 166 if ((objects = Renderer.map.features.get(Obj.LITVES)) != null) for (Feature feature : objects) floats(feature); 167 if ((objects = Renderer.map.features.get(Obj.LITFLT)) != null) for (Feature feature : objects) floats(feature); 168 if ((objects = Renderer.map.features.get(Obj.BOYINB)) != null) for (Feature feature : objects) floats(feature); 169 if ((objects = Renderer.map.features.get(Obj.BOYLAT)) != null) for (Feature feature : objects) buoys(feature); 170 if ((objects = Renderer.map.features.get(Obj.BOYCAR)) != null) for (Feature feature : objects) buoys(feature); 171 if ((objects = Renderer.map.features.get(Obj.BOYISD)) != null) for (Feature feature : objects) buoys(feature); 172 if ((objects = Renderer.map.features.get(Obj.BOYSAW)) != null) for (Feature feature : objects) buoys(feature); 173 if ((objects = Renderer.map.features.get(Obj.BOYSPP)) != null) for (Feature feature : objects) buoys(feature); 174 if ((objects = Renderer.map.features.get(Obj.BOYWTW)) != null) for (Feature feature : objects) buoys(feature); 175 if ((objects = Renderer.map.features.get(Obj.BCNLAT)) != null) for (Feature feature : objects) beacons(feature); 176 if ((objects = Renderer.map.features.get(Obj.BCNCAR)) != null) for (Feature feature : objects) beacons(feature); 177 if ((objects = Renderer.map.features.get(Obj.BCNISD)) != null) for (Feature feature : objects) beacons(feature); 178 if ((objects = Renderer.map.features.get(Obj.BCNSAW)) != null) for (Feature feature : objects) beacons(feature); 179 if ((objects = Renderer.map.features.get(Obj.BCNSPP)) != null) for (Feature feature : objects) beacons(feature); 180 if ((objects = Renderer.map.features.get(Obj.BCNWTW)) != null) for (Feature feature : objects) beacons(feature); 182 181 } 183 182 … … 186 185 switch (feature.type) { 187 186 case DRGARE: 188 if ( zoom < 16)187 if (Renderer.zoom < 16) 189 188 Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 }, new Color(0x40ffffff, true))); 190 189 else 191 190 Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 })); 192 if (( zoom >= 12) && (name != null))191 if ((Renderer.zoom >= 12) && (name != null)) 193 192 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 100), LabelStyle.NONE, Color.black); 194 193 break; 195 194 case FAIRWY: 196 195 if (feature.area > 2.0) { 197 if ( zoom < 16)198 Renderer.lineVector(feature, new LineStyle( Renderer.Mline, 8, new float[] { 50, 50 }, new Color(0x40ffffff, true)));196 if (Renderer.zoom < 16) 197 Renderer.lineVector(feature, new LineStyle(Mline, 8, new float[] { 50, 50 }, new Color(0x40ffffff, true))); 199 198 else 200 Renderer.lineVector(feature, new LineStyle( Renderer.Mline, 8, new float[] { 50, 50 }));199 Renderer.lineVector(feature, new LineStyle(Mline, 8, new float[] { 50, 50 })); 201 200 } else { 202 if ( zoom >= 14)201 if (Renderer.zoom >= 14) 203 202 Renderer.lineVector(feature, new LineStyle(null, 0, new Color(0x40ffffff, true))); 204 203 } 205 204 break; 206 205 case MARCUL: 207 if ( zoom >= 12) {208 if ( zoom >= 14) {206 if (Renderer.zoom >= 12) { 207 if (Renderer.zoom >= 14) { 209 208 Renderer.symbol(feature, Areas.MarineFarm); 210 209 } 211 if ((feature.area > 0.2) || ((feature.area > 0.05) && ( zoom >= 14)) || ((feature.area > 0.005) && (zoom >= 16))) {210 if ((feature.area > 0.2) || ((feature.area > 0.05) && (Renderer.zoom >= 14)) || ((feature.area > 0.005) && (Renderer.zoom >= 16))) { 212 211 Renderer.lineVector(feature, new LineStyle(Color.black, 4, new float[] { 10, 10 })); 213 212 } … … 218 217 Renderer.symbol(feature, Areas.WindFarm); 219 218 Renderer.lineVector(feature, new LineStyle(Color.black, 20, new float[] { 40, 40 })); 220 if (( zoom >= 15) && (name != null))219 if ((Renderer.zoom >= 15) && (name != null)) 221 220 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 10))); 222 221 } 223 222 break; 224 223 case RESARE: 225 if ( zoom >= 12) {226 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, Renderer.Mline);224 if (Renderer.zoom >= 12) { 225 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, null, 0, Mline); 227 226 if (testAttribute(feature, feature.type, Att.CATREA, CatREA.REA_NWAK)) { 228 227 Renderer.symbol(feature, Areas.NoWake); … … 233 232 switch ((CatSEA) getAttVal(feature, feature.type, 0, Att.CATSEA)) { 234 233 case SEA_RECH: 235 if (( zoom >= 10) && (name != null))234 if ((Renderer.zoom >= 10) && (name != null)) 236 235 if (feature.flag == Fflag.LINE) { 237 236 Renderer.lineText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5, -40); … … 241 240 break; 242 241 case SEA_BAY: 243 if (( zoom >= 12) && (name != null))242 if ((Renderer.zoom >= 12) && (name != null)) 244 243 if (feature.flag == Fflag.LINE) { 245 244 Renderer.lineText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5, -40); … … 249 248 break; 250 249 case SEA_SHOL: 251 if ( zoom >= 14) {250 if (Renderer.zoom >= 14) { 252 251 if (feature.flag == Fflag.AREA) { 253 252 Renderer.lineVector(feature, new LineStyle(new Color(0xc480ff), 4, new float[] { 25, 25 })); … … 271 270 case SEA_GAT: 272 271 case SEA_NRRW: 273 if (( zoom >= 12) && (name != null))272 if ((Renderer.zoom >= 12) && (name != null)) 274 273 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 100), LabelStyle.NONE, Color.black); 275 274 break; … … 279 278 break; 280 279 case SNDWAV: 281 if ( zoom >= 12) Renderer.fillPattern(feature, Areas.Sandwaves);280 if (Renderer.zoom >= 12) Renderer.fillPattern(feature, Areas.Sandwaves); 282 281 break; 283 282 case SPLARE: 284 if ( zoom >= 12) {285 Renderer.symbol(feature, Areas.Plane, new Scheme( Renderer.Msymb));286 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Renderer.Mline);287 } 288 if (( zoom >= 15) && (name != null))283 if (Renderer.zoom >= 12) { 284 Renderer.symbol(feature, Areas.Plane, new Scheme(Msymb)); 285 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, null, 10, Mline); 286 } 287 if ((Renderer.zoom >= 15) && (name != null)) 289 288 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90))); 290 289 break; … … 332 331 333 332 private static void bridges(Feature feature) { 334 if ( zoom >= 16) {333 if (Renderer.zoom >= 16) { 335 334 double verclr, verccl, vercop, horclr; 336 335 AttMap atts = feature.objs.get(Obj.BRIDGE).get(0); … … 371 370 372 371 private static void cables(Feature feature) { 373 if (( zoom >= 16) && (feature.length < 2)) {372 if ((Renderer.zoom >= 16) && (feature.length < 2)) { 374 373 if (feature.type == Obj.CBLSUB) { 375 Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, null, 0, Renderer.Mline);374 Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, null, 0, Mline); 376 375 } else if (feature.type == Obj.CBLOHD) { 377 376 AttMap atts = feature.objs.get(Obj.CBLOHD).get(0); … … 393 392 394 393 private static void distances(Feature feature) { 395 if ( zoom >= 14) {394 if (Renderer.zoom >= 14) { 396 395 if (!testAttribute(feature, Obj.DISMAR, Att.CATDIS, CatDIS.DIS_NONI)) { 397 396 Renderer.symbol(feature, Harbours.DistanceI); … … 399 398 Renderer.symbol(feature, Harbours.DistanceU); 400 399 } 401 if (( zoom >=15) && hasAttribute(feature, Obj.DISMAR, Att.WTWDIS)) {400 if ((Renderer.zoom >=15) && hasAttribute(feature, Obj.DISMAR, Att.WTWDIS)) { 402 401 AttMap atts = feature.objs.get(Obj.DISMAR).get(0); 403 402 Double dist = (Double) atts.get(Att.WTWDIS).val; … … 453 452 454 453 private static void gauges(Feature feature) { 455 if ( zoom >= 14) {454 if (Renderer.zoom >= 14) { 456 455 Renderer.symbol(feature, Harbours.TideGauge); 457 456 Signals.addSignals(feature); … … 463 462 switch (feature.type) { 464 463 case ACHBRT: 465 if ( zoom >= 14) {466 Renderer.symbol(feature, Harbours.Anchorage, new Scheme( Renderer.Mline));467 Renderer.labelText(feature, name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), LabelStyle.RRCT, Renderer.Mline, Color.white, new Delta(Handle.BC));464 if (Renderer.zoom >= 14) { 465 Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Mline)); 466 Renderer.labelText(feature, name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), LabelStyle.RRCT, Mline, Color.white, new Delta(Handle.BC)); 468 467 } 469 468 double radius = (Double)getAttVal(feature, Obj.ACHBRT, 0, Att.RADIUS); 470 469 if (radius != 0) { 471 470 UniHLU units = (UniHLU)getAttVal(feature, Obj.ACHBRT, 0, Att.HUNITS); 472 Renderer.lineCircle (feature, new LineStyle( Renderer.Mline, 4, new float[] { 10, 10 }, null), radius, units);471 Renderer.lineCircle (feature, new LineStyle(Mline, 4, new float[] { 10, 10 }, null), radius, units); 473 472 } 474 473 break; 475 474 case ACHARE: 476 if ( zoom >= 12) {475 if (Renderer.zoom >= 12) { 477 476 if (feature.flag != Fflag.AREA) { 478 477 Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Color.black)); 479 478 } else { 480 Renderer.symbol(feature, Harbours.Anchorage, new Scheme( Renderer.Mline));481 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, null, 10, Renderer.Mline);482 } 483 if (( zoom >= 15) && ((name) != null)) {484 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 60), LabelStyle.NONE, Renderer.Mline, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));479 Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Mline)); 480 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, null, 10, Mline); 481 } 482 if ((Renderer.zoom >= 15) && ((name) != null)) { 483 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 60), LabelStyle.NONE, Mline, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0))); 485 484 } 486 485 ArrayList<StsSTS> sts = (ArrayList<StsSTS>)getAttVal(feature, Obj.ACHARE, 0, Att.STATUS); 487 if (( zoom >= 15) && (sts != null) && (sts.contains(StsSTS.STS_RESV))) {488 Renderer.labelText(feature, "Reserved", new Font("Arial", Font.PLAIN, 50), LabelStyle.NONE, Renderer.Mline, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60)));486 if ((Renderer.zoom >= 15) && (sts != null) && (sts.contains(StsSTS.STS_RESV))) { 487 Renderer.labelText(feature, "Reserved", new Font("Arial", Font.PLAIN, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60))); 489 488 } 490 489 } … … 494 493 switch (cat) { 495 494 case ACH_DEEP: 496 Renderer.labelText(feature, "DW", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Renderer.Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));495 Renderer.labelText(feature, "DW", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 497 496 dy += 60; 498 497 break; 499 498 case ACH_TANK: 500 Renderer.labelText(feature, "Tanker", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Renderer.Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));499 Renderer.labelText(feature, "Tanker", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 501 500 dy += 60; 502 501 break; 503 502 case ACH_H24P: 504 Renderer.labelText(feature, "24h", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Renderer.Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));503 Renderer.labelText(feature, "24h", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 505 504 dy += 60; 506 505 break; 507 506 case ACH_EXPL: 508 Renderer.symbol(feature, Harbours.Explosives, new Scheme( Renderer.Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));507 Renderer.symbol(feature, Harbours.Explosives, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 509 508 dy += 60; 510 509 break; 511 510 case ACH_QUAR: 512 Renderer.symbol(feature, Harbours.Hospital, new Scheme( Renderer.Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));511 Renderer.symbol(feature, Harbours.Hospital, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 513 512 dy += 60; 514 513 break; 515 514 case ACH_SEAP: 516 Renderer.symbol(feature, Areas.Seaplane, new Scheme( Renderer.Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));515 Renderer.symbol(feature, Areas.Seaplane, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy))); 517 516 dy += 60; 518 517 break; … … 521 520 break; 522 521 case BERTHS: 523 if ( zoom >= 14) {524 Renderer.labelText(feature, name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), LabelStyle.RRCT, Renderer.Mline, Color.white, null);522 if (Renderer.zoom >= 14) { 523 Renderer.labelText(feature, name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), LabelStyle.RRCT, Mline, Color.white, null); 525 524 } 526 525 break; 527 526 case BUISGL: 528 if ( zoom >= 16) {527 if (Renderer.zoom >= 16) { 529 528 ArrayList<Symbol> symbols = new ArrayList<Symbol>(); 530 529 ArrayList<FncFNC> fncs = (ArrayList<FncFNC>) getAttVal(feature, Obj.BUISGL, 0, Att.FUNCTN); … … 542 541 break; 543 542 case HRBFAC: 544 if ( zoom >= 12) {543 if (Renderer.zoom >= 12) { 545 544 ArrayList<CatHAF> cathaf = (ArrayList<CatHAF>) getAttVal(feature, Obj.HRBFAC, 0, Att.CATHAF); 546 545 if (cathaf.size() == 1) { … … 621 620 622 621 private static void marinas(Feature feature) { 623 if ( zoom >= 16) {622 if (Renderer.zoom >= 16) { 624 623 625 624 } … … 648 647 649 648 private static void notices(Feature feature) { 650 if ( zoom >= 14) {649 if (Renderer.zoom >= 14) { 651 650 double dx = 0.0, dy = 0.0; 652 651 switch (feature.type) { … … 865 864 866 865 private static void obstructions(Feature feature) { 867 if (( zoom >= 14) && (feature.type == Obj.UWTROC)) {866 if ((Renderer.zoom >= 14) && (feature.type == Obj.UWTROC)) { 868 867 WatLEV lvl = (WatLEV) getAttVal(feature, feature.type, 0, Att.WATLEV); 869 868 switch (lvl) { … … 883 882 884 883 private static void pipelines(Feature feature) { 885 if (( zoom >= 16) && (feature.length < 2)) {884 if ((Renderer.zoom >= 16) && (feature.length < 2)) { 886 885 if (feature.type == Obj.PIPSOL) { 887 Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, null, 0, Renderer.Mline);886 Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, null, 0, Mline); 888 887 } else if (feature.type == Obj.PIPOHD) { 889 888 Renderer.lineVector(feature, new LineStyle(Color.black, 8)); … … 911 910 Renderer.symbol(feature, Landmarks.Platform); 912 911 String name = getName(feature); 913 if (( zoom >= 15) && (name != null))912 if ((Renderer.zoom >= 15) && (name != null)) 914 913 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50))); 915 914 Signals.addSignals(feature); … … 917 916 918 917 private static void ports(Feature feature) { 919 if ( zoom >= 14) {918 if (Renderer.zoom >= 14) { 920 919 if (feature.type == Obj.CRANES) { 921 920 if ((CatCRN) getAttVal(feature, feature.type, 0, Att.CATCRN) == CatCRN.CRN_CONT) … … 926 925 Renderer.lineVector(feature, new LineStyle(Color.black, 4, null, new Color(0xffe000))); 927 926 String name = getName(feature); 928 if (( zoom >= 15) && (name != null))927 if ((Renderer.zoom >= 15) && (name != null)) 929 928 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, null); 930 929 } … … 937 936 case TSSCRS: 938 937 case TSSRON: 939 if ( zoom <= 15)938 if (Renderer.zoom <= 15) 940 939 Renderer.lineVector(feature, new LineStyle(null, 0, null, new Color(0x80c48080, true))); 941 940 else 942 941 Renderer.lineVector(feature, new LineStyle(new Color(0x80c48080, true), 20, null, null)); 943 942 String name = getName(feature); 944 if (( zoom >= 10) && (name != null))943 if ((Renderer.zoom >= 10) && (name != null)) 945 944 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 150), LabelStyle.NONE, new Color(0x80c48080, true), null, null); 946 945 break; … … 961 960 962 961 private static void shoreline(Feature feature) { 963 if ( zoom >= 12) {962 if (Renderer.zoom >= 12) { 964 963 switch ((CatSLC) getAttVal(feature, feature.type, 0, Att.CATSLC)) { 965 964 case SLC_TWAL: … … 967 966 if (lev == WatLEV.LEV_CVRS) { 968 967 Renderer.lineVector(feature, new LineStyle(Color.black, 10, new float[] { 40, 40 }, null)); 969 if ( zoom >= 15)968 if (Renderer.zoom >= 15) 970 969 Renderer.lineText(feature, "(covers)", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, 20); 971 970 } else { 972 971 Renderer.lineVector(feature, new LineStyle(Color.black, 10, null, null)); 973 972 } 974 if ( zoom >= 15)973 if (Renderer.zoom >= 15) 975 974 Renderer.lineText(feature, "Training Wall", new Font("Arial", Font.PLAIN, 80), Color.black, 0.5, -20); 976 975 } … … 979 978 980 979 private static void stations(Feature feature) { 981 if ( zoom >= 14) {980 if (Renderer.zoom >= 14) { 982 981 String str = ""; 983 982 switch (feature.type) { … … 1007 1006 break; 1008 1007 } 1009 if (( zoom >= 15) && !str.isEmpty()) {1008 if ((Renderer.zoom >= 15) && !str.isEmpty()) { 1010 1009 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(30, 0))); 1011 1010 } … … 1015 1014 1016 1015 private static void transits(Feature feature) { 1017 if ( zoom >= 12) {1016 if (Renderer.zoom >= 12) { 1018 1017 if (feature.type == Obj.RECTRC) Renderer.lineVector (feature, new LineStyle(Color.black, 10, null, null)); 1019 1018 else if (feature.type == Obj.NAVLNE) Renderer.lineVector (feature, new LineStyle(Color.black, 10, new float[] { 25, 25 }, null)); 1020 1019 } 1021 if ( zoom >= 15) {1020 if (Renderer.zoom >= 15) { 1022 1021 String str = ""; 1023 1022 String name = getName(feature); … … 1034 1033 1035 1034 private static void wrecks(Feature feature) { 1036 if ( zoom >= 14) {1035 if (Renderer.zoom >= 14) { 1037 1036 CatWRK cat = (CatWRK) getAttVal(feature, feature.type, 0, Att.CATWRK); 1038 1037 switch (cat) { -
applications/editors/josm/plugins/smed2/src/render/Signals.java
r30123 r30150 8 8 */ 9 9 10 package seamap;10 package render; 11 11 12 12 import java.awt.Color; … … 18 18 import s57.S57obj.*; 19 19 import s57.S57val.*; 20 import s eamap.Renderer.*;21 import seamap.SeaMap.*;20 import s57.S57map.*; 21 import render.Renderer.*; 22 22 import symbols.Beacons; 23 23 import symbols.Topmarks; -
applications/editors/josm/plugins/smed2/src/s57/S57dat.java
r29215 r30150 1 1 package s57; 2 2 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 5 import java.awt.Dimension; 6 import java.awt.event.ActionListener; 7 import java.io.File; 8 import java.io.FileInputStream; 9 import java.io.FileOutputStream; 10 import java.io.IOException; 11 12 import javax.swing.*; 13 14 import org.openstreetmap.josm.Main; 15 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 16 import org.openstreetmap.josm.data.osm.DataSet; 17 18 import panels.PanelMain; 19 20 import smed2.Smed2Action; 21 22 import s57.S57obj; 23 import s57.S57att; 24 import s57.S57val; 25 26 public class S57dat extends JPanel { 3 public class S57dat { 27 4 28 5 private enum S57field { DSID, DSSI, DSPM, DSPR, DSRC, DSHT, DSAC, CATD, CATX, DDDF, DDDR, DDDI, DDOM, DDRF, DDSI, DDSC, … … 64 41 private enum S57ct2d { YCOO, XCOO } 65 42 66 private File importFile;67 private FileInputStream inp;68 private File exportFile;69 private FileOutputStream outp;70 private OsmDataLayer layer;71 private DataSet data;72 73 private JButton importButton;74 private ActionListener alImport = new ActionListener() {75 public void actionPerformed(java.awt.event.ActionEvent e) {76 if (e.getSource() == importButton) {77 readFile();78 Smed2Action.panelS57.setVisible(true);79 Smed2Action.panelMain.setVisible(false);80 PanelMain.messageBar.setText("File imported");81 }82 }83 };84 private JButton exportButton;85 private ActionListener alExport = new ActionListener() {86 public void actionPerformed(java.awt.event.ActionEvent e) {87 if (e.getSource() == exportButton) {88 writeFile();89 Smed2Action.panelS57.setVisible(true);90 Smed2Action.panelMain.setVisible(false);91 PanelMain.messageBar.setText("File exported");92 }93 }94 };95 private JButton cancelButton;96 private ActionListener alCancel = new ActionListener() {97 public void actionPerformed(java.awt.event.ActionEvent e) {98 if (e.getSource() == cancelButton) {99 try {100 inp.close();101 } catch (IOException e1) {}102 Smed2Action.panelS57.setVisible(false);103 Smed2Action.panelMain.setVisible(true);104 PanelMain.messageBar.setText("Operation cancelled");105 }106 }107 };108 109 public S57dat() {110 111 setLayout(null);112 setSize(new Dimension(480, 480));113 cancelButton = new JButton();114 cancelButton.setBounds(250, 430, 100, 20);115 cancelButton.setText(tr("Cancel"));116 cancelButton.addActionListener(alCancel);117 add(cancelButton);118 importButton = new JButton();119 importButton.setBounds(370, 430, 100, 20);120 importButton.setText(tr("Import"));121 importButton.addActionListener(alImport);122 add(importButton);123 exportButton = new JButton();124 exportButton.setBounds(370, 430, 100, 20);125 exportButton.setText(tr("Export"));126 exportButton.addActionListener(alExport);127 add(exportButton);128 }129 130 public void startImport(File file) {131 importFile = file;132 try {133 inp = new FileInputStream(file);134 } catch (IOException e) {135 PanelMain.messageBar.setText("Failed to open file");136 return;137 }138 Smed2Action.panelMain.setVisible(false);139 Smed2Action.panelS57.setVisible(true);140 }141 142 public void startExport(File file) {143 exportFile = file;144 try {145 outp = new FileOutputStream(file);146 } catch (IOException e) {147 PanelMain.messageBar.setText("Failed to open file");148 return;149 }150 Smed2Action.panelMain.setVisible(false);151 Smed2Action.panelS57.setVisible(true);152 }153 154 private void writeFile() {155 }156 157 private void readFile() {158 // Read & convert file.159 // read record at a time160 // read leader161 // if DDR, build conversion tables162 // if DR, build data structures163 // Extract list of features & present on chooser panel164 }165 166 private void importData() {167 data = new DataSet();168 // Transfer selected features169 layer = new OsmDataLayer(data, importFile.getName(), null);170 layer.setUploadDiscouraged(true);171 Main.main.addLayer(layer);172 173 }174 43 } -
applications/editors/josm/plugins/smed2/src/s57/S57map.java
r30138 r30150 8 8 */ 9 9 10 package s eamap;10 package s57; 11 11 12 12 import java.util.*; 13 13 14 14 import s57.S57att; 15 import s57.S57att. Att;15 import s57.S57att.*; 16 16 import s57.S57obj; 17 17 import s57.S57obj.*; … … 19 19 import s57.S57val.*; 20 20 21 public class S eaMap {21 public class S57map { 22 22 23 23 public enum Nflag { … … 274 274 } 275 275 276 public S eaMap() {276 public S57map() { 277 277 nodes = new NodeTab(); 278 278 edges = new EdgeTab(); -
applications/editors/josm/plugins/smed2/src/smed2/MapImage.java
r30123 r30150 28 28 import org.openstreetmap.josm.gui.layer.ImageryLayer; 29 29 30 import seamap.MapContext;31 import seamap.Renderer;32 import s eamap.SeaMap.*;30 import render.MapContext; 31 import render.Renderer; 32 import s57.S57map.*; 33 33 34 34 public class MapImage extends ImageryLayer implements ZoomChangeListener, MapContext { -
applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java
r30037 r30150 30 30 31 31 import s57.S57dat; 32 import s eamap.SeaMap;33 import s eamap.SeaMap.*;32 import s57.S57map; 33 import s57.S57map.*; 34 34 35 35 import panels.PanelMain; … … 40 40 public static JFrame editFrame = null; 41 41 public static ShowFrame showFrame = null; 42 public static S57dat panelS57;43 42 private boolean isOpen = false; 44 43 public static PanelMain panelMain = null; 45 44 public MapImage rendering; 46 public S eaMap map = null;45 public S57map map = null; 47 46 public DataSet data = null; 48 47 … … 122 121 panelMain = new PanelMain(this); 123 122 editFrame.add(panelMain); 124 panelS57 = new S57dat();125 panelS57.setVisible(false);126 editFrame.add(panelS57);127 123 128 124 showFrame = new ShowFrame(tr("Seamark Inspector")); … … 206 202 207 203 void makeMap() { 208 map = new S eaMap();204 map = new S57map(); 209 205 if (data != null) { 210 206 for (Node node : data.getNodes()) { -
applications/editors/josm/plugins/smed2/src/symbols/Harbours.java
r30120 r30150 14 14 import java.awt.geom.*; 15 15 16 import seamap.Renderer;16 import render.Rules; 17 17 import symbols.Symbols.*; 18 18 … … 39 39 public static final Symbol Anchorage = new Symbol(); 40 40 static { 41 Anchorage.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 1.0, 0, 0, new Scheme(R enderer.Msymb), null)));41 Anchorage.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 1.0, 0, 0, new Scheme(Rules.Msymb), null))); 42 42 } 43 43 public static final Symbol Bollard = new Symbol(); … … 79 79 static { 80 80 DistanceU.add(new Instr(Prim.STRK, new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 81 DistanceU.add(new Instr(Prim.FILL, R enderer.Msymb));81 DistanceU.add(new Instr(Prim.FILL, Rules.Msymb)); 82 82 DistanceU.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-11,-11,22,22))); 83 83 } … … 105 105 static { 106 106 Fishing.add(new Instr(Prim.STRK, new BasicStroke(15, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 107 Fishing.add(new Instr(Prim.FILL, R enderer.Msymb));107 Fishing.add(new Instr(Prim.FILL, Rules.Msymb)); 108 108 Fishing.add(new Instr(Prim.EARC, new Arc2D.Double(-75,-75,150,150,15,140,Arc2D.OPEN))); 109 109 Fishing.add(new Instr(Prim.EARC, new Arc2D.Double(-75,-75,150,150,-15,-140,Arc2D.OPEN))); … … 117 117 static { 118 118 Harbour.add(new Instr(Prim.STRK, new BasicStroke(15, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 119 Harbour.add(new Instr(Prim.FILL, R enderer.Msymb));119 Harbour.add(new Instr(Prim.FILL, Rules.Msymb)); 120 120 Harbour.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-75,-75,150,150))); 121 Harbour.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 1.0, 0, 0, new Scheme(R enderer.Msymb), null)));121 Harbour.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 1.0, 0, 0, new Scheme(Rules.Msymb), null))); 122 122 } 123 123 public static final Symbol HarbourMaster = new Symbol(); … … 139 139 public static final Symbol LandingSteps = new Symbol(); 140 140 static { 141 LandingSteps.add(new Instr(Prim.FILL, R enderer.Msymb));141 LandingSteps.add(new Instr(Prim.FILL, Rules.Msymb)); 142 142 Path2D.Double p = new Path2D.Double(); p.moveTo(-20,-10); p.lineTo(10,20); p.lineTo(20,20); p.lineTo(20,10); 143 143 p.lineTo(10,10); p.lineTo(10,0); p.lineTo(0,0); p.lineTo(0,-10); p.lineTo(-10,-10); p.lineTo(-10,-20); p.lineTo(-20,-20); p.closePath(); … … 149 149 static { 150 150 Marina.add(new Instr(Prim.STRK, new BasicStroke(15, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 151 Marina.add(new Instr(Prim.FILL, R enderer.Msymb));152 Marina.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Harbours.Yacht, 1.0, 0, 0, new Scheme(R enderer.Msymb), null)));151 Marina.add(new Instr(Prim.FILL, Rules.Msymb)); 152 Marina.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Harbours.Yacht, 1.0, 0, 0, new Scheme(Rules.Msymb), null))); 153 153 Marina.add(new Instr(Prim.EARC, new Arc2D.Double(-80.0,-80.0,160.0,160.0,215.0,-250.0,Arc2D.OPEN))); 154 154 } … … 156 156 static { 157 157 MarinaNF.add(new Instr(Prim.STRK, new BasicStroke(15, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 158 MarinaNF.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Harbours.Yacht, 1.0, 0, 0, new Scheme(R enderer.Msymb), null)));158 MarinaNF.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Harbours.Yacht, 1.0, 0, 0, new Scheme(Rules.Msymb), null))); 159 159 } 160 160 public static final Symbol Pilot = new Symbol();
Note:
See TracChangeset
for help on using the changeset viewer.