예제 #1
0
 /**
  * Sets the curve depth of the arc. The curve depth is defined as the maximum distance from any
  * point on the chord (i.e. a vector normal to the chord with magnitude d).
  *
  * <p>If 0 is set, a Polyline Connection will be used, otherwise a PolylineArcConnectoin will be
  * used. Negative depths are also supported.
  *
  * @param depth The depth of the curve
  */
 public void setCurveDepth(int depth) {
   if (this.curveDepth == 0 && depth != 0 || this.curveDepth != 0 && depth == 0) {
     // There is currently no curve, so we have to create
     // a curved connection
     graph.removeConnection(this);
     this.curveDepth = depth;
     this.connectionFigure = doCreateFigure();
     registerConnection(sourceNode, destinationNode);
     updateFigure(this.connectionFigure);
   } else {
     this.curveDepth = depth;
     updateFigure(this.connectionFigure);
   }
 }
예제 #2
0
  public GraphConnection(Graph graphModel, int style, GraphNode source, GraphNode destination) {
    super(graphModel, style);

    this.connectionStyle |= graphModel.getConnectionStyle();
    this.connectionStyle |= style;
    this.sourceNode = source;
    this.destinationNode = destination;
    this.visible = true;
    this.color = ColorConstants.lightGray;
    this.foreground = ColorConstants.lightGray;
    this.highlightColor = graphModel.DARK_BLUE;
    this.lineWidth = 1;
    this.lineStyle = Graphics.LINE_SOLID;
    setWeight(1.0);
    this.graph = graphModel;
    this.curveDepth = 0;
    this.font = Display.getDefault().getSystemFont();
    registerConnection(source, destination);
  }