void verify()

in modules/awt/src/main/java/common/java/awt/GridBagConstraints.java [108:189]


    void verify() throws IllegalArgumentException {
        int maxN = GridBagLayout.MAXGRIDSIZE - 1;

        if (((gridx != RELATIVE) && (gridx < 0)) || (gridx >= maxN)) {
            // awt.9C=wrong value of GridBagConstraints: {0}
            throw new IllegalArgumentException(Messages.getString("awt.9C", "gridx")); //$NON-NLS-1$ //$NON-NLS-2$
        }
        if (((gridy != RELATIVE) && (gridy < 0)) || (gridy >= maxN)) {
            // awt.9C=wrong value of GridBagConstraints: {0}
            throw new IllegalArgumentException(Messages.getString("awt.9C", "gridy")); //$NON-NLS-1$  //$NON-NLS-2$
        }
        if (((gridwidth != RELATIVE) && (gridwidth != REMAINDER) && (gridwidth < 0))
                || (gridwidth > maxN))
        {
            // awt.9C=wrong value of GridBagConstraints: {0}
            throw new IllegalArgumentException(Messages.getString("awt.9C", "gridwidth")); //$NON-NLS-1$ //$NON-NLS-2$
        }
        if (((gridheight != RELATIVE) && (gridheight != REMAINDER) && (gridheight < 0))
                || (gridheight > maxN))
        {
            // awt.9C=wrong value of GridBagConstraints: {0}
            throw new IllegalArgumentException(Messages.getString("awt.9C", "gridheight")); //$NON-NLS-1$ //$NON-NLS-2$
        }
        if (((gridx >= 0) || (gridy >= 0))
                && ((gridwidth <= 0) || (gridheight <= 0)))
        {
            // awt.9D=relative grid size parameter goes after absolute grid coordinate
            throw new IllegalArgumentException(Messages.getString("awt.9D")); //$NON-NLS-1$
        }
        if ((gridx != RELATIVE) && ((gridwidth + gridx) > maxN)) {
            // awt.9E=wrong values sum of GridBagConstraints' gridwidth and gridx
            throw new IllegalArgumentException(Messages.getString("awt.9E")); //$NON-NLS-1$
        }
        if ((gridy != RELATIVE) && ((gridheight + gridy) > maxN)) {
            // awt.9F=wrong values sum of GridBagConstraints' gridheight and gridy
            throw new IllegalArgumentException(Messages.getString("awt.9F")); //$NON-NLS-1$
        }
        if ((gridwidth == RELATIVE) && (gridheight == RELATIVE)) {
            // awt.100=component has RELATIVE width and height
            throw new IllegalArgumentException(Messages.getString("awt.100")); //$NON-NLS-1$
        }

        if (weightx < 0.) {
            // awt.9C=wrong value of GridBagConstraints: {0}
            throw new IllegalArgumentException(Messages.getString("awt.9C", "weightx")); //$NON-NLS-1$ //$NON-NLS-2$
        }
        if (weighty < 0.) {
            // awt.9C=wrong value of GridBagConstraints: {0}
            throw new IllegalArgumentException(Messages.getString("awt.9C", "weighty")); //$NON-NLS-1$ //$NON-NLS-2$
        }

        if ((anchor != CENTER) && (anchor != NORTH) && (anchor != NORTHEAST)
                && (anchor != EAST) && (anchor != SOUTHEAST)
                && (anchor != SOUTH) && (anchor != SOUTHWEST)
                && (anchor != WEST) && (anchor != NORTHWEST)
                && (anchor != PAGE_START) && (anchor != PAGE_END)
                && (anchor != LINE_START) && (anchor != LINE_END)
                && (anchor != FIRST_LINE_START) && (anchor != FIRST_LINE_END)
                && (anchor != LAST_LINE_START) && (anchor != LAST_LINE_END)) {
            // awt.9C=wrong value of GridBagConstraints: {0}
            throw new IllegalArgumentException(Messages.getString("awt.9C", "anchor")); //$NON-NLS-1$ //$NON-NLS-2$
        }
        if ((fill != NONE) && (fill != HORIZONTAL) && (fill != VERTICAL)
                && (fill != BOTH)) {
            // awt.9C=wrong value of GridBagConstraints: {0}
            throw new IllegalArgumentException(Messages.getString("awt.9C", "fill")); //$NON-NLS-1$ //$NON-NLS-2$
        }

        if (ipadx < 0) {
            // awt.9C=wrong value of GridBagConstraints: {0}
            throw new IllegalArgumentException(Messages.getString("awt.9C", "ipadx")); //$NON-NLS-1$ //$NON-NLS-2$
        }
        if (ipady < 0) {
            // awt.9C=wrong value of GridBagConstraints: {0}
            throw new IllegalArgumentException(Messages.getString("awt.9C", "ipady")); //$NON-NLS-1$ //$NON-NLS-2$
        }
        if ((insets == null) || (insets.left < 0) || (insets.left < 0)
                || (insets.left < 0) || (insets.left < 0)) {
            // awt.9C=wrong value of GridBagConstraints: {0}
            throw new IllegalArgumentException(Messages.getString("awt.9C", "insets")); //$NON-NLS-1$ //$NON-NLS-2$
        }
    }