Ignore:
Timestamp:
2014-02-05T23:22:04+01:00 (10 years ago)
Author:
Don-vip
Message:

fix #8234 - remove duplicated/unused icons + javadoc

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
7 edited

Legend:

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

    r6380 r6814  
    3232 * Aligns all selected nodes within a circle. (Useful for roundabouts)
    3333 *
     34 * @since 146
     35 *
    3436 * @author Matthew Newton
    3537 * @author Petr Dlouhý
     
    4850    }
    4951
    50     public double distance(EastNorth n, EastNorth m) {
     52    private static double distance(EastNorth n, EastNorth m) {
    5153        double easd, nord;
    5254        easd = n.east() - m.east();
     
    5557    }
    5658
    57     public class PolarCoor {
     59    public static class PolarCoor {
    5860        double radius;
    5961        double angle;
     
    250252     * @return true if all nodes in the given collection are referred by the same object, and no other one (see #8431)
    251253     */
    252     protected boolean allowRegularPolygon(Collection<Node> nodes) {
     254    protected static boolean allowRegularPolygon(Collection<Node> nodes) {
    253255        Set<OsmPrimitive> allReferrers = new HashSet<OsmPrimitive>();
    254256        for (Node n : nodes) {
  • trunk/src/org/openstreetmap/josm/actions/CreateCircleAction.java

    r6672 r6814  
    3838 * BTW: Someone might want to implement projection corrections for this...
    3939 *
     40 * @since 996
     41 *
    4042 * @author Henry Loenwind, based on much copy&Paste from other Actions.
    4143 * @author Sebastian Masch
     
    4749     */
    4850    public CreateCircleAction() {
    49         super(tr("Create Circle"), "createcircle", tr("Create a circle from three selected nodes."),
     51        super(tr("Create Circle"), "aligncircle", tr("Create a circle from three selected nodes."),
    5052            Shortcut.registerShortcut("tools:createcircle", tr("Tool: {0}", tr("Create Circle")),
    51             KeyEvent.VK_O, Shortcut.SHIFT), true);
     53            KeyEvent.VK_O, Shortcut.SHIFT), true, "createcircle", true);
    5254        putValue("help", ht("/Action/CreateCircle"));
    5355    }
     
    276278        Main.map.repaint();
    277279    }
    278    
     280
    279281    private static void notifyNodesNotOnCircle() {
    280282        new Notification(
  • trunk/src/org/openstreetmap/josm/actions/DownloadReferrersAction.java

    r6336 r6814  
    2020
    2121/**
    22  * This action loads the set of primitives referring to the current selection from the OSM
    23  * server.
    24  *
     22 * This action loads the set of primitives referring to the current selection from the OSM server.
     23 * @since 1810
    2524 */
    26 public class DownloadReferrersAction extends JosmAction{
     25public class DownloadReferrersAction extends JosmAction {
    2726
     27        /**
     28         * Constructs a new {@code DownloadReferrersAction}.
     29         */
    2830    public DownloadReferrersAction() {
    29         super(tr("Download parent ways/relations..."), "downloadreferrers", tr("Download objects referring to one of the selected objects"),
    30                 Shortcut.registerShortcut("file:downloadreferrers", tr("File: {0}", tr("Download parent ways/relations...")), KeyEvent.VK_D, Shortcut.ALT_CTRL), true);
     31        super(tr("Download parent ways/relations..."), "download",
     32                        tr("Download objects referring to one of the selected objects"),
     33                Shortcut.registerShortcut("file:downloadreferrers",
     34                                tr("File: {0}", tr("Download parent ways/relations...")), KeyEvent.VK_D, Shortcut.ALT_CTRL),
     35                true, "downloadreferrers", true);
    3136        putValue("help", ht("/Action/DownloadParentWaysAndRelation"));
    3237    }
     
    4146     * @exception IllegalArgumentException thrown if targetLayer is null
    4247     */
    43     static public void downloadReferrers(OsmDataLayer targetLayer, Collection<OsmPrimitive> children) throws IllegalArgumentException {
     48    public static void downloadReferrers(OsmDataLayer targetLayer, Collection<OsmPrimitive> children) throws IllegalArgumentException {
    4449        if (children == null || children.isEmpty()) return;
    4550        Main.worker.submit(new DownloadReferrersTask(targetLayer, children));
     
    5560     * @exception IllegalArgumentException thrown if targetLayer is null
    5661     */
    57     static public void downloadReferrers(OsmDataLayer targetLayer, Map<Long, OsmPrimitiveType> children) throws IllegalArgumentException {
     62    public static void downloadReferrers(OsmDataLayer targetLayer, Map<Long, OsmPrimitiveType> children) throws IllegalArgumentException {
    5863        if (children == null || children.isEmpty()) return;
    5964        Main.worker.submit(new DownloadReferrersTask(targetLayer, children));
     
    6469     * <code>type</code>.
    6570     *
    66      *
    6771     * @param targetLayer  the target layer. Must not be null.
    6872     * @param id the primitive id. id > 0 required.
     
    7276     * @exception IllegalArgumentException thrown if type == null
    7377     */
    74     static public void downloadReferrers(OsmDataLayer targetLayer, long id, OsmPrimitiveType type) throws IllegalArgumentException {
     78    public static void downloadReferrers(OsmDataLayer targetLayer, long id, OsmPrimitiveType type) throws IllegalArgumentException {
    7579        if (id <= 0)
    7680            throw new IllegalArgumentException(MessageFormat.format("Id > 0 required, got {0}", id));
  • trunk/src/org/openstreetmap/josm/actions/JoinNodeWayAction.java

    r6380 r6814  
    2727
    2828public class JoinNodeWayAction extends JosmAction {
     29
     30    /**
     31     * Constructs a new {@code JoinNodeWayAction}.
     32     */
    2933    public JoinNodeWayAction() {
    3034        super(tr("Join Node to Way"), "joinnodeway", tr("Include a node into the nearest way segments"),
     
    5357            HashMap<Way, List<Integer>> insertPoints = new HashMap<Way, List<Integer>>();
    5458            for (WaySegment ws : wss) {
    55                 // Maybe cleaner to pass a "isSelected" predicate to getNearestWaySegements, but this is atm. less invasive.
     59                // Maybe cleaner to pass a "isSelected" predicate to getNearestWaySegments, but this is less invasive.
    5660                if(restrictToSelectedWays && !ws.way.isSelected()) {
    5761                    continue;
  • trunk/src/org/openstreetmap/josm/actions/JosmAction.java

    r6380 r6814  
    4444    private SelectionChangeAdapter selectionChangeAdapter;
    4545
     46    /**
     47     * Returns the shortcut for this action.
     48     * @return the shortcut for this action, or "No shortcut" if none is defined
     49     */
    4650    public Shortcut getShortcut() {
    4751        if (sc == null) {
     
    110114    }
    111115
     116    /**
     117     * Constructs a new {@code JosmAction}.
     118     *
     119     * Use this super constructor to setup your action.
     120     *
     121     * @param name the action's text as displayed on the menu (if it is added to a menu)
     122     * @param iconName the filename of the icon to use
     123     * @param tooltip  a longer description of the action that will be displayed in the tooltip. Please note
     124     *           that html is not supported for menu actions on some platforms.
     125     * @param shortcut a ready-created shortcut object or null if you don't want a shortcut. But you always
     126     *            do want a shortcut, remember you can always register it with group=none, so you
     127     *            won't be assigned a shortcut unless the user configures one. If you pass null here,
     128     *            the user CANNOT configure a shortcut for your action.
     129     * @param registerInToolbar register this action for the toolbar preferences?
     130     * @param installAdapters false, if you don't want to install layer changed and selection changed adapters
     131     */
    112132    public JosmAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean registerInToolbar, boolean installAdapters) {
    113133        this(name, iconName, tooltip, shortcut, registerInToolbar, null, installAdapters);
    114134    }
    115135
     136    /**
     137     * Constructs a new {@code JosmAction}.
     138     *
     139     * Use this super constructor to setup your action.
     140     *
     141     * @param name the action's text as displayed on the menu (if it is added to a menu)
     142     * @param iconName the filename of the icon to use
     143     * @param tooltip  a longer description of the action that will be displayed in the tooltip. Please note
     144     *           that html is not supported for menu actions on some platforms.
     145     * @param shortcut a ready-created shortcut object or null if you don't want a shortcut. But you always
     146     *            do want a shortcut, remember you can always register it with group=none, so you
     147     *            won't be assigned a shortcut unless the user configures one. If you pass null here,
     148     *            the user CANNOT configure a shortcut for your action.
     149     * @param registerInToolbar register this action for the toolbar preferences?
     150     */
    116151    public JosmAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean registerInToolbar) {
    117152        this(name, iconName, tooltip, shortcut, registerInToolbar, null, true);
    118153    }
    119154
     155    /**
     156     * Constructs a new {@code JosmAction}.
     157     */
    120158    public JosmAction() {
    121159        this(true);
    122160    }
    123161
     162    /**
     163     * Constructs a new {@code JosmAction}.
     164     *
     165     * @param installAdapters false, if you don't want to install layer changed and selection changed adapters
     166     */
    124167    public JosmAction(boolean installAdapters) {
    125168        setHelpId();
     
    146189    }
    147190
     191    /**
     192     * Sets the tooltip text of this action.
     193     * @param tooltip The text to display in tooltip. Can be {@code null}
     194     */
    148195    public void setTooltip(String tooltip) {
    149196        if (tooltip != null) {
  • trunk/src/org/openstreetmap/josm/actions/UpdateModifiedAction.java

    r4982 r6814  
    1414/**
    1515 * This action synchronizes a set of primitives with their state on the server.
    16  *
     16 * @since 2682
    1717 */
    1818public class UpdateModifiedAction extends UpdateSelectionAction {
    1919
    2020    /**
    21      * constructor
     21     * Constructs a new {@code UpdateModifiedAction}.
    2222     */
    2323    public UpdateModifiedAction() {
    24         super(tr("Update modified"),
    25                 "updatemodified",
     24        super(tr("Update modified"), "updatedata",
    2625                tr("Updates the currently modified objects from the server (re-downloads data)"),
    2726                Shortcut.registerShortcut("file:updatemodified",
    2827                        tr("File: {0}", tr("Update modified")), KeyEvent.VK_M,
    2928                        Shortcut.ALT_CTRL),
    30                         true);
     29                        true, "updatemodified");
    3130        putValue("help", ht("/Action/UpdateModified"));
    3231    }
  • trunk/src/org/openstreetmap/josm/actions/UpdateSelectionAction.java

    r6336 r6814  
    2626/**
    2727 * This action synchronizes a set of primitives with their state on the server.
    28  *
     28 * @since 1670
    2929 */
    3030public class UpdateSelectionAction extends JosmAction {
     
    3434     *
    3535     * @param id the primitive id
     36     * @param type The primitive type. Must be one of {@link OsmPrimitiveType#NODE NODE}, {@link OsmPrimitiveType#WAY WAY}, {@link OsmPrimitiveType#RELATION RELATION}
    3637     */
    3738    public static void handlePrimitiveGoneException(long id, OsmPrimitiveType type) {
    3839        MultiFetchServerObjectReader reader = new MultiFetchServerObjectReader();
    39         reader.append(getCurrentDataSet(),id, type);
     40        reader.append(getCurrentDataSet(), id, type);
    4041        try {
    4142            DataSet ds = reader.parseOsm(NullProgressMonitor.INSTANCE);
     
    8081
    8182    /**
    82      * constructor
     83     * Constructs a new {@code UpdateSelectionAction}.
    8384     */
    8485    public UpdateSelectionAction() {
    85         super(tr("Update selection"),
    86                 "updateselection",
     86        super(tr("Update selection"), "updatedata",
    8787                tr("Updates the currently selected objects from the server (re-downloads data)"),
    8888                Shortcut.registerShortcut("file:updateselection",
    8989                        tr("File: {0}", tr("Update selection")), KeyEvent.VK_U,
    9090                        Shortcut.ALT_CTRL),
    91                 true);
     91                true, "updateselection", true);
    9292        putValue("help", ht("/Action/UpdateSelection"));
    9393    }
    94     public UpdateSelectionAction(String name, String iconName, String tooltip,
    95             Shortcut shortcut, boolean register) {
    96         super(name, iconName, tooltip, shortcut, register);
     94
     95    /**
     96     * Constructs a new {@code UpdateSelectionAction}.
     97     *
     98     * @param name the action's text as displayed on the menu (if it is added to a menu)
     99     * @param iconName the filename of the icon to use
     100     * @param tooltip  a longer description of the action that will be displayed in the tooltip. Please note
     101     *           that html is not supported for menu actions on some platforms.
     102     * @param shortcut a ready-created shortcut object or null if you don't want a shortcut. But you always
     103     *            do want a shortcut, remember you can always register it with group=none, so you
     104     *            won't be assigned a shortcut unless the user configures one. If you pass null here,
     105     *            the user CANNOT configure a shortcut for your action.
     106     * @param register register this action for the toolbar preferences?
     107     * @param toolbarId identifier for the toolbar preferences. The iconName is used, if this parameter is null
     108     */
     109    public UpdateSelectionAction(String name, String iconName, String tooltip, Shortcut shortcut, boolean register, String toolbarId) {
     110        super(name, iconName, tooltip, shortcut, register, toolbarId, true);
    97111    }
    98112
     
    111125    }
    112126
    113     /**
    114      * action handler
    115      */
    116127    @Override
    117128    public void actionPerformed(ActionEvent e) {
    118129        if (! isEnabled())
    119130            return;
    120         Collection<OsmPrimitive> toUpdate =getData();
     131        Collection<OsmPrimitive> toUpdate = getData();
    121132        if (toUpdate.isEmpty()) {
    122133            JOptionPane.showMessageDialog(
     
    131142    }
    132143
     144    /**
     145     * Returns the data on which this action operates. Override if needed.
     146     * @return the data on which this action operates
     147     */
    133148    public Collection<OsmPrimitive> getData() {
    134149        return getCurrentDataSet().getAllSelected();
Note: See TracChangeset for help on using the changeset viewer.