Ignore:
Timestamp:
2016-08-19T03:43:18+02:00 (3 years ago)
Author:
Don-vip
Message:

see #13309 - fix most of deprecation warnings

Location:
trunk/src/org/openstreetmap/josm/actions/mapmode
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r10827 r10853  
    5353import org.openstreetmap.josm.data.osm.visitor.paint.MapPath2D;
    5454import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors;
     55import org.openstreetmap.josm.data.preferences.ColorProperty;
    5556import org.openstreetmap.josm.gui.MainMenu;
    5657import org.openstreetmap.josm.gui.MapFrame;
     
    246247    @Override
    247248    protected void readPreferences() {
    248         rubberLineColor = Main.pref.getColor(marktr("helper line"), null);
    249         if (rubberLineColor == null) rubberLineColor = PaintColors.SELECTED.get();
     249        rubberLineColor = new ColorProperty(marktr("helper line"), (Color) null).get();
     250        if (rubberLineColor == null)
     251            rubberLineColor = PaintColors.SELECTED.get();
    250252
    251253        rubberLineStroke = GuiHelper.getCustomizedStroke(Main.pref.get("draw.stroke.helper-line", "3"));
     
    14561458
    14571459            normalStroke = rubberLineStroke;
    1458             snapHelperColor = Main.pref.getColor(marktr("draw angle snap"), Color.ORANGE);
    1459 
    1460             highlightColor = Main.pref.getColor(marktr("draw angle snap highlight"), ORANGE_TRANSPARENT);
     1460            snapHelperColor = new ColorProperty(marktr("draw angle snap"), Color.ORANGE).get();
     1461
     1462            highlightColor = new ColorProperty(marktr("draw angle snap highlight"), ORANGE_TRANSPARENT).get();
    14611463            highlightStroke = GuiHelper.getCustomizedStroke(Main.pref.get("draw.anglesnap.stroke.highlight", "10"));
    14621464            helperStroke = GuiHelper.getCustomizedStroke(Main.pref.get("draw.anglesnap.stroke.helper", "1 4"));
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r10716 r10853  
    4444import org.openstreetmap.josm.data.osm.WaySegment;
    4545import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors;
     46import org.openstreetmap.josm.data.preferences.ColorProperty;
    4647import org.openstreetmap.josm.gui.MainMenu;
    4748import org.openstreetmap.josm.gui.MapFrame;
     
    304305        initialMoveDelay = Main.pref.getInteger("edit.initial-move-delay", 200);
    305306        initialMoveThreshold = Main.pref.getInteger("extrude.initial-move-threshold", 1);
    306         mainColor = Main.pref.getColor(marktr("Extrude: main line"), null);
     307        mainColor = new ColorProperty(marktr("Extrude: main line"), (Color) null).get();
    307308        if (mainColor == null) mainColor = PaintColors.SELECTED.get();
    308         helperColor = Main.pref.getColor(marktr("Extrude: helper line"), Color.ORANGE);
     309        helperColor = new ColorProperty(marktr("Extrude: helper line"), Color.ORANGE).get();
    309310        helperStrokeDash = GuiHelper.getCustomizedStroke(Main.pref.get("extrude.stroke.helper-line", "1 4"));
    310311        helperStrokeRA = new BasicStroke(1);
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java

    r10827 r10853  
    3737import org.openstreetmap.josm.data.osm.visitor.paint.MapPath2D;
    3838import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors;
     39import org.openstreetmap.josm.data.preferences.ColorProperty;
    3940import org.openstreetmap.josm.gui.MapFrame;
    4041import org.openstreetmap.josm.gui.MapView;
     
    152153    @Override
    153154    protected void readPreferences() {
    154         guideColor = Main.pref.getColor(marktr("improve way accuracy helper line"), null);
    155         if (guideColor == null) guideColor = PaintColors.HIGHLIGHT.get();
     155        guideColor = new ColorProperty(marktr("improve way accuracy helper line"), (Color) null).get();
     156        if (guideColor == null)
     157            guideColor = PaintColors.HIGHLIGHT.get();
    156158
    157159        selectTargetWayStroke = GuiHelper.getCustomizedStroke(Main.pref.get("improvewayaccuracy.stroke.select-target", "2"));
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java

    r10716 r10853  
    2929import org.openstreetmap.josm.data.osm.WaySegment;
    3030import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors;
     31import org.openstreetmap.josm.data.preferences.ColorProperty;
    3132import org.openstreetmap.josm.gui.MapFrame;
    3233import org.openstreetmap.josm.gui.MapView;
     
    155156        helpLineStroke = GuiHelper.getCustomizedStroke(getStringPref("stroke.hepler-line", "1"));
    156157        refLineStroke = GuiHelper.getCustomizedStroke(getStringPref("stroke.ref-line", "1 2 2"));
    157         mainColor = Main.pref.getColor(marktr("make parallel helper line"), null);
    158         if (mainColor == null) mainColor = PaintColors.SELECTED.get();
     158        mainColor = new ColorProperty(marktr("make parallel helper line"), (Color) null).get();
     159        if (mainColor == null)
     160            mainColor = PaintColors.SELECTED.get();
    159161
    160162        //// Needed to update the mouse cursor if modifiers are changed when the mouse is motionless
Note: See TracChangeset for help on using the changeset viewer.