javax.swing.SizeRequirements#calculateTiledPositions ( )源码实例Demo

下面列出了javax.swing.SizeRequirements#calculateTiledPositions ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: pcgen   文件: FilterBar.java
private void layoutComponents(Container target, int xOffset, int yOffset, int maxwidth, int rowheight,
	SizeRequirements[] xChildren, SizeRequirements[] yChildren, int start, int end, boolean ltr)
{
	SizeRequirements[] children = ArrayUtils.subarray(xChildren, start, end);
	int[] xOffsets = new int[children.length];
	int[] xSpans = new int[children.length];
	SizeRequirements.calculateTiledPositions(maxwidth, null, children, xOffsets, xSpans, ltr);

	children = ArrayUtils.subarray(yChildren, start, end);
	int[] yOffsets = new int[children.length];
	int[] ySpans = new int[children.length];
	SizeRequirements total = new SizeRequirements(rowheight, rowheight, rowheight, 0.5f);
	SizeRequirements.calculateAlignedPositions(rowheight, total, children, yOffsets, ySpans, ltr);

	for (int i = 0; i < children.length; i++)
	{
		Component c = target.getComponent(i + start);
		c.setBounds((int) Math.min((long) xOffset + (long) xOffsets[i], Integer.MAX_VALUE),
			(int) Math.min((long) yOffset + (long) yOffsets[i], Integer.MAX_VALUE), xSpans[i], ySpans[i]);
	}
}
 
源代码2 项目: pcgen   文件: FilterBar.java
private void layoutComponents(Container target, int xOffset, int yOffset, int maxwidth, int rowheight,
	SizeRequirements[] xChildren, SizeRequirements[] yChildren, int start, int end, boolean ltr)
{
	SizeRequirements[] children = ArrayUtils.subarray(xChildren, start, end);
	int[] xOffsets = new int[children.length];
	int[] xSpans = new int[children.length];
	SizeRequirements.calculateTiledPositions(maxwidth, null, children, xOffsets, xSpans, ltr);

	children = ArrayUtils.subarray(yChildren, start, end);
	int[] yOffsets = new int[children.length];
	int[] ySpans = new int[children.length];
	SizeRequirements total = new SizeRequirements(rowheight, rowheight, rowheight, 0.5f);
	SizeRequirements.calculateAlignedPositions(rowheight, total, children, yOffsets, ySpans, ltr);

	for (int i = 0; i < children.length; i++)
	{
		Component c = target.getComponent(i + start);
		c.setBounds((int) Math.min((long) xOffset + (long) xOffsets[i], Integer.MAX_VALUE),
			(int) Math.min((long) yOffset + (long) yOffsets[i], Integer.MAX_VALUE), xSpans[i], ySpans[i]);
	}
}
 
源代码3 项目: jdk1.8-source-analysis   文件: TableView.java
/**
 * 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);
}
 
源代码4 项目: dragonwell8_jdk   文件: TableView.java
/**
 * 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);
}
 
源代码5 项目: TencentKona-8   文件: TableView.java
/**
 * 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);
}
 
源代码6 项目: jdk8u60   文件: TableView.java
/**
 * 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);
}
 
源代码7 项目: JDKSourceCode1.8   文件: TableView.java
/**
 * 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);
}
 
源代码8 项目: openjdk-jdk8u   文件: TableView.java
/**
 * 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);
}
 
源代码9 项目: openjdk-jdk8u-backup   文件: TableView.java
/**
 * 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);
}
 
源代码10 项目: Bytecoder   文件: TableView.java
/**
 * 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);
}
 
源代码11 项目: openjdk-jdk9   文件: TableView.java
/**
 * 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);
}
 
源代码12 项目: jdk8u-jdk   文件: TableView.java
/**
 * 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);
}
 
源代码13 项目: Java8CN   文件: TableView.java
/**
 * 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);
}
 
源代码14 项目: hottub   文件: TableView.java
/**
 * 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);
}
 
源代码15 项目: openjdk-8-source   文件: TableView.java
/**
 * 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);
}
 
源代码16 项目: openjdk-8   文件: TableView.java
/**
 * 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);
}
 
源代码17 项目: jdk8u_jdk   文件: TableView.java
/**
 * 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);
}
 
源代码18 项目: jdk8u-jdk   文件: TableView.java
/**
 * 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);
}
 
源代码19 项目: jdk8u-dev-jdk   文件: TableView.java
/**
 * 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);
}