Search in sources :

Example 1 with JRibbonApplicationMenuButton

use of org.pushingpixels.flamingo.internal.ui.ribbon.appmenu.JRibbonApplicationMenuButton in project freeplane by freeplane.

the class RibbonBuilder method updateApplicationMenuButton.

public void updateApplicationMenuButton(JRibbon ribbon) {
    for (Component comp : ribbon.getComponents()) {
        if (comp instanceof JRibbonApplicationMenuButton) {
            String appName = ResourceController.getResourceController().getProperty("ApplicationName", "Freeplane");
            URL location = ResourceController.getResourceController().getResource("/images/" + appName.trim() + "_app_menu_128.png");
            if (location != null) {
                ResizableIcon icon = ImageWrapperResizableIcon.getIcon(location, new Dimension(32, 32));
                ((JRibbonApplicationMenuButton) comp).setIcon(icon);
                ((JRibbonApplicationMenuButton) comp).setBackground(Color.blue);
            }
        }
    }
}
Also used : JRibbonApplicationMenuButton(org.pushingpixels.flamingo.internal.ui.ribbon.appmenu.JRibbonApplicationMenuButton) Dimension(java.awt.Dimension) Component(java.awt.Component) ImageWrapperResizableIcon(org.pushingpixels.flamingo.api.common.icon.ImageWrapperResizableIcon) ResizableIcon(org.pushingpixels.flamingo.api.common.icon.ResizableIcon) URL(java.net.URL)

Aggregations

Component (java.awt.Component)1 Dimension (java.awt.Dimension)1 URL (java.net.URL)1 ImageWrapperResizableIcon (org.pushingpixels.flamingo.api.common.icon.ImageWrapperResizableIcon)1 ResizableIcon (org.pushingpixels.flamingo.api.common.icon.ResizableIcon)1 JRibbonApplicationMenuButton (org.pushingpixels.flamingo.internal.ui.ribbon.appmenu.JRibbonApplicationMenuButton)1