Ignore:
Timestamp:
2013-09-18T12:41:49+02:00 (12 years ago)
Author:
malcolmh
Message:

save

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

Legend:

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

    r29884 r29929  
    972972
    973973        public static final Symbol NoticeBnank = new Symbol();
     974        static {
     975                NoticeBnank.add(new Instr(Prim.BBOX, new Rectangle(-30,-30,60,60)));
     976                Symbol colours = new Symbol();
     977                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();
     978                colours.add(new Instr(Prim.P1, p));
     979                p = new Path2D.Double(); p.moveTo(0.0,-10.0); p.lineTo(-15.0,-43.0); p.lineTo(15.0,-43.0); p.closePath();
     980                colours.add(new Instr(Prim.P2, p));
     981                NoticeBnank.add(new Instr(Prim.COLR, colours));
     982        }
    974983        public static final Symbol NoticeBlmhr = new Symbol();
    975984        public static final Symbol NoticeBwral = new Symbol();
  • applications/editors/josm/plugins/smed2/src/symbols/Symbols.java

    r29286 r29929  
    1818import java.awt.geom.*;
    1919import java.util.ArrayList;
    20 import java.util.EnumMap;
    21 
    22 import s57.S57val.*;
    2320
    2421public class Symbols {
     
    2825        }
    2926
     27        public enum Patt {
     28                Z, H, V, D, B, S, C, X
     29        }
     30
    3031        public enum Handle {
    3132                CC, TL, TR, TC, LC, RC, BL, BR, BC
    32         }
    33 
    34         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,
    35                         0.0843, 0.0514, 0.0313, 0.0191, 0.0117, 0.007, 0.138 };
    36 
    37         public static final double textScale[] = { 256.0, 128.0, 64.0, 32.0, 16.0, 8.0, 4.0, 2.0, 1.0, 0.5556, 0.3086, 0.1714, 0.0953,
    38                         0.0529, 0.0294, 0.0163, 0.0091, 0.0050, 0.0028, 0.0163 };
    39 
    40         private static final EnumMap<ColCOL, Color> bodyColours = new EnumMap<ColCOL, Color>(ColCOL.class);
    41         static {
    42                 bodyColours.put(ColCOL.COL_UNK, new Color(0, true));
    43                 bodyColours.put(ColCOL.COL_WHT, new Color(0xffffff));
    44                 bodyColours.put(ColCOL.COL_BLK, new Color(0x000000));
    45                 bodyColours.put(ColCOL.COL_RED, new Color(0xd40000));
    46                 bodyColours.put(ColCOL.COL_GRN, new Color(0x00d400));
    47                 bodyColours.put(ColCOL.COL_BLU, Color.blue);
    48                 bodyColours.put(ColCOL.COL_YEL, new Color(0xffd400));
    49                 bodyColours.put(ColCOL.COL_GRY, Color.gray);
    50                 bodyColours.put(ColCOL.COL_BRN, new Color(0x8b4513));
    51                 bodyColours.put(ColCOL.COL_AMB, new Color(0xfbf00f));
    52                 bodyColours.put(ColCOL.COL_VIO, new Color(0xee82ee));
    53                 bodyColours.put(ColCOL.COL_ORG, Color.orange);
    54                 bodyColours.put(ColCOL.COL_MAG, new Color(0xf000f0));
    55                 bodyColours.put(ColCOL.COL_PNK, Color.pink);
    5633        }
    5734
     
    7754
    7855        public static class Scheme {
    79                 public ArrayList<ColPAT> pat;
    80                 public ArrayList<ColCOL> col;
    81 
    82                 public Scheme(ArrayList<ColPAT> ipat, ArrayList<ColCOL> icol) {
     56                public ArrayList<Patt> pat;
     57                public ArrayList<Color> col;
     58
     59                public Scheme(ArrayList<Patt> ipat, ArrayList<Color> icol) {
    8360                        pat = ipat;
    8461                        col = icol;
     
    205182                                                        case P1:
    206183                                                                if (cn > 0) {
    207                                                                         g2.setPaint(bodyColours.get(cs.col.get(0)));
     184                                                                        g2.setPaint(cs.col.get(0));
    208185                                                                        g2.fill((Path2D.Double) patch.params);
    209186                                                                }
     
    212189                                                                if (cn > 0) {
    213190                                                                        if (cn > 1) {
    214                                                                                 g2.setPaint(bodyColours.get(cs.col.get(1)));
     191                                                                                g2.setPaint(cs.col.get(1));
    215192                                                                        } else {
    216                                                                                 g2.setPaint(bodyColours.get(cs.col.get(0)));
     193                                                                                g2.setPaint(cs.col.get(0));
    217194                                                                        }
    218195                                                                        g2.fill((Path2D.Double) patch.params);
     
    220197                                                                break;
    221198                                                        case H2:
    222                                                                 if ((cn > 1) && (cs.pat.get(0) == ColPAT.PAT_HORI)) {
    223                                                                         g2.setPaint(bodyColours.get(cs.col.get(cs.col.size() - pn)));
     199                                                                if ((cn > 1) && (cs.pat.get(0) == Patt.H)) {
     200                                                                        g2.setPaint(cs.col.get(cs.col.size() - pn));
    224201                                                                        g2.fill((Path2D.Double) patch.params);
    225202                                                                }
    226203                                                                break;
    227204                                                        case H3:
    228                                                                 if ((cn == 3) && (cs.pat.get(0) == ColPAT.PAT_HORI)) {
    229                                                                         g2.setPaint(bodyColours.get(cs.col.get(1)));
     205                                                                if ((cn == 3) && (cs.pat.get(0) == Patt.H)) {
     206                                                                        g2.setPaint(cs.col.get(1));
    230207                                                                        g2.fill((Path2D.Double) patch.params);
    231208                                                                }
    232209                                                                break;
    233210                                                        case H4:
    234                                                                 if ((cn == 4) && (cs.pat.get(0) == ColPAT.PAT_HORI)) {
    235                                                                         g2.setPaint(bodyColours.get(cs.col.get(1)));
     211                                                                if ((cn == 4) && (cs.pat.get(0) == Patt.H)) {
     212                                                                        g2.setPaint(cs.col.get(1));
    236213                                                                        g2.fill((Path2D.Double) patch.params);
    237214                                                                }
    238215                                                                break;
    239216                                                        case H5:
    240                                                                 if ((cn == 4) && (cs.pat.get(0) == ColPAT.PAT_HORI)) {
    241                                                                         g2.setPaint(bodyColours.get(cs.col.get(2)));
     217                                                                if ((cn == 4) && (cs.pat.get(0) == Patt.H)) {
     218                                                                        g2.setPaint(cs.col.get(2));
    242219                                                                        g2.fill((Path2D.Double) patch.params);
    243220                                                                }
    244221                                                                break;
    245222                                                        case V2:
    246                                                                 if ((cn > 1) && (cs.pat.get(0) == ColPAT.PAT_VERT)) {
    247                                                                         g2.setPaint(bodyColours.get(cs.col.get(cs.col.size() - pn)));
     223                                                                if ((cn > 1) && (cs.pat.get(0) == Patt.V)) {
     224                                                                        g2.setPaint(cs.col.get(cs.col.size() - pn));
    248225                                                                        g2.fill((Path2D.Double) patch.params);
    249226                                                                }
Note: See TracChangeset for help on using the changeset viewer.