1 11 package org.eclipse.team.internal.ccvs.ui.operations; 12 13 import java.util.HashMap ; 14 import java.util.Map ; 15 16 import org.eclipse.swt.graphics.RGB; 17 18 19 24 final class CommitterColors { 25 26 private static CommitterColors fInstance; 27 28 private static final RGB[] COMMITTER_RGBs= new RGB[] { 30 new RGB(131, 150, 98), new RGB(132, 164, 118), new RGB(221, 205, 93), new RGB(199, 134, 57), new RGB(197, 123, 127), 31 new RGB(133, 166, 214), new RGB(143, 163, 54), new RGB(180, 148, 74), new RGB(139, 136, 140), new RGB(48, 135, 144), 32 new RGB(190, 93, 66), new RGB(101, 101, 217), new RGB(23, 101, 160), new RGB(72, 153, 119), 33 34 new RGB(136, 176, 70), new RGB(123, 187, 95), new RGB(255, 230, 59), new RGB(255, 138, 1), new RGB(233, 88, 98), 35 new RGB(93, 158, 254), new RGB(175, 215, 0), new RGB(232, 168, 21), new RGB(140, 134, 142), new RGB(0, 172, 191), 36 new RGB(251, 58, 4), new RGB(63, 64, 255), new RGB(0, 104, 183), new RGB(27, 194, 130) 37 }; 38 39 40 45 public static CommitterColors getDefault() { 46 if (fInstance == null) 47 fInstance= new CommitterColors(); 48 return fInstance; 49 } 50 51 52 private Map fColors= new HashMap (); 53 54 55 private int fCount= 0; 56 57 private CommitterColors() { 58 } 59 60 67 public RGB getCommitterRGB(String committer) { 68 RGB rgb= (RGB) fColors.get(committer); 69 if (rgb == null) { 70 rgb= COMMITTER_RGBs[fCount++ % COMMITTER_RGBs.length]; 71 fColors.put(committer, rgb); 72 } 73 return rgb; 74 } 75 76 } 77 | Popular Tags |