Changeset 30022 in osm for applications/editors
- Timestamp:
- 2013-10-13T19:17:33+02:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/smed2/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/smed2/src/panels/PanelMain.java
r30006 r30022 5 5 import java.awt.Color; 6 6 import java.awt.Dimension; 7 import java.awt.Graphics; 8 import java.awt.Graphics2D; 7 9 import java.awt.event.ActionListener; 10 import java.awt.image.BufferedImage; 11 import java.io.File; 8 12 import java.util.ArrayList; 9 13 import java.util.Iterator; 10 14 15 import javax.imageio.ImageIO; 11 16 import javax.swing.*; 12 17 … … 14 19 15 20 import org.openstreetmap.josm.Main; 21 import org.openstreetmap.josm.actions.search.SearchCompiler.Parent; 16 22 17 23 import s57.S57att.Att; 18 24 import s57.S57obj.Obj; 25 import seamap.Renderer; 19 26 import seamap.SeaMap.*; 20 27 import smed2.Smed2Action; 21 28 22 29 public class PanelMain extends JPanel { 23 24 /**25 *26 */27 30 private static final long serialVersionUID = 1L; 31 32 Smed2Action dlg; 33 BufferedImage img; 34 int w, h, z, f; 35 JTextField wt, ht, zt, ft; 28 36 public static JTextArea decode = null; 29 37 public static JTextField messageBar = null; … … 31 39 private ActionListener alSave = new ActionListener() { 32 40 public void actionPerformed(java.awt.event.ActionEvent e) { 41 dumpMap(); 33 42 } 34 43 }; … … 65 74 }; 66 75 67 public PanelMain( ) {68 76 public PanelMain(Smed2Action dia) { 77 dlg = dia; 69 78 setLayout(null); 70 79 setSize(new Dimension(480, 480)); 71 80 81 w = h = z = f = 0; 82 wt = new JTextField("0"); 83 wt.setBounds(10, 400, 40, 20); 84 add(wt); 85 ht = new JTextField("0"); 86 ht.setBounds(60, 400, 40, 20); 87 add(ht); 88 zt = new JTextField("0"); 89 zt.setBounds(110, 400, 40, 20); 90 add(zt); 91 ft = new JTextField("0"); 92 ft.setBounds(160, 400, 40, 20); 93 add(ft); 94 72 95 messageBar = new JTextField(); 73 96 messageBar.setBounds(70, 430, 290, 20); … … 92 115 decode.setBounds(0, 0, 480, 420); 93 116 decode.setTabSize(1); 94 add(decode); 117 // add(decode); 118 } 119 120 public void dumpMap() { 121 img = new BufferedImage(Integer.parseInt(wt.getText()), Integer.parseInt(ht.getText()), BufferedImage.TYPE_INT_ARGB); 122 Graphics2D g2 = img.createGraphics(); 123 Renderer.reRender(g2, Integer.parseInt(zt.getText()), Integer.parseInt(ft.getText()), dlg.map, dlg.rendering); 124 try { 125 ImageIO.write(img, "png", new File("/Users/mherring/Desktop/export.png")); 126 } catch (Exception x) { 127 System.out.println("Exception"); 128 } 129 repaint(); 130 } 131 132 public void paintComponent(Graphics g){ 133 super.paintComponent(g); 134 Graphics2D g2 = (Graphics2D) g; 135 g2.setBackground(new Color(0xb5d0d0)); 136 if (img != null) g2.clearRect(0, 0, img.getWidth(), img.getHeight()); 137 g2.drawImage(img, 0, 0, null);; 95 138 } 96 139 -
applications/editors/josm/plugins/smed2/src/seamap/Renderer.java
r30020 r30022 143 143 } 144 144 145 public static void lineSymbols(Feature feature, Symbol prisymb, double space, Symbol secsymb, int ratio ) {145 public static void lineSymbols(Feature feature, Symbol prisymb, double space, Symbol secsymb, int ratio, Color col) { 146 146 Area area; 147 147 switch (feature.flag) { … … 207 207 } 208 208 if (!gap) { 209 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); 209 Symbols.drawSymbol(g2, symbol, sScale, curr.getX(), curr.getY(), 210 new Delta(Handle.BC, AffineTransform.getRotateInstance(Math.atan2((succ.getY() - curr.getY()), (succ.getX() - curr.getX())) + Math.toRadians(90))), 211 new Scheme(col)); 210 212 } 211 213 if (space > 0) -
applications/editors/josm/plugins/smed2/src/seamap/Rules.java
r30020 r30022 140 140 case RESARE: 141 141 if (zoom >= 12) { 142 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, 0 );142 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, 0, new Color(0x80c480)); 143 143 // if ((CatREA)Renderer.getAttVal(feature, feature.type, 0, Att.CATREA) == CatREA.REA_NWAK) 144 144 // Renderer.symbol(feature, Areas.NoWake, Obj.RESARE, null); … … 199 199 if (zoom >= 12) { 200 200 Renderer.symbol(feature, Areas.Plane, Obj.SPLARE, null, null); 201 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, 10 );201 Renderer.lineSymbols(feature, Areas.Restricted, 0.5, Areas.LinePlane, 10, new Color(0x80c480)); 202 202 } 203 203 if ((zoom >= 15) && (name != null)) … … 268 268 if (zoom >= 14) { 269 269 if (feature.type == Obj.CBLSUB) { 270 Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, 0 );270 Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, 0, new Color(0x80c480)); 271 271 } else if (feature.type == Obj.CBLOHD) { 272 272 … … 311 311 case ACHARE: 312 312 if (zoom >= 12) { 313 if (feature.flag != Fflag.LINE) 314 Renderer.symbol(feature, Harbours.Anchorage, null, null, null); 315 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, 10); 313 if (feature.flag != Fflag.AREA) { 314 Renderer.symbol(feature, Harbours.Anchorage, null, null, new Scheme(Color.black)); 315 } else { 316 Renderer.symbol(feature, Harbours.Anchorage, null, null, new Scheme(new Color(0xc480ff))); 317 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, 10, new Color(0xc480ff)); 318 } 316 319 if ((zoom >= 15) && ((name) != null)) { 317 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), new Color(0x 80c480ff), null);320 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), new Color(0xc480ff), new Delta(Handle.BC, AffineTransform.getTranslateInstance(160, 0))); 318 321 } 319 322 } … … 705 708 if (zoom >= 14) { 706 709 if (feature.type == Obj.PIPSOL) { 707 Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, 0 );710 Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, 0, new Color(0x80c480)); 708 711 } else if (feature.type == Obj.PIPOHD) { 709 712 … … 748 751 case TSSRON: 749 752 if (zoom <= 15) 750 Renderer.lineVector(feature, new LineStyle(null, 0, null, new Color(0x80c480 ff, true)));753 Renderer.lineVector(feature, new LineStyle(null, 0, null, new Color(0x80c48080, true))); 751 754 else 752 Renderer.lineVector(feature, new LineStyle(new Color(0x80c480 ff, true), 20, null, null));755 Renderer.lineVector(feature, new LineStyle(new Color(0x80c48080, true), 20, null, null)); 753 756 AttItem name = feature.atts.get(Att.OBJNAM); 754 757 if ((zoom >= 10) && (name != null)) 755 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 150), new Color(0x80c480 ff), null);758 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 150), new Color(0x80c48080), null); 756 759 break; 757 760 case TSELNE: 758 Renderer.lineVector(feature, new LineStyle(new Color(0x80c480 ff, true), 20, null, null));761 Renderer.lineVector(feature, new LineStyle(new Color(0x80c48080, true), 20, null, null)); 759 762 break; 760 763 case TSSLPT: 761 Renderer.lineSymbols(feature, Areas.LaneArrow, 0.5, null, 0 );764 Renderer.lineSymbols(feature, Areas.LaneArrow, 0.5, null, 0, new Color(0x80c48080, true)); 762 765 break; 763 766 case TSSBND: 764 Renderer.lineVector(feature, new LineStyle(new Color(0x80c480 ff, true), 20, new float[] { 40, 40 }, null));767 Renderer.lineVector(feature, new LineStyle(new Color(0x80c48080, true), 20, new float[] { 40, 40 }, null)); 765 768 break; 766 769 case ISTZNE: 767 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, 0 );770 Renderer.lineSymbols(feature, Areas.Restricted, 1.0, null, 0, new Color(0x80c48080, true)); 768 771 break; 769 772 } -
applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java
r30021 r30022 12 12 import java.awt.*; 13 13 import java.awt.event.*; 14 import java.awt.image.BufferedImage; 15 import java.io.File; 14 16 import java.util.*; 15 17 import java.util.Map.Entry; 16 18 19 import javax.imageio.ImageIO; 17 20 import javax.swing.*; 18 21 … … 30 33 31 34 import s57.S57dat; 35 import seamap.Renderer; 32 36 import seamap.SeaMap; 33 37 import seamap.SeaMap.*; … … 37 41 38 42 public class Smed2Action extends JosmAction implements EditLayerChangeListener, SelectionChangedListener { 39 40 43 private static final long serialVersionUID = 1L; 44 41 45 private static String editor = tr("SeaMap Editor"); 42 46 public static JFrame editFrame = null; … … 122 126 editFrame.setAlwaysOnTop(true); 123 127 editFrame.setVisible(true); 124 panelMain = new PanelMain( );128 panelMain = new PanelMain(this); 125 129 editFrame.add(panelMain); 126 130 panelS57 = new S57dat(); -
applications/editors/josm/plugins/smed2/src/symbols/Areas.java
r30020 r30022 20 20 static { 21 21 Plane.add(new Instr(Prim.BBOX, new Rectangle(-60,-60,120,120))); 22 Plane.add(new Instr(Prim.FILL, new Color(0xa30075))); 22 23 Path2D.Double p = new Path2D.Double(); p.moveTo(40,20); p.lineTo(50,10); p.lineTo(27.0,13.3); p.lineTo(23.7,6.8); p.lineTo(40.0,5.0); p.curveTo(55,4,55,-9,40,-10); 23 24 p.quadTo(31,-11,30,-15); p.lineTo(-30,2); p.quadTo(-35,-12,-45,-15); p.quadTo(-56,-3,-50,15); p.lineTo(18.4,7.3); p.lineTo(21.7,14); p.lineTo(-20,20); p.closePath(); … … 44 45 static { 45 46 LineAnchor.add(new Instr(Prim.BBOX, new Rectangle(-30,-60,60,90))); 46 LineAnchor.add(new Instr(Prim.FILL, new Color(0xc480ff)));47 47 LineAnchor.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 0.5, 0, 0, new Delta(Handle.CC, AffineTransform.getRotateInstance(Math.toRadians(-90.0))), null))); 48 48 } … … 55 55 static { 56 56 MarineFarm.add(new Instr(Prim.STRK, new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND))); 57 MarineFarm.add(new Instr(Prim.FILL, Color.black));58 57 Path2D.Double p = new Path2D.Double(); p.moveTo(-23,12); p.lineTo(-23,23); p.lineTo(23,23); p.lineTo(23,12); p.moveTo(-8,15); p.lineTo(-8,23); p.moveTo(8,15); p.lineTo(8,23); 59 58 p.moveTo(-23,-12); p.lineTo(-23,-23); p.lineTo(23,-23); p.lineTo(23,-12); p.moveTo(-8,-15); p.lineTo(-8,-23); p.moveTo(8,-15); p.lineTo(8,-23); … … 84 83 Restricted.add(new Instr(Prim.BBOX, new Rectangle(-15,-30,30,30))); 85 84 Restricted.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND))); 86 Restricted.add(new Instr(Prim.FILL, new Color(0xc480ff)));87 85 Restricted.add(new Instr(Prim.LINE, new Line2D.Double(0,0,0,-30))); 88 86 Restricted.add(new Instr(Prim.LINE, new Line2D.Double(0,-15,17,-15))); … … 136 134 static { 137 135 WindFarm.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 138 WindFarm.add(new Instr(Prim.FILL, Color.black));139 136 WindFarm.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-100,-100,200,200))); 140 137 WindFarm.add(new Instr(Prim.LINE, new Line2D.Double(-35,50,35,50))); … … 160 157 static { 161 158 WreckND.add(new Instr(Prim.STRK, new BasicStroke(5, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 162 WreckND.add(new Instr(Prim.FILL, Color.black));163 159 WreckND.add(new Instr(Prim.LINE, new Line2D.Double(-40,0,40,0))); 164 160 WreckND.add(new Instr(Prim.LINE, new Line2D.Double(0,-30,0,30))); … … 169 165 static { 170 166 WreckS.add(new Instr(Prim.STRK, new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 171 WreckS.add(new Instr(Prim.FILL, Color.black));172 167 WreckS.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-6,-6,12,12))); 173 168 WreckS.add(new Instr(Prim.LINE, new Line2D.Double(-40,0,-6,0))); -
applications/editors/josm/plugins/smed2/src/symbols/Harbours.java
r29789 r30022 31 31 public static final Symbol Anchorage = new Symbol(); 32 32 static { 33 Anchorage.add(new Instr(Prim.FILL, new Color(0xa30075)));34 33 Anchorage.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 1.0, 0, 0, null, null))); 35 34 } … … 67 66 static { 68 67 ContainerCrane.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 69 ContainerCrane.add(new Instr(Prim.FILL, Color.black));70 68 ContainerCrane.add(new Instr(Prim.RSHP, new Rectangle2D.Double(-15,-65,30,100))); 71 69 ContainerCrane.add(new Instr(Prim.RECT, new Rectangle2D.Double(-40,-12.5,80,25))); 72 70 } 71 public static final Symbol Customs = new Symbol(); 72 static { 73 Customs.add(new Instr(Prim.BBOX, new Rectangle(-30,-30,60,60))); 74 Customs.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER))); 75 Customs.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-28,-28,56,56))); 76 Customs.add(new Instr(Prim.LINE, new Line2D.Double(-25,5,25,5))); 77 Customs.add(new Instr(Prim.LINE, new Line2D.Double(-25,-5,25,-5))); 78 } 73 79 public static final Symbol DeviationDolphin = new Symbol(); 74 80 static { 75 81 DeviationDolphin.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 76 DeviationDolphin.add(new Instr(Prim.FILL, Color.black));77 82 Path2D.Double p = new Path2D.Double(); p.moveTo(-30.0,0.0); p.lineTo(30.0,0.0); p.moveTo(0.0,0.0); p.lineTo(0.0,-40.0); 78 83 p.moveTo(-20.0,0.0); p.lineTo(-15.0,-32.0); p.lineTo(15.0,-32.0); p.lineTo(20.0,0.0); … … 82 87 static { 83 88 DistanceI.add(new Instr(Prim.STRK, new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 84 DistanceI.add(new Instr(Prim.FILL, Color.black));85 89 DistanceI.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-11,-11,22,22))); 86 90 } … … 101 105 Dolphin.add(new Instr(Prim.PLIN, p)); 102 106 } 107 public static final Symbol Explosives = new Symbol(); 108 static { 109 Explosives.add(new Instr(Prim.BBOX, new Rectangle(-30,-30,60,60))); 110 Explosives.add(new Instr(Prim.FILL, new Color(0xa30075))); 111 Explosives.add(new Instr(Prim.RSHP, new Ellipse2D.Double(-5,25,10,10))); 112 Explosives.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND))); 113 Path2D.Double p = new Path2D.Double(); p.moveTo(-10,20); p.lineTo(-13,17); p.lineTo(-13,8); 114 p.moveTo(0,10); p.lineTo(0,0); p.lineTo(-8,-10); 115 p.moveTo(10,17); p.lineTo(18,-10); p.lineTo(10,-20); 116 Explosives.add(new Instr(Prim.PLIN, p)); 117 } 103 118 public static final Symbol Harbour = new Symbol(); 104 119 static { … … 111 126 static { 112 127 HarbourMaster.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 113 HarbourMaster.add(new Instr(Prim.FILL, Color.black));114 128 HarbourMaster.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-35,-50,70,100))); 115 129 HarbourMaster.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Harbours.Anchor, 0.6, 0, 0, null, null))); 130 } 131 public static final Symbol Hospital = new Symbol(); 132 static { 133 Hospital.add(new Instr(Prim.BBOX, new Rectangle(-30,-30,60,60))); 134 Hospital.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER))); 135 Hospital.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-28,-28,56,56))); 136 Path2D.Double p = new Path2D.Double(); p.moveTo(-26,-5); p.lineTo(-5,-5); p.lineTo(-5,-25); p.moveTo(5,-25); p.lineTo(5,-5); p.lineTo(25,-5); 137 p.moveTo(-25,5); p.lineTo(-5,5); p.lineTo(-5,25); p.moveTo(5,25); p.lineTo(5,5); p.lineTo(25,5); 138 Hospital.add(new Instr(Prim.PLIN, p)); 116 139 } 117 140 public static final Symbol LandingSteps = new Symbol(); … … 148 171 static { 149 172 PortCrane.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 150 PortCrane.add(new Instr(Prim.FILL, Color.black));151 173 PortCrane.add(new Instr(Prim.EARC, new Arc2D.Double(-36.0,-36.0,72.0,72.0,70.0,-320.0,Arc2D.OPEN))); 152 174 PortCrane.add(new Instr(Prim.LINE, new Line2D.Double(0,0,0,-60))); … … 154 176 public static final Symbol Post = new Symbol(); 155 177 static { 156 Post.add(new Instr(Prim.FILL, Color.black));157 178 Post.add(new Instr(Prim.RSHP, new Ellipse2D.Double(-10,-10,20,20))); 158 179 } … … 160 181 static{ 161 182 Rescue.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 162 Rescue.add(new Instr(Prim.FILL, Color.black));163 183 Path2D.Double p = new Path2D.Double(); p.moveTo(-11,0); p.lineTo(0,-43); p.lineTo(11,0); p.lineTo(0,43); p.closePath(); 164 184 Rescue.add(new Instr(Prim.PGON, p)); … … 168 188 static { 169 189 SignalStation.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 170 SignalStation.add(new Instr(Prim.FILL, Color.black));171 190 SignalStation.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-25,-25,50,50))); 172 191 SignalStation.add(new Instr(Prim.RSHP, new Ellipse2D.Double(-4,-4,8,8))); … … 175 194 static { 176 195 TideGauge.add(new Instr(Prim.STRK, new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 177 TideGauge.add(new Instr(Prim.FILL, Color.black));178 196 TideGauge.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-10,-10,20,20))); 179 197 TideGauge.add(new Instr(Prim.LINE, new Line2D.Double(-10,0,-30,0))); -
applications/editors/josm/plugins/smed2/src/symbols/Landmarks.java
r29198 r30022 27 27 static { 28 28 Base.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 29 Base.add(new Instr(Prim.FILL, Color.black));30 29 Base.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-10,-10,20,20))); 31 30 Base.add(new Instr(Prim.LINE, new Line2D.Double(-35,0,-10,0))); … … 37 36 Chimney.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null))); 38 37 Chimney.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 39 Chimney.add(new Instr(Prim.FILL, Color.black));40 38 Path2D.Double p = new Path2D.Double(); p.moveTo(-25.0,0.0); p.lineTo(-10.0,-120.0); p.lineTo(10.0,-120.0); p.lineTo(25.0,0.0); 41 39 p.moveTo(-10.0,-128.0); p.curveTo(-13.0,-147.0,15.0,-159.0,20.0,-148.0); … … 46 44 public static final Symbol Church = new Symbol(); 47 45 static { 48 Church.add(new Instr(Prim.FILL, Color.black));49 46 Path2D.Double p = new Path2D.Double(); p.moveTo(10.0,-10.0); p.lineTo(37.0,-10.0); p.quadTo(48.0,-10.0,48.0,-21.0); p.lineTo(50.0,-21.0); p.lineTo(50.0,21.0); 50 47 p.lineTo(48.0,21.0); p.quadTo(48.0,10.0,37.0,10.0); p.lineTo(10.0,10.0); p.lineTo(10.0,37.0); p.quadTo(10.0,48.0,21.0,48.0); p.lineTo(21.0,50.0); … … 57 54 static { 58 55 ChurchTower.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 59 ChurchTower.add(new Instr(Prim.FILL, Color.black));60 56 ChurchTower.add(new Instr(Prim.RECT, new Rectangle2D.Double(-36,-36,72,72))); 61 57 ChurchTower.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-2,-2,4,4))); … … 65 61 Cross.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null))); 66 62 Cross.add(new Instr(Prim.STRK, new BasicStroke(6, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 67 Cross.add(new Instr(Prim.FILL, Color.black));68 63 Cross.add(new Instr(Prim.LINE, new Line2D.Double(0,-10,0,-150))); 69 64 Cross.add(new Instr(Prim.LINE, new Line2D.Double(-30,-115,30,-115))); … … 73 68 DishAerial.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null))); 74 69 DishAerial.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL))); 75 DishAerial.add(new Instr(Prim.FILL, Color.black));76 70 Path2D.Double p = new Path2D.Double(); p.moveTo(-7.8,-6.0); p.lineTo(0.0,-62.0); p.lineTo(7.8,-6.0); p.moveTo(18.0,-109.0); p.lineTo(25.0,-113.0); 77 71 p.moveTo(-9.5,-157.0); p.curveTo(-60.7,-125.5,-16.5,-33.9,44.9,-61.7); p.closePath(); … … 81 75 static { 82 76 Dome.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 83 Dome.add(new Instr(Prim.FILL, Color.black));84 77 Dome.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-36,-36,72,72))); 85 78 Dome.add(new Instr(Prim.RSHP, new Ellipse2D.Double(-4,-4,8,8))); … … 89 82 Flagstaff.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null))); 90 83 Flagstaff.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 91 Flagstaff.add(new Instr(Prim.FILL, Color.black));92 84 Path2D.Double p = new Path2D.Double(); p.moveTo(0.0,-10.0); p.lineTo(0.0,-150.0); p.moveTo(0.0,-140.0); p.lineTo(40.0,-140.0); p.lineTo(40.0,-100.0); p.lineTo(0.0,-100.0); 93 85 Flagstaff.add(new Instr(Prim.PLIN, p)); … … 97 89 FlareStack.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null))); 98 90 FlareStack.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 99 FlareStack.add(new Instr(Prim.FILL, Color.black));100 91 Path2D.Double p = new Path2D.Double(); p.moveTo(-7.8,-6.0); p.lineTo(-7.8,-100.0); p.lineTo(7.8,-100.0); p.lineTo(7.8,-6.0); 101 92 FlareStack.add(new Instr(Prim.PLIN, p)); … … 108 99 LandTower.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null))); 109 100 LandTower.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 110 LandTower.add(new Instr(Prim.FILL, Color.black));111 101 LandTower.add(new Instr(Prim.LINE, new Line2D.Double(-25,0,-15,-120))); 112 102 LandTower.add(new Instr(Prim.LINE, new Line2D.Double(25,0,15,-120))); … … 117 107 Mast.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null))); 118 108 Mast.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL))); 119 Mast.add(new Instr(Prim.FILL, Color.black));120 109 Path2D.Double p = new Path2D.Double(); p.moveTo(-25.0,0.0); p.lineTo(0.0,-150.0); p.lineTo(25.0,0.0); 121 110 Mast.add(new Instr(Prim.PLIN, p)); … … 125 114 Monument.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null))); 126 115 Monument.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER))); 127 Monument.add(new Instr(Prim.FILL, Color.black));128 116 Monument.add(new Instr(Prim.LINE, new Line2D.Double(-25,0,-15,-105))); 129 117 Monument.add(new Instr(Prim.LINE, new Line2D.Double(25,0,15,-105))); … … 133 121 static { 134 122 Platform.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 135 Platform.add(new Instr(Prim.FILL, Color.black));136 123 Platform.add(new Instr(Prim.RECT, new Rectangle2D.Double(-48,-48,96,96))); 137 124 Platform.add(new Instr(Prim.RSHP, new Ellipse2D.Double(-4,-4,8,8))); … … 140 127 static { 141 128 RadioTV.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL))); 142 RadioTV.add(new Instr(Prim.FILL, Color.black));143 129 RadioTV.add(new Instr(Prim.EARC, new Arc2D.Double(-30.0,-180.0,60.0,60.0,45.0,-90.0,Arc2D.OPEN))); 144 130 RadioTV.add(new Instr(Prim.EARC, new Arc2D.Double(-45.0,-195.0,90.0,90.0,45.0,-90.0,Arc2D.OPEN))); … … 149 135 static { 150 136 Spire.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 151 Spire.add(new Instr(Prim.FILL, Color.black));152 137 Spire.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-25,-25,50,50))); 153 138 Spire.add(new Instr(Prim.RSHP, new Ellipse2D.Double(-4,-4,8,8))); … … 173 158 WaterTower.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null))); 174 159 WaterTower.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 175 WaterTower.add(new Instr(Prim.FILL, Color.black));176 160 WaterTower.add(new Instr(Prim.LINE, new Line2D.Double(-25,0,-15,-120))); 177 161 WaterTower.add(new Instr(Prim.LINE, new Line2D.Double(25,0,15,-120))); … … 182 166 WindMotor.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null))); 183 167 WindMotor.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER))); 184 WindMotor.add(new Instr(Prim.FILL, Color.black));185 168 WindMotor.add(new Instr(Prim.LINE, new Line2D.Double(0,-10,0,-90))); 186 169 WindMotor.add(new Instr(Prim.LINE, new Line2D.Double(0,-90,30,-90))); … … 191 174 static { 192 175 Windmill.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER))); 193 Windmill.add(new Instr(Prim.FILL, Color.black));194 176 Windmill.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-12,-12,24,24))); 195 177 Windmill.add(new Instr(Prim.LINE, new Line2D.Double(-30,-42,30,10))); … … 200 182 Windsock.add(new Instr(Prim.SYMB, new Symbols.SubSymbol(Landmarks.Base, 1.0, 0, 0, null, null))); 201 183 Windsock.add(new Instr(Prim.STRK, new BasicStroke(4, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER))); 202 Windsock.add(new Instr(Prim.FILL, Color.black));203 184 Windsock.add(new Instr(Prim.LINE, new Line2D.Double(0,-10,0,-100))); 204 185 Windsock.add(new Instr(Prim.STRK, new BasicStroke(8, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER))); -
applications/editors/josm/plugins/smed2/src/symbols/Symbols.java
r29929 r30022 61 61 col = icol; 62 62 } 63 public Scheme(Color icol) { 64 pat = new ArrayList<Patt>(); 65 col = new ArrayList<Color>(); 66 col.add(icol); 67 } 63 68 } 64 69 … … 119 124 int pn = 0; 120 125 int cn = 0; 126 g2.setPaint(Color.black); 121 127 if (cs != null) { 122 128 pn = cs.pat.size(); 123 129 cn = cs.col.size() - ((pn != 0) ? pn - 1 : 0); 130 if ((pn == 0) && (cs.col.size() == 1)) { 131 g2.setPaint(cs.col.get(0)); 132 } 124 133 } 125 134 AffineTransform savetr = g2.getTransform(); … … 262 271 case SYMB: 263 272 SubSymbol s = (SubSymbol) item.params; 264 drawSymbol(g2, s.instr, s.scale, s.x, s.y, s.delta, s.scheme);273 drawSymbol(g2, s.instr, s.scale, s.x, s.y, s.delta, (s.scheme != null ? s.scheme : cs)); 265 274 break; 266 275 case TEXT:
Note:
See TracChangeset
for help on using the changeset viewer.