1 package org.netbeans.modules.tasklist.usertasks.renderers; 2 3 import java.awt.Image ; 4 import org.netbeans.modules.tasklist.usertasks.model.UserTask; 5 import org.openide.util.Utilities; 6 7 12 public class UserTaskIconProvider { 13 private static final Image LIST_IMAGE = 14 Utilities.loadImage( 15 "org/netbeans/modules/tasklist/usertasks/tasklistfile.gif"); private static final Image IMAGE = 17 Utilities.loadImage( 18 "org/netbeans/modules/tasklist/core/task.gif"); private static final Image DONE = 20 Utilities.loadImage( 21 "org/netbeans/modules/tasklist/core/doneItem.gif"); private static final Image UNMATCHED = 23 Utilities.loadImage( 24 "org/netbeans/modules/tasklist/core/unmatched.gif"); 26 private static final Image STARTED_BADGE = 27 Utilities.loadImage( 28 "org/netbeans/modules/tasklist/usertasks/startedBadge.gif"); 30 private static final Image IMAGE_STARTED = 31 Utilities.mergeImages(IMAGE, STARTED_BADGE, 8, 8); 32 private static final Image DONE_STARTED = 33 Utilities.mergeImages(DONE, STARTED_BADGE, 8, 8); 34 private static final Image UNMATCHED_STARTED = 35 Utilities.mergeImages(UNMATCHED, STARTED_BADGE, 8, 8); 36 37 42 public static Image getUserTaskListImage() { 43 return LIST_IMAGE; 44 } 45 46 54 public static Image getUserTaskImage(UserTask ut, boolean unmatched) { 55 if (ut.isStarted()) { 56 if (unmatched) 57 return UNMATCHED_STARTED; 58 else if (ut.isDone()) 59 return DONE_STARTED; 60 else 61 return IMAGE_STARTED; 62 } else { 63 if (unmatched) 64 return UNMATCHED; 65 else if (ut.isDone()) 66 return DONE; 67 else 68 return IMAGE; 69 } 70 } 71 72 75 private UserTaskIconProvider() { 76 } 77 } 78 | Popular Tags |