Java Code Examples for javax.swing.border.AbstractBorder#getBorderInsets()

The following examples show how to use javax.swing.border.AbstractBorder#getBorderInsets() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Test4856008.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void test(AbstractBorder border) {
    Insets insets = new Insets(0, 0, 0, 0);
    if (insets != border.getBorderInsets(getComponent(border), insets)) {
        throw new Error("both instances are differ for " + border.getClass());
    }
    test(border, insets);
}
 
Example 2
Source File: Test4856008.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void test(AbstractBorder border) {
    Insets insets = new Insets(0, 0, 0, 0);
    if (insets != border.getBorderInsets(getComponent(border), insets)) {
        throw new Error("both instances are differ for " + border.getClass());
    }
    test(border, insets);
}
 
Example 3
Source File: Test4856008.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private static void test(AbstractBorder border) {
    Insets insets = new Insets(0, 0, 0, 0);
    if (insets != border.getBorderInsets(getComponent(border), insets)) {
        throw new Error("both instances are differ for " + border.getClass());
    }
    test(border, insets);
}
 
Example 4
Source File: Test4856008.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private static void test(AbstractBorder border) {
    Insets insets = new Insets(0, 0, 0, 0);
    if (insets != border.getBorderInsets(getComponent(border), insets)) {
        throw new Error("both instances are differ for " + border.getClass());
    }
    test(border, insets);
}
 
Example 5
Source File: Test4856008.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private static void test(AbstractBorder border) {
    Insets insets = new Insets(0, 0, 0, 0);
    if (insets != border.getBorderInsets(getComponent(border), insets)) {
        throw new Error("both instances are differ for " + border.getClass());
    }
    test(border, insets);
}
 
Example 6
Source File: Test4856008.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static void test(AbstractBorder border) {
    Insets insets = new Insets(0, 0, 0, 0);
    if (insets != border.getBorderInsets(getComponent(border), insets)) {
        throw new Error("both instances are differ for " + border.getClass());
    }
    test(border, insets);
}
 
Example 7
Source File: Test4856008.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void test(AbstractBorder border) {
    Insets insets = new Insets(0, 0, 0, 0);
    if (insets != border.getBorderInsets(getComponent(border), insets)) {
        throw new Error("both instances are differ for " + border.getClass());
    }
    test(border, insets);
}
 
Example 8
Source File: Test4856008.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private static void test(AbstractBorder border) {
    Insets insets = new Insets(0, 0, 0, 0);
    if (insets != border.getBorderInsets(getComponent(border), insets)) {
        throw new Error("both instances are differ for " + border.getClass());
    }
    test(border, insets);
}
 
Example 9
Source File: Test4856008.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private static void test(AbstractBorder border) {
    Insets insets = new Insets(0, 0, 0, 0);
    if (insets != border.getBorderInsets(getComponent(border), insets)) {
        throw new Error("both instances are differ for " + border.getClass());
    }
    test(border, insets);
}
 
Example 10
Source File: Test4856008.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private static void test(AbstractBorder border) {
    Insets insets = new Insets(0, 0, 0, 0);
    if (insets != border.getBorderInsets(getComponent(border), insets)) {
        throw new Error("both instances are differ for " + border.getClass());
    }
    test(border, insets);
}
 
Example 11
Source File: Test4856008.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void test(AbstractBorder border) {
    Insets insets = new Insets(0, 0, 0, 0);
    if (insets != border.getBorderInsets(getComponent(border), insets)) {
        throw new Error("both instances are differ for " + border.getClass());
    }
    test(border, insets);
}
 
Example 12
Source File: Test4856008.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void test(AbstractBorder border) {
    Insets insets = new Insets(0, 0, 0, 0);
    if (insets != border.getBorderInsets(getComponent(border), insets)) {
        throw new Error("both instances are differ for " + border.getClass());
    }
    test(border, insets);
}
 
Example 13
Source File: Test4856008.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private static void test(AbstractBorder border) {
    Insets insets = new Insets(0, 0, 0, 0);
    if (insets != border.getBorderInsets(getComponent(border), insets)) {
        throw new Error("both instances are differ for " + border.getClass());
    }
    test(border, insets);
}
 
Example 14
Source File: MainPanel.java    From java-swing-tips with MIT License 5 votes vote down vote up
@SuppressWarnings("PMD.AvoidReassigningParameters")
private static Insets makeBorderInsets(Border border, Component c, Insets insets) {
  if (Objects.isNull(border)) {
    insets.set(0, 0, 0, 0);
  } else if (border instanceof AbstractBorder) {
    AbstractBorder ab = (AbstractBorder) border;
    insets = ab.getBorderInsets(c, insets);
  } else {
    Insets i = border.getBorderInsets(c);
    insets.set(i.top, i.left, i.bottom, i.right);
  }
  return insets;
}
 
Example 15
Source File: MainPanel.java    From java-swing-tips with MIT License 5 votes vote down vote up
private static Insets makeComponentBorderInsets(Border border, Component c, Insets i) {
  Insets ins = new Insets(i.top, i.left, i.bottom, i.right);
  if (Objects.isNull(border)) {
    ins.set(0, 0, 0, 0);
  } else if (border instanceof AbstractBorder) {
    AbstractBorder ab = (AbstractBorder) border;
    ins = ab.getBorderInsets(c, i);
  } else {
    ins = border.getBorderInsets(c);
  }
  return ins;
}
 
Example 16
Source File: TitledBorder2.java    From java-swing-tips with MIT License 5 votes vote down vote up
@SuppressWarnings("PMD.AvoidReassigningParameters")
private static Insets makeBorderInsets(Border border, Component c, Insets insets) {
  if (Objects.isNull(border)) {
    insets.set(0, 0, 0, 0);
  } else if (border instanceof AbstractBorder) {
    AbstractBorder ab = (AbstractBorder) border;
    insets = ab.getBorderInsets(c, insets);
  } else {
    Insets i = border.getBorderInsets(c);
    insets.set(i.top, i.left, i.bottom, i.right);
  }
  return insets;
}