Changeset 6814 in josm for trunk


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

fix #8234 - remove duplicated/unused icons + javadoc

Location:
trunk
Files:
9 deleted
12 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/data/defaultpresets.xml

    r6813 r6814  
    22132213            </optional>
    22142214        </item>
    2215         <item name="Gondola" icon="presets/gondola.png" type="way">
     2215        <item name="Gondola" icon="presets/aerialway.png" type="way">
    22162216            <link href="http://wiki.openstreetmap.org/wiki/Proposed_features/Piste_Maps"
    22172217                  fr.href="http://wiki.openstreetmap.org/wiki/FR:Proposed_features/Piste_Maps"
  • 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();
  • trunk/src/org/openstreetmap/josm/gui/conflict/pair/ConflictResolver.java

    r6316 r6814  
    8787     */
    8888    protected void loadIcons() {
    89         mergeComplete = ImageProvider.get("dialogs/conflict","mergecomplete.png" );
    90         mergeIncomplete = ImageProvider.get("dialogs/conflict","mergeincomplete.png" );
     89        mergeComplete = ImageProvider.get("dialogs", "valid.png" );
     90        mergeIncomplete = ImageProvider.get("dialogs/conflict", "mergeincomplete.png" );
    9191    }
    9292
  • trunk/src/org/openstreetmap/josm/gui/dialogs/changeset/query/UrlBasedQueryPanel.java

    r6453 r6814  
    2323import org.openstreetmap.josm.Main;
    2424import org.openstreetmap.josm.gui.widgets.HtmlPanel;
     25import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2526import org.openstreetmap.josm.io.ChangesetQuery;
     27import org.openstreetmap.josm.io.ChangesetQuery.ChangesetQueryUrlException;
    2628import org.openstreetmap.josm.io.OsmApi;
    27 import org.openstreetmap.josm.io.ChangesetQuery.ChangesetQueryUrlException;
    2829import org.openstreetmap.josm.tools.ImageProvider;
    29 import org.openstreetmap.josm.gui.widgets.JosmTextField;
    3030
    3131
     
    166166        protected void feedbackValid() {
    167167            if (getCurrentFeedback().equals("valid")) return;
    168             lblValid.setIcon(ImageProvider.get("dialogs/changeset", "valid"));
     168            lblValid.setIcon(ImageProvider.get("dialogs", "valid"));
    169169            lblValid.setToolTipText("");
    170170            lblValid.putClientProperty("valid", "valid");
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OsmApiUrlInputPanel.java

    r6653 r6814  
    4141 */
    4242public class OsmApiUrlInputPanel extends JPanel {
    43    
     43
    4444    /**
    4545     * OSM API URL property key.
     
    5454    /** indicates whether to use the default OSM URL or not */
    5555    private JCheckBox cbUseDefaultServerUrl;
    56    
     56
    5757    private ApiUrlPropagator propagator;
    5858
     
    154154        }
    155155    }
    156    
     156
    157157    /**
    158158     * Returns the entered API URL, stripped of leading and trailing white characters.
    159      * @return the entered API URL, stripped of leading and trailing white characters. 
     159     * @return the entered API URL, stripped of leading and trailing white characters.
    160160     *         May be an empty string if nothing has been entered. In this case, it means the user wants to use {@link OsmApi#DEFAULT_API_URL}.
    161161     * @see Utils#strip(String)
     
    189189                        public void run() {
    190190                            if (task.isSuccess()) {
    191                                 lblValid.setIcon(ImageProvider.get("dialogs/changeset", "valid"));
     191                                lblValid.setIcon(ImageProvider.get("dialogs", "valid"));
    192192                                lblValid.setToolTipText(tr("The API URL is valid."));
    193193                                lastTestedUrl = url;
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r6809 r6814  
    2222import java.io.StringReader;
    2323import java.io.UnsupportedEncodingException;
    24 import java.net.MalformedURLException;
    2524import java.net.URI;
    2625import java.net.URL;
     
    360359
    361360    /**
    362      * @see #get(java.lang.String, java.lang.String)
     361     * @param name The icon name (base name with or without '.png' or '.svg' extension)
     362     * @return the requested image or null if the request failed
     363     * @see #get(String, String)
    363364     */
    364365    public static ImageIcon get(String name) {
     
    369370     * Load an image with a given file name, but do not throw an exception
    370371     * when the image cannot be found.
    371      * @see #get(java.lang.String, java.lang.String)
     372     *
     373     * @param subdir subdirectory the image lies in
     374     * @param name The icon name (base name with or without '.png' or '.svg' extension)
     375     * @return the requested image or null if the request failed
     376     * @see #get(String, String)
    372377     */
    373378    public static ImageIcon getIfAvailable(String subdir, String name) {
     
    376381
    377382    /**
    378      * @see #getIfAvailable(java.lang.String, java.lang.String)
     383     * @param name The icon name (base name with or without '.png' or '.svg' extension)
     384     * @return the requested image or null if the request failed
     385     * @see #getIfAvailable(String, String)
    379386     */
    380387    public static ImageIcon getIfAvailable(String name) {
     
    854861     * @param img the image to be rotated.
    855862     * @param rotatedAngle the rotated angle, in degree, clockwise. It could be any double but we
    856      * will mod it with 360 before using it. More over for caching performance, it will be rounded to 
     863     * will mod it with 360 before using it. More over for caching performance, it will be rounded to
    857864     * an entire value between 0 and 360.
    858865     *
     
    863870        return createRotatedImage(img, rotatedAngle, ImageResource.DEFAULT_DIMENSION);
    864871    }
    865    
     872
    866873    /**
    867874     * Creates a rotated version of the input image, scaled to the given dimension.
     
    869876     * @param img the image to be rotated.
    870877     * @param rotatedAngle the rotated angle, in degree, clockwise. It could be any double but we
    871      * will mod it with 360 before using it. More over for caching performance, it will be rounded to 
     878     * will mod it with 360 before using it. More over for caching performance, it will be rounded to
    872879     * an entire value between 0 and 360.
    873880     * @param dimension The requested dimensions. Use (-1,-1) for the original size
     
    878885    public static Image createRotatedImage(Image img, double rotatedAngle, Dimension dimension) {
    879886        CheckParameterUtil.ensureParameterNotNull(img, "img");
    880        
     887
    881888        // convert rotatedAngle to an integer value from 0 to 360
    882889        Long originalAngle = Math.round(rotatedAngle % 360);
     
    884891            originalAngle = 360L;
    885892        }
    886        
     893
    887894        ImageResource imageResource = null;
    888895
     
    892899                ROTATE_CACHE.put(img, cacheByAngle = new HashMap<Long, ImageResource>());
    893900            }
    894            
     901
    895902            imageResource = cacheByAngle.get(originalAngle);
    896            
     903
    897904            if (imageResource == null) {
    898905                // convert originalAngle to a value from 0 to 90
     
    901908                    angle = 90.0;
    902909                }
    903        
     910
    904911                double radian = Math.toRadians(angle);
    905        
     912
    906913                new ImageIcon(img); // load completely
    907914                int iw = img.getWidth(null);
     
    909916                int w;
    910917                int h;
    911        
     918
    912919                if ((originalAngle >= 0 && originalAngle <= 90) || (originalAngle > 180 && originalAngle <= 270)) {
    913920                    w = (int) (iw * Math.sin(DEGREE_90 - radian) + ih * Math.sin(radian));
     
    921928                Graphics g = image.getGraphics();
    922929                Graphics2D g2d = (Graphics2D) g.create();
    923        
     930
    924931                // calculate the center of the icon.
    925932                int cx = iw / 2;
    926933                int cy = ih / 2;
    927        
     934
    928935                // move the graphics center point to the center of the icon.
    929936                g2d.translate(w / 2, h / 2);
    930        
     937
    931938                // rotate the graphics about the center point of the icon
    932939                g2d.rotate(Math.toRadians(originalAngle));
    933        
     940
    934941                g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BICUBIC);
    935942                g2d.drawImage(img, -cx, -cy, null);
    936        
     943
    937944                g2d.dispose();
    938945                new ImageIcon(image); // load completely
     
    941948        }
    942949    }
    943    
     950
    944951    /**
    945952     * Creates a scaled down version of the input image to fit maximum dimensions. (Keeps aspect ratio)
    946953     *
    947954     * @param img the image to be scaled down.
    948      * @param maxSize the maximum size in pixels (both for width and height) 
     955     * @param maxSize the maximum size in pixels (both for width and height)
    949956     *
    950957     * @return the image after scaling.
Note: See TracChangeset for help on using the changeset viewer.