Package org.freeplane.features.styles

Examples of org.freeplane.features.styles.LogicalStyleController


      }
    });
    addShapeGetter(IPropertyHandler.STYLE, new IPropertyHandler<String, NodeModel>() {
      public String getProperty(final NodeModel node, final String currentValue) {
        final MapModel map = node.getMap();
        final LogicalStyleController styleController = LogicalStyleController.getController(modeController);
        final Collection<IStyle> style = styleController.getStyles(node);
        final String returnedString = getStyleShape(map, style);
        return returnedString;
      }
    });
    addShapeGetter(IPropertyHandler.DEFAULT, new IPropertyHandler<String, NodeModel>() {
View Full Code Here


    return style == null ? null : style.getNodeFormat();
  }

  public int getMaxWidth(NodeModel node) {
    final MapModel map = node.getMap();
    final LogicalStyleController styleController = LogicalStyleController.getController(modeController);
    final Collection<IStyle> style = styleController.getStyles(node);
    final int maxTextWidth = getStyleMaxNodeWidth(map, style);
    return maxTextWidth;
    }
View Full Code Here

    return maxTextWidth;
    }

  public int getMinWidth(NodeModel node) {
    final MapModel map = node.getMap();
    final LogicalStyleController styleController = LogicalStyleController.getController(modeController);
    final Collection<IStyle> style = styleController.getStyles(node);
    final int minWidth = getStyleMinWidth(map, style);
    return minWidth;
    }
View Full Code Here

    if (internalChange) {
      return;
    }
    internalChange = true;
    try {
      final LogicalStyleController logicalStyleController = LogicalStyleController.getController();
      if(addStyleBox){
        final boolean isStyleSet = LogicalStyleModel.getStyle(node) != null;
        mSetStyle.setValue(isStyleSet);
        setStyleList(mMapStyleButton, logicalStyleController.getMapStyleNames(node, "\n"));
      }
      setStyleList(mNodeStyleButton, logicalStyleController.getNodeStyleNames(node, "\n"));
      final NodeStyleController styleController = NodeStyleController.getController();
      {
        final Color nodeColor = NodeStyleModel.getColor(node);
        final Color viewNodeColor = styleController.getColor(node);
        mSetNodeColor.setValue(nodeColor != null);
View Full Code Here

    EdgeController.install(new EdgeController(modeController));
    CloudController.install(new CloudController(modeController));
    NoteController.install(new NoteController());
    TextController.install(new TextController(modeController));
    LinkController.install(new LinkController());
    LogicalStyleController.install(new LogicalStyleController(modeController));
    try {
      ClipboardController.install(new ClipboardController());
    }
    catch (final AccessControlException e) {
      LogUtils.warn("can not access system clipboard, clipboard controller disabled");
View Full Code Here

      return;
    }
    final MMapController mapController = (MMapController) Controller.getCurrentModeController().getMapController();
    final NodeModel newNode = new NodeModel(styleMap);
    newNode.setUserObject(newStyle);
    final LogicalStyleController styleController = LogicalStyleController.getController();
    final ArrayList<IStyle> styles = new ArrayList<IStyle>(styleController.getStyles(selectedNode));
    for(int i = styles.size() - 1; i >= 0; i--){
      IStyle style = styles.get(i);
      if(MapStyleModel.DEFAULT_STYLE.equals(style)){
        continue;
      }
      final NodeModel styleNode = styleModel.getStyleNode(style);
            if(styleNode == null){
                continue;
            }
      Controller.getCurrentModeController().copyExtensions(LogicalStyleKeys.NODE_STYLE, styleNode, newNode);
    }
    Controller.getCurrentModeController().copyExtensions(LogicalStyleKeys.NODE_STYLE, selectedNode, newNode);
    Controller.getCurrentModeController().copyExtensions(Keys.ICONS, selectedNode, newNode);
    NodeModel userStyleParentNode = styleModel.getStyleNodeGroup(styleMap, MapStyleModel.STYLES_USER_DEFINED);
    if(userStyleParentNode == null){
      userStyleParentNode = new NodeModel(styleMap);
      userStyleParentNode.setUserObject(new StyleNamedObject(MapStyleModel.STYLES_USER_DEFINED));
      mapController.insertNode(userStyleParentNode, styleMap.getRootNode(), false, false, true);

    }
    mapController.insertNode(newNode, userStyleParentNode, false, false, true);
    mapController.select(newNode);
    final IActor actor = new IActor() {
      public void undo() {
        styleModel.removeStyleNode(newNode);
        styleController.refreshMap(map);
      }

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

      public void act() {
        styleModel.addStyleNode(newNode);
        styleController.refreshMap(map);
      }
    };
    Controller.getCurrentModeController().execute(actor, styleMap);
  }
View Full Code Here

    final Controller controller = Controller.getCurrentController();
    final MNodeStyleController styleController = (MNodeStyleController) controller.getModeController()
        .getExtension(NodeStyleController.class);
    selectFontSize(Integer.toString(styleController.getFontSize(node)));
    selectFontName(styleController.getFontFamilyName(node));
    final LogicalStyleController logicalStyleController = LogicalStyleController.getController();
    ignoreChangeEvent = true;
     styles.setSelectedItem(logicalStyleController.getFirstStyle(node));
        ignoreChangeEvent = false;
  }
View Full Code Here

    TextController.install(new TextController(modeController));
    LinkController.install(new LinkController());
    CloudController.install(new CloudController(modeController));
    ClipboardController.install(new ClipboardController());
    LocationController.install(new LocationController());
    LogicalStyleController.install(new LogicalStyleController(modeController));
    MapStyle.install(true);
    NodeStyleController.getController().addShapeGetter(new Integer(0),
        new IPropertyHandler<String, NodeModel>() {
          public String getProperty(final NodeModel node, final String currentValue) {
            return "fork";
View Full Code Here

TOP

Related Classes of org.freeplane.features.styles.LogicalStyleController

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.