/** * Creates and returns a <code>Border</code> using sizes as specified by * the given string. This string is a comma-separated encoding of * 4 <code>ConstantSize</code>s. * * @param encodedSizes top, left, bottom, right gap encoded as String * @return an <code>EmptyBorder</code> with the specified gaps * * @see #createEmptyBorder(ConstantSize, ConstantSize, ConstantSize, ConstantSize) */ public static Border createEmptyBorder(String encodedSizes) { String[] token = encodedSizes.split("\\s*,\\s*"); int tokenCount = token.length; if (token.length != 4) { throw new IllegalArgumentException( "The border requires 4 sizes, but \"" + encodedSizes + "\" has " + tokenCount + "."); } ConstantSize top = Sizes.constant(token[0], false); ConstantSize left = Sizes.constant(token[1], true); ConstantSize bottom = Sizes.constant(token[2], false); ConstantSize right = Sizes.constant(token[3], true); return createEmptyBorder(top, left, bottom, right); }
/** * Creates and returns a {@code Border} using sizes as specified by * the given string. This string is a comma-separated encoding of * 4 {@code ConstantSize}s. * * @param encodedSizes top, left, bottom, right gap encoded as String * @return an {@code EmptyBorder} with the specified gaps * * @see #createEmptyBorder(ConstantSize, ConstantSize, ConstantSize, ConstantSize) */ public static Border createEmptyBorder(String encodedSizes) { String[] token = encodedSizes.split("\\s*,\\s*"); int tokenCount = token.length; checkArgument(token.length == 4, "The border requires 4 sizes, but \"%s\" has %d.", encodedSizes, Integer.valueOf(tokenCount)); ConstantSize top = Sizes.constant(token[0], false); ConstantSize left = Sizes.constant(token[1], true); ConstantSize bottom = Sizes.constant(token[2], false); ConstantSize right = Sizes.constant(token[3], true); return createEmptyBorder(top, left, bottom, right); }
/** * Creates and returns a <code>Border</code> using sizes as specified by * the given string. This string is a comma-separated encoding of 4 * <code>ConstantSize</code>s. * * @param encodedSizes * top, left, bottom, right gap encoded as String * @return an <code>EmptyBorder</code> with the specified gaps * * @see #createEmptyBorder(ConstantSize, ConstantSize, ConstantSize, * ConstantSize) */ public static Border createEmptyBorder(String encodedSizes) { StringTokenizer tokenizer = new StringTokenizer(encodedSizes, ", "); int tokenCount = tokenizer.countTokens(); if (tokenCount != 4) { throw new IllegalArgumentException("The border requires 4 sizes, but '" + encodedSizes + "' has " + tokenCount + "."); } ConstantSize top = Sizes.constant(tokenizer.nextToken(), false); ConstantSize left = Sizes.constant(tokenizer.nextToken(), true); ConstantSize bottom = Sizes.constant(tokenizer.nextToken(), false); ConstantSize right = Sizes.constant(tokenizer.nextToken(), true); return createEmptyBorder(top, left, bottom, right); }
FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, new RowSpec(RowSpec.CENTER, Sizes.bounded(Sizes.MINIMUM, Sizes.constant("15px", false), Sizes.constant("50px", false)), 0), FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,