类javax.swing.border.AbstractBorder源码实例Demo

下面列出了怎么用javax.swing.border.AbstractBorder的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: ghidra   文件: DndTableCellRenderer.java
@Override
public Insets getBorderInsets(Component c, Insets insets) {
	if (under == null) {
		throw new IllegalStateException("Must set under border");
	}
	if (under instanceof AbstractBorder) {
		// Repeat the sin from JComponent.java:1847 (OpenJDK-1.8.0_25)
		// that necessitate this method in the first place...
		return ((AbstractBorder) under).getBorderInsets(c, insets);
	}
	Insets temp = under.getBorderInsets(c);
	insets.top = temp.top;
	insets.left = temp.left;
	insets.bottom = temp.bottom;
	insets.right = temp.right;
	return insets;
}
 
源代码2 项目: weblaf   文件: PainterSupport.java
/**
 * Returns {@link java.awt.Component.BaselineResizeBehavior} indicating how baseline of a {@link Component} changes when resized.
 *
 * @param component   {@link JComponent}
 * @param componentUI {@link ComponentUI}
 * @return {@link java.awt.Component.BaselineResizeBehavior} indicating how baseline of a {@link Component} changes when resized
 */
@NotNull
public static Component.BaselineResizeBehavior getBaselineResizeBehavior ( @NotNull final JComponent component,
                                                                           @NotNull final ComponentUI componentUI )
{
    final Component.BaselineResizeBehavior behavior;
    final Painter painter = getPainter ( component );
    if ( painter != null )
    {
        behavior = painter.getBaselineResizeBehavior ( component, componentUI );
    }
    else
    {
        final Border border = component.getBorder ();
        if ( border instanceof AbstractBorder )
        {
            final AbstractBorder abstractBorder = ( AbstractBorder ) border;
            behavior = abstractBorder.getBaselineResizeBehavior ( component );
        }
        else
        {
            behavior = Component.BaselineResizeBehavior.OTHER;
        }
    }
    return behavior;
}
 
源代码3 项目: dragonwell8_jdk   文件: Test4856008.java
public static void main(String[] args) {
    for (Border border : BORDERS) {
        System.out.println(border.getClass());
        test(border, border.getBorderInsets(getComponent(border)));
        if (border instanceof AbstractBorder) {
            test((AbstractBorder) border);
        }
    }
}
 
源代码4 项目: dragonwell8_jdk   文件: Test4856008.java
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);
}
 
源代码5 项目: TencentKona-8   文件: Test4856008.java
public static void main(String[] args) {
    for (Border border : BORDERS) {
        System.out.println(border.getClass());
        test(border, border.getBorderInsets(getComponent(border)));
        if (border instanceof AbstractBorder) {
            test((AbstractBorder) border);
        }
    }
}
 
源代码6 项目: TencentKona-8   文件: Test4856008.java
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);
}
 
源代码7 项目: jdk8u60   文件: Test4856008.java
public static void main(String[] args) {
    for (Border border : BORDERS) {
        System.out.println(border.getClass());
        test(border, border.getBorderInsets(getComponent(border)));
        if (border instanceof AbstractBorder) {
            test((AbstractBorder) border);
        }
    }
}
 
源代码8 项目: jdk8u60   文件: Test4856008.java
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);
}
 
源代码9 项目: openjdk-jdk8u   文件: Test4856008.java
public static void main(String[] args) {
    for (Border border : BORDERS) {
        System.out.println(border.getClass());
        test(border, border.getBorderInsets(getComponent(border)));
        if (border instanceof AbstractBorder) {
            test((AbstractBorder) border);
        }
    }
}
 
源代码10 项目: openjdk-jdk8u   文件: Test4856008.java
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);
}
 
源代码11 项目: openjdk-jdk8u-backup   文件: Test4856008.java
public static void main(String[] args) {
    for (Border border : BORDERS) {
        System.out.println(border.getClass());
        test(border, border.getBorderInsets(getComponent(border)));
        if (border instanceof AbstractBorder) {
            test((AbstractBorder) border);
        }
    }
}
 
源代码12 项目: openjdk-jdk8u-backup   文件: Test4856008.java
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);
}
 
源代码13 项目: openjdk-jdk9   文件: Test4856008.java
public static void main(String[] args) {
    for (Border border : BORDERS) {
        System.out.println(border.getClass());
        test(border, border.getBorderInsets(getComponent(border)));
        if (border instanceof AbstractBorder) {
            test((AbstractBorder) border);
        }
    }
}
 
源代码14 项目: openjdk-jdk9   文件: Test4856008.java
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);
}
 
