1 19 24 25 package org.netbeans.swing.plaf.aqua; 26 27 import org.netbeans.swing.plaf.util.UIUtils; 28 29 import javax.swing.*; 30 import javax.swing.border.Border ; 31 import java.awt.*; 32 33 34 39 public class AquaEditorTabControlBorder implements Border { 40 static int ARCSIZE = 16; 41 42 43 public AquaEditorTabControlBorder() { 44 } 45 46 public Insets getBorderInsets(Component component) { 47 return new Insets (1,1,1,1); 48 } 49 50 public boolean isBorderOpaque() { 51 return true; 52 } 53 54 public void paintBorder(Component c, Graphics g, int x, int y, int w, int h) { 55 UIUtils.configureRenderingHints(g); 56 57 Color col = UIUtils.getMiddle(UIManager.getColor("controlShadow"), 58 UIManager.getColor("control")); 59 60 g.setColor(col); 61 62 Graphics2D g2d = (Graphics2D) g; 63 int ytop = y + (h / 2) - 1; 64 65 drawLines (g, x, y, ytop, w, h); 66 x++; 67 ytop++; 68 w-=2; 69 h-=1; 70 g.setColor (UIUtils.getMiddle (col, UIManager.getColor("control"))); drawLines (g, x, y, ytop, w, h); 72 } 73 74 private void drawLines (Graphics g, int x, int y, int ytop, int w, int h) { 75 g.drawArc (x, ytop, ARCSIZE, ARCSIZE, 90, 90); 76 g.drawLine(x, ytop+(ARCSIZE/2), x, y+h); 77 78 g.drawArc (x+w-(ARCSIZE+1), ytop, ARCSIZE, ARCSIZE, 90, -90); 79 g.drawLine(x+w-1, ytop+(ARCSIZE/2), x+w-1, y+h); 80 } 81 } 82 | Popular Tags |