本文整理汇总了Java中org.pushingpixels.flamingo.api.common.icon.ResizableIcon类的典型用法代码示例。如果您正苦于以下问题:Java ResizableIcon类的具体用法?Java ResizableIcon怎么用?Java ResizableIcon使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResizableIcon类属于org.pushingpixels.flamingo.api.common.icon包,在下文中一共展示了ResizableIcon类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ActionCommandButton
import org.pushingpixels.flamingo.api.common.icon.ResizableIcon; //导入依赖的package包/类
public ActionCommandButton(ResizableIcon icon, String text, final Action action,
CommandButtonKind type) {
super(text, icon);
setCommandButtonKind(type);
if (action != null) {
addActionListener(action);
action.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if ("enabled".equals(evt.getPropertyName())) {
setEnabled(action.isEnabled());
}
}
});
setEnabled(action.isEnabled());
}
}
示例2: ActionMenuButton
import org.pushingpixels.flamingo.api.common.icon.ResizableIcon; //导入依赖的package包/类
public ActionMenuButton(ResizableIcon icon, String text, final Action action,
CommandButtonKind type) {
super(text, icon);
setCommandButtonKind(type);
if (action != null) {
addActionListener(action);
action.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if ("enabled".equals(evt.getPropertyName())) {
setEnabled(action.isEnabled());
}
}
});
setEnabled(action.isEnabled());
}
}
示例3: PrimaryMenuItem
import org.pushingpixels.flamingo.api.common.icon.ResizableIcon; //导入依赖的package包/类
public PrimaryMenuItem(ResizableIcon icon, String text, final Action action, CommandButtonKind type) {
super(icon, text, action, type);
if (action != null) {
action.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if ("enabled".equals(evt.getPropertyName())) {
setEnabled(action.isEnabled());
}
}
});
setEnabled(action.isEnabled());
}
}
示例4: SecondaryMenuItem
import org.pushingpixels.flamingo.api.common.icon.ResizableIcon; //导入依赖的package包/类
public SecondaryMenuItem(ResizableIcon icon, String text, final Action action, CommandButtonKind type) {
super(icon, text, action, type);
if (action != null) {
action.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if ("enabled".equals(evt.getPropertyName())) {
setEnabled(action.isEnabled());
}
}
});
setEnabled(action.isEnabled());
}
}
示例5: ActionMenuButton
import org.pushingpixels.flamingo.api.common.icon.ResizableIcon; //导入依赖的package包/类
public ActionMenuButton(
ResizableIcon icon, String text,
final Action action, CommandButtonKind type) {
super(text, icon);
setCommandButtonKind(type);
if(action != null) {
addActionListener(action);
action.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if("enabled".equals(evt.getPropertyName()))
setEnabled(action.isEnabled());
}
});
setEnabled(action.isEnabled());
}
}
示例6: ActionCommandButton
import org.pushingpixels.flamingo.api.common.icon.ResizableIcon; //导入依赖的package包/类
public ActionCommandButton(
ResizableIcon icon, String text,
final Action action, CommandButtonKind type) {
super(text, icon);
setCommandButtonKind(type);
if(action != null) {
addActionListener(action);
action.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if("enabled".equals(evt.getPropertyName()))
setEnabled(action.isEnabled());
}
});
setEnabled(action.isEnabled());
}
}
示例7: createTaskbarButton
import org.pushingpixels.flamingo.api.common.icon.ResizableIcon; //导入依赖的package包/类
private JButton createTaskbarButton(final ResizableIcon icon, final String tooltip, final ActionListener actionListener) {
icon.setDimension(new Dimension(16, 16));
JButton btn = new JButton(icon);
//JCommandButton btn = new JCommandButton(icon);
if (tooltip != null) btn.setToolTipText(tooltip);
//if (tooltip!=null) btn.setActionRichTooltip(new RichTooltip(tooltip,""));
if (actionListener != null) btn.addActionListener(actionListener);
return btn;
}
示例8: createTaskbarToggleButton
import org.pushingpixels.flamingo.api.common.icon.ResizableIcon; //导入依赖的package包/类
private JToggleButton createTaskbarToggleButton(final ResizableIcon icon, final ResizableIcon selectedIcon, final String tooltip, final ActionListener actionListener) {
icon.setDimension(new Dimension(16, 16));
selectedIcon.setDimension(new Dimension(16, 16));
JToggleButton btn = new JToggleButton(icon, false);
btn.setSelectedIcon(selectedIcon);
if (tooltip != null) btn.setToolTipText(tooltip);
if (actionListener != null) btn.addActionListener(actionListener);
return btn;
}
示例9: getResizableIcon
import org.pushingpixels.flamingo.api.common.icon.ResizableIcon; //导入依赖的package包/类
/**
* Get the icon associated with this GlycanAction scaled to the given icon size.
* @param iconSize
* @return
*/
public ResizableIcon getResizableIcon(ICON_SIZE iconSize){
if(this.eurocarbIcon.getIconProperties()==null){
return ImageWrapperResizableIcon.getIcon(ThemeManager.getEmptyIcon(iconSize).getImage(), new Dimension(iconSize.getSize(),iconSize.getSize()));
}else{
return this.eurocarbIcon.getThemeManager().getResizableIcon(this.getEurocarbIcon().getIconProperties().id, iconSize).getResizableIcon();
}
}
示例10: getResizableIconFromResource
import org.pushingpixels.flamingo.api.common.icon.ResizableIcon; //导入依赖的package包/类
private static ResizableIcon getResizableIconFromResource(String resource) {
try {
return ImageWrapperResizableIcon.getIcon(DSWorkbenchMainFrame.class.getResource(resource), new Dimension(48, 48));
} catch (Exception e) {
return new EmptyResizableIcon(18);
}
}
示例11: getResizableIconFromFile
import org.pushingpixels.flamingo.api.common.icon.ResizableIcon; //导入依赖的package包/类
private static ResizableIcon getResizableIconFromFile(String resource) {
try {
return ImageWrapperResizableIcon.getIcon(new File(resource).toURI().toURL(), new Dimension(48, 48));
} catch (Exception e) {
return new EmptyResizableIcon(18);
}
}
示例12: getResizableIconFromResource
import org.pushingpixels.flamingo.api.common.icon.ResizableIcon; //导入依赖的package包/类
public ResizableIcon getResizableIconFromResource(String resource) {
ResizableIcon icon = null;
try {
icon = ImageWrapperResizableIcon
.getIcon(this.getClass().getClassLoader().getResourceAsStream(resource.substring(1)), new Dimension(16, 16));
} catch (Exception ex) {
ex.printStackTrace();
}
return icon;
}
示例13: getIcon
import org.pushingpixels.flamingo.api.common.icon.ResizableIcon; //导入依赖的package包/类
public ResizableIcon getIcon() {
String iconResource = (String) getValue(ICON_BASE);
if (iconResource != null) {
return ResizableIcons.fromResource(iconResource);
} else {
Icon small = (Icon) getValue(Action.SMALL_ICON);
Icon large = (Icon) getValue(Action.LARGE_ICON_KEY);
return ResizableIcons.binary(small, large);
}
}
示例14: SecondaryMenuEntry
import org.pushingpixels.flamingo.api.common.icon.ResizableIcon; //导入依赖的package包/类
public SecondaryMenuEntry(String text, String description, ResizableIcon icon, final Action action) {
super(icon, text, action, JCommandButton.CommandButtonKind.ACTION_ONLY);
if (action != null) {
action.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if ("enabled".equals(evt.getPropertyName())) {
setEnabled(action.isEnabled());
}
}
});
setEnabled(action.isEnabled());
}
setDescriptionText(description);
}
示例15: BoundMenuCommandButton
import org.pushingpixels.flamingo.api.common.icon.ResizableIcon; //导入依赖的package包/类
public BoundMenuCommandButton(CommandButtonKind kind, String text, String description, ResizableIcon icon,
ResizableIcon disabledIcon, Action action) {
super(text, icon);
this.action = action;
setCommandButtonKind(kind);
setDisabledIcon(disabledIcon);
addActionListener(action);
RichTooltip tooltip = new RichTooltip();
tooltip.setTitle(getText());
tooltip.addDescriptionSection(description == null || description.length() == 0 ? " " : description);
setActionRichTooltip(tooltip);
setPopupRichTooltip(tooltip);
PropertyChangeListener l = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if ("enabled".equals(evt.getPropertyName())) {
updateState();
}
if (Action.SHORT_DESCRIPTION.equals(evt.getPropertyName())) {
updateTooltip();
}
}
};
action.addPropertyChangeListener(l);
updateState();
updateTooltip();
}