1 19 20 package org.netbeans.modules.xml.xam.ui.column; 21 22 import java.awt.Color ; 23 import java.awt.Component ; 24 import java.awt.Graphics ; 25 import java.awt.Insets ; 26 import javax.swing.border.Border ; 27 28 33 public class ArrowBorder implements Border { 34 35 38 41 private boolean enabled; 42 public ArrowBorder(boolean enabled) { 43 this.enabled=enabled; 44 } 45 46 public boolean isBorderOpaque() { 47 return true; 48 } 49 50 public Insets getBorderInsets(Component c) { 51 return new Insets (0, 0, 0, 12); 53 } 54 55 public void paintBorder(Component c, Graphics g, int x, int y, 56 int width, int height) { 57 int tx = width - 8; 59 int ty = (height - 8) / 2; 60 g.translate(tx, ty); 61 g.setColor(enabled?Color.BLACK:Color.LIGHT_GRAY); 62 g.drawLine(0, 0, 0, 7); 63 g.drawLine(1, 1, 1, 6); 64 g.drawLine(2, 2, 2, 5); 65 g.drawLine(3, 3, 3, 4); 66 g.translate(-tx, -ty); 67 } 68 } 69 | Popular Tags |