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


Java ConstantSize类代码示例

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


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

示例1: testMoveMultipleColumnsRight

import com.jgoodies.forms.layout.ConstantSize; //导入依赖的package包/类
public void testMoveMultipleColumnsRight() {
  myManager.insertGridCells(myContainer, 0, false, false, true);
  myManager.insertGridCells(myContainer, 0, false, false, true);
  final ConstantSize colSize1 = new ConstantSize(17, ConstantSize.MM);
  final ConstantSize colSize2 = new ConstantSize(19, ConstantSize.MM);
  myLayout.setColumnSpec(1, new ColumnSpec(colSize1));
  myLayout.setColumnSpec(3, new ColumnSpec(colSize2));
  RadComponent c1 = newComponent(0, 0, 1, 1);
  myContainer.addComponent(c1);
  RadComponent c2 = newComponent(0, 2, 1, 1);
  myContainer.addComponent(c2);
  myManager.processCellsMoved(myContainer, false, new int[] { 0, 2 }, 5);
  assertEquals(colSize1, myLayout.getColumnSpec(3).getSize());
  assertEquals(colSize2, myLayout.getColumnSpec(5).getSize());
  assertEquals(3, myLayout.getConstraints(c1.getDelegee()).gridX);
  assertEquals(5, myLayout.getConstraints(c2.getDelegee()).gridX);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:RadFormLayoutManagerTest.java

示例2: EmptyBorder

import com.jgoodies.forms.layout.ConstantSize; //导入依赖的package包/类
private EmptyBorder(
        ConstantSize top,
        ConstantSize left,
        ConstantSize bottom,
        ConstantSize right) {
    if (   (top == null)
        || (left == null)
        || (bottom == null)
        || (right == null)) {
        throw new NullPointerException("The top, left, bottom, and right must not be null.");
    }
    this.top    = top;
    this.left   = left;
    this.bottom = bottom;
    this.right  = right;
}
 
开发者ID:evandrocoan,项目名称:ComputerScienceGraduation,代码行数:17,代码来源:Borders.java

示例3: testMoveColumnLeft

import com.jgoodies.forms.layout.ConstantSize; //导入依赖的package包/类
public void testMoveColumnLeft() {
  myManager.insertGridCells(myContainer, 0, false, false, true);
  final ConstantSize colSize = new ConstantSize(17, ConstantSize.MM);
  myLayout.setColumnSpec(3, new ColumnSpec(colSize));
  RadComponent c = newComponent(0, 2, 1, 1);
  myContainer.addComponent(c);
  myManager.processCellsMoved(myContainer, false, new int[] { 2 }, 0);
  assertEquals(colSize, myLayout.getColumnSpec(1).getSize());
  assertEquals(1, myLayout.getConstraints(c.getDelegee()).gridX);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:RadFormLayoutManagerTest.java

示例4: testResizeColumn

import com.jgoodies.forms.layout.ConstantSize; //导入依赖的package包/类
public void testResizeColumn() {
  myManager.processCellResized(myContainer, false, 0, 210);
  final ColumnSpec spec = myLayout.getColumnSpec(1);
  assertTrue(spec.getSize() instanceof ConstantSize);
  ConstantSize cSize = (ConstantSize) spec.getSize();
  assertEquals(210, cSize.getPixelSize(myContainer.getDelegee()));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:RadFormLayoutManagerTest.java

示例5: addStrut

import com.jgoodies.forms.layout.ConstantSize; //导入依赖的package包/类
/**
 * Adds a strut of a specified size.
 *
 * @param size  a constant that describes the gap
 */
public void addStrut(ConstantSize size) {
    getLayout().appendRow(new RowSpec(RowSpec.TOP,
                                      size,
                                      RowSpec.NO_GROW));
    nextRow();
}
 
开发者ID:evandrocoan,项目名称:ComputerScienceGraduation,代码行数:12,代码来源:ButtonStackBuilder.java

示例6: createEmptyBorder

import com.jgoodies.forms.layout.ConstantSize; //导入依赖的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

示例7: Padding

import com.jgoodies.forms.layout.ConstantSize; //导入依赖的package包/类
private Padding(
        ConstantSize top,
        ConstantSize left,
        ConstantSize bottom,
        ConstantSize right) {
    super(0, 0, 0, 0);
    this.topMargin    = checkNotNull(top,    MUST_NOT_BE_NULL, "top");
    this.leftMargin   = checkNotNull(left,   MUST_NOT_BE_NULL, "left");
    this.bottomMargin = checkNotNull(bottom, MUST_NOT_BE_NULL, "bottom");
    this.rightMargin  = checkNotNull(right,  MUST_NOT_BE_NULL, "right");
}
 
开发者ID:JFormDesigner,项目名称:swing-jgoodies-forms,代码行数:12,代码来源:Paddings.java

示例8: testMoveColumnRight

import com.jgoodies.forms.layout.ConstantSize; //导入依赖的package包/类
public void testMoveColumnRight() {
  myManager.insertGridCells(myContainer, 0, false, false, true);
  final ConstantSize colSize = new ConstantSize(17, ConstantSize.MM);
  myLayout.setColumnSpec(1, new ColumnSpec(colSize));
  RadComponent c = newComponent(0, 0, 1, 1);
  myContainer.addComponent(c);
  myManager.processCellsMoved(myContainer, false, new int[] { 0 }, 3);
  assertEquals(colSize, myLayout.getColumnSpec(3).getSize());
  assertEquals(3, myLayout.getConstraints(c.getDelegee()).gridX);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:RadFormLayoutManagerTest.java

示例9: addStrut

import com.jgoodies.forms.layout.ConstantSize; //导入依赖的package包/类
/**
 * Adds a strut of a specified size.
 *
 * @param size  a constant that describes the gap
 */
public ButtonStackBuilder addStrut(ConstantSize size) {
    getLayout().appendRow(new RowSpec(RowSpec.TOP,
                                      size,
                                      FormSpec.NO_GROW));
    nextRow();
    return this;
}
 
开发者ID:JFormDesigner,项目名称:swing-jgoodies-forms,代码行数:13,代码来源:ButtonStackBuilder.java

示例10: createPadding

import com.jgoodies.forms.layout.ConstantSize; //导入依赖的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

示例11: getDialogMarginY

import com.jgoodies.forms.layout.ConstantSize; //导入依赖的package包/类
@Override
public ConstantSize getDialogMarginY() {
    return DIALOG_MARGIN_Y;
}
 
开发者ID:JFormDesigner,项目名称:swing-jgoodies-forms,代码行数:5,代码来源:MacLayoutStyle.java

示例12: getTabbedDialogMarginX

import com.jgoodies.forms.layout.ConstantSize; //导入依赖的package包/类
@Override
public ConstantSize getTabbedDialogMarginX() {
    return TABBED_DIALOG_MARGIN_X;
}
 
开发者ID:JFormDesigner,项目名称:swing-jgoodies-forms,代码行数:5,代码来源:MacLayoutStyle.java

示例13: getTabbedDialogMarginY

import com.jgoodies.forms.layout.ConstantSize; //导入依赖的package包/类
@Override
public ConstantSize getTabbedDialogMarginY() {
    return TABBED_DIALOG_MARGIN_Y;
}
 
开发者ID:JFormDesigner,项目名称:swing-jgoodies-forms,代码行数:5,代码来源:MacLayoutStyle.java

示例14: getLabelComponentPadX

import com.jgoodies.forms.layout.ConstantSize; //导入依赖的package包/类
@Override
public ConstantSize getLabelComponentPadX() {
    return LABEL_COMPONENT_PADX;
}
 
开发者ID:JFormDesigner,项目名称:swing-jgoodies-forms,代码行数:5,代码来源:MacLayoutStyle.java

示例15: getLabelComponentPadY

import com.jgoodies.forms.layout.ConstantSize; //导入依赖的package包/类
@Override
public ConstantSize getLabelComponentPadY() {
    return LABEL_COMPONENT_PADY;
}
 
开发者ID:JFormDesigner,项目名称:swing-jgoodies-forms,代码行数:5,代码来源:MacLayoutStyle.java


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