Changeset 29126 in osm for applications


Ignore:
Timestamp:
2012-12-26T19:31:12+01:00 (12 years ago)
Author:
malcolmh
Message:

save

Location:
applications/editors/josm/plugins/smed2/src/symbols
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed2/src/symbols/Areas.java

    r29109 r29126  
    1010package symbols;
    1111
     12import java.awt.BasicStroke;
     13import java.awt.Color;
     14import java.awt.Rectangle;
     15import java.awt.geom.*;
    1216import java.util.ArrayList;
    1317
    14 import symbols.Symbols.Instr;
     18import symbols.Symbols.*;
    1519
    1620public class Areas {
    1721        public static final ArrayList<Instr> Cable = new ArrayList<Instr>();
     22        static {
     23                Cable.add(new Instr(Prim.STRK, new BasicStroke(8.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND)));
     24                Cable.add(new Instr(Prim.FILL, new Color(0xc480ff)));
     25                Path2D.Double p = new Path2D.Double(); p.moveTo(0,0); p.curveTo(-13,-13,-13,-17,0,-30); p.curveTo(13,-43,13,-47,0,-60);
     26                Cable.add(new Instr(Prim.PLIN, p));
     27        }
    1828        public static final ArrayList<Instr> LaneArrow = new ArrayList<Instr>();
     29        static {
     30                LaneArrow.add(new Instr(Prim.STRK, new BasicStroke(10.0f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_MITER)));
     31                LaneArrow.add(new Instr(Prim.FILL, new Color(0x80c480ff, true)));
     32                Path2D.Double p = new Path2D.Double(); p.moveTo(15,0); p.lineTo(15,-195); p.lineTo(40,-195);
     33                p.lineTo(0,-240); p.lineTo(-40,-195); p.lineTo(-15,-195); p.lineTo(-15,0); p.closePath();
     34                LaneArrow.add(new Instr(Prim.PLIN, p));
     35        }
    1936        public static final ArrayList<Instr> LineAnchor = new ArrayList<Instr>();
     37        static {
     38                LineAnchor.add(new Instr(Prim.FILL, new Color(0xc480ff)));
     39                LineAnchor.add(new Instr(Prim.SYMB, new Symbols.Symbol(Harbours.Anchor, 0.5, 0, 0, new Delta(Handle.TC, AffineTransform.getRotateInstance(Math.toRadians(-90.0))), null)));
     40        }
    2041        public static final ArrayList<Instr> LinePlane = new ArrayList<Instr>();
    2142        public static final ArrayList<Instr> MarineFarm = new ArrayList<Instr>();
  • applications/editors/josm/plugins/smed2/src/symbols/Harbours.java

    r29120 r29126  
    1212import java.awt.BasicStroke;
    1313import java.awt.Color;
     14import java.awt.Rectangle;
    1415import java.awt.geom.Arc2D;
    1516import java.awt.geom.Ellipse2D;
     
    2526        public static final ArrayList<Instr> Anchor = new ArrayList<Instr>();
    2627        static {
     28                Anchor.add(new Instr(Prim.BBOX, new Rectangle(-60,-60,120,120)));
    2729                Anchor.add(new Instr(Prim.STRK, new BasicStroke(4.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
    2830                Anchor.add(new Instr(Prim.ELPS, new Ellipse2D.Double(-10,-59,20,20)));
  • applications/editors/josm/plugins/smed2/src/symbols/Symbols.java

    r29123 r29126  
    119119                                double dy = 0.0;
    120120                                if (dd != null) {
     121                                        g2.transform(dd.t);
    121122                                        switch (dd.h) {
    122123                                        case CC:
    123124                                                dx = bbox.x + (bbox.width / 2.0);
    124                                                 dy = bbox.y - (bbox.height / 2.0);
     125                                                dy = bbox.y + (bbox.height / 2.0);
    125126                                                break;
    126127                                        case TL:
     
    138139                                        case LC:
    139140                                                dx = bbox.x;
    140                                                 dy = bbox.y - (bbox.height / 2.0);
     141                                                dy = bbox.y + (bbox.height / 2.0);
    141142                                                break;
    142143                                        case RC:
    143144                                                dx = bbox.x + bbox.width;
    144                                                 dy = bbox.y - (bbox.height / 2.0);
     145                                                dy = bbox.y + (bbox.height / 2.0);
    145146                                                break;
    146147                                        case BL:
    147148                                                dx = bbox.x;
    148                                                 dy = bbox.y - bbox.height;
     149                                                dy = bbox.y + bbox.height;
    149150                                                break;
    150151                                        case BR:
    151152                                                dx = bbox.x + bbox.width;
    152                                                 dy = bbox.y - bbox.height;
     153                                                dy = bbox.y + bbox.height;
    153154                                                break;
    154155                                        case BC:
    155156                                                dx = bbox.x + (bbox.width / 2.0);
    156                                                 dy = bbox.y - bbox.height;
     157                                                dy = bbox.y + bbox.height;
    157158                                                break;
    158159                                        }
    159                                         g2.translate(dx, dy);
    160                                         g2.transform(dd.t);
     160                                        g2.translate(-dx, -dy);
    161161                                }
    162162                                break;
  • applications/editors/josm/plugins/smed2/src/symbols/Topmarks.java

    r29111 r29126  
    2828        public static final ArrayList<Instr> TopBoard = new ArrayList<Instr>();
    2929        static {
    30                 TopBoard.add(new Instr(Prim.BBOX, new Rectangle(-20,80,40,80)));
     30                TopBoard.add(new Instr(Prim.BBOX, new Rectangle(-20,-80,40,80)));
    3131                ArrayList<Instr> colours = new ArrayList<Instr>();
    3232                Path2D.Double p = new Path2D.Double(); p.moveTo(-19.0,-2.0); p.lineTo(-19.0,-39.0); p.lineTo(19.0,-39.0); p.lineTo(19.0,-2.0); p.closePath();
     
    4040        public static final ArrayList<Instr> TopCan = new ArrayList<Instr>();
    4141        static {
    42                 TopCan.add(new Instr(Prim.BBOX, new Rectangle(-20,80,40,80)));
     42                TopCan.add(new Instr(Prim.BBOX, new Rectangle(-20,-80,40,80)));
    4343                ArrayList<Instr> colours = new ArrayList<Instr>();
    4444                Path2D.Double p = new Path2D.Double(); p.moveTo(-12.0,-15.0); p.lineTo(-12.0,-48.0); p.lineTo(12.0,-48.0); p.lineTo(12.0,-15.0); p.closePath();
     
    5353        public static final ArrayList<Instr> TopCone = new ArrayList<Instr>();
    5454        static {
    55                 TopCone.add(new Instr(Prim.BBOX, new Rectangle(-20,80,40,80)));
     55                TopCone.add(new Instr(Prim.BBOX, new Rectangle(-20,-80,40,80)));
    5656                ArrayList<Instr> colours = new ArrayList<Instr>();
    5757                Path2D.Double p = new Path2D.Double(); p.moveTo(-15.0,-15.0); p.lineTo(0.0,-45.0); p.lineTo(15.0,-15.0); p.closePath();
     
    6666        public static final ArrayList<Instr> TopCross = new ArrayList<Instr>();
    6767        static {
    68                 TopCross.add(new Instr(Prim.BBOX, new Rectangle(-30,80,60,80)));
     68                TopCross.add(new Instr(Prim.BBOX, new Rectangle(-30,-80,60,80)));
    6969                ArrayList<Instr> colours = new ArrayList<Instr>();
    7070                Path2D.Double p = new Path2D.Double(); p.moveTo(-5.0,-15.0); p.lineTo(-5.0,-32.5); p.lineTo(-22.5,-32.5);       p.lineTo(-22.5,-42.5); p.lineTo(-5.0,-42.5);
     
    8282        public static final ArrayList<Instr> TopEast = new ArrayList<Instr>();
    8383        static {
    84                 TopEast.add(new Instr(Prim.BBOX, new Rectangle(-30,80,60,80)));
     84                TopEast.add(new Instr(Prim.BBOX, new Rectangle(-30,-80,60,80)));
    8585                ArrayList<Instr> colours = new ArrayList<Instr>();
    8686                Path2D.Double p = new Path2D.Double(); p.moveTo(0.0,-80.0); p.lineTo(-15.0,-47.0); p.lineTo(15.0,-47.0); p.closePath();
     
    100100        public static final ArrayList<Instr> TopIsol = new ArrayList<Instr>();
    101101        static {
    102                 TopIsol.add(new Instr(Prim.BBOX, new Rectangle(-30,80,60,80)));
     102                TopIsol.add(new Instr(Prim.BBOX, new Rectangle(-30,-80,60,80)));
    103103                ArrayList<Instr> colours = new ArrayList<Instr>();
    104104                Path2D.Double p = new Path2D.Double(); p.moveTo(-13.0,-55.0); p.curveTo(-13.0, -72.3, 13.0, -72.3, 13.0,-55.0); p.curveTo(13.0, -37.7, -13.0, -37.7, -13.0,-55.0); p.closePath();
     
    116116        public static final ArrayList<Instr> TopMooring = new ArrayList<Instr>();
    117117        static {
    118                 TopMooring.add(new Instr(Prim.BBOX, new Rectangle(-30,80,60,80)));
     118                TopMooring.add(new Instr(Prim.BBOX, new Rectangle(-30,-80,60,80)));
    119119                TopMooring.add(new Instr(Prim.STRK, new BasicStroke(3.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER)));
    120120                TopMooring.add(new Instr(Prim.FILL, Color.black));
     
    124124        public static final ArrayList<Instr> TopNorth = new ArrayList<Instr>();
    125125        static {
    126                 TopNorth.add(new Instr(Prim.BBOX, new Rectangle(-30,80,60,80)));
     126                TopNorth.add(new Instr(Prim.BBOX, new Rectangle(-30,-80,60,80)));
    127127                ArrayList<Instr> colours = new ArrayList<Instr>();
    128128                Path2D.Double p = new Path2D.Double(); p.moveTo(0.0,-78.0); p.lineTo(-15.0,-45.0); p.lineTo(15.0,-45.0); p.closePath();
     
    141141        public static final ArrayList<Instr> TopSouth = new ArrayList<Instr>();
    142142        static {
    143                 TopSouth.add(new Instr(Prim.BBOX, new Rectangle(-30,80,60,80)));
     143                TopSouth.add(new Instr(Prim.BBOX, new Rectangle(-30,-80,60,80)));
    144144                ArrayList<Instr> colours = new ArrayList<Instr>();
    145145                Path2D.Double p = new Path2D.Double(); p.moveTo(-15.0,-78.0); p.lineTo(0.0,-45.0);  p.lineTo(15.0,-78.0); p.closePath();
     
    158158        public static final ArrayList<Instr> TopSphere = new ArrayList<Instr>();
    159159        static {
    160                 TopSphere.add(new Instr(Prim.BBOX, new Rectangle(-30,80,60,80)));
     160                TopSphere.add(new Instr(Prim.BBOX, new Rectangle(-30,-80,60,80)));
    161161                ArrayList<Instr> colours = new ArrayList<Instr>();
    162162                Path2D.Double p = new Path2D.Double(); p.moveTo(-14.0,-28.0); p.curveTo(-14.0,-46.7,14.0,-46.7,14.0,-28.0); p.curveTo(14.0,-9.3,-14.0,-9.3,-14.0,-28.0); p.closePath();
     
    171171        public static final ArrayList<Instr> TopSquare = new ArrayList<Instr>();
    172172        static {
    173                 TopSquare.add(new Instr(Prim.BBOX, new Rectangle(-20,80,40,80)));
     173                TopSquare.add(new Instr(Prim.BBOX, new Rectangle(-20,-80,40,80)));
    174174                ArrayList<Instr> colours = new ArrayList<Instr>();
    175175                Path2D.Double p = new Path2D.Double(); p.moveTo(-13.0,-1.0); p.lineTo(-13.0,-27.0); p.lineTo(13.0,-27.0); p.lineTo(13.0,-1.0); p.closePath();
     
    183183        public static final ArrayList<Instr> TopTriangle = new ArrayList<Instr>();
    184184        static {
    185                 TopTriangle.add(new Instr(Prim.BBOX, new Rectangle(-20,80,40,80)));
     185                TopTriangle.add(new Instr(Prim.BBOX, new Rectangle(-20,-80,40,80)));
    186186                ArrayList<Instr> colours = new ArrayList<Instr>();
    187187                Path2D.Double p = new Path2D.Double(); p.moveTo(-15.0,-1.0); p.lineTo(0.0,-29.0); p.lineTo(15.0,-1.0); p.closePath();
     
    195195        public static final ArrayList<Instr> TopWest = new ArrayList<Instr>();
    196196        static {
    197                 TopWest.add(new Instr(Prim.BBOX, new Rectangle(-30,80,60,80)));
     197                TopWest.add(new Instr(Prim.BBOX, new Rectangle(-30,-80,60,80)));
    198198                ArrayList<Instr> colours = new ArrayList<Instr>();
    199199                Path2D.Double p = new Path2D.Double(); p.moveTo(-15.0,-78.0); p.lineTo(0.0,-45.0);  p.lineTo(15.0,-78.0); p.closePath();
     
    212212        public static final ArrayList<Instr> TopX = new ArrayList<Instr>();
    213213        static {
    214                 TopX.add(new Instr(Prim.BBOX, new Rectangle(-30,80,60,80)));
     214                TopX.add(new Instr(Prim.BBOX, new Rectangle(-30,-80,60,80)));
    215215                ArrayList<Instr> colours = new ArrayList<Instr>();
    216216                Path2D.Double p = new Path2D.Double(); p.moveTo(0.0,-27.7); p.lineTo(-12.4,-15.7); p.lineTo(-19.3,-22.6); p.lineTo(-7.3,-35.0); p.lineTo(-19.3,-47.3);
Note: See TracChangeset for help on using the changeset viewer.