package bk;

/**
 * There are four types of layouts, based on iteration order and median alignment.
 * Additionally there is one layout for the combined coordinates.
 * @author kolja
 *
 */
public enum LayoutType{
    LEFTMOST_UPPER,
    RIGHTMOST_UPPER,
    LEFTMOST_LOWER,
    RIGHTMOST_LOWER,
    COMBINED;
    
    /**
     * converts a {@link String} into an {@link LayoutType}
     * @param s the {@link String}
     * @return the {@link LayoutType}
     */
    public static LayoutType fromString( String s )
    {
        switch( s ) {
        case "RIGHTMOST_LOWER":
            return LEFTMOST_UPPER;
        case "LEFTMOST_LOWER":
            return RIGHTMOST_UPPER;
        case "RIGHTMOST_UPPER":
            return LEFTMOST_LOWER;
        case "LEFTMOST_UPPER":
            return RIGHTMOST_LOWER;
        default:
            throw new IllegalArgumentException(s + " is not a valid LayoutType.");
        }
    }
}