Changeset 10378 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2016-06-15T10:30:37+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/tools
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ColorScale.java
r9796 r10378 37 37 public static ColorScale createCyclicScale(int count) { 38 38 ColorScale sc = new ColorScale(); 39 // red yellow green blue red 40 int[] h = new int[] {0, 59, 127, 244, 360}; 39 // CHECKSTYLE.OFF: SingleSpaceSeparator 40 // red yellow green blue red 41 int[] h = new int[] {0, 59, 127, 244, 360}; 41 42 int[] s = new int[] {100, 84, 99, 100}; 42 43 int[] b = new int[] {90, 93, 74, 83}; 44 // CHECKSTYLE.ON: SingleSpaceSeparator 43 45 44 46 sc.colors = new Color[count]; … … 166 168 for (int i = 0; i <= intervalCount; i++) { 167 169 g.setColor(colors[(int) (1.0*i*n/intervalCount-1e-10)]); 168 final double val = 170 final double val = min+i*(max-min)/intervalCount; 169 171 final String txt = String.format("%.3f", val*valueScale); 170 172 if (w < h) { -
trunk/src/org/openstreetmap/josm/tools/Diff.java
r10308 r10378 327 327 static class ReverseScript implements ScriptBuilder { 328 328 @Override 329 public 329 public Change build_script( 330 330 final boolean[] changed0, int len0, 331 331 final boolean[] changed1, int len1) { … … 828 828 private final int bufferedLines; 829 829 830 /** Vector, indexed by line number, containing an equivalence code for 831 each line. It is this vector that is actually compared with that 832 of another file to generate differences. */ 833 private final int[] equivs; 834 835 /** Vector, like the previous one except that 836 the elements for discarded lines have been squeezed out. */ 837 private final int[] undiscarded; 838 839 /** Vector mapping virtual line numbers (not counting discarded lines) 840 to real ones (counting those lines). Both are origin-0. */ 841 private final int[] realindexes; 830 /** Vector, indexed by line number, containing an equivalence code for each line. 831 * It is this vector that is actually compared with that of another file to generate differences. */ 832 private final int[] equivs; 833 834 /** Vector, like the previous one except that the elements for discarded lines have been squeezed out. */ 835 private final int[] undiscarded; 836 837 /** Vector mapping virtual line numbers (not counting discarded lines) to real ones (counting those lines). 838 * Both are origin-0. */ 839 private final int[] realindexes; 842 840 843 841 /** Total number of nondiscarded lines. */ 844 private int nondiscardedLines; 845 846 /** Array, indexed by real origin-1 line number, 847 containing true for a line that is an insertion or a deletion. 848 The results of comparison are stored here. */ 849 private boolean[] changedFlag; 842 private int nondiscardedLines; 843 844 /** Array, indexed by real origin-1 line number, containing true for a line that is an insertion or a deletion. 845 The results of comparison are stored here. */ 846 private boolean[] changedFlag; 850 847 } 851 848 } -
trunk/src/org/openstreetmap/josm/tools/ExifReader.java
r10212 r10378 179 179 } 180 180 181 private static double readAxis(GpsDirectory dirGps, int gpsTag, int gpsTagRef, char cRef) throws MetadataException 181 private static double readAxis(GpsDirectory dirGps, int gpsTag, int gpsTagRef, char cRef) throws MetadataException { 182 182 double value; 183 183 Rational[] components = dirGps.getRationalArray(gpsTag); … … 205 205 * Returns a Transform that fixes the image orientation. 206 206 * 207 * Only orientation 1, 3, 6 and 8 are supported. Everything else is treated 208 * as 1. 207 * Only orientation 1, 3, 6 and 8 are supported. Everything else is treated as 1. 209 208 * @param orientation the exif-orientation of the image 210 209 * @param width the original width of the image -
trunk/src/org/openstreetmap/josm/tools/Geometry.java
r9952 r10378 789 789 790 790 BigDecimal d = new BigDecimal(3, MathContext.DECIMAL128); // 1/2 * 6 = 3 791 area 791 area = area.multiply(d, MathContext.DECIMAL128); 792 792 if (area.compareTo(BigDecimal.ZERO) != 0) { 793 793 north = north.divide(area, MathContext.DECIMAL128); -
trunk/src/org/openstreetmap/josm/tools/ImageProvider.java
r10362 r10378 102 102 public class ImageProvider { 103 103 104 // CHECKSTYLE.OFF: SingleSpaceSeparator 104 105 private static final String HTTP_PROTOCOL = "http://"; 105 106 private static final String HTTPS_PROTOCOL = "https://"; 106 107 private static final String WIKI_PROTOCOL = "wiki://"; 108 // CHECKSTYLE.ON: SingleSpaceSeparator 107 109 108 110 /** -
trunk/src/org/openstreetmap/josm/tools/MultikeyShortcutAction.java
r8674 r10378 27 27 return '0'; 28 28 else 29 return (char) ('A' + 29 return (char) ('A' + index - 10); 30 30 } 31 31 -
trunk/src/org/openstreetmap/josm/tools/PlatformHookUnixoid.java
r10308 r10378 232 232 public static String getPackageDetails(String ... packageNames) { 233 233 try { 234 // CHECKSTYLE.OFF: SingleSpaceSeparator 234 235 boolean dpkg = Files.exists(Paths.get("/usr/bin/dpkg-query")); 235 236 boolean eque = Files.exists(Paths.get("/usr/bin/equery")); 236 237 boolean rpm = Files.exists(Paths.get("/bin/rpm")); 238 // CHECKSTYLE.ON: SingleSpaceSeparator 237 239 if (dpkg || rpm || eque) { 238 240 for (String packageName : packageNames) { -
trunk/src/org/openstreetmap/josm/tools/PlatformHookWindows.java
r10337 r10378 79 79 (byte) 0xfc, (byte) 0xf1, 0x7f, 0x73, (byte) 0xa7, (byte) 0x9d, (byte) 0xde, (byte) 0xc7, (byte) 0x88, 0x57, 0x51, 80 80 (byte) 0x84, (byte) 0xed, (byte) 0x96, (byte) 0xfb, (byte) 0xe1, 0x38, (byte) 0xef, 0x08, 0x2b, (byte) 0xf3, 81 (byte) 0xc7, (byte) 0xc3, 81 (byte) 0xc7, (byte) 0xc3, 0x5d, (byte) 0xfe, (byte) 0xf9, 0x51, (byte) 0xe6, 0x29, (byte) 0xfc, (byte) 0xe5, 0x0d, 82 82 (byte) 0xa1, 0x0d, (byte) 0xa8, (byte) 0xb4, (byte) 0xae, 0x26, 0x18, 0x19, 0x4d, 0x6c, 0x0c, 0x3b, 0x12, (byte) 0xba, 83 83 (byte) 0xbc, 0x5f, 0x32, (byte) 0xb3, (byte) 0xbe, (byte) 0x9d, 0x17, 0x0d, 0x4d, 0x2f, 0x1a, 0x48, (byte) 0xb7, -
trunk/src/org/openstreetmap/josm/tools/Shortcut.java
r10339 r10378 221 221 */ 222 222 public void setMnemonic(AbstractButton button) { 223 if (assignedModifier == getGroupModifier(MNEMONIC) 223 if (assignedModifier == getGroupModifier(MNEMONIC) && getKeyStroke() != null && KeyEvent.getKeyText(assignedKey).length() == 1) { 224 224 button.setMnemonic(KeyEvent.getKeyText(assignedKey).charAt(0)); //getKeyStroke().getKeyChar() seems not to work here 225 225 } … … 231 231 */ 232 232 public void setFocusAccelerator(JTextComponent component) { 233 if (assignedModifier == getGroupModifier(MNEMONIC) 233 if (assignedModifier == getGroupModifier(MNEMONIC) && getKeyStroke() != null && KeyEvent.getKeyText(assignedKey).length() == 1) { 234 234 component.setFocusAccelerator(KeyEvent.getKeyText(assignedKey).charAt(0)); 235 235 } -
trunk/src/org/openstreetmap/josm/tools/TextTagParser.java
r10308 r10378 125 125 while (pos < n) { 126 126 c = data.charAt(pos); 127 if (c == '\t' || c == '\n' 127 if (c == '\t' || c == '\n' || c == ' ') { 128 128 pos++; 129 129 } else if (c == '=') { … … 177 177 String k; 178 178 String v; 179 for (String 179 for (String line: lines) { 180 180 if (line.trim().isEmpty()) continue; // skip empty lines 181 181 Matcher m = p.matcher(line); … … 195 195 if (!tags.isEmpty()) { 196 196 return tags; 197 } 197 } else { 198 198 return null; 199 199 } -
trunk/src/org/openstreetmap/josm/tools/WindowGeometry.java
r10242 r10378 58 58 * @param window the window 59 59 */ 60 public WindowGeometry(Window window) 60 public WindowGeometry(Window window) { 61 61 this(window.getLocationOnScreen(), window.getSize()); 62 62 } … … 165 165 * @param window the window 166 166 */ 167 public void fixScreen(Window window) 167 public void fixScreen(Window window) { 168 168 Rectangle oldScreen = getScreenInfo(getRectangle()); 169 169 Rectangle newScreen = getScreenInfo(new Rectangle(window.getLocationOnScreen(), window.getSize())); … … 402 402 Rectangle bounds = gc.getBounds(); 403 403 Insets insets = component.getToolkit().getScreenInsets(gc); 404 result.width = bounds.width- insets.left - insets.right;404 result.width = bounds.width - insets.left - insets.right; 405 405 result.height = bounds.height - insets.top - insets.bottom; 406 406 } -
trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java
r10212 r10378 106 106 } else if (mapping.containsKey(qname) && characters != null && !current.isEmpty()) { 107 107 setValue(mapping.get(qname), qname, characters.toString().trim()); 108 characters 108 characters = new StringBuilder(64); 109 109 } 110 110 } … … 117 117 private void report() { 118 118 queue.add(current.pop()); 119 characters 119 characters = new StringBuilder(64); 120 120 } 121 121 -
trunk/src/org/openstreetmap/josm/tools/template_engine/TemplateParser.java
r8926 r10378 108 108 109 109 Token token = tokenizer.lookAhead(); 110 if (token.getType() 110 if (token.getType() == TokenType.END) { 111 111 tokenizer.nextToken(); 112 112 return result;
Note: See TracChangeset
for help on using the changeset viewer.