private void calculatePath() {
      Shape rectangle = new RoundRectangle2D.Float( x, y, width, height, arc, arc );
      Triangle triangle = null;
      AffineTransform at = new AffineTransform();

      switch( tabLocation ) {
         case TAB_AT_RIGHT:
            if( anglePosition == NONE ) {
               triangle = new Triangle( 0f, 0f, tabWidth, 270f, tabHeight );
            } else {
               triangle = new Triangle( 0f, 0f, tabWidth, 270f, calculateAnglePosition(), tabHeight );
            }
            float a = (tabWidth + arc - height) * tabDisplacement;
            at = AffineTransform.getTranslateInstance( x + width, y + height - tabWidth - (arc / 2) + a );
            break;
         case TAB_AT_LEFT:
            if( anglePosition == NONE ) {
               triangle = new Triangle( 0, 0, tabWidth, 90, tabHeight );
            } else {
               triangle = new Triangle( 0, 0, tabWidth, 90, calculateAnglePosition(), tabHeight );
            }
            float b = (height - arc - tabWidth) * tabDisplacement;
            at = AffineTransform.getTranslateInstance( x, y + tabWidth + (arc / 2) + b );
            break;
         case TAB_AT_TOP:
            if( anglePosition == NONE ) {
               triangle = new Triangle( 0, 0, tabWidth, 0, tabHeight );
            } else {
               triangle = new Triangle( 0, 0, tabWidth, 0, calculateAnglePosition(), tabHeight );
            }
            float c = (tabWidth + arc - width) * tabDisplacement;
            at = AffineTransform.getTranslateInstance( x + width - tabWidth - (arc / 2) + c, y );
            break;
         default:
            if( anglePosition == NONE ) {
               triangle = new Triangle( 0, 0, tabWidth, 180, tabHeight );
            } else {
               triangle = new Triangle( 0, 0, tabWidth, 180, calculateAnglePosition(), tabHeight );
            }
            float d = (width - arc - tabWidth) * tabDisplacement;
            at = AffineTransform.getTranslateInstance( x + tabWidth + (arc / 2) + d, y + height );
      }

      balloon = new Area( rectangle );
      ((Area) balloon).add( new Area( at.createTransformedShape( triangle ) ) );
   }