Changeset 30157 in osm


Ignore:
Timestamp:
2013-12-29T12:52:10+01:00 (11 years ago)
Author:
malcolmh
Message:

save

Location:
applications/editors/josm/plugins/smed2
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed2/build.xml

    r29996 r30157  
    3939    <!-- this is the directory where the plugin jar is copied to -->
    4040    <property name="plugin.dist.dir" value="../../dist"/>
    41     <property name="ant.build.javac.target" value="1.6"/>
     41    <property name="ant.build.javac.target" value="1.7"/>
    4242    <property name="plugin.dist.dir" value="../../dist"/>
    4343    <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
  • applications/editors/josm/plugins/smed2/src/render/Renderer.java

    r30150 r30157  
    388388        }
    389389
    390         public static void labelText(Feature feature, String str, Font font, LabelStyle style, Color fg) {
    391                 labelText(feature, str, font, style, fg, null, null);
    392         }
    393         public static void labelText(Feature feature, String str, Font font, LabelStyle style, Color fg, Color bg) {
    394                 labelText(feature, str, font, style, fg, bg, null);
    395         }
    396         public static void labelText(Feature feature, String str, Font font, LabelStyle style, Color fg, Delta delta) {
    397                 labelText(feature, str, font, style, fg, null, delta);
    398         }
    399         public static void labelText(Feature feature, String str, Font font, LabelStyle style, Color fg, Color bg, Delta delta) {
     390        public static void labelText(Feature feature, String str, Font font, Color tc) {
     391                labelText(feature, str, font, tc, LabelStyle.NONE, null, null, null);
     392        }
     393        public static void labelText(Feature feature, String str, Font font, Color tc, Delta delta) {
     394                labelText(feature, str, font, tc, LabelStyle.NONE, null, null, delta);
     395        }
     396        public static void labelText(Feature feature, String str, Font font, Color tc, LabelStyle style, Color fg) {
     397                labelText(feature, str, font, tc, style, fg, null, null);
     398        }
     399        public static void labelText(Feature feature, String str, Font font, Color tc, LabelStyle style, Color fg, Color bg) {
     400                labelText(feature, str, font, tc, style, fg, bg, null);
     401        }
     402        public static void labelText(Feature feature, String str, Font font, Color tc, LabelStyle style, Color fg, Delta delta) {
     403                labelText(feature, str, font, tc, style, fg, null, delta);
     404        }
     405        public static void labelText(Feature feature, String str, Font font, Color tc, LabelStyle style, Color fg, Color bg, Delta delta) {
    400406                if (delta == null) delta = new Delta(Handle.CC);
    401407                if (bg == null) bg = new Color(0x00000000, true);
     
    491497                        break;
    492498                }
    493                 label.add(new Instr(Prim.TEXT, new Caption(str, font, fg, new Delta(Handle.TL, AffineTransform.getTranslateInstance(tx, ty)))));
     499                label.add(new Instr(Prim.TEXT, new Caption(str, font, tc, new Delta(Handle.TL, AffineTransform.getTranslateInstance(tx, ty)))));
    494500                Point2D point = context.getPoint(feature.centre);
    495501                Symbols.drawSymbol(g2, label, sScale, point.getX(), point.getY(), null, delta);
  • applications/editors/josm/plugins/smed2/src/render/Rules.java

    r30150 r30157  
    190190                                Renderer.lineVector(feature, new LineStyle(Color.black, 8, new float[] { 25, 25 }));
    191191                        if ((Renderer.zoom >= 12) && (name != null))
    192                                 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 100), LabelStyle.NONE, Color.black);
     192                                Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 100), Color.black);
    193193                        break;
    194194                case FAIRWY:
     
    218218                                Renderer.lineVector(feature, new LineStyle(Color.black, 20, new float[] { 40, 40 }));
    219219                                if ((Renderer.zoom >= 15) && (name != null))
    220                                         Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 10)));
     220                                        Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 10)));
    221221                        }
    222222                        break;
     
    236236                                                Renderer.lineText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5, -40);
    237237                                        } else {
    238                                                 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 150), LabelStyle.NONE, Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
     238                                                Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
    239239                                        }
    240240                                break;
     
    244244                                                Renderer.lineText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, 0.5, -40);
    245245                                        } else {
    246                                                 Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 150), LabelStyle.NONE, Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
     246                                                Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 150), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
    247247                                        }
    248248                                break;
     
    252252                                                Renderer.lineVector(feature, new LineStyle(new Color(0xc480ff), 4, new float[] { 25, 25 }));
    253253                                                if (name != null) {
    254                                                         Renderer.labelText(feature, name, new Font("Arial", Font.ITALIC, 75), LabelStyle.NONE, Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
    255                                                         Renderer.labelText(feature, "(Shoal)", new Font("Arial", Font.PLAIN, 60), LabelStyle.NONE, Color.black, new Delta(Handle.BC));
     254                                                        Renderer.labelText(feature, name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
     255                                                        Renderer.labelText(feature, "(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC));
    256256                                                }
    257257                                        } else if (feature.flag == Fflag.LINE) {
     
    262262                                        } else {
    263263                                                if (name != null) {
    264                                                         Renderer.labelText(feature, name, new Font("Arial", Font.ITALIC, 75), LabelStyle.NONE, Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
    265                                                         Renderer.labelText(feature, "(Shoal)", new Font("Arial", Font.PLAIN, 60), LabelStyle.NONE, Color.black, new Delta(Handle.BC));
     264                                                        Renderer.labelText(feature, name, new Font("Arial", Font.ITALIC, 75), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -40)));
     265                                                        Renderer.labelText(feature, "(Shoal)", new Font("Arial", Font.PLAIN, 60), Color.black, new Delta(Handle.BC));
    266266                                                }
    267267                                        }
     
    271271                        case SEA_NRRW:
    272272                                if ((Renderer.zoom >= 12) && (name != null))
    273                                         Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 100), LabelStyle.NONE, Color.black);
     273                                        Renderer.labelText(feature, name, new Font("Arial", Font.PLAIN, 100), Color.black);
    274274                                break;
    275275                        default:
     
    286286                        }
    287287                        if ((Renderer.zoom >= 15) && (name != null))
    288                                 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90)));
     288                                Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, -90)));
    289289                        break;
    290290                default:
     
    294294       
    295295        private static void beacons(Feature feature) {
    296                 BcnSHP shape = (BcnSHP) getAttVal(feature, feature.type, 0, Att.BCNSHP);
    297                 if (((shape == BcnSHP.BCN_PRCH) || (shape == BcnSHP.BCN_WTHY)) && (feature.type == Obj.BCNLAT)) {
    298                         CatLAM cat = (CatLAM) getAttVal(feature, feature.type, 0, Att.CATLAM);
    299                         switch (cat) {
    300                         case LAM_PORT:
    301                                 if (shape == BcnSHP.BCN_PRCH)
    302                                         Renderer.symbol(feature, Beacons.PerchPort);
    303                                 else
    304                                         Renderer.symbol(feature, Beacons.WithyPort);
    305                                 break;
    306                         case LAM_STBD:
    307                                 if (shape == BcnSHP.BCN_PRCH)
    308                                         Renderer.symbol(feature, Beacons.PerchStarboard);
    309                                 else
    310                                         Renderer.symbol(feature, Beacons.WithyStarboard);
    311                                 break;
    312                         default:
    313                                 Renderer.symbol(feature, Beacons.Stake, getScheme(feature, feature.type));
    314                         }
    315                 } else {
    316                         Renderer.symbol(feature, Beacons.Shapes.get(shape), getScheme(feature, feature.type));
    317                         if (feature.objs.get(Obj.TOPMAR) != null)
    318                                 Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), getScheme(feature, Obj.TOPMAR), Topmarks.BeaconDelta);
    319                 }
    320                 Signals.addSignals(feature);
     296                if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BCNLAT) || (feature.type == Obj.BCNCAR)))) {
     297                        BcnSHP shape = (BcnSHP) getAttVal(feature, feature.type, 0,
     298                                        Att.BCNSHP);
     299                        if (((shape == BcnSHP.BCN_PRCH) || (shape == BcnSHP.BCN_WTHY))
     300                                        && (feature.type == Obj.BCNLAT)) {
     301                                CatLAM cat = (CatLAM) getAttVal(feature, feature.type, 0,
     302                                                Att.CATLAM);
     303                                switch (cat) {
     304                                case LAM_PORT:
     305                                        if (shape == BcnSHP.BCN_PRCH)
     306                                                Renderer.symbol(feature, Beacons.PerchPort);
     307                                        else
     308                                                Renderer.symbol(feature, Beacons.WithyPort);
     309                                        break;
     310                                case LAM_STBD:
     311                                        if (shape == BcnSHP.BCN_PRCH)
     312                                                Renderer.symbol(feature, Beacons.PerchStarboard);
     313                                        else
     314                                                Renderer.symbol(feature, Beacons.WithyStarboard);
     315                                        break;
     316                                default:
     317                                        Renderer.symbol(feature, Beacons.Stake,
     318                                                        getScheme(feature, feature.type));
     319                                }
     320                        } else {
     321                                Renderer.symbol(feature, Beacons.Shapes.get(shape),
     322                                                getScheme(feature, feature.type));
     323                                if (feature.objs.get(Obj.TOPMAR) != null)
     324                                        Renderer.symbol(
     325                                                        feature,
     326                                                        Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR)
     327                                                                        .get(0).get(Att.TOPSHP).val),
     328                                                        getScheme(feature, Obj.TOPMAR),
     329                                                        Topmarks.BeaconDelta);
     330                        }
     331                        Signals.addSignals(feature);
     332                }
    321333        }
    322334       
    323335        private static void buoys(Feature feature) {
    324                 BoySHP shape = (BoySHP) getAttVal(feature, feature.type, 0, Att.BOYSHP);
    325                 Renderer.symbol(feature, Buoys.Shapes.get(shape), getScheme(feature, feature.type));
    326                 if (hasObject(feature, Obj.TOPMAR)) {
    327                         Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val), getScheme(feature, Obj.TOPMAR), Topmarks.BuoyDeltas.get(shape));
    328                 }
    329                 Signals.addSignals(feature);
     336                if ((Renderer.zoom >= 14) || ((Renderer.zoom >= 12) && ((feature.type == Obj.BOYLAT) || (feature.type == Obj.BOYCAR)))) {
     337                        BoySHP shape = (BoySHP) getAttVal(feature, feature.type, 0, Att.BOYSHP);
     338                        Renderer.symbol(feature, Buoys.Shapes.get(shape), getScheme(feature, feature.type));
     339                        if (hasObject(feature, Obj.TOPMAR)) {
     340                                Renderer.symbol(feature, Topmarks.Shapes.get(feature.objs.get(Obj.TOPMAR).get(0).get(Att.TOPSHP).val),
     341                                                getScheme(feature, Obj.TOPMAR), Topmarks.BuoyDeltas.get(shape));
     342                        }
     343                        Signals.addSignals(feature);
     344                }
    330345        }
    331346       
     
    358373                                }
    359374                                if (hstr.isEmpty() && !vstr.isEmpty()) {
    360                                         Renderer.labelText(feature, vstr, new Font("Arial", Font.PLAIN, 30), LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.CC));
     375                                        Renderer.labelText(feature, vstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.CC));
    361376                                } else if (!hstr.isEmpty() && !vstr.isEmpty()) {
    362                                         Renderer.labelText(feature, vstr, new Font("Arial", Font.PLAIN, 30), LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.BC));
    363                                         Renderer.labelText(feature, hstr, new Font("Arial", Font.PLAIN, 30), LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.TC));
     377                                        Renderer.labelText(feature, vstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.VCLR, Color.black, Color.white, new Delta(Handle.BC));
     378                                        Renderer.labelText(feature, hstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.TC));
    364379                                } else if (!hstr.isEmpty() && vstr.isEmpty()) {
    365                                         Renderer.labelText(feature, hstr, new Font("Arial", Font.PLAIN, 30), LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.CC));
     380                                        Renderer.labelText(feature, hstr, new Font("Arial", Font.PLAIN, 30), Color.black, LabelStyle.HCLR, Color.black, Color.white, new Delta(Handle.CC));
    366381                                }
    367382                        }
     
    382397                                if (atts != null) {
    383398                                        if (atts.containsKey(Att.VERCLR)) {
    384                                                 Renderer.labelText(feature, String.valueOf((Double) atts.get(Att.VERCLR).val), new Font("Arial", Font.PLAIN, 50), LabelStyle.VCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25)));
     399                                                Renderer.labelText(feature, String.valueOf((Double) atts.get(Att.VERCLR).val), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.VCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25)));
    385400                                        } else if (atts.containsKey(Att.VERCSA)) {
    386                                                 Renderer.labelText(feature, String.valueOf((Double) atts.get(Att.VERCSA).val), new Font("Arial", Font.PLAIN, 50), LabelStyle.PCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25)));
     401                                                Renderer.labelText(feature, String.valueOf((Double) atts.get(Att.VERCSA).val), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.PCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25)));
    387402                                        }
    388403                                }
     
    427442                                }
    428443                                str += String.format("%1.0f", dist);
    429                                 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 45)));
     444                                Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.CC, AffineTransform.getTranslateInstance(0, 45)));
    430445                        }
    431446                }
     
    464479                        if (Renderer.zoom >= 14) {
    465480                                Renderer.symbol(feature, Harbours.Anchorage, new Scheme(Mline));
    466                         Renderer.labelText(feature, name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), LabelStyle.RRCT, Mline, Color.white, new Delta(Handle.BC));
     481                        Renderer.labelText(feature, name == null ? "" : name, new Font("Arial", Font.PLAIN, 30), Msymb, LabelStyle.RRCT, Mline, Color.white, new Delta(Handle.BC));
    467482                        }
    468483                        double radius = (Double)getAttVal(feature, Obj.ACHBRT, 0, Att.RADIUS);
     
    481496                                }
    482497                                if ((Renderer.zoom >= 15) && ((name) != null)) {
    483                                         Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 60), LabelStyle.NONE, Mline, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));
     498                                        Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 60), Mline, new Delta(Handle.LC, AffineTransform.getTranslateInstance(70, 0)));
    484499                                }
    485500                                ArrayList<StsSTS> sts = (ArrayList<StsSTS>)getAttVal(feature, Obj.ACHARE, 0, Att.STATUS);
    486501                                if ((Renderer.zoom >= 15) && (sts != null) && (sts.contains(StsSTS.STS_RESV))) {
    487                                         Renderer.labelText(feature, "Reserved", new Font("Arial", Font.PLAIN, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60)));
     502                                        Renderer.labelText(feature, "Reserved", new Font("Arial", Font.PLAIN, 50), Mline, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0, 60)));
    488503                                }
    489504                        }
     
    493508                                switch (cat) {
    494509                                case ACH_DEEP:
    495                                         Renderer.labelText(feature, "DW", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
     510                                        Renderer.labelText(feature, "DW", new Font("Arial", Font.BOLD, 50), Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
    496511                                        dy += 60;
    497512                                        break;
    498513                                case ACH_TANK:
    499                                         Renderer.labelText(feature, "Tanker", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
     514                                        Renderer.labelText(feature, "Tanker", new Font("Arial", Font.BOLD, 50), Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
    500515                                        dy += 60;
    501516                                        break;
    502517                                case ACH_H24P:
    503                                         Renderer.labelText(feature, "24h", new Font("Arial", Font.BOLD, 50), LabelStyle.NONE, Mline, null, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
     518                                        Renderer.labelText(feature, "24h", new Font("Arial", Font.BOLD, 50), Msymb, new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
    504519                                        dy += 60;
    505520                                        break;
    506521                                case ACH_EXPL:
    507                                         Renderer.symbol(feature, Harbours.Explosives, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
     522                                        Renderer.symbol(feature, Harbours.Explosives, new Scheme(Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
    508523                                        dy += 60;
    509524                                        break;
    510525                                case ACH_QUAR:
    511                                         Renderer.symbol(feature, Harbours.Hospital, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
     526                                        Renderer.symbol(feature, Harbours.Hospital, new Scheme(Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
    512527                                        dy += 60;
    513528                                        break;
    514529                                case ACH_SEAP:
    515                                         Renderer.symbol(feature, Areas.Seaplane, new Scheme(Mline), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
     530                                        Renderer.symbol(feature, Areas.Seaplane, new Scheme(Msymb), new Delta(Handle.RC, AffineTransform.getTranslateInstance(-60, dy)));
    516531                                        dy += 60;
    517532                                        break;
     533                                default:
    518534                                }
    519535                        }
     
    521537                case BERTHS:
    522538                        if (Renderer.zoom >= 14) {
    523                                 Renderer.labelText(feature, name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), LabelStyle.RRCT, Mline, Color.white, null);
     539                                Renderer.labelText(feature, name == null ? " " : name, new Font("Arial", Font.PLAIN, 40), Msymb, LabelStyle.RRCT, Mline, Color.white, null);
    524540                        }
    525541                        break;
     
    896912                                        }
    897913                                        if (verclr > 0) {
    898                                                 Renderer.labelText(feature, String.valueOf(verclr), new Font("Arial", Font.PLAIN, 50), LabelStyle.VCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25)));
     914                                                Renderer.labelText(feature, String.valueOf(verclr), new Font("Arial", Font.PLAIN, 50), Color.black, LabelStyle.VCLR, Color.black, new Delta(Handle.TC, AffineTransform.getTranslateInstance(0,25)));
    899915                                        }
    900916                                }
     
    911927                String name = getName(feature);
    912928                if ((Renderer.zoom >= 15) && (name != null))
    913                         Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));
     929                        Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 40), Color.black, new Delta(Handle.BL, AffineTransform.getTranslateInstance(20, -50)));
    914930                Signals.addSignals(feature);
    915931        }
     
    926942                                String name = getName(feature);
    927943                                if ((Renderer.zoom >= 15) && (name != null))
    928                                         Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), LabelStyle.NONE, Color.black, null, null);
     944                                        Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 80), Color.black);
    929945                        }
    930946                }
     
    942958                        String name = getName(feature);
    943959                        if ((Renderer.zoom >= 10) && (name != null))
    944                                 Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 150), LabelStyle.NONE, new Color(0x80c48080, true), null, null);
     960                                Renderer.labelText(feature, name, new Font("Arial", Font.BOLD, 150), new Color(0x80c48080, true));
    945961                        break;
    946962                case TSELNE:
     
    10071023                        }
    10081024                        if ((Renderer.zoom >= 15) && !str.isEmpty()) {
    1009                                 Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.LC, AffineTransform.getTranslateInstance(30, 0)));
    1010                         }
    1011                 }
    1012                 Signals.addSignals(feature);
     1025                                Renderer.labelText(feature, str, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.LC, AffineTransform.getTranslateInstance(30, 0)));
     1026                        }
     1027                        Signals.addSignals(feature);
     1028                }
    10131029        }
    10141030
  • applications/editors/josm/plugins/smed2/src/render/Signals.java

    r30150 r30157  
    6464                }
    6565                if ((Renderer.zoom >= 15) && !bstr.isEmpty()) {
    66                         Renderer.labelText(feature, bstr, new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -30)));
     66                        Renderer.labelText(feature, bstr, new Font("Arial", Font.PLAIN, 40),Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -30)));
    6767                }
    6868        }
     
    175175                if (Renderer.zoom >= 15) {
    176176                        if (vais) {
    177                                 Renderer.labelText(feature, "V-AIS", new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));
     177                                Renderer.labelText(feature, "V-AIS", new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.BC, AffineTransform.getTranslateInstance(0, 70)));
    178178                        }
    179179                        if (!bstr.isEmpty()) {
    180                                 Renderer.labelText(feature, bstr, new Font("Arial", Font.PLAIN, 40), LabelStyle.NONE, Color.black, null, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -70)));
     180                                Renderer.labelText(feature, bstr, new Font("Arial", Font.PLAIN, 40), Color.black, new Delta(Handle.BR, AffineTransform.getTranslateInstance(-30, -70)));
    181181                        }
    182182                }
  • applications/editors/josm/plugins/smed2/src/s57/S57map.java

    r30150 r30157  
    1313
    1414import s57.S57att;
     15import s57.S57val.AttVal;
    1516import s57.S57att.*;
    1617import s57.S57obj;
     
    351352                                        items.put(idx, atts);
    352353                                }
    353                                 AttVal attval = S57val.convertValue(val, att);
     354                                AttVal<?> attval = S57val.convertValue(val, att);
    354355                                if (attval.val != null)
    355356                                        atts.put(att, new AttItem(attval.conv, attval.val));
     
    363364                                        Att att = S57att.enumAttribute(subkeys[1], Obj.UNKOBJ);
    364365                                        if (att != Att.UNKATT) {
    365                                                 AttVal attval = S57val.convertValue(val, att);
     366                                                AttVal<?> attval = S57val.convertValue(val, att);
    366367                                                if (attval.val != null)
    367368                                                        feature.atts.put(att, new AttItem(attval.conv, attval.val));
     
    436437                        areas.put(id, area);
    437438                        break;
     439                case UNKN:
     440                default:
     441                        break;
    438442                }
    439443                if ((feature.type != Obj.UNKOBJ) && !((edge != null) && (edge.last == 0))) {
     
    556560                        }
    557561                        return new Snode((sarc > 0.0 ? slat / sarc : 0.0), (sarc > 0.0 ? slon / sarc : 0.0));
     562                default:
    558563                }
    559564                return null;
  • applications/editors/josm/plugins/smed2/src/s57/S57val.java

    r30046 r30157  
    2626        }
    2727       
    28         public static class AttVal {
     28        public static class AttVal<V> {
    2929                public Att att;
    3030                public Conv conv;
    31                 public Object val;
    32                 AttVal(Att a, Conv c, Object v) {
     31                public V val;
     32                AttVal(Att a, Conv c, V v) {
    3333                        att = a; conv = c; val = v;
    3434                }
     
    11411141
    11421142       
    1143         public static String stringValue(AttVal attval) {                  // Convert OSeaM value object to OSeaM attribute value string
     1143        public static String stringValue(AttVal<?> attval) {                  // Convert OSeaM value object to OSeaM attribute value string
    11441144                switch (attval.conv) {
    11451145                case A:
     
    11771177        }
    11781178
    1179         public static AttVal convertValue(String val, Att att) {                                // Convert OSeaM attribute value string to OSeaM value object
     1179        public static AttVal<?> convertValue(String val, Att att) {                             // Convert OSeaM attribute value string to OSeaM value object
    11801180                switch (keys.get(att).conv) {
    11811181                case A:
    11821182                case S:
    1183                         return new AttVal(att, Conv.S, val);
     1183                        return new AttVal<String>(att, Conv.S, val);
    11841184                case E:
    1185                         return new AttVal(att, Conv.E, enumValue(val, att));
     1185                        return new AttVal<Enum<?>>(att, Conv.E, enumValue(val, att));
    11861186                case L:
    11871187                        ArrayList<Enum<?>> list = new ArrayList<Enum<?>>();
     
    11891189                                list.add(enumValue(item, att));
    11901190                        }
    1191                         return new AttVal(att, Conv.L, list);
     1191                        return new AttVal<ArrayList<?>>(att, Conv.L, list);
    11921192                case I:
    11931193                        try {
    11941194                                long i = Long.parseLong(val);
    1195                                 return new AttVal(att, Conv.I, i);
     1195                                return new AttVal<Long>(att, Conv.I, i);
    11961196                        } catch (Exception e) {
    11971197                                break;
     
    12001200                        try {
    12011201                                double f = Double.parseDouble(val);
    1202                                 return new AttVal(att, Conv.F, f);
     1202                                return new AttVal<Double>(att, Conv.F, f);
    12031203                        } catch (Exception e) {
    12041204                                break;
    12051205                        }
    12061206                }
    1207                 return new AttVal(att, keys.get(att).conv, null);
     1207                return new AttVal<>(att, keys.get(att).conv, null);
    12081208        }
    12091209
  • applications/editors/josm/plugins/smed2/src/smed2/Smed2Action.java

    r30150 r30157  
    2929import org.openstreetmap.josm.Main;
    3030
    31 import s57.S57dat;
    3231import s57.S57map;
    3332import s57.S57map.*;
  • applications/editors/josm/plugins/smed2/src/symbols/Facilities.java

    r30033 r30157  
    1515import java.util.EnumMap;
    1616
    17 import s57.S57val.CatLMK;
    18 import s57.S57val.CatSCF;
     17import s57.S57val.*;
    1918import symbols.Symbols.*;
    2019
Note: See TracChangeset for help on using the changeset viewer.