@Override
  protected void outlineShape(Graphics graphics) {
    if (fill) return;

    Rectangle r = calculateRectangle();

    double highestAngle1 = Integer.MAX_VALUE;
    double highestAngle2 = Integer.MIN_VALUE;

    if (this instanceof LegendRelationDecoration) {
      highestAngle2 = HALF_ARC ? 360 : calculateAngle(r.getCenter(), getFeatureLocation());
      highestAngle1 = HALF_ARC ? 180 : calculateAngle(r.getCenter(), referencePoint);
      graphics.drawArc(r, (int) highestAngle1, (int) (highestAngle2 - highestAngle1));
    } else {

      if (children != null) {
        for (int i = 0; i < children.size(); i++) {
          Feature temp;
          temp = this.lastChild;
          this.lastChild = children.get(i);
          if (!(this.lastChild.isHidden() && !FeatureUIHelper.showHiddenFeatures(featureModel))) {
            double angle2 = HALF_ARC ? 360 : calculateAngle(r.getCenter(), getFeatureLocation());
            double angle1 = HALF_ARC ? 180 : calculateAngle(r.getCenter(), getFeatureLocation());
            if (angle2 > 450 && !vertical) {
              highestAngle1 = 180;
            } else {
              if (angle1 < highestAngle1) highestAngle1 = angle1;

              if (angle2 > highestAngle2) highestAngle2 = angle2;
              else this.lastChild = temp;
            }
          }
        }
      } else {
        highestAngle2 = HALF_ARC ? 360 : calculateAngle(r.getCenter(), getFeatureLocation());
      }
      r.shrink(7, 7);
      r.y += FeatureUIHelper.getSize(lastChild.getParent()).height / 2;
      if (vertical) {
        r.shrink(2, 2);
        if (highestAngle2 < 270) graphics.drawArc(r.x - 20, r.y, r.width, r.height, 270, (180));
        else
          graphics.drawArc(
              r.x - 20,
              r.y,
              r.width,
              r.height,
              (int) highestAngle1,
              (int) (highestAngle2 - highestAngle1));
      } else {
        if (highestAngle1 > 360) graphics.drawArc(r.x, r.y - 10, r.width, r.height, 180, 180);
        if (highestAngle2 > 450)
          graphics.fillArc(r, (int) highestAngle1, (int) (highestAngle2 - highestAngle1));
        else
          graphics.drawArc(
              r.x,
              r.y - 10,
              r.width,
              r.height,
              (int) (highestAngle1),
              (int) (highestAngle2 - highestAngle1));
      }
    }
  }