String str = (String)constraints;  if (str == null || str.equals(CENTER)) center = component; else if (str.equals(NORTH)) north = component; else if (str.equals(SOUTH)) south = component; else if (str.equals(EAST)) east = component; else if (str.equals(WEST)) west = component; else if (str.equals(BEFORE_FIRST_LINE)) firstLine = component; else if (str.equals(AFTER_LAST_LINE)) lastLine = component; else if (str.equals(BEFORE_LINE_BEGINS)) firstItem = component; else if (str.equals(AFTER_LINE_ENDS)) lastItem = component; else throw new IllegalArgumentException("Constraint value not valid: " + str);
addLayoutComponent((String) constraints, component);
addLayoutComponent(Component component, Object constraints){  if (constraints != null && ! (constraints instanceof String))    throw new IllegalArgumentException("Constraint must be a string");  String str = (String)constraints;  if (str == null || str.equals(CENTER))    center = component;  else if (str.equals(NORTH))    north = component;  else if (str.equals(SOUTH))    south = component;  else if (str.equals(EAST))    east = component;  else if (str.equals(WEST))    west = component;  else if (str.equals(BEFORE_FIRST_LINE))    firstLine = component;  else if (str.equals(AFTER_LAST_LINE))    lastLine = component;  else if (str.equals(BEFORE_LINE_BEGINS))    firstItem = component;  else if (str.equals(AFTER_LINE_ENDS))    lastItem = component;  else    throw new IllegalArgumentException("Constraint value not valid: " + str);}