Changeset 30190 in osm for applications/editors/josm
- Timestamp:
- 2014-01-07T22:28:02+01:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/smed2
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/js57toosm/build.xml
r30188 r30190 2 2 <property name="src" location="src"/> 3 3 <property name="build" location="build"/> 4 <property name=" dist" location="dist"/>4 <property name="jarfile" location="./js57toosm.jar"/> 5 5 6 6 <target name="init"> … … 13 13 14 14 <target name="dist" depends="compile" description="generate the distribution" > 15 <jar jarfile=" ./js57toosm.jar" basedir="${build}" >15 <jar jarfile="${jarfile}" basedir="${build}" > 16 16 <manifest> 17 <attribute name="Main-Class" value="Js57toosm"/> 17 <attribute name="Main-Class" value="js57toosm.Js57toosm"/> 18 <attribute name="Class-Path" value="$jarfile"/> 18 19 </manifest> 19 20 </jar> … … 22 23 <target name="clean" description="clean up" > 23 24 <delete dir="${build}"/> 24 <delete dir="${dist}"/> 25 <delete file="./js57toosm.jar"/> 25 <delete file="${jarfile}"/> 26 26 </target> 27 27 </project> -
applications/editors/josm/plugins/smed2/src/render/Renderer.java
r30186 r30190 307 307 } 308 308 break; 309 default: 310 break; 309 311 } 310 312 if (style.line != null) { … … 385 387 g2.fill(p); 386 388 break; 389 default: 390 break; 387 391 } 388 392 } -
applications/editors/josm/plugins/smed2/src/render/Signals.java
r30157 r30190 19 19 import s57.S57val.*; 20 20 import s57.S57map.*; 21 import render.Renderer.*;22 21 import symbols.Beacons; 23 22 import symbols.Topmarks; -
applications/editors/josm/plugins/smed2/src/s57/S57dat.java
r30188 r30190 165 165 } 166 166 167 p ublic static Object getSubf(S57subf subf) {167 private static S57conv findSubf(S57subf subf) { 168 168 ArrayList<S57subf> subs = fields.get(field); 169 169 boolean wrap = false; … … 181 181 S57conv conv = convs.get(sub); 182 182 if (sub == subf) { 183 if (conv.bin == 0) { 184 String str = ""; 185 if (conv.asc == 0) { 186 while (buffer[offset] != 0x1f) { 187 str += buffer[offset++]; 188 } 189 } else { 190 str = new String(buffer, offset, conv.asc); 191 offset += conv.asc; 192 } 193 return str; 194 } else { 195 int f = Math.abs(conv.bin); 196 if (f < 8) { 197 long val = buffer[offset + --f]; 198 if (conv.bin > 0) 199 val &= 0xff; 200 while (f > 0) { 201 val = (val << 8) + (buffer[offset + --f] & 0xff); 202 } 203 offset += Math.abs(conv.bin); 204 return val; 205 } else { 206 f /= 8; 207 long val = 0; 208 for (int i = 0; i < f; i++) { 209 val = (val << 8) + (buffer[offset++] & 0xff); 210 } 211 return val; 212 } 213 } 183 return conv; 214 184 } else { 215 185 offset += (conv.bin != 0) ? ((conv.bin < 8) ? Math.abs(conv.bin) : conv.bin / 8) : conv.asc; … … 217 187 } 218 188 } 219 189 190 public static Object getSubf(S57subf subf) { 191 S57conv conv = findSubf(subf); 192 if (conv.bin == 0) { 193 String str = ""; 194 if (conv.asc == 0) { 195 while (buffer[offset] != 0x1f) { 196 str += buffer[offset++]; 197 } 198 } else { 199 str = new String(buffer, offset, conv.asc); 200 offset += conv.asc; 201 } 202 return str; 203 } else { 204 int f = Math.abs(conv.bin); 205 if (f < 8) { 206 long val = buffer[offset + --f]; 207 if (conv.bin > 0) 208 val &= 0xff; 209 while (f > 0) { 210 val = (val << 8) + (buffer[offset + --f] & 0xff); 211 } 212 offset += Math.abs(conv.bin); 213 return val; 214 } else { 215 f /= 8; 216 long val = 0; 217 for (int i = 0; i < f; i++) { 218 val = (val << 8) + (buffer[offset++] & 0xff); 219 } 220 return val; 221 } 222 } 223 } 224 225 public static void putSubf(byte[] buf, int off, S57field fld, S57subf subf, Object val) { 226 buffer = buf; 227 offset = off; 228 index = 0; 229 putSubf(fld, subf, val); 230 } 231 232 public static void putSubf(S57field fld, S57subf subf, Object val) { 233 field = fld; 234 index = 0; 235 putSubf(subf, val); 236 } 237 238 public static void putSubf(S57subf subf, Object val) { 239 S57conv conv = findSubf(subf); 240 if (conv.bin == 0) { 241 } else { 242 } 243 } 220 244 }
Note:
See TracChangeset
for help on using the changeset viewer.