1 7 package javax.swing.border; 8 9 import java.awt.Graphics ; 10 import java.awt.Insets ; 11 import java.awt.Rectangle ; 12 import java.awt.Component ; 13 import java.io.Serializable ; 14 15 31 public class EmptyBorder extends AbstractBorder implements Serializable 32 { 33 protected int left, right, top, bottom; 34 35 42 public EmptyBorder(int top, int left, int bottom, int right) { 43 this.top = top; 44 this.right = right; 45 this.bottom = bottom; 46 this.left = left; 47 } 48 49 53 public EmptyBorder(Insets borderInsets) { 54 this.top = borderInsets.top; 55 this.right = borderInsets.right; 56 this.bottom = borderInsets.bottom; 57 this.left = borderInsets.left; 58 } 59 60 63 public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { 64 } 65 66 70 public Insets getBorderInsets(Component c) { 71 return getBorderInsets(); 72 } 73 74 79 public Insets getBorderInsets(Component c, Insets insets) { 80 insets.left = left; 81 insets.top = top; 82 insets.right = right; 83 insets.bottom = bottom; 84 return insets; 85 } 86 87 90 public Insets getBorderInsets() { 91 return new Insets (top, left, bottom, right); 92 } 93 94 98 public boolean isBorderOpaque() { return false; } 99 100 } 101 | Popular Tags |