Changeset 4069 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2011-05-02T23:47:19+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Utils.java
r4065 r4069 7 7 import java.io.InputStream; 8 8 import java.io.OutputStream; 9 import java.text.MessageFormat; 9 10 import java.util.Collection; 10 11 12 /** 13 * Basic utils, that can be useful in different parts of the program. 14 */ 11 15 public class Utils { 12 16 … … 80 84 return true; 81 85 return (a != null && a.equals(b)); 86 } 87 88 public static void ensure(boolean condition, String message, Object...data) { 89 if (!condition) 90 throw new AssertionError( 91 MessageFormat.format(message,data) 92 ); 82 93 } 83 94 … … 162 173 } 163 174 175 public static Color complement(Color clr) { 176 return new Color(255 - clr.getRed(), 255 - clr.getGreen(), 255 - clr.getBlue(), clr.getAlpha()); 177 } 164 178 165 179 public static int copyStream(InputStream source, OutputStream destination) throws IOException { … … 172 186 } 173 187 return count; 174 }175 176 177 178 public static Color complement(Color clr) {179 return new Color(255 - clr.getRed(), 255 - clr.getGreen(), 255 - clr.getBlue(), clr.getAlpha());180 188 } 181 189
Note:
See TracChangeset
for help on using the changeset viewer.