Changeset 8324 in josm


Ignore:
Timestamp:
2015-05-04T23:24:14+02:00 (9 years ago)
Author:
Don-vip
Message:

squid:S1133 - remove deprecated code

Location:
trunk/src/org/openstreetmap/josm
Files:
5 edited

Legend:

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

    r8308 r8324  
    88
    99import javax.swing.AbstractAction;
    10 import javax.swing.Icon;
    1110
    1211import org.openstreetmap.josm.Main;
     
    7271     * @param toolbarId identifier for the toolbar preferences. The iconName is used, if this parameter is null
    7372     * @param installAdapters false, if you don't want to install layer changed and selection changed adapters
    74      * @deprecated do not pass Icon, pass ImageProvider instead
    75      */
    76     @Deprecated
    77     public JosmAction(String name, Icon icon, String tooltip, Shortcut shortcut, boolean registerInToolbar, String toolbarId, boolean installAdapters) {
    78         super(name, icon);
    79         setHelpId();
    80         sc = shortcut;
    81         if (sc != null) {
    82             Main.registerActionShortcut(this, sc);
    83         }
    84         setTooltip(tooltip);
    85         if (getValue("toolbar") == null) {
    86             putValue("toolbar", toolbarId);
    87         }
    88         if (registerInToolbar && Main.toolbar != null) {
    89             Main.toolbar.register(this);
    90         }
    91         if (installAdapters) {
    92             installAdapters();
    93         }
    94     }
    95 
    96     /**
    97      * Constructs a {@code JosmAction}.
    98      *
    99      * @param name the action's text as displayed on the menu (if it is added to a menu)
    100      * @param icon the icon to use
    101      * @param tooltip  a longer description of the action that will be displayed in the tooltip. Please note
    102      *           that html is not supported for menu actions on some platforms.
    103      * @param shortcut a ready-created shortcut object or null if you don't want a shortcut. But you always
    104      *            do want a shortcut, remember you can always register it with group=none, so you
    105      *            won't be assigned a shortcut unless the user configures one. If you pass null here,
    106      *            the user CANNOT configure a shortcut for your action.
    107      * @param registerInToolbar register this action for the toolbar preferences?
    108      * @param toolbarId identifier for the toolbar preferences. The iconName is used, if this parameter is null
    109      * @param installAdapters false, if you don't want to install layer changed and selection changed adapters
    11073     * TODO: do not pass Icon, pass ImageProvider instead
    11174     */
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r8315 r8324  
    535535
    536536    /**
    537      * Returns the location of the user defined preferences directory
    538      * @return The location of the user defined preferences directory
    539      * @deprecated use #getPreferencesDirectory() to access preferences directory
    540      * or #getUserDataDirectory to access user data directory
    541      */
    542     @Deprecated
    543     public String getPreferencesDir() {
    544         final String path = getPreferencesDirectory().getPath();
    545         if (path.endsWith(File.separator))
    546             return path;
    547         return path + File.separator;
    548     }
    549 
    550     /**
    551537     * Returns the user defined preferences directory, containing the preferences.xml file
    552538     * @return The user defined preferences directory, containing the preferences.xml file
     
    16951681                                 val += "&zip=1";
    16961682                                 modified = true;
    1697                                  
     1683
    16981684                             }
    16991685                             newmap.put(mkey, val);
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java

    r8304 r8324  
    205205
    206206        /**
    207          * Returns the first non-null object. The name originates from the {@code COALESCE} SQL function.
    208          * @param args arguments
    209          * @return the first non-null object
    210          * @deprecated Deprecated in favour of {@link #any(Object...)} from the MapCSS standard.
    211          */
    212         @NullableArguments
    213         @Deprecated
    214         public static Object coalesce(Object... args) {
    215             return any(args);
    216         }
    217 
    218         /**
    219207         * Returns the first non-null object.
    220208         * The name originates from <a href="http://wiki.openstreetmap.org/wiki/MapCSS/0.2/eval">MapCSS standard</a>.
  • trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java

    r8318 r8324  
    1010import java.awt.GridBagConstraints;
    1111import java.awt.GridBagLayout;
    12 import java.awt.Image;
    1312import java.awt.Insets;
    1413import java.awt.Rectangle;
     
    5049import javax.swing.DefaultListSelectionModel;
    5150import javax.swing.Icon;
    52 import javax.swing.ImageIcon;
    5351import javax.swing.JButton;
    5452import javax.swing.JCheckBox;
     
    9694import org.openstreetmap.josm.io.OsmTransferException;
    9795import org.openstreetmap.josm.tools.GBC;
     96import org.openstreetmap.josm.tools.ImageOverlay;
    9897import org.openstreetmap.josm.tools.ImageProvider;
     98import org.openstreetmap.josm.tools.ImageProvider.ImageSizes;
    9999import org.openstreetmap.josm.tools.LanguageInfo;
    100100import org.openstreetmap.josm.tools.Utils;
     
    10021002                    dlg.setButtonIcons(new Icon[] {
    10031003                        ImageProvider.get("cancel"),
    1004                         ImageProvider.overlay(
    1005                             ImageProvider.get("ok"),
    1006                             new ImageIcon(ImageProvider.get("warning-small").getImage().getScaledInstance(12 , 12, Image.SCALE_SMOOTH)),
    1007                             ImageProvider.OverlayPosition.SOUTHEAST)
     1004                        new ImageProvider("ok").setMaxSize(ImageSizes.LARGEICON).addOverlay(
     1005                                new ImageOverlay(new ImageProvider("warning-small"), 0.5, 0.5, 1.0, 1.0)).get()
    10081006                    });
    10091007                    dlg.setToolTipTexts(new String[] {
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r8323 r8324  
    5252import javax.imageio.metadata.IIOMetadata;
    5353import javax.imageio.stream.ImageInputStream;
    54 import javax.swing.Icon;
    5554import javax.swing.ImageIcon;
    5655import javax.xml.bind.DatatypeConverter;
     
    11441143        return Toolkit.getDefaultToolkit().createCustomCursor(img.getImage(),
    11451144                "crosshair".equals(name) ? new Point(10, 10) : new Point(3, 2), "Cursor");
    1146     }
    1147 
    1148     /**
    1149      * Decorate one icon with an overlay icon.
    1150      *
    1151      * @param ground the base image
    1152      * @param overlay the overlay image (can be smaller than the base image)
    1153      * @param pos position of the overlay image inside the base image (positioned
    1154      * in one of the corners)
    1155      * @return an icon that represent the overlay of the two given icons. The second icon is layed
    1156      * on the first relative to the given position.
    1157      * FIXME: This function does not fit into the ImageProvider concept as public function!
    1158      * Overlay should be handled like all the other functions only settings arguments and
    1159      * overlay must be transparent in the background.
    1160      * Also scaling is not cared about with current implementation.
    1161      * @deprecated this method will be refactored
    1162      */
    1163     @Deprecated
    1164     public static ImageIcon overlay(Icon ground, Icon overlay, OverlayPosition pos) {
    1165         int w = ground.getIconWidth();
    1166         int h = ground.getIconHeight();
    1167         int wo = overlay.getIconWidth();
    1168         int ho = overlay.getIconHeight();
    1169         BufferedImage img = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
    1170         Graphics g = img.createGraphics();
    1171         ground.paintIcon(null, g, 0, 0);
    1172         int x = 0, y = 0;
    1173         switch (pos) {
    1174         case NORTHWEST:
    1175             x = 0;
    1176             y = 0;
    1177             break;
    1178         case NORTHEAST:
    1179             x = w - wo;
    1180             y = 0;
    1181             break;
    1182         case SOUTHWEST:
    1183             x = 0;
    1184             y = h - ho;
    1185             break;
    1186         case SOUTHEAST:
    1187             x = w - wo;
    1188             y = h - ho;
    1189             break;
    1190         }
    1191         overlay.paintIcon(null, g, x, y);
    1192         return new ImageIcon(img);
    11931145    }
    11941146
Note: See TracChangeset for help on using the changeset viewer.