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

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

Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore
      •  

        old new  
        1212junit*.properties
        1313foobar
         14pmd-josm.xml
  • 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    }
Note: See TracChangeset for help on using the changeset viewer.