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