Ignore:
Timestamp:
2013-01-20T11:51:05+01:00 (13 years ago)
Author:
malcolmh
Message:

save

Location:
applications/editors/josm/plugins/smed2/src/seamap
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed2/src/seamap/Renderer.java

    r29205 r29206  
    100100                ArrayList<Long> way;
    101101                if (map.mpolys.containsKey(feature.refs)) {
    102                         way = map.ways.get(map.mpolys.get(feature.refs));
     102                        way = map.ways.get(map.mpolys.get(feature.refs).get(0));
    103103                } else {
    104104                        way = map.ways.get(feature.refs);
     
    107107                case NODE:
    108108                        return map.nodes.get(feature.refs);
    109                 case WAY:
     109                case LINE:
    110110                        coord = map.nodes.get(way.get(1));
    111111                        break;
     
    152152                                }
    153153                                if (item.type == Prim.SYMB) {
    154                                         ssymb = (Symbol) item.params;
     154                                        ssymb = ((SubSymbol)item.params).instr;
    155155                                        break;
    156156                                }
     
    293293        public static void labelText (Feature feature, String str, Font font, Color colour, Delta delta) {
    294294                Symbol label = new Symbol();
    295                 label.add(new Instr(Prim.TEXT, new Caption(str, font, colour
    296                                 , delta)));
     295                label.add(new Instr(Prim.TEXT, new Caption(str, font, colour, (delta == null) ? new Delta(Handle.CC, null) : delta)));
    297296                Point2D point = helper.getPoint(findCentroid(feature));
    298                 Symbols.drawSymbol(g2, label, tScale, point.getX(), point.getY(), delta, null);
     297                Symbols.drawSymbol(g2, label, tScale, point.getX(), point.getY(), null, null);
    299298        }
    300299       
  • applications/editors/josm/plugins/smed2/src/seamap/Rules.java

    r29204 r29206  
    195195                                Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 }, null));
    196196                        if ((zoom >= 12) && (name != null))
    197                                 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.PLAIN, 100), Color.black, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 0)));
     197                                Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.PLAIN, 100), Color.black, null);
    198198                        break;
    199199                case RESARE:
     
    291291        }
    292292        private static void harbours(Feature feature) {
    293         }
     293                AttItem name = feature.atts.get(Att.OBJNAM);
     294                switch (feature.type) {
     295                case ACHARE:
     296                        if (zoom >= 12) {
     297                                Renderer.symbol(feature, Harbours.Anchorage, null, null);
     298                                Renderer.lineSymbols(feature, Areas.Restricted, 1.0, Areas.LineAnchor, 10);
     299                                if ((zoom >= 15) && ((name) != null)) {
     300                                        Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 80), new Color(0x80c480ff), null);
     301                                }
     302                        }
     303                        break;
     304                }
     305        }
     306        /*
     307         *   if ((zoom >= 12) && is_type("anchorage")) {
     308    symbol("anchorage");
     309    if ((zoom >= 15) && (has_item_attribute("name")))
     310      text(item_attribute("name"), "font-family:Arial; font-weight:bold; font-size:80; text-anchor:middle", 0, -90);
     311    if ((zoom >= 12) && (is_area)) line_symbols("restricted_line", 0.5, "line_anchor", 10);
     312  }
     313  if ((zoom >= 16) && is_type("anchor_berth")) symbol("anchor_berth");
     314  if ((zoom >= 12) && is_type("harbour")) {
     315    if (has_attribute("category")) {
     316      attribute_switch("category")
     317      attribute_case("marina|yacht") symbol("marina");
     318      attribute_case("marina_no_facilities") symbol("marina_nf");
     319      attribute_default symbol("harbour");
     320      end_switch
     321    } else symbol("harbour");
     322    if ((zoom >= 15) && (has_item_attribute("name")))
     323      text(item_attribute("name"), "font-family:Arial; font-weight:bold; font-size:80; text-anchor:middle", 0, -90);
     324  }
     325
     326         */
    294327        private static void locks(Feature feature) {
    295328        }
  • applications/editors/josm/plugins/smed2/src/seamap/SeaMap.java

    r29202 r29206  
    2424
    2525        public enum Fflag {
    26                 UNKN, NODE, WAY, AREA
     26                UNKN, NODE, LINE, AREA
    2727        }
    2828
     
    147147                feature = new Feature();
    148148                feature.refs = id;
    149                 feature.flag = Fflag.WAY;
     149                feature.flag = Fflag.LINE;
    150150        }
    151151
     
    172172
    173173        public void tagsDone(long id) {
    174                 if ((feature.type != Obj.UNKOBJ) && !((feature.flag == Fflag.WAY) && (list.size() < 2))) {
     174                if ((feature.type != Obj.UNKOBJ) && !((feature.flag == Fflag.LINE) && (list.size() < 2))) {
    175175                        index.put(id, feature);
    176                         if ((feature.flag == Fflag.WAY) && (list.size() > 0) && (list.get(0).equals(list.get(list.size() - 1)))) {
     176                        if ((feature.flag == Fflag.LINE) && (list.size() > 0) && (list.get(0).equals(list.get(list.size() - 1)))) {
    177177                                feature.flag = Fflag.AREA;
    178178                        }
Note: See TracChangeset for help on using the changeset viewer.