1 23 24 package org.netbeans.swing.plaf.winxp; 25 26 import org.netbeans.swing.plaf.LFCustoms; 27 28 import javax.swing.*; 29 import javax.swing.border.AbstractBorder ; 30 import java.awt.*; 31 32 36 class StatusLineBorder extends AbstractBorder { 37 38 39 public static final int LEFT = 1; 40 public static final int TOP = 2; 41 public static final int RIGHT = 4; 42 43 private Insets insets; 44 45 private int type; 46 47 49 public StatusLineBorder(int type) { 50 this.type = type; 51 } 52 53 public void paintBorder(Component c, Graphics g, int x, int y, 54 int w, int h) { 55 g.translate(x, y); 56 Color borderC = UIManager.getColor (LFCustoms.SCROLLPANE_BORDER_COLOR); 57 g.setColor(borderC); 58 if ((type & TOP) != 0) { 60 g.drawLine(0, 0, w - 1, 0); 61 } 62 if ((type & LEFT) != 0) { 64 g.drawLine(0, 0, 0, h - 1); 65 } 66 if ((type & RIGHT) != 0) { 68 g.drawLine(w - 1, 0, w - 1, h - 1); 69 } 70 71 g.translate(-x, -y); 72 } 73 74 public Insets getBorderInsets(Component c) { 75 if (insets == null) { 76 insets = new Insets((type & TOP) != 0 ? 1 : 0, 77 (type & LEFT) != 0 ? 1 : 0, 0, 78 (type & RIGHT) != 0 ? 1 : 0); 79 } 80 return insets; 81 } 82 83 } 84 | Popular Tags |