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


Java SynthLookAndFeel.getRegion方法代码示例

本文整理汇总了Java中javax.swing.plaf.synth.SynthLookAndFeel.getRegion方法的典型用法代码示例。如果您正苦于以下问题:Java SynthLookAndFeel.getRegion方法的具体用法?Java SynthLookAndFeel.getRegion怎么用?Java SynthLookAndFeel.getRegion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.plaf.synth.SynthLookAndFeel的用法示例。


在下文中一共展示了SynthLookAndFeel.getRegion方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSynthIcon

import javax.swing.plaf.synth.SynthLookAndFeel; //导入方法依赖的package包/类
private static void testSynthIcon() {

        if (!checkAndSetNimbusLookAndFeel()) {
            return;
        }

        JMenuItem menu = new JMenuItem();
        Icon subMenuIcon = UIManager.getIcon("Menu.arrowIcon");

        if (!(subMenuIcon instanceof SynthIcon)) {
            throw new RuntimeException("Icon is not a SynthIcon!");
        }

        Region region = SynthLookAndFeel.getRegion(menu);
        SynthStyle style = SynthLookAndFeel.getStyle(menu, region);
        SynthContext synthContext = new SynthContext(menu, region, style, SynthConstants.ENABLED);

        int width = SynthGraphicsUtils.getIconWidth(subMenuIcon, synthContext);
        int height = SynthGraphicsUtils.getIconHeight(subMenuIcon, synthContext);
        paintAndCheckIcon(subMenuIcon, synthContext, width, height);

        int newWidth = width * 17;
        int newHeight = height * 37;
        Icon centeredIcon = new CenteredSynthIcon((SynthIcon) subMenuIcon,
                newWidth, newHeight);
        paintAndCheckIcon(centeredIcon, synthContext, newWidth, newHeight);
    }
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:28,代码来源:bug8081411.java

示例2: getRegion

import javax.swing.plaf.synth.SynthLookAndFeel; //导入方法依赖的package包/类
private Region getRegion(JComponent c) {
    return SynthLookAndFeel.getRegion(c);
}
 
开发者ID:khuxtable,项目名称:seaglass,代码行数:4,代码来源:SeaGlassViewportUI.java

示例3: getRegion

import javax.swing.plaf.synth.SynthLookAndFeel; //导入方法依赖的package包/类
/**
 * Get the region.
 *
 * @param  c the component.
 *
 * @return the region.
 */
private Region getRegion(JComponent c) {
    return SynthLookAndFeel.getRegion(c);
}
 
开发者ID:khuxtable,项目名称:seaglass,代码行数:11,代码来源:SeaGlassButtonUI.java


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