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


Java DynamicallySizingJRSUIIcon类代码示例

本文整理汇总了Java中com.apple.laf.AquaIcon.DynamicallySizingJRSUIIcon的典型用法代码示例。如果您正苦于以下问题:Java DynamicallySizingJRSUIIcon类的具体用法?Java DynamicallySizingJRSUIIcon怎么用?Java DynamicallySizingJRSUIIcon使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getFindButton

import com.apple.laf.AquaIcon.DynamicallySizingJRSUIIcon; //导入依赖的package包/类
protected static JButton getFindButton(final JTextComponent c) {
    final DynamicallySizingJRSUIIcon findIcon = getFindIcon(c);
    final JButton b = createButton(c, findIcon);
    b.setName("find");

    final Object findPopup = c.getClientProperty(FIND_POPUP_KEY);
    if (findPopup instanceof JPopupMenu) {
        // if we have a popup, indicate that in the icon
        findIcon.painter.state.set(Variant.MENU_GLYPH);

        b.addMouseListener(new MouseAdapter() {
            public void mousePressed(final MouseEvent e) {
                ((JPopupMenu)findPopup).show(b, 8, b.getHeight() - 2);
                c.requestFocusInWindow();
                c.repaint();
            }
        });
    }

    final Object findAction = c.getClientProperty(FIND_ACTION_KEY);
    if (findAction instanceof ActionListener) {
        b.addActionListener((ActionListener)findAction);
    }

    return b;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:AquaTextFieldSearch.java

示例2: getFindIcon

import com.apple.laf.AquaIcon.DynamicallySizingJRSUIIcon; //导入依赖的package包/类
protected static DynamicallySizingJRSUIIcon getFindIcon(final JTextComponent text) {
    return (text.getClientProperty(FIND_POPUP_KEY) == null) ?
        new DynamicallySizingJRSUIIcon(new SizeDescriptor(new SizeVariant(25, 22).alterMargins(0, 4, 0, -5))) {
            public void initJRSUIState() {
                painter.state.set(Widget.BUTTON_SEARCH_FIELD_FIND);
            }
        }
    :
        new DynamicallySizingJRSUIIcon(new SizeDescriptor(new SizeVariant(25, 22).alterMargins(0, 4, 0, 2))) {
            public void initJRSUIState() {
                painter.state.set(Widget.BUTTON_SEARCH_FIELD_FIND);
            }
        }
    ;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:AquaTextFieldSearch.java

示例3: getCancelIcon

import com.apple.laf.AquaIcon.DynamicallySizingJRSUIIcon; //导入依赖的package包/类
protected static DynamicallySizingJRSUIIcon getCancelIcon() {
    return new DynamicallySizingJRSUIIcon(new SizeDescriptor(new SizeVariant(22, 22).alterMargins(0, 0, 0, 4))) {
        public void initJRSUIState() {
            painter.state.set(Widget.BUTTON_SEARCH_FIELD_CANCEL);
        }
    };
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:AquaTextFieldSearch.java


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