protected int getAnchor() {
        boolean isTop = "top".equalsIgnoreCase(valign);
        boolean isBottom = "bottom".equalsIgnoreCase(valign);
        
        if ("center".equalsIgnoreCase(align)) {
            if (isTop) {
                return GridBagConstraints.NORTH;
            }
            else if (isBottom) {
                return GridBagConstraints.SOUTH;
            }
            else {
                return GridBagConstraints.CENTER;
            }
        }
        else if ("right".equalsIgnoreCase(align)) {
            if (isTop) {
                return GridBagConstraints.NORTHEAST;
            }
            else if (isBottom) {
                return GridBagConstraints.SOUTHEAST;
            }
            else {
                return GridBagConstraints.EAST;
            }
        }
        else {
            // defaults to left
            if (isTop) {
                return GridBagConstraints.NORTHWEST;
            }
            else if (isBottom) {
                return GridBagConstraints.SOUTHWEST;
            }
            else {
                return GridBagConstraints.WEST;
            }
        }
    }
protected int getAnchor ( ) { boolean isTop = "top" . equalsIgnoreCase ( valign ) ; boolean isBottom = "bottom" . equalsIgnoreCase ( valign ) ; if ( "center" . equalsIgnoreCase ( align ) ) { if ( isTop ) { return GridBagConstraints . NORTH ; } else if ( isBottom ) { return GridBagConstraints . SOUTH ; } else { return GridBagConstraints . CENTER ; } } else if ( "right" . equalsIgnoreCase ( align ) ) { if ( isTop ) { return GridBagConstraints . NORTHEAST ; } else if ( isBottom ) { return GridBagConstraints . SOUTHEAST ; } else { return GridBagConstraints . EAST ; } } else { if ( isTop ) { return GridBagConstraints . NORTHWEST ; } else if ( isBottom ) { return GridBagConstraints . SOUTHWEST ; } else { return GridBagConstraints . WEST ; } } }
@return the GridBagConstraints enumeration for anchor