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

The following examples show how to use javax.swing.border.AbstractBorder#getBorderInsets() . These examples are extracted from open source projects. 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
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
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
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
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
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
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
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 Project: hottub   File: Test4856008.java    License: 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
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
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
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
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
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 Project: java-swing-tips   File: MainPanel.java    License: 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 Project: java-swing-tips   File: MainPanel.java    License: 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 Project: java-swing-tips   File: TitledBorder2.java    License: 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;
}