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


Java SizeRequirements.calculateTiledPositions方法代码示例

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


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

示例1: testLayoutMajorAxis04

import javax.swing.SizeRequirements; //导入方法依赖的package包/类
/**
 * Tests <code>layoutMajorAxis</code> with "flexible" settings:
 * resizable children, height space > minimum but < preferred.
 */
public void testLayoutMajorAxis04() {
    makeFlexible();
    int[] offsets = new int[view.getViewCount()];
    int[] spans = new int[view.getViewCount()];
    final int axis = Y_AXIS;
    shape.height = major.minimum - 50;
    assertTrue(shape.height < major.minimum);
    view.layoutMajorAxis(shape.height, axis, offsets, spans);
    // This method doesn't mark layout as valid
    assertFalse(view.isLayoutValid(axis));
    SizeRequirements[] childReq = new SizeRequirements[view.getViewCount()];
    int[] childOffsets = new int[view.getViewCount()];
    int[] childSpans = new int[view.getViewCount()];
    fillRequirements(childReq, axis);
    SizeRequirements.calculateTiledPositions(shape.height, major, childReq, childOffsets,
            childSpans);
    for (int i = 0; i < view.getViewCount(); i++) {
        assertEquals("Offsets are different @ " + i, childOffsets[i], offsets[i]);
        assertEquals("Spans are different @ " + i, childSpans[i], spans[i]);
    }
}
 
开发者ID:shannah,项目名称:cn1,代码行数:26,代码来源:BoxView_WithChildrenTest.java

示例2: layoutColumns

import javax.swing.SizeRequirements; //导入方法依赖的package包/类
/**
 * Lays out the columns to fit within the given target span.
 * Returns the results through {@code offsets} and {@code spans}.
 *
 * @param targetSpan the given span for total of all the table
 *  columns
 * @param reqs the requirements desired for each column.  This
 *  is the column maximum of the cells minimum, preferred, and
 *  maximum requested span
 * @param spans the return value of how much to allocated to
 *  each column
 * @param offsets the return value of the offset from the
 *  origin for each column
 */
protected void layoutColumns(int targetSpan, int[] offsets, int[] spans,
                             SizeRequirements[] reqs) {
    // allocate using the convenience method on SizeRequirements
    SizeRequirements.calculateTiledPositions(targetSpan, null, reqs,
                                             offsets, spans);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:TableView.java

示例3: layoutColumns

import javax.swing.SizeRequirements; //导入方法依赖的package包/类
/**
 * Lays out the columns to fit within the specified target span.
 *
 * @param targetSpan the total span for the columns
 * @param offsets an array that holds the offsets of the columns when this
 *        method returns
 * @param spans an array that holds the spans of the columns when this method
 *        returns
 * @param reqs the size requirements for each column
 */
protected void layoutColumns(int targetSpan, int[] offsets, int spans[],
                             SizeRequirements[] reqs)
{
  updateColumnRequirements();
  SizeRequirements r = calculateMinorAxisRequirements(X_AXIS, null);
  SizeRequirements.calculateTiledPositions(targetSpan, r, columnRequirements,
                                           offsets, spans);
}
 
开发者ID:vilie,项目名称:javify,代码行数:19,代码来源:TableView.java


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