Changeset 32907 in osm for applications/editors/josm/plugins/seachart/jicons
- Timestamp:
- 2016-09-03T16:43:42+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/seachart/jicons/src/jicons/Jicons.java
r32906 r32907 1 /* Copyright 2014 Malcolm Herring 2 * 3 * This is free software: you can redistribute it and/or modify 4 * it under the terms of the GNU General Public License as published by 5 * the Free Software Foundation, version 3 of the License. 6 * 7 * For a copy of the GNU General Public License, see <http://www.gnu.org/licenses/>. 8 */ 9 1 // License: GPL. For details, see LICENSE file. 10 2 package jicons; 11 3 4 import java.awt.Color; 5 import java.awt.Dimension; 6 import java.awt.Graphics2D; 7 import java.awt.Rectangle; 8 import java.awt.geom.Point2D; 9 import java.awt.image.BufferedImage; 12 10 import java.io.BufferedReader; 13 11 import java.io.File; … … 17 15 import java.io.OutputStreamWriter; 18 16 import java.io.Writer; 19 import java.awt.Color;20 import java.awt.Dimension;21 import java.awt.Graphics2D;22 import java.awt.Rectangle;23 import java.awt.geom.Point2D;24 import java.awt.image.BufferedImage;25 17 26 18 import javax.imageio.ImageIO; 27 19 20 import org.apache.batik.dom.GenericDOMImplementation; 28 21 import org.apache.batik.svggen.SVGGraphics2D; 29 22 import org.apache.batik.svggen.SVGGraphics2DIOException; 30 import org. apache.batik.dom.GenericDOMImplementation;23 import org.w3c.dom.DOMImplementation; 31 24 import org.w3c.dom.Document; 32 import org.w3c.dom.DOMImplementation; 33 25 26 import render.ChartContext; 27 import render.Renderer; 34 28 import s57.S57map; 35 import s57.S57map.*; 36 import render.*; 37 38 public class Jicons { 39 29 import s57.S57map.Feature; 30 import s57.S57map.Snode; 31 32 /** 33 * @author Malcolm Herring 34 */ 35 public final class Jicons { 36 private Jicons() { 37 // Hide default constructor for utilities classes 38 } 39 40 40 static int x = 0; 41 41 static int y = 0; … … 58 58 boolean inIcons = false; 59 59 boolean inIcon = false; 60 60 61 61 if (args.length < 2) { 62 62 System.err.println("Usage: java -jar jicons.jar icon_definition_file icons_directory"); … … 64 64 } 65 65 in = new BufferedReader(new FileReader(args[0])); 66 66 67 67 context = new Context(); 68 68 String ln; … … 188 188 System.exit(0); 189 189 } 190 190 191 191 static class Context implements ChartContext { 192 192 193 @Override 193 194 public Point2D getPoint(Snode coord) { 194 195 return new Point2D.Double(x, y); 195 196 } 196 197 198 @Override 197 199 public double mile(Feature feature) { 198 200 return Math.min(w, h); 199 201 } 200 202 203 @Override 201 204 public boolean clip() { 202 205 return false; 203 206 } 204 207 208 @Override 205 209 public Color background(S57map map) { 206 210 return new Color(0, true); 207 211 } 208 212 213 @Override 209 214 public RuleSet ruleset() { 210 215 return RuleSet.ALL;
Note:
See TracChangeset
for help on using the changeset viewer.