Examples of ModeController


Examples of org.freeplane.features.mode.ModeController

      final NodeStyleModel styleModel = NodeStyleModel.getModel(node);
      if (styleModel != null) {
        return styleModel;
      }
    }
    final ModeController modeController = Controller.getCurrentModeController();
    final IActor actor = new IActor() {
      public void act() {
        node.addExtension(new NodeStyleModel());
      }

      public String getDescription() {
        return null;
      }

      public void undo() {
        node.removeExtension(NodeStyleModel.class);
      }
    };
    modeController.execute(actor, node.getMap());
    return NodeStyleModel.getModel(node);
  }
View Full Code Here

Examples of org.freeplane.features.mode.ModeController

      final NodeSizeModel sizeModel = NodeSizeModel.getModel(node);
      if (sizeModel != null) {
        return sizeModel;
      }
    }
    final ModeController modeController = Controller.getCurrentModeController();
    final IActor actor = new IActor() {
      public void act() {
        node.addExtension(new NodeSizeModel());
      }

      public String getDescription() {
        return null;
      }

      public void undo() {
        node.removeExtension(NodeSizeModel.class);
      }
    };
    modeController.execute(actor, node.getMap());
    return NodeSizeModel.getModel(node);
  }
View Full Code Here

Examples of org.freeplane.features.mode.ModeController

      setFontSize(node, newSize);
    }
  }

  public void setBackgroundColor(final NodeModel node, final Color color) {
    final ModeController modeController = Controller.getCurrentModeController();
    final Color oldColor = NodeStyleModel.getBackgroundColor(node);
    if (color == oldColor || color != null && color.equals(oldColor)) {
      return;
    }
    final IActor actor = new IActor() {
      public void act() {
        NodeStyleModel.setBackgroundColor(node, color);
        Controller.getCurrentModeController().getMapController().nodeChanged(node);
      }

      public String getDescription() {
        return "setBackgroundColor";
      }

      public void undo() {
        NodeStyleModel.setBackgroundColor(node, oldColor);
        Controller.getCurrentModeController().getMapController().nodeChanged(node);
      }
    };
    modeController.execute(actor, node.getMap());
  }
View Full Code Here

Examples of org.freeplane.features.mode.ModeController

    final Boolean oldBold = NodeStyleModel.isBold(node);
    if (oldBold == bold || oldBold != null && oldBold.equals(bold)) {
      return;
    }
    createOwnStyleModel(node);
    final ModeController modeController = Controller.getCurrentModeController();
    final IActor actor = new IActor() {
      public void act() {
        final NodeStyleModel styleModel = NodeStyleModel.getModel(node);
        styleModel.setBold(bold);
        Controller.getCurrentModeController().getMapController().nodeChanged(node);
      }

      public String getDescription() {
        return "setBold";
      }

      public void undo() {
        final NodeStyleModel styleModel = NodeStyleModel.getModel(node);
        styleModel.setBold(oldBold);
        Controller.getCurrentModeController().getMapController().nodeChanged(node);
      }
    };
    modeController.execute(actor, node.getMap());
  }
View Full Code Here

Examples of org.freeplane.features.mode.ModeController

    };
    modeController.execute(actor, node.getMap());
  }

  public void setColor(final NodeModel node, final Color color) {
    final ModeController modeController = Controller.getCurrentModeController();
    final Color oldColor = NodeStyleModel.getColor(node);
    if (oldColor == color || oldColor != null && oldColor.equals(color)) {
      return;
    }
    final IActor actor = new IActor() {
      public void act() {
        NodeStyleModel.setColor(node, color);
        Controller.getCurrentModeController().getMapController().nodeChanged(node);
      }

      public String getDescription() {
        return "setColor";
      }

      public void undo() {
        NodeStyleModel.setColor(node, oldColor);
        Controller.getCurrentModeController().getMapController().nodeChanged(node);
      }
    };
    modeController.execute(actor, node.getMap());
  }
View Full Code Here

