Example #1
0
 private Color getColor(Entity e) {
   // Lazy initialisation
   if (!colormap.containsKey(e.getId())) {
     colormap.put(
         e.getId(),
         new Color(
             100 + rand.nextInt() % 126, 60 + rand.nextInt() % 126, 100 + rand.nextInt() % 126));
   }
   return colormap.get(e.getId());
 }