Package org.freeplane.features.nodestyle

Examples of org.freeplane.features.nodestyle.NodeStyleController


    modeController.addToolTipProvider(NODE_TOOLTIP, new ITooltipProvider() {
          public String getTooltip(final ModeController modeController, NodeModel node, Component view) {
            if (!ShortenedTextModel.isShortened(node)) {
              return null;
            }
            final NodeStyleController style = (NodeStyleController) modeController.getExtension(NodeStyleController.class);
            final Font font = style.getFont(node);
            final StringBuilder rule = new StringBuilder();
            rule.append("font-family: " + font.getFamily() + ";");
            rule.append("font-size: " + font.getSize() + "pt;");
            rule.append("margin-top:0;");
          if (font.isItalic()) {
View Full Code Here


    }

  protected Dimension calculateContentSize(final NodeView view) {
      final JComponent content = view.getContent();
        final ModeController modeController = view.getMap().getModeController();
        final NodeStyleController nsc = NodeStyleController.getController(modeController);
        Dimension contentSize;
        if (content instanceof ZoomableLabel){
          int maxNodeWidth = nsc.getMaxWidth(view.getModel());
          contentSize=  ((ZoomableLabel)content).getPreferredSize(maxNodeWidth);
        }
        else{
          contentSize=  content.getPreferredSize();
        }
        int minNodeWidth = nsc.getMinWidth(view.getModel());
        int contentWidth = Math.max(view.getZoomed(minNodeWidth),contentSize.width);
        int contentHeight = contentSize.height;
        final Dimension contentProfSize = new Dimension(contentWidth, contentHeight);
        return contentProfSize;
    }
View Full Code Here

  public void layoutContainer(final Container parent) {
    final int componentCount = parent.getComponentCount();
    final int width = parent.getWidth();
    NodeView view = (NodeView) parent.getParent();
    final MapView map = view.getMap();
    final NodeStyleController ncs = NodeStyleController.getController(map.getModeController());
    final int maxWidth = ncs.getMaxWidth(view.getModel());
    int y = 0;
    for (int i = 0; i < componentCount; i++) {
      final Component component = parent.getComponent(i);
      if (component.isVisible()) {
        component.validate();
View Full Code Here

  }

  public Dimension preferredLayoutSize(final Container parent) {
    NodeView view = (NodeView) parent.getParent();
    final MapView map = view.getMap();
    final NodeStyleController ncs = NodeStyleController.getController(map.getModeController());
    final int width = ncs.getMaxWidth(view.getModel());
    final Dimension prefSize = new Dimension(0, 0);
    final int componentCount = parent.getComponentCount();
    for (int i = 0; i < componentCount; i++) {
      final Component component = parent.getComponent(i);
      if (component.isVisible()) {
View Full Code Here

    final Dimension dimension = super.getPreferredSize();
    NodeView nodeView = (NodeView) SwingUtilities.getAncestorOfClass(NodeView.class, this);
    if(nodeView != null){
      final MapView map = nodeView.getMap();
      final ModeController modeController = map.getModeController();
      final NodeStyleController nsc = NodeStyleController.getController(modeController);
      dimension.width = Math.min(map.getZoomed(nsc.getMaxWidth(nodeView.getModel())), dimension.width);
      dimension.height = Math.min(map.getZoomed(AttributeTable.MAX_HEIGTH) - getTableHeaderHeight(), dimension.height);
    }
    else{
      dimension.width = Math.min(MAX_WIDTH, dimension.width);
      dimension.height = Math.min(MAX_HEIGTH, dimension.height);
View Full Code Here

    }
    final boolean isHtml = nodeText.startsWith("<html>");
    boolean widthMustBeRestricted = false;
    boolean isLong = false;
    final ModeController modeController = map.getModeController();
    final NodeStyleController nsc = NodeStyleController.getController(modeController);
    final int maxNodeWidth = nsc.getMaxWidth(node.getModel());
    if (!isHtml) {
      final String[] lines = nodeText.split("\n");
      for (int line = 0; line < lines.length; line++) {
        setText(lines[line]);
        widthMustBeRestricted = getPreferredSize().width > map.getZoomed(maxNodeWidth);
View Full Code Here

TOP

Related Classes of org.freeplane.features.nodestyle.NodeStyleController

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.