Examples of org.freeplane.features.mode.ModeController

    final String oldFontFamily = NodeStyleModel.getFontFamilyName(node);
    if (oldFontFamily == fontFamily || oldFontFamily != null && oldFontFamily.equals(fontFamily)) {
      return;
    }
    createOwnStyleModel(node);
    final ModeController modeController = Controller.getCurrentModeController();
    final IActor actor = new IActor() {
      public void act() {
        final NodeStyleModel styleModel = NodeStyleModel.getModel(node);
        styleModel.setFontFamilyName(fontFamily);
        Controller.getCurrentModeController().getMapController().nodeChanged(node);
      }

      public String getDescription() {
        return "setFontFamily";
      }

      public void undo() {
        final NodeStyleModel styleModel = NodeStyleModel.getModel(node);
        styleModel.setFontFamilyName(oldFontFamily);
        Controller.getCurrentModeController().getMapController().nodeChanged(node);
      }
    };
    modeController.execute(actor, node.getMap());
  }
View Full Code Here

Examples of org.freeplane.features.mode.ModeController

    final Integer oldFontSize = NodeStyleModel.getFontSize(node);
    if (oldFontSize == fontSize || oldFontSize != null && oldFontSize.equals(fontSize)) {
      return;
    }
    createOwnStyleModel(node);
    final ModeController modeController = Controller.getCurrentModeController();
    final IActor actor = new IActor() {
      public void act() {
        final NodeStyleModel styleModel = NodeStyleModel.getModel(node);
        styleModel.setFontSize(fontSize);
        Controller.getCurrentModeController().getMapController().nodeChanged(node);
      }

      public String getDescription() {
        return "setFontSize";
      }

      public void undo() {
        final NodeStyleModel styleModel = NodeStyleModel.getModel(node);
        styleModel.setFontSize(oldFontSize);
        Controller.getCurrentModeController().getMapController().nodeChanged(node);
      }
    };
    modeController.execute(actor, node.getMap());
  }
View Full Code Here

Examples of org.freeplane.features.mode.ModeController

    final Boolean oldItalic = NodeStyleModel.isItalic(node);
    if (oldItalic == italic || oldItalic != null && oldItalic.equals(italic)) {
      return;
    }
    createOwnStyleModel(node);
    final ModeController modeController = Controller.getCurrentModeController();
    final IActor actor = new IActor() {
      public void act() {
        final NodeStyleModel styleModel = NodeStyleModel.getModel(node);
        styleModel.setItalic(italic);
        Controller.getCurrentModeController().getMapController().nodeChanged(node);
      }

      public String getDescription() {
        return "setItalic";
      }

      public void undo() {
        final NodeStyleModel styleModel = NodeStyleModel.getModel(node);
        styleModel.setItalic(oldItalic);
        Controller.getCurrentModeController().getMapController().nodeChanged(node);
      }
    };
    modeController.execute(actor, node.getMap());
  }
View Full Code Here

Examples of org.freeplane.features.mode.ModeController

    };
    modeController.execute(actor, node.getMap());
  }

  public void setNodeNumbering(final NodeModel node, final Boolean enableNodeNumbering) {
    final ModeController modeController = Controller.getCurrentModeController();
    final Boolean oldValue = NodeStyleModel.getNodeNumbering(node);
    final IActor actor = new IActor() {
      public void act() {
        NodeStyleModel.setNodeNumbering(node, enableNodeNumbering);
        final MapController mapController = modeController.getMapController();
        mapController.setSaved(node.getMap(), false);
        mapController.delayedNodeRefresh(node, NodeStyleController.NODE_NUMBERING, oldValue, enableNodeNumbering);
      }

      public String getDescription() {
        return "setNodeNumbering";
      }

      public void undo() {
        NodeStyleModel.setNodeNumbering(node, oldValue);
        final MapController mapController = modeController.getMapController();
        mapController.setSaved(node.getMap(), false);
        modeController.getMapController().delayedNodeRefresh(node, NodeStyleController.NODE_NUMBERING, enableNodeNumbering, oldValue);
      }
    };
    modeController.execute(actor, node.getMap());
    }
View Full Code Here

Examples of org.freeplane.features.mode.ModeController

    };
    modeController.execute(actor, node.getMap());
    }

  public void setNodeFormat(final NodeModel node, final String format) {
    final ModeController modeController = Controller.getCurrentModeController();
    final String oldFormat = NodeStyleModel.getNodeFormat(node);
    final IActor actor = new IActor() {
      public void act() {
        NodeStyleModel.setNodeFormat(node, format);
        modeController.getMapController().nodeChanged(node);
      }

      public String getDescription() {
        return "setNodeFormat";
      }

      public void undo() {
        NodeStyleModel.setNodeFormat(node, oldFormat);
        modeController.getMapController().nodeChanged(node);
      }
    };
    modeController.execute(actor, node.getMap());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.