Changeset 11713 in josm


Ignore:
Timestamp:
2017-03-10T02:28:00+01:00 (6 months ago)
Author:
Don-vip
Message:

add Ant target to run PMD (only few rules for now), fix violations

Location:
trunk
Files:
9 added
40 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1212junit*.properties
        1313foobar
         14pmd-josm.xml
  • trunk/build.xml

    r11681 r11713  
    4545            <pathelement path="${groovy.jar}"/>
    4646            <pathelement path="tools/findbugs/annotations.jar"/>
     47        </path>
     48        <path id="pmd.classpath">
     49            <fileset dir="${base.dir}/tools/pmd/">
     50                <include name="*.jar"/>
     51            </fileset>
    4752        </path>
    4853    </target>
     
    756761        </findbugs>
    757762    </target>
     763
     764    <target name="pmd" depends="init-properties">
     765        <taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask" classpath="${toString:pmd.classpath}"/>
     766        <pmd shortFilenames="true" encoding="UTF-8">
     767            <sourceLanguage name="java" version="1.8" />
     768            <ruleset>${base.dir}/tools/pmd/josm-ruleset.xml</ruleset>
     769            <formatter type="text" toConsole="true" />
     770            <formatter type="xml" toFile="pmd-josm.xml">
     771                <param name="encoding" value="UTF-8" />
     772            </formatter>
     773            <fileset dir="${src.dir}">
     774                <include name="org/openstreetmap/josm/**/*.java"/>
     775                <exclude name="org/openstreetmap/josm/gui/mappaint/mapcss/parsergen/*.java" />
     776            </fileset>
     777        </pmd>
     778    </target>
     779
    758780    <target name="run" depends="dist">
    759781        <java jar="${dist.dir}/josm-custom.jar" fork="true">
  • trunk/src/org/openstreetmap/josm/Main.java

    r11656 r11713  
    8282import org.openstreetmap.josm.gui.layer.TMSLayer;
    8383import org.openstreetmap.josm.gui.preferences.ToolbarPreferences;
     84import org.openstreetmap.josm.gui.preferences.display.LafPreference;
    8485import org.openstreetmap.josm.gui.preferences.imagery.ImageryPreference;
    8586import org.openstreetmap.josm.gui.preferences.map.MapPaintPreference;
     
    765766
    766767        String defaultlaf = platform.getDefaultStyle();
    767         String laf = Main.pref.get("laf", defaultlaf);
     768        String laf = LafPreference.LAF.get();
    768769        try {
    769770            UIManager.setLookAndFeel(laf);
     
    787788                } catch (UnsupportedLookAndFeelException ex) {
    788789                    info("Look and Feel not supported: " + laf);
    789                     Main.pref.put("laf", defaultlaf);
     790                    LafPreference.LAF.put(defaultlaf);
    790791                    trace(ex);
    791792                }
    792793            } else {
    793794                info("Look and Feel not found: " + laf);
    794                 Main.pref.put("laf", defaultlaf);
     795                LafPreference.LAF.put(defaultlaf);
    795796            }
    796797        } catch (UnsupportedLookAndFeelException e) {
    797798            info("Look and Feel not supported: " + laf);
    798             Main.pref.put("laf", defaultlaf);
     799            LafPreference.LAF.put(defaultlaf);
    799800            trace(e);
    800801        } catch (InstantiationException | IllegalAccessException e) {
  • trunk/src/org/openstreetmap/josm/actions/AutoScaleAction.java

    r11383 r11713  
    137137     * Constructs a new {@code AutoScaleAction}.
    138138     * @param mode The autoscale mode (one of {@link AutoScaleAction#MODES})
    139      * @param marker Used only to differentiate from default constructor
     139     * @param marker Must be set to false. Used only to differentiate from default constructor
    140140     */
    141141    private AutoScaleAction(String mode, boolean marker) {
    142         super(false);
     142        super(marker);
    143143        this.mode = mode;
    144144    }
  • trunk/src/org/openstreetmap/josm/actions/ImageryAdjustAction.java

    r11652 r11713  
    5353     */
    5454    public ImageryAdjustAction(AbstractTileSourceLayer<?> layer) {
    55         super(tr("New offset"), "adjustimg",
    56                 tr("Adjust the position of this imagery layer"), Main.map,
    57                 cursor);
     55        super(tr("New offset"), "adjustimg", tr("Adjust the position of this imagery layer"), cursor);
    5856        putValue("toolbar", Boolean.FALSE);
    5957        this.layer = layer;
  • trunk/src/org/openstreetmap/josm/actions/LassoModeAction.java

    r7937 r11713  
    2222                /* ICON(mapmode/) */ "rope",
    2323                tr("Lasso selection mode: select objects within a hand-drawn region"),
    24                 null,
    2524                ImageProvider.getCursor("normal", "rope"));
    2625    }
  • trunk/src/org/openstreetmap/josm/actions/mapmode/AddNoteAction.java

    r10433 r11713  
    1313import org.openstreetmap.josm.data.coor.LatLon;
    1414import org.openstreetmap.josm.data.osm.NoteData;
    15 import org.openstreetmap.josm.gui.MapFrame;
    1615import org.openstreetmap.josm.gui.NoteInputDialog;
    1716import org.openstreetmap.josm.gui.Notification;
     
    3029    /**
    3130     * Construct a new map mode.
    32      * @param mapFrame Map frame to pass to the superconstructor
    3331     * @param data Note data container. Must not be null
     32     * @since 11713
    3433     */
    35     public AddNoteAction(MapFrame mapFrame, NoteData data) {
    36         super(tr("Add a new Note"), "addnote",
    37             tr("Add note mode"),
    38             mapFrame, ImageProvider.getCursor("crosshair", "create_note"));
     34    public AddNoteAction(NoteData data) {
     35        super(tr("Add a new Note"), "addnote", tr("Add note mode"),
     36            ImageProvider.getCursor("crosshair", "create_note"));
    3937        CheckParameterUtil.ensureParameterNotNull(data, "data");
    4038        noteData = data;
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DeleteAction.java

    r10716 r11713  
    2222import org.openstreetmap.josm.data.osm.Relation;
    2323import org.openstreetmap.josm.data.osm.WaySegment;
    24 import org.openstreetmap.josm.gui.MapFrame;
    2524import org.openstreetmap.josm.gui.dialogs.relation.RelationDialogManager;
    2625import org.openstreetmap.josm.gui.layer.Layer;
     
    8988    /**
    9089     * Construct a new DeleteAction. Mnemonic is the delete - key.
    91      * @param mapFrame The frame this action belongs to.
    92      */
    93     public DeleteAction(MapFrame mapFrame) {
     90     * @since 11713
     91     */
     92    public DeleteAction() {
    9493        super(tr("Delete Mode"),
    9594                "delete",
     
    9796                Shortcut.registerShortcut("mapmode:delete", tr("Mode: {0}", tr("Delete")),
    9897                KeyEvent.VK_DELETE, Shortcut.CTRL),
    99                 mapFrame,
    10098                ImageProvider.getCursor("normal", "delete"));
    10199    }
    102100
    103     @Override public void enterMode() {
     101    @Override
     102    public void enterMode() {
    104103        super.enterMode();
    105104        if (!isEnabled())
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r11601 r11713  
    5454import org.openstreetmap.josm.data.preferences.StrokeProperty;
    5555import org.openstreetmap.josm.gui.MainMenu;
    56 import org.openstreetmap.josm.gui.MapFrame;
    5756import org.openstreetmap.josm.gui.MapView;
    5857import org.openstreetmap.josm.gui.MapViewState.MapViewPoint;
     
    156155    /**
    157156     * Constructs a new {@code DrawAction}.
    158      * @param mapFrame Map frame
    159      */
    160     public DrawAction(MapFrame mapFrame) {
     157     * @since 11713
     158     */
     159    public DrawAction() {
    161160        super(tr("Draw"), "node/autonode", tr("Draw nodes"),
    162161                Shortcut.registerShortcut("mapmode:draw", tr("Mode: {0}", tr("Draw")), KeyEvent.VK_A, Shortcut.DIRECT),
    163                 mapFrame, ImageProvider.getCursor("crosshair", null));
     162                ImageProvider.getCursor("crosshair", null));
    164163
    165164        snappingShortcut = Shortcut.registerShortcut("mapmode:drawanglesnapping",
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ExtrudeAction.java

    r11542 r11713  
    4545import org.openstreetmap.josm.data.preferences.ColorProperty;
    4646import org.openstreetmap.josm.gui.MainMenu;
    47 import org.openstreetmap.josm.gui.MapFrame;
    4847import org.openstreetmap.josm.gui.MapView;
    4948import org.openstreetmap.josm.gui.draw.MapViewPath;
     
    210209    /**
    211210     * Creates a new ExtrudeAction
    212      * @param mapFrame The MapFrame this action belongs to.
    213      */
    214     public ExtrudeAction(MapFrame mapFrame) {
     211     * @since 11713
     212     */
     213    public ExtrudeAction() {
    215214        super(tr("Extrude"), /* ICON(mapmode/) */ "extrude/extrude", tr("Create areas"),
    216215                Shortcut.registerShortcut("mapmode:extrude", tr("Mode: {0}", tr("Extrude")), KeyEvent.VK_X, Shortcut.DIRECT),
    217                 mapFrame,
    218216                ImageProvider.getCursor("normal", "rectangle"));
    219217        putValue("help", ht("/Action/Extrude"));
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java

    r11542 r11713  
    4040import org.openstreetmap.josm.data.preferences.IntegerProperty;
    4141import org.openstreetmap.josm.data.preferences.StrokeProperty;
    42 import org.openstreetmap.josm.gui.MapFrame;
    4342import org.openstreetmap.josm.gui.MapView;
    4443import org.openstreetmap.josm.gui.draw.MapViewPath;
     
    111110    /**
    112111     * Constructs a new {@code ImproveWayAccuracyAction}.
    113      * @param mapFrame Map frame
     112     * @since 11713
    114113     */
    115     public ImproveWayAccuracyAction(MapFrame mapFrame) {
     114    public ImproveWayAccuracyAction() {
    116115        super(tr("Improve Way Accuracy"), "improvewayaccuracy",
    117116                tr("Improve Way Accuracy mode"),
    118117                Shortcut.registerShortcut("mapmode:ImproveWayAccuracy",
    119118                tr("Mode: {0}", tr("Improve Way Accuracy")),
    120                 KeyEvent.VK_W, Shortcut.DIRECT), mapFrame, Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
     119                KeyEvent.VK_W, Shortcut.DIRECT), Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
    121120
    122121        readPreferences();
  • trunk/src/org/openstreetmap/josm/actions/mapmode/MapMode.java

    r11421 r11713  
    1111import org.openstreetmap.josm.Main;
    1212import org.openstreetmap.josm.actions.JosmAction;
     13import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
     14import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
    1315import org.openstreetmap.josm.gui.MapFrame;
    1416import org.openstreetmap.josm.gui.layer.Layer;
    1517import org.openstreetmap.josm.tools.ImageProvider;
    1618import org.openstreetmap.josm.tools.Shortcut;
    17 import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
    18 import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
    1919
    2020/**
     
    3636     * @param tooltip  a longer description of the action that will be displayed in the tooltip.
    3737     * @param shortcut a ready-created shortcut object or null if you don't want a shortcut.
    38      * @param mapFrame unused but kept for plugin compatibility. Can be {@code null}
    39      * @param cursor cursor displayed when map mode is active
    40      */
    41     public MapMode(String name, String iconName, String tooltip, Shortcut shortcut, MapFrame mapFrame, Cursor cursor) {
     38     * @param cursor cursor displayed when map mode is active
     39     * @since 11713
     40     */
     41    public MapMode(String name, String iconName, String tooltip, Shortcut shortcut, Cursor cursor) {
    4242        super(name, "mapmode/"+iconName, tooltip, shortcut, false);
    4343        this.cursor = cursor;
     
    5050     * @param iconName icon filename in {@code mapmode} directory
    5151     * @param tooltip  a longer description of the action that will be displayed in the tooltip.
    52      * @param mapFrame unused but kept for plugin compatibility. Can be {@code null}
    53      * @param cursor cursor displayed when map mode is active
    54      */
    55     public MapMode(String name, String iconName, String tooltip, MapFrame mapFrame, Cursor cursor) {
     52     * @param cursor cursor displayed when map mode is active
     53     * @since 11713
     54     */
     55    public MapMode(String name, String iconName, String tooltip, Cursor cursor) {
    5656        putValue(NAME, name);
    5757        new ImageProvider("mapmode", iconName).getResource().attachImageIcon(this);
    5858        putValue(SHORT_DESCRIPTION, tooltip);
    5959        this.cursor = cursor;
     60    }
     61
     62    /**
     63     * Constructor for mapmodes without a menu
     64     * @param name the action's text
     65     * @param iconName icon filename in {@code mapmode} directory
     66     * @param tooltip  a longer description of the action that will be displayed in the tooltip.
     67     * @param shortcut a ready-created shortcut object or null if you don't want a shortcut.
     68     * @param mapFrame unused but kept for plugin compatibility. Can be {@code null}
     69     * @param cursor cursor displayed when map mode is active
     70     * @deprecated use {@link #MapMode(String, String, String, Shortcut, Cursor) instead}
     71     */
     72    @Deprecated
     73    public MapMode(String name, String iconName, String tooltip, Shortcut shortcut, MapFrame mapFrame, Cursor cursor) {
     74        this(name, iconName, tooltip, shortcut, cursor);
     75    }
     76
     77    /**
     78     * Constructor for mapmodes with a menu (no shortcut will be registered)
     79     * @param name the action's text
     80     * @param iconName icon filename in {@code mapmode} directory
     81     * @param tooltip  a longer description of the action that will be displayed in the tooltip.
     82     * @param mapFrame unused but kept for plugin compatibility. Can be {@code null}
     83     * @param cursor cursor displayed when map mode is active
     84     * @deprecated use {@link #MapMode(String, String, String, Cursor) instead}
     85     */
     86    @Deprecated
     87    public MapMode(String name, String iconName, String tooltip, MapFrame mapFrame, Cursor cursor) {
     88        this(name, iconName, tooltip, cursor);
    6089    }
    6190
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java

    r11542 r11713  
    153153            Shortcut.registerShortcut("mapmode:parallel", tr("Mode: {0}",
    154154                tr("Parallel")), KeyEvent.VK_P, Shortcut.SHIFT),
    155             mapFrame, ImageProvider.getCursor("normal", "parallel"));
     155            ImageProvider.getCursor("normal", "parallel"));
    156156        putValue("help", ht("/Action/Parallel"));
    157157        mv = mapFrame.mapView;
  • trunk/src/org/openstreetmap/josm/actions/mapmode/PlayHeadDragMode.java

    r11381 r11713  
    1111import org.openstreetmap.josm.data.coor.EastNorth;
    1212import org.openstreetmap.josm.gui.layer.markerlayer.PlayHeadMarker;
     13import org.openstreetmap.josm.tools.Shortcut;
    1314
    1415/**
     
    3031     */
    3132    public PlayHeadDragMode(PlayHeadMarker m) {
    32         super(tr("Drag play head"), "playheaddrag", tr("Drag play head"), null,
    33                 Main.map, Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
     33        super(tr("Drag play head"), "playheaddrag", tr("Drag play head"), (Shortcut) null,
     34                Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
    3435        playHeadMarker = m;
    3536    }
  • trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java

    r11553 r11713  
    182182        super(tr("Select"), "move/move", tr("Select, move, scale and rotate objects"),
    183183                Shortcut.registerShortcut("mapmode:select", tr("Mode: {0}", tr("Select")), KeyEvent.VK_S, Shortcut.DIRECT),
    184                 mapFrame,
    185184                ImageProvider.getCursor("normal", "selection"));
    186185        mv = mapFrame.mapView;
  • trunk/src/org/openstreetmap/josm/actions/mapmode/ZoomAction.java

    r10241 r11713  
    4444        super(tr("Zoom"), "zoom", tr("Zoom and move map"),
    4545                Shortcut.registerShortcut("mapmode:zoom", tr("Mode: {0}", tr("Zoom")), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE),
    46                 mapFrame, ImageProvider.getCursor("normal", "zoom"));
     46                ImageProvider.getCursor("normal", "zoom"));
    4747        selectionManager = new SelectionManager(this, true, mapFrame.mapView);
    4848    }
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r11650 r11713  
    293293                args.getSingle(Option.GEOMETRY).orElse(null),
    294294                !args.hasOption(Option.NO_MAXIMIZE) && Main.pref.getBoolean("gui.maximized", false));
    295         final MainFrame mainFrame = new MainFrame(contentPanePrivate, mainPanel, geometry);
     295        final MainFrame mainFrame = new MainFrame(contentPanePrivate, geometry);
    296296        Main.parent = mainFrame;
    297297
  • trunk/src/org/openstreetmap/josm/gui/MainFrame.java

    r11348 r11713  
    5555     */
    5656    public MainFrame() {
    57         this(new JPanel(), new MainPanel(Main.getLayerManager()), new WindowGeometry(new Rectangle(10, 10, 500, 500)));
     57        this(new JPanel(), new WindowGeometry(new Rectangle(10, 10, 500, 500)));
    5858    }
    5959
     
    6161     * Create a new main window. The parameters will be removed in the future.
    6262     * @param contentPanePrivate The content
    63      * @param mainPanel The main panel.
    6463     * @param geometry The inital geometry to use.
    65      */
    66     public MainFrame(Container contentPanePrivate, MainPanel mainPanel, WindowGeometry geometry) {
     64     * @since 11713
     65     */
     66    public MainFrame(Container contentPanePrivate, WindowGeometry geometry) {
    6767        super();
    6868        this.geometry = geometry;
  • trunk/src/org/openstreetmap/josm/gui/MainPanel.java

    r11551 r11713  
    8484
    8585    private MapFrame createNewMapFrame() {
    86         MapFrame mapFrame = new MapFrame(null, null);
     86        MapFrame mapFrame = new MapFrame(null);
    8787        // Required by many components.
    8888        Main.map = mapFrame;
  • trunk/src/org/openstreetmap/josm/gui/MapFrame.java

    r11536 r11713  
    183183    /**
    184184     * Constructs a new {@code MapFrame}.
    185      * @param contentPane Ignored. Main content pane is used.
    186185     * @param viewportData the initial viewport of the map. Can be null, then
    187186     * the viewport is derived from the layer data.
    188      */
    189     public MapFrame(JPanel contentPane, ViewportData viewportData) {
     187     * @since 11713
     188     */
     189    public MapFrame(ViewportData viewportData) {
    190190        setSize(400, 400);
    191191        setLayout(new BorderLayout());
    192192
    193         mapView = new MapView(Main.getLayerManager(), contentPane, viewportData);
     193        mapView = new MapView(Main.getLayerManager(), viewportData);
    194194
    195195        splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true);
     
    228228        mapModeSelect = new SelectAction(this);
    229229        mapModeSelectLasso = new LassoModeAction();
    230         mapModeDraw = new DrawAction(this);
     230        mapModeDraw = new DrawAction();
    231231        mapModeZoom = new ZoomAction(this);
    232232
     
    235235        addMapMode(new IconToggleButton(mapModeDraw));
    236236        addMapMode(new IconToggleButton(mapModeZoom, true));
    237         addMapMode(new IconToggleButton(new DeleteAction(this), true));
     237        addMapMode(new IconToggleButton(new DeleteAction(), true));
    238238        addMapMode(new IconToggleButton(new ParallelWayAction(this), true));
    239         addMapMode(new IconToggleButton(new ExtrudeAction(this), true));
    240         addMapMode(new IconToggleButton(new ImproveWayAccuracyAction(Main.map), false));
     239        addMapMode(new IconToggleButton(new ExtrudeAction(), true));
     240        addMapMode(new IconToggleButton(new ImproveWayAccuracyAction(), false));
    241241        toolBarActionsGroup.setSelected(allMapModeButtons.get(0).getModel(), true);
    242242        toolBarActions.setFloatable(false);
  • trunk/src/org/openstreetmap/josm/gui/MapMover.java

    r11553 r11713  
    1515
    1616import javax.swing.AbstractAction;
    17 import javax.swing.JPanel;
    1817
    1918import org.openstreetmap.gui.jmapviewer.JMapViewer;
     
    3837    public static final BooleanProperty PROP_ZOOM_REVERSE_WHEEL = new BooleanProperty("zoom.reverse-wheel", false);
    3938
    40     private static final JMapViewerUpdater jMapViewerUpdater = new JMapViewerUpdater();
     39    static {
     40        new JMapViewerUpdater();
     41    }
    4142
    4243    private static class JMapViewerUpdater implements PreferenceChangedListener {
     
    117118     * Constructs a new {@code MapMover}.
    118119     * @param navComp the navigatable component
    119      * @param contentPane Ignored. The main action map is used.
    120      */
    121     public MapMover(NavigatableComponent navComp, JPanel contentPane) {
     120     * @since 11713
     121     */
     122    public MapMover(NavigatableComponent navComp) {
    122123        this.nc = navComp;
    123124        nc.addMouseListener(this);
  • trunk/src/org/openstreetmap/josm/gui/MapView.java

    r11226 r11713  
    237237     * the viewport is derived from the layer data.
    238238     * @since 10279
    239      */
     239     * @deprecated use {@link #MapView(MainLayerManager, ViewportData)} instead
     240     */
     241    @Deprecated
    240242    public MapView(MainLayerManager layerManager, final JPanel contentPane, final ViewportData viewportData) {
     243        this(layerManager, viewportData);
     244    }
     245
     246    /**
     247     * Constructs a new {@code MapView}.
     248     * @param layerManager The layers to display.
     249     * @param viewportData the initial viewport of the map. Can be null, then
     250     * the viewport is derived from the layer data.
     251     * @since 11713
     252     */
     253    public MapView(MainLayerManager layerManager, final ViewportData viewportData) {
    241254        this.layerManager = layerManager;
    242255        initialViewport = viewportData;
     
    249262            public void componentResized(ComponentEvent e) {
    250263                removeComponentListener(this);
    251 
    252                 mapMover = new MapMover(MapView.this, contentPane);
     264                mapMover = new MapMover(MapView.this);
    253265            }
    254266        });
    255267
    256         // listend to selection changes to redraw the map
     268        // listens to selection changes to redraw the map
    257269        DataSet.addSelectionListener(repaintSelectionChangedListener);
    258270
  • trunk/src/org/openstreetmap/josm/gui/datatransfer/importers/OsmLinkPaster.java

    r11357 r11713  
    1414import org.openstreetmap.josm.data.coor.EastNorth;
    1515import org.openstreetmap.josm.data.coor.LatLon;
    16 import org.openstreetmap.josm.data.preferences.BooleanProperty;
    1716import org.openstreetmap.josm.gui.MapView;
    1817import org.openstreetmap.josm.gui.layer.OsmDataLayer;
     
    3534    }
    3635
    37     private static final BooleanProperty PASTE_REFERRERS = new BooleanProperty("paste.url.download-referrers", true);
    3836    private static final String OSM_SERVER = "^https?\\://(\\w+\\.)?(osm|openstreetmap)\\.org/";
    3937
     
    6866    }
    6967
    70     protected static LatLon parseLatLon(String transferData) {
     68    static LatLon parseLatLon(String transferData) {
    7169        Matcher matcher = Pattern
    7270                .compile(OSM_SERVER + "#map=(?<zoom>\\d+)/(?<lat>-?\\d+\\.\\d+)/(?<lon>-?\\d+\\.\\d+)$")
  • trunk/src/org/openstreetmap/josm/gui/dialogs/NotesDialog.java

    r11386 r11713  
    355355                Main.getLayerManager().addLayer(new NoteLayer());
    356356            }
    357             Main.map.selectMapMode(new AddNoteAction(Main.map, noteData));
     357            Main.map.selectMapMode(new AddNoteAction(noteData));
    358358        }
    359359    }
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java

    r11628 r11713  
    8686    private DefaultMutableTreeNode lastSelectedNode;
    8787
    88     private transient OsmDataLayer linkedLayer;
    89 
    9088    /**
    9189     * Constructor
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/ChangesetCacheManager.java

    r11593 r11713  
    294294        actDownloadSelectedChangesets = new DownloadSelectedChangesetsAction(model);
    295295        actDownloadSelectedContent = new DownloadSelectedChangesetContentAction(model);
    296         actDownloadSelectedChangesetObjects = new DownloadSelectedChangesetObjectsAction(model);
     296        actDownloadSelectedChangesetObjects = new DownloadSelectedChangesetObjectsAction();
    297297
    298298        cp.add(buildToolbarPanel(), BorderLayout.NORTH);
     
    556556    private class DownloadSelectedChangesetObjectsAction extends AbstractAction implements ListSelectionListener {
    557557
    558         DownloadSelectedChangesetObjectsAction(ChangesetCacheManagerModel model) {
     558        DownloadSelectedChangesetObjectsAction() {
    559559            putValue(NAME, tr("Download changed objects"));
    560560            new ImageProvider("downloadprimitive").getResource().attachImageIcon(this);
  • trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java

    r11383 r11713  
    8989        super(d.getString(GpxConstants.META_NAME));
    9090        data = d;
    91         drawHelper = new GpxDrawHelper(data, getColorProperty());
     91        drawHelper = new GpxDrawHelper(data);
    9292        SystemOfMeasurement.addSoMChangeListener(drawHelper);
    9393        ensureTrackVisibilityLength();
  • trunk/src/org/openstreetmap/josm/gui/layer/MapViewPaintable.java

    r10609 r11713  
    7272     * @since 10458
    7373     */
    74     public interface LayerPainter {
     74    interface LayerPainter {
    7575
    7676        /**
  • trunk/src/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelper.java

    r11704 r11713  
    3939import org.openstreetmap.josm.data.gpx.GpxData;
    4040import org.openstreetmap.josm.data.gpx.WayPoint;
    41 import org.openstreetmap.josm.data.preferences.AbstractProperty;
    4241import org.openstreetmap.josm.data.preferences.ColorProperty;
    4342import org.openstreetmap.josm.gui.MapView;
     
    206205     * Constructs a new {@code GpxDrawHelper}.
    207206     * @param gpxData GPX data
    208      * @param abstractProperty The color to draw with
    209      * @since 10824
    210      */
    211     public GpxDrawHelper(GpxData gpxData, AbstractProperty<Color> abstractProperty) {
     207     * @since 11713
     208     */
     209    public GpxDrawHelper(GpxData gpxData) {
    212210        data = gpxData;
    213211        setupColors();
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java

    r10837 r11713  
    4040     */
    4141    @FunctionalInterface
    42     public interface ToTagConvertable {
     42    interface ToTagConvertable {
    4343        /**
    4444         * Converts the current condition to a tag
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java

    r11374 r11713  
    5858    @Target(ElementType.METHOD)
    5959    @Retention(RetentionPolicy.RUNTIME)
    60     static @interface NullableArguments {}
     60    @interface NullableArguments {}
    6161
    6262    private static final List<Method> arrayFunctions = new ArrayList<>();
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj

    r11623 r11713  
    6767     * Nicer way to refer to a lexical state.
    6868     */
    69     public static enum LexicalState {
     69    public enum LexicalState {
    7070        /** the preprocessor */
    7171        PREPROCESSOR(0),
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java

    r11366 r11713  
    2626import org.openstreetmap.josm.Main;
    2727import org.openstreetmap.josm.actions.ExpertToggleAction;
     28import org.openstreetmap.josm.data.preferences.StringProperty;
    2829import org.openstreetmap.josm.gui.MapMover;
    2930import org.openstreetmap.josm.gui.NavigatableComponent;
     
    4445 */
    4546public class LafPreference implements SubPreferenceSetting {
     47
     48    /**
     49     * Look-and-feel property.
     50     * @since 11713
     51     */
     52    public static final StringProperty LAF = new StringProperty("laf", Main.platform.getDefaultStyle());
    4653
    4754    static final class LafListCellRenderer implements ListCellRenderer<LookAndFeelInfo> {
     
    100107        }
    101108
    102         String laf = Main.pref.get("laf", Main.platform.getDefaultStyle());
     109        String laf = LAF.get();
    103110        for (int i = 0; i < lafCombo.getItemCount(); ++i) {
    104111            if (lafCombo.getItemAt(i).getClassName().equals(laf)) {
     
    203210        NavigatableComponent.PROP_ZOOM_INTERMEDIATE_STEPS.put(zoomIntermediateSteps.isSelected());
    204211        NavigatableComponent.PROP_ZOOM_RATIO.put(Math.pow(2, 1/(double) spinZoomRatio.getModel().getValue()));
    205         mod |= Main.pref.put("laf", ((LookAndFeelInfo) lafCombo.getSelectedItem()).getClassName());
     212        mod |= LAF.put(((LookAndFeelInfo) lafCombo.getSelectedItem()).getClassName());
    206213        return mod;
    207214    }
  • trunk/src/org/openstreetmap/josm/gui/progress/ProgressMonitor.java

    r11100 r11713  
    3333
    3434    @FunctionalInterface
    35     public interface CancelListener {
     35    interface CancelListener {
    3636        void operationCanceled();
    3737    }
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/AddNoteActionTest.java

    r10945 r11713  
    3838        try {
    3939            Main.getLayerManager().addLayer(layer);
    40             AddNoteAction mapMode = new AddNoteAction(Main.map, new NoteData(Collections.<Note>emptyList()));
     40            AddNoteAction mapMode = new AddNoteAction(new NoteData(Collections.<Note>emptyList()));
    4141            MapMode oldMapMode = Main.map.mapMode;
    4242            assertTrue(Main.map.selectMapMode(mapMode));
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/DeleteActionTest.java

    r10945 r11713  
    3434        try {
    3535            Main.getLayerManager().addLayer(layer);
    36             DeleteAction mapMode = new DeleteAction(Main.map);
     36            DeleteAction mapMode = new DeleteAction();
    3737            MapMode oldMapMode = Main.map.mapMode;
    3838            assertTrue(Main.map.selectMapMode(mapMode));
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ExtrudeActionTest.java

    r10945 r11713  
    3434        try {
    3535            Main.getLayerManager().addLayer(layer);
    36             ExtrudeAction mapMode = new ExtrudeAction(Main.map);
     36            ExtrudeAction mapMode = new ExtrudeAction();
    3737            MapMode oldMapMode = Main.map.mapMode;
    3838            assertTrue(Main.map.selectMapMode(mapMode));
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyActionTest.java

    r10945 r11713  
    3434        try {
    3535            Main.getLayerManager().addLayer(layer);
    36             ImproveWayAccuracyAction mapMode = new ImproveWayAccuracyAction(Main.map);
     36            ImproveWayAccuracyAction mapMode = new ImproveWayAccuracyAction();
    3737            MapMode oldMapMode = Main.map.mapMode;
    3838            assertTrue(Main.map.selectMapMode(mapMode));
  • trunk/test/unit/org/openstreetmap/josm/actions/mapmode/MapViewMock.java

    r10396 r11713  
    1212class MapViewMock extends MapView {
    1313    MapViewMock() {
    14         super(Main.getLayerManager(), null, null);
     14        super(Main.getLayerManager(), null);
    1515    }
    1616
  • trunk/test/unit/org/openstreetmap/josm/gui/layer/gpx/GpxDrawHelperTest.java

    r10824 r11713  
    44import static org.junit.Assert.assertEquals;
    55
    6 import java.awt.Color;
    76import java.io.FileNotFoundException;
    87import java.io.IOException;
     
    1817import org.openstreetmap.josm.data.gpx.GpxData;
    1918import org.openstreetmap.josm.data.gpx.WayPoint;
    20 import org.openstreetmap.josm.data.preferences.ColorProperty;
    2119import org.openstreetmap.josm.io.GpxReaderTest;
    2220import org.openstreetmap.josm.tools.ColorHelper;
     
    127125    static List<String> calculateColors(String fileName, String layerName, int n) throws IOException, SAXException {
    128126        final GpxData data = GpxReaderTest.parseGpxData(fileName);
    129         final GpxDrawHelper gdh = new GpxDrawHelper(data, new ColorProperty("x", Color.MAGENTA));
     127        final GpxDrawHelper gdh = new GpxDrawHelper(data);
    130128        gdh.readPreferences(layerName);
    131129        gdh.calculateColors();
Note: See TracChangeset for help on using the changeset viewer.