当前位置: 首页>>代码示例>>Java>>正文


Java MetalBorders.TableHeaderBorder方法代码示例

本文整理汇总了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);
        }
        
    }
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:17,代码来源:TableHeaderAddon.java

示例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);
        }
    }
 
开发者ID:sing-group,项目名称:aibench-project,代码行数:12,代码来源:ColumnHeaderRendererAddon.java

示例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)));
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:14,代码来源:JXTableHeaderIssues.java

示例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)));
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:16,代码来源:JXTableHeaderIssues.java


注:本文中的javax.swing.plaf.metal.MetalBorders.TableHeaderBorder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。