Package org.freeplane.features.edge

Examples of org.freeplane.features.edge.EdgeStyle


  @Override
  protected Stroke getStroke() {
    final NodeView target = getTarget();
    int edgeWidth = target.getEdgeWidth();
    final EdgeStyle style = target.getEdgeStyle();
    final int nodeLineWidth = style.getNodeLineWidth(edgeWidth);
    final int zoomedWidth;
    if(edgeWidth != 0)
          zoomedWidth = getTarget().getZoomed(nodeLineWidth);
        else
          zoomedWidth = nodeLineWidth;
View Full Code Here


*/
public class EdgeViewFactory {
  final private static EdgeViewFactory instance = new EdgeViewFactory();

  public EdgeView getEdge(final NodeView source, final NodeView target, Component paintedComponent) {
    final EdgeStyle edgeStyle = target.getEdgeStyle();
    if (source.getMap().getLayoutType() == MapViewLayout.OUTLINE) {
      if(edgeStyle.equals(EdgeStyle.EDGESTYLE_HIDDEN))
        return new HiddenOutlineEdgeView(source, target, paintedComponent);
      return new OutlineEdgeView(source, target, paintedComponent);
    }
    if (edgeStyle.equals(EdgeStyle.EDGESTYLE_LINEAR)) {
      return new LinearEdgeView(source, target, paintedComponent);
    }
    else if (edgeStyle.equals(EdgeStyle.EDGESTYLE_BEZIER)) {
      return new BezierEdgeView(source, target, paintedComponent);
    }
    else if (edgeStyle.equals(EdgeStyle.EDGESTYLE_SUMMARY)) {
            return new SummaryEdgeView(source, target, paintedComponent);
        }
    else if (edgeStyle.equals(EdgeStyle.EDGESTYLE_SHARP_LINEAR)) {
      return new SharpLinearEdgeView(source, target, paintedComponent);
    }
    else if (edgeStyle.equals(EdgeStyle.EDGESTYLE_SHARP_BEZIER)) {
      return new SharpBezierEdgeView(source, target, paintedComponent);
    }
    else if (edgeStyle.equals(EdgeStyle.EDGESTYLE_HORIZONTAL)) {
      return new HorizontalEdgeView(source, target, paintedComponent);
    }
    else if (edgeStyle.equals(EdgeStyle.EDGESTYLE_HIDDEN)) {
      return new HiddenEdgeView(source, target, paintedComponent);
    }
    else {
      System.err.println("Unknown Edge Type.");
      return new LinearEdgeView(source, target, paintedComponent);
View Full Code Here

        final Color viewColor = edgeController.getColor(node);
        mSetEdgeColor.setValue(edgeColor != null);
        mEdgeColor.setColorValue(viewColor);
      }
      {
        final EdgeStyle style = edgeModel != null ? edgeModel.getStyle() : null;
        final EdgeStyle viewStyle = edgeController.getStyle(node);
        mSetEdgeStyle.setValue(style != null);
        mEdgeStyle.setValue(viewStyle.toString());
      }
      {
        final int width = edgeModel != null ? edgeModel.getWidth() : EdgeModel.DEFAULT_WIDTH;
        final int viewWidth = edgeController.getWidth(node);
        mSetEdgeWidth.setValue(width != EdgeModel.DEFAULT_WIDTH);
View Full Code Here

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

  public void setStyle(final NodeModel node, final EdgeStyle style) {
    final ModeController modeController = Controller.getCurrentModeController();
    final EdgeStyle oldStyle;
    if (style != null) {
      oldStyle = EdgeModel.createEdgeModel(node).getStyle();
      if (style.equals(oldStyle)) {
        return;
      }
View Full Code Here

      }
      final EdgeModel toStyle = EdgeModel.createEdgeModel(to);
      final Color color = fromStyle.getColor();
      if(color != null)
          toStyle.setColor(color);
      final EdgeStyle style = fromStyle.getStyle();
      if(style != null)
          toStyle.setStyle(style);
      final int width = fromStyle.getWidth();
      if(width  != EdgeModel.DEFAULT_WIDTH)
          toStyle.setWidth(width);
View Full Code Here

      boolean deltaFound = false;
      if(color != null && whichStyle.getColor() == null){
        delta.setColor(color);
        deltaFound = true;
      }
      final EdgeStyle style = fromStyle.getStyle();
      if(style != null && whichStyle.getStyle() == null){
        delta.setStyle(style);
        deltaFound = true;
      }
      final int width = fromStyle.getWidth();
View Full Code Here

    private void resolveStyle(NodeModel to) {
          if (null != getStyle(to))
        return;
      for(NodeModel source = to.getParentNode(); source != null; source = source.getParentNode() ){
        final EdgeStyle style = getStyle(source);
        if(style != null){
          EdgeModel.createEdgeModel(to).setStyle(style);
          return;
        }
      }
View Full Code Here

  }

  public int getEdgeWidth() {
      final NodeView nodeView = getNodeView();
      final int edgeWidth = nodeView.getEdgeWidth();
    final EdgeStyle style = nodeView.getEdgeStyle();
    final int nodeLineWidth = style.getNodeLineWidth(edgeWidth);
    if(edgeWidth == 0)
      return nodeLineWidth;
    else{
      final int zoomedLineWidth = nodeView.getMap().getZoomed(nodeLineWidth);
      return zoomedLineWidth;
View Full Code Here

  @Override
    public Insets getInsets(Insets insets) {
      final NodeView nodeView = getNodeView();
        int edgeWidth = nodeView.getEdgeWidth();
        final EdgeStyle style = nodeView.getEdgeStyle();
        edgeWidth = style.getNodeLineWidth(edgeWidth);
    if(insets == null)
        insets = new Insets(0, 2, edgeWidth, 2);
      else
        insets.set(0, 2, edgeWidth, 2);
        return insets;
View Full Code Here

TOP

Related Classes of org.freeplane.features.edge.EdgeStyle

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.