Changeset 7012 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2014-04-27T15:35:47+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/tools
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r7005 r7012 834 834 for (RelationMember m : multiPolygon.getMembers()) { 835 835 if (m.getType().equals(OsmPrimitiveType.WAY)) { 836 if ( m.getRole().equals("outer")) {836 if ("outer".equals(m.getRole())) { 837 837 outers.add(m.getWay()); 838 } else if ( m.getRole().equals("inner")) {838 } else if ("inner".equals(m.getRole())) { 839 839 inners.add(m.getWay()); 840 840 } -
trunk/src/org/openstreetmap/josm/tools/I18n.java
r7005 r7012 394 394 } 395 395 396 public static void addTexts(File source) 397 { 398 if(loadedCode.equals("en")) 396 public static void addTexts(File source) { 397 if ("en".equals(loadedCode)) 399 398 return; 400 399 FileInputStream fis = null; … … 440 439 } 441 440 442 private static boolean load(String l) 443 { 444 if(l.equals("en") || l.equals("en_US")) 445 { 441 private static boolean load(String l) { 442 if ("en".equals(l) || "en_US".equals(l)) { 446 443 strings = null; 447 444 pstrings = null; … … 451 448 } 452 449 URL en = getTranslationFile("en"); 453 if (en == null)450 if (en == null) 454 451 return false; 455 452 URL tr = getTranslationFile(l); 456 if(tr == null || !languages.containsKey(l)) 457 { 453 if (tr == null || !languages.containsKey(l)) { 458 454 int i = l.indexOf('_'); 459 455 if (i > 0) { … … 461 457 } 462 458 tr = getTranslationFile(l); 463 if (tr == null || !languages.containsKey(l))459 if (tr == null || !languages.containsKey(l)) 464 460 return false; 465 461 } … … 643 639 Locale.setDefault(l); 644 640 } else { 645 if (! l.getLanguage().equals("en")) {641 if (!"en".equals(l.getLanguage())) { 646 642 Main.info(tr("Unable to find translation for the locale {0}. Reverting to {1}.", 647 643 l.getDisplayName(), Locale.getDefault().getDisplayName())); -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r7005 r7012 606 606 try { 607 607 zipFile = new ZipFile(archive); 608 if (inArchiveDir == null || inArchiveDir.equals(".")) {608 if (inArchiveDir == null || ".".equals(inArchiveDir)) { 609 609 inArchiveDir = ""; 610 610 } else if (!inArchiveDir.isEmpty()) { … … 805 805 } 806 806 Cursor c = Toolkit.getDefaultToolkit().createCustomCursor(img.getImage(), 807 name.equals("crosshair") ? new Point(10, 10) : new Point(3, 2), "Cursor");807 "crosshair".equals(name) ? new Point(10, 10) : new Point(3, 2), "Cursor"); 808 808 return c; 809 809 } -
trunk/src/org/openstreetmap/josm/tools/LanguageInfo.java
r6889 r7012 87 87 if (locale == null) return "en"; 88 88 String full = locale.toString(); 89 if ( full.equals("iw_IL"))89 if ("iw_IL".equals(full)) 90 90 return "he"; 91 else if ( full.equals("in"))91 else if ("in".equals(full)) 92 92 return "id"; 93 93 else if (I18n.hasCode(full)) // catch all non-single codes … … 107 107 */ 108 108 public static Locale getLocale(String localeName) { 109 if ( localeName.equals("he")) {109 if ("he".equals(localeName)) { 110 110 localeName = "iw_IL"; 111 111 } 112 else if ( localeName.equals("id")) {112 else if ("id".equals(localeName)) { 113 113 localeName = "in"; 114 114 } -
trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java
r7001 r7012 53 53 public Object invoke (Object proxy, Method method, Object[] args) throws Throwable { 54 54 Boolean handled = Boolean.TRUE; 55 if (method.getName().equals("handleQuit")) { 55 switch (method.getName()) { 56 case "handleQuit": 56 57 handled = Main.exitJosm(false, 0); 57 } else if (method.getName().equals("handleAbout")) { 58 break; 59 case "handleAbout": 58 60 Main.main.menu.about.actionPerformed(null); 59 } else if (method.getName().equals("handlePreferences")) { 61 break; 62 case "handlePreferences": 60 63 Main.main.menu.preferences.actionPerformed(null); 61 } else 64 break; 65 default: 62 66 return null; 67 } 63 68 if (args[0] != null) { 64 69 try { -
trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java
r7006 r7012 165 165 public String getJavaPackageDetails() { 166 166 if (isDebianOrUbuntu()) { 167 String javaHome = System.getProperty("java.home");168 if ("/usr/lib/jvm/java-7-openjdk-amd64/jre".equals(javaHome) ||169 "/usr/lib/jvm/java-7-openjdk-i386/jre".equals(javaHome)) {167 switch(System.getProperty("java.home")) { 168 case "/usr/lib/jvm/java-7-openjdk-amd64/jre": 169 case "/usr/lib/jvm/java-7-openjdk-i386/jre": 170 170 return getPackageDetails("openjdk-7-jre"); 171 171 } -
trunk/src/org/openstreetmap/josm/tools/Shortcut.java
r7005 r7012 95 95 96 96 public boolean isChangeable() { 97 return !automatic && ! shortText.equals("core:none");97 return !automatic && !"core:none".equals(shortText); 98 98 } 99 99 … … 255 255 for(Shortcut c : shortcuts.values()) 256 256 { 257 if(! c.shortText.equals("core:none")) {257 if(!"core:none".equals(c.shortText)) { 258 258 l.add(c); 259 259 } -
trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java
r6890 r7012 189 189 x = Integer.valueOf(m.group(5)); 190 190 y = Integer.valueOf(m.group(7)); 191 if ( m.group(4).equals("-")) {191 if ("-".equals(m.group(4))) { 192 192 x = screenDimension.x + screenDimension.width - x - w; 193 193 } 194 if ( m.group(6).equals("-")) {194 if ("-".equals(m.group(6))) { 195 195 y = screenDimension.y + screenDimension.height - y - h; 196 196 } -
trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java
r7005 r7012 133 133 private void setValue(Entry entry, String fieldName, String value) throws SAXException { 134 134 CheckParameterUtil.ensureParameterNotNull(entry, "entry"); 135 if ( fieldName.equals("class") || fieldName.equals("default") || fieldName.equals("throw") || fieldName.equals("new") || fieldName.equals("null")) {135 if ("class".equals(fieldName) || "default".equals(fieldName) || "throw".equals(fieldName) || "new".equals(fieldName) || "null".equals(fieldName)) { 136 136 fieldName += "_"; 137 137 } … … 165 165 private boolean parseBoolean(String s) { 166 166 return s != null 167 && ! s.equals("0")167 && !"0".equals(s) 168 168 && !s.startsWith("off") 169 169 && !s.startsWith("false")
Note:
See TracChangeset
for help on using the changeset viewer.