本文整理汇总了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;
}
示例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);
}
}
;
}
示例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);
}
};
}