Package org.freeplane.view.swing.features.progress.mindmapmode

Examples of org.freeplane.view.swing.features.progress.mindmapmode.ProgressUtilities


    super("ExternalImageRemoveAction");
  }

  @Override
  public void actionPerformed(final ActionEvent arg0, final NodeModel node) {
    final ProgressUtilities progUtil = new ProgressUtilities();
    final ViewerController vc = ((ViewerController) Controller.getCurrentController().getModeController()
        .getExtension(ViewerController.class));
    if (progUtil.hasExternalResource(node) && !progUtil.hasExtendedProgressIcon(node)) {
      vc.undoableDeactivateHook(node);
    }
  }
View Full Code Here


  }

  @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);
View Full Code Here

  public ChangeExternalImageAction() {
    super("ExternalImageChangeAction");
  }

  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());
        }
      }
    }
View Full Code Here

  }

  @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);
View Full Code Here

  public AddExternalImageAction() {
    super("ExternalImageAddAction");
  }

  public void actionPerformed(final ActionEvent event) {
    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 NodeModel selectedNode = mapController.getSelectedNode();
    if (selectedNode == null)
      return;
    final ExternalResource extRes = (ExternalResource) vc.createExtension(selectedNode);
    if (extRes == null)
      return;
    URI absoluteUri = extRes.getAbsoluteUri(selectedNode.getMap());
    if (absoluteUri == null)
      return;
    for (final NodeModel node : nodes) {
      if (!progUtil.hasExternalResource(node)) {
        vc.paste(absoluteUri, node, node.isLeft());
      }
    }
  }
View Full Code Here

  }

  @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);
View Full Code Here

  /**
   * @return Returns the delete menu item.
   */
  private JMenuItem getRemove() {
    final ProgressUtilities progUtil = new ProgressUtilities();
    if (remove == null) {
      remove = new JMenuItem(TextUtils.getText("ExternalImage_popupMenu_Remove"));
      remove.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
          final ExternalResource extRes = node.getExtension(ExternalResource.class);
          if (progUtil.hasExternalResource(node) && !progUtil.hasExtendedProgressIcon(node)) {
            viewer.remove(node, extRes);
            NodeView nv = null;
            final Collection<INodeView> invs = Controller.getCurrentController().getModeController()
                .getMapController().getSelectedNode().getViewers();
            for (final INodeView inv : invs) {
View Full Code Here

  /**
   * @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());
            }
          }
        }
View Full Code Here

  /**
   * Builds the menu.
   */
  private void make() {
    final ProgressUtilities progUtil = new ProgressUtilities();
    if (progUtil.hasExtendedProgressIcon(node)) {
      removeAll();
      add(getOpen());
      add(getResetZoom());
    }
    else {
View Full Code Here

TOP

Related Classes of org.freeplane.view.swing.features.progress.mindmapmode.ProgressUtilities

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.