Changeset 29286 in osm for applications/editors


Ignore:
Timestamp:
2013-02-26T15:13:39+01:00 (12 years ago)
Author:
malcolmh
Message:

save

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

Legend:

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

    r29275 r29286  
    101101        }
    102102       
    103         private static void shoreline(Feature feature) {
    104                 if (zoom >= 12) {
    105                         switch ((CatSLC) Renderer.getAttVal(feature, feature.type, 0, Att.CATSLC)) {
    106                         case SLC_TWAL:
    107                                 WatLEV lev = (WatLEV) Renderer.getAttVal(feature, feature.type, 0, Att.WATLEV);
    108                                 if (lev == WatLEV.LEV_CVRS) {
    109                                         Renderer.lineVector(feature, new LineStyle(Color.black, 10, new float[] { 40, 40 }, null));
    110                                         if (zoom >= 15)
    111                                                 Renderer.lineText(feature, "(covers)", new Font("Arial", Font.PLAIN, 80), 0.5, 20);
    112                                 } else {
    113                                         Renderer.lineVector(feature, new LineStyle(Color.black, 10, null, null));
    114                                 }
    115                                 if (zoom >= 15)
    116                                         Renderer.lineText(feature, "Training Wall", new Font("Arial", Font.PLAIN, 80), 0.5, -20);
    117                         }
    118                 }
    119         }
    120         private static void pipelines(Feature feature) {
    121                 if (zoom >= 14) {
    122                         if (feature.type == Obj.PIPSOL) {
    123                                 Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, 0);
    124                         } else if (feature.type == Obj.PIPOHD) {
    125 
    126                         }
    127                 }
    128         }
    129         private static void cables(Feature feature) {
    130                 if (zoom >= 14) {
    131                         if (feature.type == Obj.CBLSUB) {
    132                                 Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, 0);
    133                         } else if (feature.type == Obj.CBLOHD) {
    134 
    135                         }
    136                 }
    137         }
    138         private static void separation(Feature feature) {
    139                 switch (feature.type) {
    140                 case TSEZNE:
    141                 case TSSCRS:
    142                 case TSSRON:
    143                         if (zoom <= 15)
    144                                 Renderer.lineVector(feature, new LineStyle(null, 0, null, new Color(0x80c480ff, true)));
    145                         else
    146                                 Renderer.lineVector(feature, new LineStyle(new Color(0x80c480ff, true), 20, null, null));
    147                         AttItem name = feature.atts.get(Att.OBJNAM);
    148                         if ((zoom >= 10) && (name != null))
    149                                 Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 150), new Color(0x80c480ff), null);
    150                         break;
    151                 case TSELNE:
    152                         Renderer.lineVector(feature, new LineStyle(new Color(0x80c480ff, true), 20, null, null));
    153                         break;
    154                 case TSSLPT:
    155                         Renderer.lineSymbols(feature, Areas.LaneArrow, 0.5, null, 0);
    156                         break;
    157                 case TSSBND:
    158                         Renderer.lineVector(feature, new LineStyle(new Color(0x80c480ff, true), 20, new float[] { 40, 40 }, null));
    159                         break;
    160                 }
    161         }
    162103        private static void areas(Feature feature) {
    163104                AttItem name = feature.atts.get(Att.OBJNAM);
     
    264205 */
    265206        }
    266 
    267         private static void obstructions(Feature feature) {
    268                 if ((zoom >= 14) && (feature.type == Obj.UWTROC)) {
    269                         WatLEV lvl = (WatLEV) Renderer.getAttVal(feature, feature.type, 0, Att.WATLEV);
    270                         switch (lvl) {
    271                         case LEV_CVRS:
    272                                 Renderer.symbol(feature, Areas.RockC, null, null);
    273                                 break;
    274                         case LEV_AWSH:
    275                                 Renderer.symbol(feature, Areas.RockA, null, null);
     207        private static void beacons(Feature feature) {
     208                BcnSHP shape = (BcnSHP) Renderer.getAttVal(feature, feature.type, 0, Att.BCNSHP);
     209                if (((shape == BcnSHP.BCN_PRCH) || (shape == BcnSHP.BCN_WTHY)) && (feature.type == Obj.BCNLAT)) {
     210                        CatLAM cat = (CatLAM) Renderer.getAttVal(feature, feature.type, 0, Att.CATLAM);
     211                        switch (cat) {
     212                        case LAM_PORT:
     213                                if (shape == BcnSHP.BCN_PRCH)
     214                                        Renderer.symbol(feature, Beacons.PerchPort, null, null);
     215                                else
     216                                        Renderer.symbol(feature, Beacons.WithyPort, null, null);
     217                                break;
     218                        case LAM_STBD:
     219                                if (shape == BcnSHP.BCN_PRCH)
     220                                        Renderer.symbol(feature, Beacons.PerchStarboard, null, null);
     221                                else
     222                                        Renderer.symbol(feature, Beacons.WithyStarboard, null, null);
    276223                                break;
    277224                        default:
    278                                 Renderer.symbol(feature, Areas.Rock, null, null);
     225                                Renderer.symbol(feature, Beacons.Stake, feature.type, null);
    279226                        }
    280227                } else {
    281                         Renderer.symbol(feature, Areas.Rock, null, null);
    282                 }
    283         }
    284         private static void waterways(Feature feature) {
    285                 if ((zoom >= 14) && (feature.atts.get(Att.OBJNAM) != null)) {
    286                         // lineText(item_attribute("name"), "font-family:Arial;font-weight:bold;font-size:80;text-anchor:middle", 0.5, 15, line("stroke:none;fill:none"));
    287                 }
    288         }
    289         private static void transits(Feature feature) {
     228                        Renderer.symbol(feature, Beacons.Shapes.get(shape), feature.type, null);
     229                        if (feature.objs.get(Obj.TOPMAR) != null)
     230                                Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Beacons);
     231                }
     232        }
     233        private static void buoys(Feature feature) {
     234                BoySHP shape = (BoySHP) Renderer.getAttVal(feature, feature.type, 0, Att.BOYSHP);
     235                Renderer.symbol(feature, Buoys.Shapes.get(shape), feature.type, null);
     236                if (feature.objs.get(Obj.TOPMAR) != null) {
     237                        Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Buoys.get(shape));
     238                }
     239        }
     240        private static void bridges(Feature feature) {
     241                if (zoom >= 16) {
     242                       
     243                }
     244/*      Att_t *attv = getAtt(getObj(item, BRIDGE, 0), VERCLR);
     245      if (attv == NULL) attv = getAtt(getObj(item, BRIDGE, 0), VERCSA);
     246      Att_t *attc = getAtt(getObj(item, BRIDGE, 0), VERCCL);
     247      Att_t *atto = getAtt(getObj(item, BRIDGE, 0), VERCOP);
     248      if (attv != NULL) {
     249        renderSymbol(item, obja, "clear_v", "", "", CC, 0, 0, 0);
     250        drawText(item, stringValue(attv->val), "font-family:Arial; font-weight:normal; font-size:70; text-anchor:middle", 0, 12);
     251      }
     252      else if ((attc != NULL) && (atto == NULL)) {
     253        renderSymbol(item, obja, "clear_v", "", "", CC, 0, 0, 0);
     254        drawText(item, stringValue(attc->val), "font-family:Arial; font-weight:normal; font-size:70; text-anchor:middle", 0, 12);
     255      }
     256      else if ((attc != NULL) && (atto != NULL)) {
     257        renderSymbol(item, obja, "clear_v", "", "", RC, 5, 0, 0);
     258        drawText(item, stringValue(attc->val), "font-family:Arial; font-weight:normal; font-size:70; text-anchor:middle", -35, 12);
     259        renderSymbol(item, obja, "clear_v", "", "", LC, -5, 0, 0);
     260        drawText(item, stringValue(atto->val), "font-family:Arial; font-weight:normal; font-size:70; text-anchor:middle", 35, 12);
     261      }
     262    }
     263*/
     264        }
     265        private static void cables(Feature feature) {
     266                if (zoom >= 14) {
     267                        if (feature.type == Obj.CBLSUB) {
     268                                Renderer.lineSymbols(feature, Areas.Cable, 0.0, null, 0);
     269                        } else if (feature.type == Obj.CBLOHD) {
     270
     271                        }
     272                }
     273        }
     274        private static void distances(Feature feature) {
     275/*object_rules(distances) {
     276  if ((zoom>=16) && (has_attribute("category"))) {
     277    attribute_switch("category")
     278    attribute_case("installed") symbol("distance_i");
     279    attribute_default symbol("distance_u");
     280    end_switch
     281  }
     282}
     283*/
     284        }
     285        private static void floats(Feature feature) {
     286                switch (feature.type) {
     287                case LITVES:
     288                        Renderer.symbol(feature, Buoys.Super, feature.type, null);
     289                        break;
     290                case LITFLT:
     291                        Renderer.symbol(feature, Buoys.Float, feature.type, null);
     292                        break;
     293                case BOYINB:
     294                        Renderer.symbol(feature, Buoys.Storage, feature.type, null);
     295                        break;
     296                }
     297                if (feature.objs.get(Obj.TOPMAR) != null)
     298                        Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Floats);
     299        }
     300        private static void gauges(Feature feature) {
     301/*object_rules(gauge) {
     302  if (zoom >= 14) symbol("tide_gauge");
     303}
     304*/
    290305        }
    291306        private static void harbours(Feature feature) {
     
    304319                }
    305320        }
    306         /*
     321/*
    307322         *   if ((zoom >= 12) && is_type("anchorage")) {
    308323    symbol("anchorage");
     
    323338      text(item_attribute("name"), "font-family:Arial; font-weight:bold; font-size:80; text-anchor:middle", 0, -90);
    324339  }
    325 
    326          */
    327         private static void locks(Feature feature) {
    328         }
    329         private static void distances(Feature feature) {
    330         }
    331         private static void ports(Feature feature) {
    332         }
     340*/
    333341        private static void landmarks(Feature feature) {
    334342                ArrayList<CatLMK> cats = (ArrayList<CatLMK>) Renderer.getAttVal(feature, feature.type, 0, Att.CATLMK);
     
    344352                Renderer.symbol(feature, catSym, null, null);
    345353                Renderer.symbol(feature, fncSym, null, null);
     354/*  if (!has_attribute("function") && !has_attribute("category") && has_object("light")) {
     355    symbol("lighthouse");
     356    if ((zoom >= 15) && has_item_attribute("name"))
     357      text(item_attribute("name"), "font-family:Arial; font-weight:bold; font-size:80; text-anchor:middle", 0, -70);
     358  } else {
     359    if ((zoom >= 15) && has_item_attribute("name"))
     360      text(item_attribute("name"), "font-family:Arial; font-weight:bold; font-size:80; text-anchor:start", 60, -50);
     361  }
     362  if (has_object("fog_signal")) object(fogs);
     363  if (has_object("radar_transponder")) object(rtbs);
     364  if (has_object("radar_station") && (zoom >= 12)) symbol("radar_station");
     365  if (has_object("light")) object(lights);
     366}
     367*/
     368        }
     369        private static void lights(Feature feature) {
     370                switch (feature.type) {
     371                case LITMAJ:
     372                        Renderer.symbol(feature, Beacons.LightMajor, null, null);
     373                        break;
     374                case LITMIN:
     375                case LIGHTS:
     376                        Renderer.symbol(feature, Beacons.LightMinor, null, null);
     377                        break;
     378                }
     379        }
     380        private static void locks(Feature feature) {
     381/*object_rules(locks) {
     382  if ((zoom>=13) && is_type("lock_basin|lock_basin_part")) symbol("lock");
     383  if ((zoom>=15) && is_type("gate")) symbol("lock_gate");
     384}
     385*/
     386        }
     387        private static void marinas(Feature feature) {
     388                if (zoom >= 16) {
     389                       
     390                }
     391/*      int n = countObjects(item, type);
     392      Atta_t atta = enumAttribute("category", obja);
     393      char **map = cluster_map(obja);
     394      if (map == NULL) return;
     395      switch (n) {
     396        case 0: {
     397          Obj_t *obj = getObj(item, obja, 0);
     398          int n = countValues(getAtt(obj, atta));
     399          switch (n) {
     400            case 1:
     401              renderSymbol(item, obja, map[getAttEnum(obj, atta, 0)], "", "", CC, 0, 0, 0);
     402              break;
     403            case 2:
     404              renderSymbol(item, obja, map[getAttEnum(obj, atta, 0)], "", "", RC, 0, 0, 0);
     405              renderSymbol(item, obja, map[getAttEnum(obj, atta, 1)], "", "", LC, 0, 0, 0);
     406              break;
     407            case 3:
     408              renderSymbol(item, obja, map[getAttEnum(obj, atta, 0)], "", "", BC, 0, 0, 0);
     409              renderSymbol(item, obja, map[getAttEnum(obj, atta, 1)], "", "", TR, 0, 0, 0);
     410              renderSymbol(item, obja, map[getAttEnum(obj, atta, 2)], "", "", TL, 0, 0, 0);
     411              break;
     412            case 4:
     413              renderSymbol(item, obja, map[getAttEnum(obj, atta, 0)], "", "", BR, 0, 0, 0);
     414              renderSymbol(item, obja, map[getAttEnum(obj, atta, 1)], "", "", BL, 0, 0, 0);
     415              renderSymbol(item, obja, map[getAttEnum(obj, atta, 2)], "", "", TR, 0, 0, 0);
     416              renderSymbol(item, obja, map[getAttEnum(obj, atta, 3)], "", "", TL, 0, 0, 0);
     417              break;
     418          }
     419        }
     420          break;
     421        case 1:
     422          renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 1), atta, 0)], "", "", CC, 0, 0, 0);
     423          break;
     424        case 2:
     425          renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 1), atta, 0)], "", "", RC, 0, 0, 0);
     426          renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 2), atta, 0)], "", "", LC, 0, 0, 0);
     427          break;
     428        case 3:
     429          renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 1), atta, 0)], "", "", BC, 0, 0, 0);
     430          renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 2), atta, 0)], "", "", TR, 0, 0, 0);
     431          renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 3), atta, 0)], "", "", TL, 0, 0, 0);
     432          break;
     433        case 4:
     434          renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 1), atta, 0)], "", "", BR, 0, 0, 0);
     435          renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 2), atta, 0)], "", "", BL, 0, 0, 0);
     436          renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 3), atta, 0)], "", "", TR, 0, 0, 0);
     437          renderSymbol(item, obja, map[getAttEnum(getObj(item, obja, 4), atta, 0)], "", "", TL, 0, 0, 0);
     438          break;
     439      }
     440*/
    346441        }
    347442        private static void moorings(Feature feature) {
     
    365460                        break;
    366461                }
     462/*  if (has_object("fog_signal")) object(fogs);
     463  if (has_object("radar_transponder")) object(rtbs);
     464  if (has_object("light")) object(lights);
     465}
     466*/
    367467        }
    368468        private static void notices(Feature feature) {
    369         }
    370         private static void marinas(Feature feature) {
    371         }
    372         private static void bridges(Feature feature) {
     469                if (zoom >= 14) {
     470                }
     471        }
     472        private static void obstructions(Feature feature) {
     473                if ((zoom >= 14) && (feature.type == Obj.UWTROC)) {
     474                        WatLEV lvl = (WatLEV) Renderer.getAttVal(feature, feature.type, 0, Att.WATLEV);
     475                        switch (lvl) {
     476                        case LEV_CVRS:
     477                                Renderer.symbol(feature, Areas.RockC, null, null);
     478                                break;
     479                        case LEV_AWSH:
     480                                Renderer.symbol(feature, Areas.RockA, null, null);
     481                                break;
     482                        default:
     483                                Renderer.symbol(feature, Areas.Rock, null, null);
     484                        }
     485                } else {
     486                        Renderer.symbol(feature, Areas.Rock, null, null);
     487                }
     488        }
     489        private static void pipelines(Feature feature) {
     490                if (zoom >= 14) {
     491                        if (feature.type == Obj.PIPSOL) {
     492                                Renderer.lineSymbols(feature, Areas.Pipeline, 1.0, null, 0);
     493                        } else if (feature.type == Obj.PIPOHD) {
     494
     495                        }
     496                }
     497        }
     498        private static void platforms(Feature feature) {
     499                Renderer.symbol(feature, Landmarks.Platform, null, null);
     500/*object_rules(platforms) {
     501  if (has_attribute("category")) {
     502    attribute_switch("category")
     503    attribute_case("fpso") symbol("storage");
     504    attribute_default symbol("platform");
     505    end_switch
     506  } else {
     507    symbol("platform");
     508  }
     509  if ((zoom >= 15) && has_item_attribute("name"))
     510    text(item_attribute("name"), "font-family:Arial; font-weight:bold; font-size:80; text-anchor:start", 60, -50);
     511  if (has_object("fog_signal")) object(fogs);
     512  if (has_object("radar_transponder")) object(rtbs);
     513  if (has_object("light")) object(lights);
     514}
     515*/
     516        }
     517        private static void ports(Feature feature) {
     518/*object_rules(ports) {
     519  if (zoom>=14) {
     520    if (is_type("crane")) {
     521      if (attribute_test("category", "container_crane")) symbol("container_crane");
     522      else symbol("port_crane");
     523    }
     524    if (is_type("hulk")) {
     525      area("fill:#ffe000;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-opacity:1");
     526      if ((zoom >= 15) && (has_item_attribute("name")))
     527        text(item_attribute("name"), "font-family:Arial; font-weight:bold; font-size:70; text-anchor:middle", 0, 0);
     528    }
     529  }
     530}
     531*/
     532        }
     533        private static void separation(Feature feature) {
     534                switch (feature.type) {
     535                case TSEZNE:
     536                case TSSCRS:
     537                case TSSRON:
     538                        if (zoom <= 15)
     539                                Renderer.lineVector(feature, new LineStyle(null, 0, null, new Color(0x80c480ff, true)));
     540                        else
     541                                Renderer.lineVector(feature, new LineStyle(new Color(0x80c480ff, true), 20, null, null));
     542                        AttItem name = feature.atts.get(Att.OBJNAM);
     543                        if ((zoom >= 10) && (name != null))
     544                                Renderer.labelText(feature, (String) name.val, new Font("Arial", Font.BOLD, 150), new Color(0x80c480ff), null);
     545                        break;
     546                case TSELNE:
     547                        Renderer.lineVector(feature, new LineStyle(new Color(0x80c480ff, true), 20, null, null));
     548                        break;
     549                case TSSLPT:
     550                        Renderer.lineSymbols(feature, Areas.LaneArrow, 0.5, null, 0);
     551                        break;
     552                case TSSBND:
     553                        Renderer.lineVector(feature, new LineStyle(new Color(0x80c480ff, true), 20, new float[] { 40, 40 }, null));
     554                        break;
     555                }
     556        }
     557        private static void shoreline(Feature feature) {
     558                if (zoom >= 12) {
     559                        switch ((CatSLC) Renderer.getAttVal(feature, feature.type, 0, Att.CATSLC)) {
     560                        case SLC_TWAL:
     561                                WatLEV lev = (WatLEV) Renderer.getAttVal(feature, feature.type, 0, Att.WATLEV);
     562                                if (lev == WatLEV.LEV_CVRS) {
     563                                        Renderer.lineVector(feature, new LineStyle(Color.black, 10, new float[] { 40, 40 }, null));
     564                                        if (zoom >= 15)
     565                                                Renderer.lineText(feature, "(covers)", new Font("Arial", Font.PLAIN, 80), 0.5, 20);
     566                                } else {
     567                                        Renderer.lineVector(feature, new LineStyle(Color.black, 10, null, null));
     568                                }
     569                                if (zoom >= 15)
     570                                        Renderer.lineText(feature, "Training Wall", new Font("Arial", Font.PLAIN, 80), 0.5, -20);
     571                        }
     572                }
     573        }
     574        private static void signals(Feature feature) {
     575                switch (feature.type) {
     576                case SISTAT:
     577                case SISTAW:
     578                        Renderer.symbol(feature, Harbours.SignalStation, null, null);
     579                        break;
     580                case RDOSTA:
     581                        Renderer.symbol(feature, Harbours.SignalStation, null, null);
     582                        break;
     583                case RADSTA:
     584                        Renderer.symbol(feature, Harbours.SignalStation, null, null);
     585                        Renderer.symbol(feature, Beacons.RadarStation, null, null);
     586                        break;
     587                case PILBOP:
     588                        Renderer.symbol(feature, Harbours.Pilot, null, null);
     589                        break;
     590                case CGUSTA:
     591                        Renderer.symbol(feature, Harbours.SignalStation, null, null);
     592                        break;
     593                case RSCSTA:
     594                        Renderer.symbol(feature, Harbours.Rescue, null, null);
     595                        break;
     596                }
     597/*  if (has_object("fog_signal")) object(fogs);
     598  if (has_object("radar_transponder")) object(rtbs);
     599  if (has_object("light")) object(lights);
     600}
     601*/
     602        }
     603        private static void transits(Feature feature) {
     604/*object_rules(transits) {
     605  int ref;
     606  if (zoom >= 12) {
     607    if (is_type("recommended_track")) ref = line("stroke-width:8; stroke:#000000; stroke-linecap:butt; fill:none");
     608    else if (is_type("navigation_line")) ref = line("stroke-width:8; stroke-dasharray:20,20; stroke:#000000; stroke-linecap:butt; fill:none");
     609  }
     610  if (zoom >= 15) {
     611    make_string("");
     612    if (has_object("name")) {
     613      add_string(item_attribute("name"));
     614      add_string(" ");
     615    }
     616    if (has_attribute("orientation")) {
     617      add_string(attribute("orientation"));
     618      add_string("¡");
     619    }
     620    if (has_attribute("category")) {
     621      add_string(" (");
     622      add_string(attribute("category"));
     623      add_string(")");
     624    }
     625    line_text(string, "font-family:Arial; font-weight:normal; font-size:80; text-anchor:middle", 0.5, -20, ref);
     626    free_string
     627  }
     628}
     629*/
     630        }
     631        private static void waterways(Feature feature) {
     632                if ((zoom >= 14) && (feature.atts.get(Att.OBJNAM) != null)) {
     633                        // lineText(item_attribute("name"), "font-family:Arial;font-weight:bold;font-size:80;text-anchor:middle", 0.5, 15, line("stroke:none;fill:none"));
     634                }
    373635        }
    374636        private static void wrecks(Feature feature) {
     
    390652                }
    391653        }
    392         private static void gauges(Feature feature) {
    393         }
    394         private static void lights(Feature feature) {
    395                 switch (feature.type) {
    396                 case LITMAJ:
    397                         Renderer.symbol(feature, Beacons.LightMajor, null, null);
    398                         break;
    399                 case LITMIN:
    400                 case LIGHTS:
    401                         Renderer.symbol(feature, Beacons.LightMinor, null, null);
    402                         break;
    403                 }
    404         }
    405         private static void signals(Feature feature) {
    406                 switch (feature.type) {
    407                 case SISTAT:
    408                 case SISTAW:
    409                         Renderer.symbol(feature, Harbours.SignalStation, null, null);
    410                         break;
    411                 case RDOSTA:
    412                         Renderer.symbol(feature, Harbours.SignalStation, null, null);
    413                         break;
    414                 case RADSTA:
    415                         Renderer.symbol(feature, Harbours.SignalStation, null, null);
    416                         Renderer.symbol(feature, Beacons.RadarStation, null, null);
    417                         break;
    418                 case PILBOP:
    419                         Renderer.symbol(feature, Harbours.Pilot, null, null);
    420                         break;
    421                 case CGUSTA:
    422                         Renderer.symbol(feature, Harbours.SignalStation, null, null);
    423                         break;
    424                 case RSCSTA:
    425                         Renderer.symbol(feature, Harbours.Rescue, null, null);
    426                         break;
    427                 }
    428         }
    429         private static void floats(Feature feature) {
    430                 switch (feature.type) {
    431                 case LITVES:
    432                         Renderer.symbol(feature, Buoys.Super, feature.type, null);
    433                         break;
    434                 case LITFLT:
    435                         Renderer.symbol(feature, Buoys.Float, feature.type, null);
    436                         break;
    437                 case BOYINB:
    438                         Renderer.symbol(feature, Buoys.Storage, feature.type, null);
    439                         break;
    440                 }
    441                 if (feature.objs.get(Obj.TOPMAR) != null)
    442                         Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Floats);
    443         }
    444         private static void platforms(Feature feature) {
    445                 Renderer.symbol(feature, Landmarks.Platform, null, null);
    446         }
    447         private static void buoys(Feature feature) {
    448                 BoySHP shape = (BoySHP) Renderer.getAttVal(feature, feature.type, 0, Att.BOYSHP);
    449                 Renderer.symbol(feature, Buoys.Shapes.get(shape), feature.type, null);
    450                 if (feature.objs.get(Obj.TOPMAR) != null) {
    451                         Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Buoys.get(shape));
    452                 }
    453         }
    454         private static void beacons(Feature feature) {
    455                 BcnSHP shape = (BcnSHP) Renderer.getAttVal(feature, feature.type, 0, Att.BCNSHP);
    456                 if (((shape == BcnSHP.BCN_PRCH) || (shape == BcnSHP.BCN_WTHY)) && (feature.type == Obj.BCNLAT)) {
    457                         CatLAM cat = (CatLAM) Renderer.getAttVal(feature, feature.type, 0, Att.CATLAM);
    458                         switch (cat) {
    459                         case LAM_PORT:
    460                                 if (shape == BcnSHP.BCN_PRCH)
    461                                         Renderer.symbol(feature, Beacons.PerchPort, null, null);
    462                                 else
    463                                         Renderer.symbol(feature, Beacons.WithyPort, null, null);
    464                                 break;
    465                         case LAM_STBD:
    466                                 if (shape == BcnSHP.BCN_PRCH)
    467                                         Renderer.symbol(feature, Beacons.PerchStarboard, null, null);
    468                                 else
    469                                         Renderer.symbol(feature, Beacons.WithyStarboard, null, null);
    470                                 break;
    471                         default:
    472                                 Renderer.symbol(feature, Beacons.Stake, feature.type, null);
    473                         }
    474                 } else {
    475                         Renderer.symbol(feature, Beacons.Shapes.get(shape), feature.type, null);
    476                         if (feature.objs.get(Obj.TOPMAR) != null)
    477                                 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), Obj.TOPMAR, Topmarks.Beacons);
    478                 }
    479         }
    480 }
     654}
  • applications/editors/josm/plugins/smed2/src/seamap/SeaMap.java

    r29281 r29286  
    1 /* Copyright 2012 Malcolm Herring
     1/* Copyright 2013 Malcolm Herring
    22 *
    33 * This is free software: you can redistribute it and/or modify
  • applications/editors/josm/plugins/smed2/src/smed2/MapImage.java

    r29266 r29286  
     1/* Copyright 2013 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
    110package smed2;
    211
  • applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java

    r29275 r29286  
     1/* Copyright 2013 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
    110package smed2;
    211
     
    138147                showFrame.setResizable(false);
    139148                showFrame.setAlwaysOnTop(true);
     149                showFrame.setEnabled(false);
    140150                showFrame.setVisible(false);
    141151
     
    192202                                                node = nextNode;
    193203//                                              showFrame.setVisible(true);
    194 //                                              showFrame.showFeature(node, map);
     204                                                showFrame.showFeature(node, map);
    195205                                        }
    196206                                } else {
     
    204214                                                way = nextWay;
    205215//                                              showFrame.setVisible(true);
    206 //                                              showFrame.showFeature(way, map);
     216                                                showFrame.showFeature(way, map);
    207217                                        }
    208218                                } else {
  • applications/editors/josm/plugins/smed2/src/symbols/Symbols.java

    r29206 r29286  
    1 /* Copyright 2012 Malcolm Herring
     1/* Copyright 2013 Malcolm Herring
    22 *
    33 * This is free software: you can redistribute it and/or modify
Note: See TracChangeset for help on using the changeset viewer.