Ignore:
Timestamp:
2011-05-02T23:47:19+02:00 (13 years ago)
Author:
bastiK
Message:

mapcss: add role based selection (collaborative work by Gubaer and me)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r4065 r4069  
    77import java.io.InputStream;
    88import java.io.OutputStream;
     9import java.text.MessageFormat;
    910import java.util.Collection;
    1011
     12/**
     13 * Basic utils, that can be useful in different parts of the program.
     14 */
    1115public class Utils {
    1216
     
    8084            return true;
    8185        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            );
    8293    }
    8394
     
    162173    }
    163174
     175    public static Color complement(Color clr) {
     176        return new Color(255 - clr.getRed(), 255 - clr.getGreen(), 255 - clr.getBlue(), clr.getAlpha());
     177    }
    164178
    165179    public static int copyStream(InputStream source, OutputStream destination) throws IOException {
     
    172186        }
    173187        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());
    180188    }
    181189
Note: See TracChangeset for help on using the changeset viewer.