本文整理汇总了Java中javax.swing.plaf.metal.MetalBorders.TableHeaderBorder方法的典型用法代码示例。如果您正苦于以下问题:Java MetalBorders.TableHeaderBorder方法的具体用法?Java MetalBorders.TableHeaderBorder怎么用?Java MetalBorders.TableHeaderBorder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.swing.plaf.metal.MetalBorders
的用法示例。
在下文中一共展示了MetalBorders.TableHeaderBorder方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addMetalDefaults
import javax.swing.plaf.metal.MetalBorders; //导入方法依赖的package包/类
@Override
protected void addMetalDefaults(LookAndFeelAddons addon,
DefaultsList defaults) {
super.addMetalDefaults(addon, defaults);
String key = "TableHeader.cellBorder";
Border border = UIManager.getBorder(key);
if (border instanceof MetalBorders.TableHeaderBorder) {
border = new BorderUIResource.CompoundBorderUIResource(border,
BorderFactory.createEmptyBorder());
// PENDING JW: this is fishy ... adding to lookAndFeelDefaults is taken
UIManager.getLookAndFeelDefaults().put(key, border);
// adding to defaults is not
// defaults.add(key, border);
}
}
示例2: hackMetalBorder
import javax.swing.plaf.metal.MetalBorders; //导入方法依赖的package包/类
private void hackMetalBorder(LookAndFeelAddons addon, DefaultsList defaults) {
Border border = UIManager.getBorder("TableHeader.cellBorder");
if (border instanceof MetalBorders.TableHeaderBorder) {
border = new BorderUIResource.CompoundBorderUIResource(border,
BorderFactory.createEmptyBorder());
// too heavyweight ...
// UIManager.put("TableHeader.cellBorder", border);
// LOG.info("updated border " + border);
defaults.add(ColumnHeaderRenderer.METAL_BORDER_HACK, border);
}
}
示例3: testMetalBorderInsets
import javax.swing.plaf.metal.MetalBorders; //导入方法依赖的package包/类
/**
* Issue 337-swingx: header heigth depends on sort icon (for ocean only?)
* Looks like a problem in MetalBorders.TableHeaderBorder: extends AbstractBorder but
* does not override getBorderInsets(comp, insets) which is used by the labelUI getPrefSize
* to determine the insets and calc the view rect.
*
*/
public void testMetalBorderInsets() {
JLabel label = new JLabel("sometext");
AbstractBorder metalBorder = new MetalBorders.TableHeaderBorder();
assertEquals(metalBorder.getBorderInsets(label),
metalBorder.getBorderInsets(label, new Insets(0,0,0,0)));
}
示例4: testMetalBorderInsetsHack
import javax.swing.plaf.metal.MetalBorders; //导入方法依赖的package包/类
/**
* Issue 337-swingx: header heigth depends on sort icon (for ocean only?)
* Looks like a problem in MetalBorders.TableHeaderBorder: extends AbstractBorder but
* does not override getBorderInsets(comp, insets) which is used by the labelUI getPrefSize
* to determine the insets and calc the view rect.
*
* Here we compound the default metal border
*/
public void testMetalBorderInsetsHack() {
JLabel label = new JLabel("sometext");
AbstractBorder metalBorder = new MetalBorders.TableHeaderBorder();
CompoundBorder compound = new CompoundBorder(metalBorder, BorderFactory.createEmptyBorder());
assertEquals(compound.getBorderInsets(label),
compound.getBorderInsets(label, new Insets(0,0,0,0)));
}