Ejemplo n.º 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);
   }
 }
Ejemplo n.º 2
0
  /*
   * (non-Javadoc)
   *
   * @see org.eclipse.swt.widgets.Item#setText(java.lang.String)
   */
  public void setText(String string) {
    super.setText(string);

    if (this.connectionFigure != null) {
      updateFigure(this.connectionFigure);
    }
  }
Ejemplo n.º 3
0
 /** Unhighlights this node. Uses the default color. */
 public void unhighlight() {
   if (!highlighted) {
     return;
   }
   IFigure parentFigure = connectionFigure.getParent();
   if (parentFigure instanceof ZestRootLayer) {
     ((ZestRootLayer) parentFigure).unHighlightConnection(connectionFigure);
   }
   highlighted = false;
   updateFigure(connectionFigure);
 }
Ejemplo n.º 4
0
 /**
  * Sets the connection line style.
  *
  * @param lineStyle
  */
 public void setLineStyle(int lineStyle) {
   this.lineStyle = lineStyle;
   updateFigure(connectionFigure);
 }
Ejemplo n.º 5
0
 /**
  * Sets the connection line width.
  *
  * @param lineWidth
  */
 public void setLineWidth(int lineWidth) {
   this.lineWidth = lineWidth;
   updateFigure(connectionFigure);
 }
Ejemplo n.º 6
0
 /**
  * Sets the tooltip on this node. This tooltip will display if the mouse hovers over the node.
  * Setting the tooltip has no effect if a custom figure has been set.
  */
 public void setTooltip(IFigure tooltip) {
   hasCustomTooltip = true;
   this.tooltip = tooltip;
   updateFigure(connectionFigure);
 }
Ejemplo n.º 7
0
 /**
  * Sets the connection color.
  *
  * @param color
  */
 public void changeLineColor(Color color) {
   this.color = color;
   updateFigure(connectionFigure);
 }
Ejemplo n.º 8
0
 /**
  * Returns the style of this connection. Valid styles are those that begin with CONNECTION in
  * ZestStyles.
  *
  * @return the style of this connection.
  * @see #ZestStyles
  */
 public void setConnectionStyle(int style) {
   this.connectionStyle = style;
   updateFigure(this.connectionFigure);
 }