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


Java ResizableIcon类代码示例

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

示例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());
    }
}
 
开发者ID:Alidron,项目名称:designer,代码行数:20,代码来源:RibbonComponentFactory.java

示例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());
    }
}
 
开发者ID:Alidron,项目名称:designer,代码行数:17,代码来源:RibbonComponentFactory.java

示例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());
    }
}
 
开发者ID:Alidron,项目名称:designer,代码行数:17,代码来源:RibbonComponentFactory.java

示例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());
    }
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:18,代码来源:ActionMenuButton.java

示例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());
    }
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:19,代码来源:ActionCommandButton.java

示例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;
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:10,代码来源:OrbitMenu.java

示例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;
}
 
开发者ID:mstritt,项目名称:orbit-image-analysis,代码行数:10,代码来源:OrbitMenu.java

示例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();
	}
}
 
开发者ID:glycoinfo,项目名称:eurocarbdb,代码行数:13,代码来源:GlycanAction.java

示例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);
    }
}
 
开发者ID:Torridity,项目名称:dsworkbench,代码行数:8,代码来源:RibbonConfigurator.java

示例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);
    }
}
 
开发者ID:Torridity,项目名称:dsworkbench,代码行数:8,代码来源:RibbonConfigurator.java

示例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;
}
 
开发者ID:DJVUpp,项目名称:Desktop,代码行数:11,代码来源:RibbonMenuCreation.java

示例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);
    }
}
 
开发者ID:Alidron,项目名称:designer,代码行数:11,代码来源:ActionItem.java

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

示例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();
}
 
开发者ID:Depter,项目名称:JRLib,代码行数:32,代码来源:BoundMenuCommandButton.java


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