1 26 27 package org.objectweb.util.browser.core.icon; 28 29 30 import java.awt.Color ; 31 import java.awt.Component ; 32 import java.awt.Graphics ; 33 34 40 public class ObjectPointIcon 41 extends javax.swing.plaf.metal.MetalIconFactory.FileIcon16 { 42 43 49 50 protected Color c_; 51 52 53 protected boolean displayCircle_; 54 55 61 65 public ObjectPointIcon(boolean displayCircle, Color c){ 66 displayCircle_ = displayCircle; 67 c_ = c; 68 } 69 70 76 79 private void myPaint(Component c, Graphics g) { 80 java.awt.Font oldFont = g.getFont(); 81 g.setFont(oldFont.deriveFont(java.awt.Font.BOLD)); 82 g.drawString("c",5,12); 83 if(displayCircle_){ 84 g.setColor(c_); 85 g.fillOval(10,11,5,5); 86 } 87 g.setFont(oldFont); 88 } 89 90 96 public void paintIcon(Component c, Graphics g, int x, int y) { 97 super.paintIcon(c,g,x,y); 98 myPaint(c,g); 99 } 100 101 } 102 | Popular Tags |