public void toggleShape() {
    switch (shape) {
      case SHAPE_ARC:
        shape = SHAPE_ELBOW;
        break;
      case SHAPE_ELBOW:
        shape = SHAPE_ARC;
        break;
      case SHAPE_BEZIER:
        // Cannot toggle a bezier link
        return;
    }
    double flateness = link.getFlateness();
    Vector2D direction = link.getDirection();

    link = createLinkInstance();
    link.setFlateness(flateness);
    link.setDirection(direction);
  }
 protected void initializeLink(double flateness) {
   if (link == null) {
     link = createLinkInstance();
     link.setFlateness(flateness);
   }
 }