private static DefaultAlignment valueOf(String str,boolean isHorizontal){
  if (str.equals("f") || str.equals("fill")) {
    return FILL_ALIGN;
  }
 else   if (str.equals("c") || str.equals("center")) {
    return CENTER_ALIGN;
  }
 else   if (isHorizontal) {
    if (str.equals("r") || str.equals("right")) {
      return RIGHT_ALIGN;
    }
 else     if (str.equals("l") || str.equals("left")) {
      return LEFT_ALIGN;
    }
 else {
      return null;
    }
  }
 else   if (str.equals("t") || str.equals("top")) {
    return TOP_ALIGN;
  }
 else   if (str.equals("b") || str.equals("bottom")) {
    return BOTTOM_ALIGN;
  }
 else {
    return null;
  }
}

private static DefaultAlignment valueOf ( String str , boolean isHorizontal ) { if ( str . equals ( "f" ) || str . equals ( "fill" ) ) { return FILL_ALIGN ; } else if ( str . equals ( "c" ) || str . equals ( "center" ) ) { return CENTER_ALIGN ; } else if ( isHorizontal ) { if ( str . equals ( "r" ) || str . equals ( "right" ) ) { return RIGHT_ALIGN ; } else if ( str . equals ( "l" ) || str . equals ( "left" ) ) { return LEFT_ALIGN ; } else { return null ; } } else if ( str . equals ( "t" ) || str . equals ( "top" ) ) { return TOP_ALIGN ; } else if ( str . equals ( "b" ) || str . equals ( "bottom" ) ) { return BOTTOM_ALIGN ; } else { return null ; } }
returns a defaultalignment that corresponds to the specified string , null if no such alignment exists .
