protected TextAnchor calculateTextAnchor(double angleDegrees){
  TextAnchor ta=TextAnchor.CENTER;
  double offset=this.angleOffset;
  while (offset < 0.0) {
    offset+=360.0;
  }
  double normalizedAngle=(((this.counterClockwise ? -1 : 1) * angleDegrees) + offset) % 360;
  while (this.counterClockwise && (normalizedAngle < 0.0)) {
    normalizedAngle+=360.0;
  }
  if (normalizedAngle == 0.0) {
    ta=TextAnchor.CENTER_LEFT;
  }
 else   if (normalizedAngle > 0.0 && normalizedAngle < 90.0) {
    ta=TextAnchor.TOP_LEFT;
  }
 else   if (normalizedAngle == 90.0) {
    ta=TextAnchor.TOP_CENTER;
  }
 else   if (normalizedAngle > 90.0 && normalizedAngle < 180.0) {
    ta=TextAnchor.TOP_RIGHT;
  }
 else   if (normalizedAngle == 180) {
    ta=TextAnchor.CENTER_RIGHT;
  }
 else   if (normalizedAngle > 180.0 && normalizedAngle < 270.0) {
    ta=TextAnchor.BOTTOM_RIGHT;
  }
 else   if (normalizedAngle == 270) {
    ta=TextAnchor.BOTTOM_CENTER;
  }
 else   if (normalizedAngle > 270.0 && normalizedAngle < 360.0) {
    ta=TextAnchor.BOTTOM_LEFT;
  }
  return ta;
}

protected TextAnchor calculateTextAnchor ( double angleDegrees ) { TextAnchor ta = TextAnchor . CENTER ; double offset = this . angleOffset ; while ( offset < 0.0 ) { offset += 360.0 ; } double normalizedAngle = ( ( ( this . counterClockwise ? - 1 : 1 ) * angleDegrees ) + offset ) % 360 ; while ( this . counterClockwise && ( normalizedAngle < 0.0 ) ) { normalizedAngle += 360.0 ; } if ( normalizedAngle == 0.0 ) { ta = TextAnchor . CENTER_LEFT ; } else if ( normalizedAngle > 0.0 && normalizedAngle < 90.0 ) { ta = TextAnchor . TOP_LEFT ; } else if ( normalizedAngle == 90.0 ) { ta = TextAnchor . TOP_CENTER ; } else if ( normalizedAngle > 90.0 && normalizedAngle < 180.0 ) { ta = TextAnchor . TOP_RIGHT ; } else if ( normalizedAngle == 180 ) { ta = TextAnchor . CENTER_RIGHT ; } else if ( normalizedAngle > 180.0 && normalizedAngle < 270.0 ) { ta = TextAnchor . BOTTOM_RIGHT ; } else if ( normalizedAngle == 270 ) { ta = TextAnchor . BOTTOM_CENTER ; } else if ( normalizedAngle > 270.0 && normalizedAngle < 360.0 ) { ta = TextAnchor . BOTTOM_LEFT ; } return ta ; }
calculate the text position for the given degrees .
