Package org.freeplane.features.styles

Examples of org.freeplane.features.styles.IStyle


      if (!event.getProperty().equals(LogicalStyleModel.class)) {
        return;
      }
      final NodeModel node = event.getNode();
      final MapModel map = node.getMap();
      final IStyle styleKey = (IStyle) event.getNewValue();
      final MapStyleModel mapStyles = MapStyleModel.getExtension(map);
      final NodeModel styleNode = mapStyles.getStyleNode(styleKey);
      if (styleNode == null) {
        return;
      }
View Full Code Here


    if (childNumber < 1) {
      UITools.errorMessage(TextUtils.getText("can_not_delete_root_style"));
      return;
    }
    final String styleName = "AutomaticLayout.level," + childNumber;
    final IStyle styleObject = StyleFactory.create(NamedObject.format(styleName));
    final MapStyleModel styleModel = MapStyleModel.getExtension(map);
    final MMapController mapController = (MMapController) modeController.getMapController();
    final NodeModel node = styleModel.getStyleNode(styleObject);
    mapController.deleteNode(node);
    final IActor actor = new IActor() {
View Full Code Here

  public void actionPerformed(final ActionEvent e) {
    final MapModel map = Controller.getCurrentController().getMap();
    final NodeModel levelStyleParentNode = getLevelStyleParentNode(map);
    final String styleName = "AutomaticLayout.level," + levelStyleParentNode.getChildCount();
    final IStyle styleObject = StyleFactory.create(NamedObject.format(styleName));
    final MapStyleModel styleModel = MapStyleModel.getExtension(map);
    final MMapController mapController = (MMapController) Controller.getCurrentModeController().getMapController();
    final NodeModel node = new NodeModel(map);
    node.setUserObject(styleObject);
    mapController.insertNode(node, levelStyleParentNode, false, false, true);
View Full Code Here

    }
    final Controller controller = Controller.getCurrentController();
    final NodeModel selectedNode = controller.getSelection().getSelected();
    final MapModel map = controller.getMap();
    final MapStyleModel styleModel = MapStyleModel.getExtension(map);
    final IStyle style = StyleFactory.create(styleName);
    if (null != styleModel.getStyleNode(style)) {
      UITools.errorMessage(TextUtils.getText("style_already_exists"));
      return;
    }
    final MMapController mapController = (MMapController) Controller.getCurrentModeController().getMapController();
View Full Code Here

  }

  private void addStyleMenu(final MenuBuilder menuBuilder, final String category, final NodeModel rootNode, MapStyleModel extension) {
    final List<NodeModel> children = rootNode.getChildren();
    for (final NodeModel child : children) {
      final IStyle style = (IStyle) child.getUserObject();
      if (child.hasChildren()) {
        addStyleMenu(menuBuilder, category, child, extension);
      }
      else if(null != extension.getStyleNode(style)){
        final AssignStyleAction action = new AssignStyleAction(style);
View Full Code Here

    }
  }

  public void setStyle(final NodeModel node, final IStyle style) {
    final ModeController modeController = Controller.getCurrentModeController();
        final IStyle oldStyle = LogicalStyleModel.getStyle(node);
    if (oldStyle != null && oldStyle.equals(style) || oldStyle == style) {
      modeController.getMapController().nodeChanged(node, LogicalStyleModel.class, oldStyle, style);
      return;
    }
    final IActor actor = new IActor() {
      public String getDescription() {
View Full Code Here

    }

  @Override
  protected void actionPerformed(ActionEvent e, NodeModel node) {
    final MLogicalStyleController controller = MLogicalStyleController.getController();
    final IStyle firstStyle = controller.getFirstStyle(node);
    controller.copyStyleExtensions(firstStyle, node);
  }
View Full Code Here

  @Override
  public void setSelected() {
    IMapSelection selection = Controller.getCurrentController().getSelection();
    if(selection != null){
      NodeModel node= selection.getSelected();
      final IStyle style = LogicalStyleModel.getStyle(node);
      setSelected(this.style == style || this.style != null && this.style.equals(style));
    }
    else
      setSelected(false);
  }
View Full Code Here

    final NodeModel selectedNode = controller.getSelection().getSelected();

    final MapModel map = controller.getMap();
    final MapStyleModel styleModel = MapStyleModel.getExtension(map);
    final MapModel styleMap = styleModel.getStyleMap();
    final IStyle newStyle = StyleFactory.create(styleName);
    if (null != styleModel.getStyleNode(newStyle)) {
      UITools.errorMessage(TextUtils.getText("style_already_exists"));
      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){
View Full Code Here

        }
        if (ignoreChangeEvent) {
          return;
        }
        final DefaultComboBoxModel source = (DefaultComboBoxModel) e.getSource();
        final IStyle style = (IStyle) source.getSelectedItem();
        final MLogicalStyleController controller = (MLogicalStyleController) modeController
            .getExtension(LogicalStyleController.class);
        controller.setStyle(style);
      }
    };
View Full Code Here

TOP

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

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.