源代码15 项目: jdk8u-jdk   文件: Test4856008.java
public static void main(String[] args) {
    for (Border border : BORDERS) {
        System.out.println(border.getClass());
        test(border, border.getBorderInsets(getComponent(border)));
        if (border instanceof AbstractBorder) {
            test((AbstractBorder) border);
        }
    }
}
 
源代码16 项目: jdk8u-jdk   文件: Test4856008.java
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);
}
 
源代码17 项目: hottub   文件: Test4856008.java
public static void main(String[] args) {
    for (Border border : BORDERS) {
        System.out.println(border.getClass());
        test(border, border.getBorderInsets(getComponent(border)));
        if (border instanceof AbstractBorder) {
            test((AbstractBorder) border);
        }
    }
}
 
源代码18 项目: hottub   文件: Test4856008.java
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);
}
 
源代码19 项目: openjdk-8-source   文件: Test4856008.java
public static void main(String[] args) {
    for (Border border : BORDERS) {
        System.out.println(border.getClass());
        test(border, border.getBorderInsets(getComponent(border)));
        if (border instanceof AbstractBorder) {
            test((AbstractBorder) border);
        }
    }
}
 
源代码20 项目: openjdk-8-source   文件: Test4856008.java
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);
}
 
源代码21 项目: openjdk-8   文件: Test4856008.java
public static void main(String[] args) {
    for (Border border : BORDERS) {
        System.out.println(border.getClass());
        test(border, border.getBorderInsets(getComponent(border)));
        if (border instanceof AbstractBorder) {
            test((AbstractBorder) border);
        }
    }
}
 
源代码22 项目: openjdk-8   文件: Test4856008.java
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);
}
 
源代码23 项目: jdk8u_jdk   文件: Test4856008.java
public static void main(String[] args) {
    for (Border border : BORDERS) {
        System.out.println(border.getClass());
        test(border, border.getBorderInsets(getComponent(border)));
        if (border instanceof AbstractBorder) {
            test((AbstractBorder) border);
        }
    }
}
 
源代码24 项目: jdk8u_jdk   文件: Test4856008.java
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);
}
 
源代码25 项目: jdk8u-jdk   文件: Test4856008.java
public static void main(String[] args) {
    for (Border border : BORDERS) {
        System.out.println(border.getClass());
        test(border, border.getBorderInsets(getComponent(border)));
        if (border instanceof AbstractBorder) {
            test((AbstractBorder) border);
        }
    }
}
 
源代码26 项目: jdk8u-jdk   文件: Test4856008.java
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);
}
 
源代码27 项目: seaglass   文件: SeaGlassTableUI.java
/**
 * Creates a {@link Border} that paints any empty space to the right of the
 * last column header in the given {@link JTable}'s {@link JTableHeader}.
 *
 * @param  table DOCUMENT ME!
 *
 * @return DOCUMENT ME!
 */
private static Border createTableHeaderEmptyColumnPainter(final JTable table) {
    return new AbstractBorder() {
        @Override
        public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
            // if this JTableHeader is parented in a JViewport, then paint
            // the table header background to the right of the last column
            // if neccessary.
            Container viewport = table.getParent();

            if ((viewport instanceof JViewport) && table.getWidth() < viewport.getWidth()) {
                int startX           = table.getWidth();
                int emptyColumnWidth = viewport.getWidth() - table.getWidth();

                TableCellRenderer renderer  = table.getTableHeader().getDefaultRenderer();
                // Rossi: Fix for indexoutofbounds exception: A try catch might be good too?
                Component         component = renderer.getTableCellRendererComponent(table, "", false, false, 0, table.getColumnCount()-1);

                component.setBounds(0, 0, emptyColumnWidth, table.getTableHeader().getHeight());

                ((JComponent) component).setOpaque(true);
                CELL_RENDER_PANE.paintComponent(g, component, null, startX, 0, emptyColumnWidth + 1,
                                                table.getTableHeader().getHeight(), true);
            }
        }
    };
}
 
源代码28 项目: jdk8u-dev-jdk   文件: Test4856008.java
public static void main(String[] args) {
    for (Border border : BORDERS) {
        System.out.println(border.getClass());
        test(border, border.getBorderInsets(getComponent(border)));
        if (border instanceof AbstractBorder) {
            test((AbstractBorder) border);
        }
    }
}
 
源代码29 项目: jdk8u-dev-jdk   文件: Test4856008.java
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);
}
 
源代码30 项目: java-swing-tips   文件: MainPanel.java
@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;
}
 
 类所在包
 同包方法