Lines Matching defs:border
27 * @summary Tests border insets
45 import javax.swing.border.AbstractBorder;
46 import javax.swing.border.BevelBorder;
47 import javax.swing.border.Border;
48 import javax.swing.border.CompoundBorder;
49 import javax.swing.border.EmptyBorder;
50 import javax.swing.border.EtchedBorder;
51 import javax.swing.border.LineBorder;
52 import javax.swing.border.MatteBorder;
53 import javax.swing.border.SoftBevelBorder;
54 import javax.swing.border.TitledBorder;
140 new NimbusLookAndFeel().getDefaults().getBorder("TitledBorder.border"),
144 for (Border border : BORDERS) {
145 System.out.println(border.getClass());
146 test(border, border.getBorderInsets(getComponent(border)));
147 if (border instanceof AbstractBorder) {
148 test((AbstractBorder) border);
153 private static void test(AbstractBorder border) {
155 if (insets != border.getBorderInsets(getComponent(border), insets)) {
156 throw new Error("both instances are differ for " + border.getClass());
158 test(border, insets);
161 private static void test(Border border, Insets insets) {
162 Insets result = border.getBorderInsets(getComponent(border));
164 throw new Error("both instances are the same for " + border.getClass());
167 throw new Error("both insets are not equal for " + border.getClass());
171 private static JComponent getComponent(Border border) {
172 Class type = border.getClass();
189 CompoundBorder border = (CompoundBorder) getNonRolloverBorder(button);
190 return border.getInsideBorder();