use of org.freeplane.view.swing.features.progress.mindmapmode.ProgressUtilities in project freeplane by freeplane.
the class ChangeExternalImageAction method setEnabled.
@Override
public void setEnabled() {
boolean enable = false;
final ProgressUtilities progUtil = new ProgressUtilities();
final Collection<NodeModel> nodes = Controller.getCurrentModeController().getMapController().getSelectedNodes();
for (final NodeModel node : nodes) {
if (node != null && progUtil.hasExternalResource(node) && !progUtil.hasExtendedProgressIcon(node)) {
enable = true;
break;
}
}
setEnabled(enable);
}
use of org.freeplane.view.swing.features.progress.mindmapmode.ProgressUtilities in project freeplane by freeplane.
the class AddExternalImageAction method setEnabled.
@Override
public void setEnabled() {
boolean enable = false;
final ProgressUtilities progUtil = new ProgressUtilities();
final Collection<NodeModel> nodes = Controller.getCurrentModeController().getMapController().getSelectedNodes();
for (final NodeModel node : nodes) {
if (node != null && !progUtil.hasExternalResource(node)) {
enable = true;
break;
}
}
setEnabled(enable);
}
use of org.freeplane.view.swing.features.progress.mindmapmode.ProgressUtilities in project freeplane by freeplane.
the class ExternalImagePopupMenu method getChange.
/**
* @return Returns the change menu item.
*/
private JMenuItem getChange() {
final ProgressUtilities progUtil = new ProgressUtilities();
if (change == null) {
change = new JMenuItem(TextUtils.getText("ExternalImage_popupMenu_Change"));
change.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
final ExternalResource extRes = (ExternalResource) viewer.createExtension(node);
if (extRes != null) {
URI uri = extRes.getAbsoluteUri(node.getMap());
if (progUtil.hasExternalResource(node) && !progUtil.hasExtendedProgressIcon(node)) {
viewer.undoableDeactivateHook(node);
viewer.paste(uri, node, node.isLeft());
}
}
}
});
}
return change;
}
use of org.freeplane.view.swing.features.progress.mindmapmode.ProgressUtilities in project freeplane by freeplane.
the class ChangeExternalImageAction method actionPerformed.
public void actionPerformed(final ActionEvent arg0) {
final ProgressUtilities progUtil = new ProgressUtilities();
final MapController mapController = Controller.getCurrentModeController().getMapController();
final Collection<NodeModel> nodes = mapController.getSelectedNodes();
final ViewerController vc = (Controller.getCurrentController().getModeController().getExtension(ViewerController.class));
final ExternalResource extRes = (ExternalResource) vc.createExtension(mapController.getSelectedNode());
if (extRes != null) {
URI uri = extRes.getAbsoluteUri(mapController.getSelectedNode().getMap());
for (final NodeModel node : nodes) {
if (progUtil.hasExternalResource(node) && !progUtil.hasExtendedProgressIcon(node)) {
vc.undoableDeactivateHook(node);
vc.paste(uri, node, node.isLeft());
}
}
}
}
use of org.freeplane.view.swing.features.progress.mindmapmode.ProgressUtilities in project freeplane by freeplane.
the class RemoveExternalImageAction method setEnabled.
@Override
public void setEnabled() {
boolean enable = false;
final ProgressUtilities progUtil = new ProgressUtilities();
final Collection<NodeModel> nodes = Controller.getCurrentModeController().getMapController().getSelectedNodes();
for (final NodeModel node : nodes) {
if (node != null && progUtil.hasExternalResource(node) && !progUtil.hasExtendedProgressIcon(node)) {
enable = true;
break;
}
}
setEnabled(enable);
}
Aggregations