当前位置: 首页>>代码示例>>Java>>正文


Java Sizes.constant方法代码示例

本文整理汇总了Java中com.jgoodies.forms.layout.Sizes.constant方法的典型用法代码示例。如果您正苦于以下问题:Java Sizes.constant方法的具体用法?Java Sizes.constant怎么用?Java Sizes.constant使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jgoodies.forms.layout.Sizes的用法示例。


在下文中一共展示了Sizes.constant方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createEmptyBorder

import com.jgoodies.forms.layout.Sizes; //导入方法依赖的package包/类
public static Border createEmptyBorder(String encodedSizes) {
	String token[] = encodedSizes.split("\\s*,\\s*");
	int tokenCount = token.length;
	if (token.length != 4) {
		throw new IllegalArgumentException((new StringBuilder()).append(
				"The border requires 4 sizes, but \"").append(encodedSizes)
				.append("\" has ").append(tokenCount).append(".")
				.toString());
	} else {
		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);
	}
}
 
开发者ID:javachen,项目名称:IBMDataMovementTool,代码行数:17,代码来源:Borders.java

示例2: createEmptyBorder

import com.jgoodies.forms.layout.Sizes; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:evandrocoan,项目名称:ComputerScienceGraduation,代码行数:25,代码来源:Borders.java

示例3: createPadding

import com.jgoodies.forms.layout.Sizes; //导入方法依赖的package包/类
/**
 * Creates and returns a padding (an instance of {@link EmptyBorder})
 * 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
 * @param args           optional format arguments,
 *                       used if {@code encodedSizes} is a format string
 * @return a padding with the specified margins
 *
 * @see #createPadding(ConstantSize, ConstantSize, ConstantSize, ConstantSize)
 */
public static Padding createPadding(String encodedSizes, Object... args) {
    String formattedSizes = Strings.get(encodedSizes, args);
    String[] token = formattedSizes.split("\\s*,\\s*");
    int tokenCount = token.length;
    checkArgument(token.length == 4,
            "The padding requires 4 sizes, but \"%s\" has %d.", formattedSizes, Integer.valueOf(tokenCount));
    ConstantSize top    = Sizes.constant(token[0]);
    ConstantSize left   = Sizes.constant(token[1]);
    ConstantSize bottom = Sizes.constant(token[2]);
    ConstantSize right  = Sizes.constant(token[3]);
    return createPadding(top, left, bottom, right);
}
 
开发者ID:JFormDesigner,项目名称:swing-jgoodies-forms,代码行数:25,代码来源:Paddings.java

示例4: parseGeneralSetting

import com.jgoodies.forms.layout.Sizes; //导入方法依赖的package包/类
@Override Object parseGeneralSetting(Context c)	{ return Sizes.constant(c.input, false); } 
开发者ID:crisis-economics,项目名称:CRISIS,代码行数:2,代码来源:FormsUtils.java


注:本文中的com.jgoodies.forms.layout.Sizes.constant方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。