Changeset 8324 in josm
- Timestamp:
- 2015-05-04T23:24:14+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/JosmAction.java
r8308 r8324 8 8 9 9 import javax.swing.AbstractAction; 10 import javax.swing.Icon;11 10 12 11 import org.openstreetmap.josm.Main; … … 72 71 * @param toolbarId identifier for the toolbar preferences. The iconName is used, if this parameter is null 73 72 * @param installAdapters false, if you don't want to install layer changed and selection changed adapters 74 * @deprecated do not pass Icon, pass ImageProvider instead75 */76 @Deprecated77 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 use101 * @param tooltip a longer description of the action that will be displayed in the tooltip. Please note102 * 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 always104 * do want a shortcut, remember you can always register it with group=none, so you105 * 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 null109 * @param installAdapters false, if you don't want to install layer changed and selection changed adapters110 73 * TODO: do not pass Icon, pass ImageProvider instead 111 74 */ -
trunk/src/org/openstreetmap/josm/data/Preferences.java
r8315 r8324 535 535 536 536 /** 537 * Returns the location of the user defined preferences directory538 * @return The location of the user defined preferences directory539 * @deprecated use #getPreferencesDirectory() to access preferences directory540 * or #getUserDataDirectory to access user data directory541 */542 @Deprecated543 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 /**551 537 * Returns the user defined preferences directory, containing the preferences.xml file 552 538 * @return The user defined preferences directory, containing the preferences.xml file … … 1695 1681 val += "&zip=1"; 1696 1682 modified = true; 1697 1683 1698 1684 } 1699 1685 newmap.put(mkey, val); -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
r8304 r8324 205 205 206 206 /** 207 * Returns the first non-null object. The name originates from the {@code COALESCE} SQL function.208 * @param args arguments209 * @return the first non-null object210 * @deprecated Deprecated in favour of {@link #any(Object...)} from the MapCSS standard.211 */212 @NullableArguments213 @Deprecated214 public static Object coalesce(Object... args) {215 return any(args);216 }217 218 /**219 207 * Returns the first non-null object. 220 208 * 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 10 10 import java.awt.GridBagConstraints; 11 11 import java.awt.GridBagLayout; 12 import java.awt.Image;13 12 import java.awt.Insets; 14 13 import java.awt.Rectangle; … … 50 49 import javax.swing.DefaultListSelectionModel; 51 50 import javax.swing.Icon; 52 import javax.swing.ImageIcon;53 51 import javax.swing.JButton; 54 52 import javax.swing.JCheckBox; … … 96 94 import org.openstreetmap.josm.io.OsmTransferException; 97 95 import org.openstreetmap.josm.tools.GBC; 96 import org.openstreetmap.josm.tools.ImageOverlay; 98 97 import org.openstreetmap.josm.tools.ImageProvider; 98 import org.openstreetmap.josm.tools.ImageProvider.ImageSizes; 99 99 import org.openstreetmap.josm.tools.LanguageInfo; 100 100 import org.openstreetmap.josm.tools.Utils; … … 1002 1002 dlg.setButtonIcons(new Icon[] { 1003 1003 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() 1008 1006 }); 1009 1007 dlg.setToolTipTexts(new String[] { -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r8323 r8324 52 52 import javax.imageio.metadata.IIOMetadata; 53 53 import javax.imageio.stream.ImageInputStream; 54 import javax.swing.Icon;55 54 import javax.swing.ImageIcon; 56 55 import javax.xml.bind.DatatypeConverter; … … 1144 1143 return Toolkit.getDefaultToolkit().createCustomCursor(img.getImage(), 1145 1144 "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 image1152 * @param overlay the overlay image (can be smaller than the base image)1153 * @param pos position of the overlay image inside the base image (positioned1154 * in one of the corners)1155 * @return an icon that represent the overlay of the two given icons. The second icon is layed1156 * 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 and1159 * overlay must be transparent in the background.1160 * Also scaling is not cared about with current implementation.1161 * @deprecated this method will be refactored1162 */1163 @Deprecated1164 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);1193 1145 } 1194 1146
Note:
See TracChangeset
for help on using the changeset viewer.