use of org.pushingpixels.flamingo.api.common.icon.ResizableIcon 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);
}
}
}
}
use of org.pushingpixels.flamingo.api.common.icon.ResizableIcon in project freeplane by freeplane.
the class RibbonActionContributorFactory method createCommandToggleMenuButton.
public static JCommandToggleMenuButton createCommandToggleMenuButton(final AFreeplaneAction action) {
String title = ActionUtils.getActionTitle(action);
ResizableIcon icon = ActionUtils.getActionIcon(action);
final JCommandToggleMenuButton button = new JCommandToggleMenuButton(title, icon);
updateRichTooltip(button, action, null);
button.addActionListener(new RibbonActionListener(action));
button.setFocusable(false);
return button;
}
use of org.pushingpixels.flamingo.api.common.icon.ResizableIcon in project freeplane by freeplane.
the class RibbonActionContributorFactory method createButton.
public static JButton createButton(final AFreeplaneAction action) {
String title = ActionUtils.getActionTitle(action);
ResizableIcon icon = ActionUtils.getActionIcon(action);
final JButton button = new JButton(title, icon);
// updateRichTooltip(button, action, null);
button.addActionListener(new RibbonActionListener(action));
button.setFocusable(false);
return button;
}
use of org.pushingpixels.flamingo.api.common.icon.ResizableIcon in project freeplane by freeplane.
the class RibbonMenuFooterContributorFactory method getContributor.
/**
*********************************************************************************
* METHODS
*********************************************************************************
*/
/**
*********************************************************************************
* REQUIRED METHODS FOR INTERFACES
*********************************************************************************
*/
public ARibbonContributor getContributor(final Properties attributes) {
String accel = attributes.getProperty("accelerator", null);
final String actionKey = attributes.getProperty("action");
if (actionKey != null) {
if (accel != null) {
if (Compat.isMacOsX()) {
accel = accel.replaceFirst("CONTROL", "META").replaceFirst("control", "meta");
}
builder.getAcceleratorManager().setDefaultAccelerator(actionKey, accel);
}
}
return new ARibbonContributor() {
public String getKey() {
return attributes.getProperty("action");
}
public void contribute(RibbonBuildContext context, ARibbonContributor parent) {
final String key = attributes.getProperty("action");
if (key != null) {
AFreeplaneAction action = context.getBuilder().getMode().getAction(key);
if (action != null) {
String title = ActionUtils.getActionTitle(action);
ResizableIcon icon = ActionUtils.getActionIcon(action);
ActionListener listener = new RibbonActionContributorFactory.RibbonActionListener(action);
final RibbonApplicationMenuEntryFooter entry = new RibbonApplicationMenuEntryFooter(icon, title, listener);
KeyStroke ks = context.getBuilder().getAcceleratorManager().getAccelerator(key);
if (ks != null) {
RichTooltip tip = RibbonActionContributorFactory.getRichTooltip(action, ks);
if (tip != null) {
entry.setActionRichTooltip(tip);
}
}
parent.addChild(entry, new ChildProperties(parseOrderSettings(attributes.getProperty("orderPriority", ""))));
}
}
}
public void addChild(Object child, ChildProperties properties) {
}
};
}
use of org.pushingpixels.flamingo.api.common.icon.ResizableIcon in project freeplane by freeplane.
the class RibbonActionContributorFactory method createCommandMenuButton.
public static JCommandMenuButton createCommandMenuButton(final AFreeplaneAction action) {
String title = ActionUtils.getActionTitle(action);
ResizableIcon icon = ActionUtils.getActionIcon(action);
final JCommandMenuButton button = new JCommandMenuButton(title, icon);
updateRichTooltip(button, action, null);
button.addActionListener(new RibbonActionListener(action));
button.setFocusable(false);
return button;
}
Aggregations