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


Java BlockContainer.arrange方法代码示例

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


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

示例1: arrange

import org.jfree.chart.block.BlockContainer; //导入方法依赖的package包/类
/**
 * Arranges the contents of the block, within the given constraints, and 
 * returns the block size.
 * 
 * @param g2  the graphics device.
 * @param constraint  the constraint (<code>null</code> not permitted).
 * 
 * @return The block size (in Java2D units, never <code>null</code>).
 */
public Size2D arrange(Graphics2D g2, RectangleConstraint constraint) {
    Size2D result = new Size2D();
    fetchLegendItems();
    if (this.items.isEmpty()) {
        return result;   
    }
    BlockContainer container = this.wrapper;
    if (container == null) {
        container = this.items;
    }
    RectangleConstraint c = toContentConstraint(constraint);
    Size2D size = container.arrange(g2, c);
    result.height = calculateTotalHeight(size.height);
    result.width = calculateTotalWidth(size.width);
    return result;
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:26,代码来源:LegendTitle.java

示例2: arrange

import org.jfree.chart.block.BlockContainer; //导入方法依赖的package包/类
/**
 * Arranges the contents of the block, within the given constraints, and
 * returns the block size.
 *
 * @param g2  the graphics device.
 * @param constraint  the constraint (<code>null</code> not permitted).
 *
 * @return The block size (in Java2D units, never <code>null</code>).
 */
@Override
public Size2D arrange(Graphics2D g2, RectangleConstraint constraint) {
    Size2D result = new Size2D();
    fetchLegendItems();
    if (this.items.isEmpty()) {
        return result;
    }
    BlockContainer container = this.wrapper;
    if (container == null) {
        container = this.items;
    }
    RectangleConstraint c = toContentConstraint(constraint);
    Size2D size = container.arrange(g2, c);
    result.height = calculateTotalHeight(size.height);
    result.width = calculateTotalWidth(size.width);
    return result;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:27,代码来源:LegendTitle.java

示例3: arrange

import org.jfree.chart.block.BlockContainer; //导入方法依赖的package包/类
/**
 * Arranges the contents of the block, within the given constraints, and
 * returns the block size.
 *
 * @param g2  the graphics device.
 * @param constraint  the constraint ({@code null} not permitted).
 *
 * @return The block size (in Java2D units, never {@code null}).
 */
@Override
public Size2D arrange(Graphics2D g2, RectangleConstraint constraint) {
    Size2D result = new Size2D();
    fetchLegendItems();
    if (this.items.isEmpty()) {
        return result;
    }
    BlockContainer container = this.wrapper;
    if (container == null) {
        container = this.items;
    }
    RectangleConstraint c = toContentConstraint(constraint);
    Size2D size = container.arrange(g2, c);
    result.height = calculateTotalHeight(size.height);
    result.width = calculateTotalWidth(size.width);
    return result;
}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:27,代码来源:LegendTitle.java

示例4: arrange

import org.jfree.chart.block.BlockContainer; //导入方法依赖的package包/类
/**
 * Arranges the contents of the block, within the given constraints, and
 * returns the block size.
 *
 * @param g2  the graphics device.
 * @param constraint  the constraint (<code>null</code> not permitted).
 *
 * @return The block size (in Java2D units, never <code>null</code>).
 */
public Size2D arrange(Graphics2D g2, RectangleConstraint constraint) {
    Size2D result = new Size2D();
    fetchLegendItems();
    if (this.items.isEmpty()) {
        return result;
    }
    BlockContainer container = this.wrapper;
    if (container == null) {
        container = this.items;
    }
    RectangleConstraint c = toContentConstraint(constraint);
    Size2D size = container.arrange(g2, c);
    result.height = calculateTotalHeight(size.height);
    result.width = calculateTotalWidth(size.width);
    return result;
}
 
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:26,代码来源:LegendTitle.java

示例5: testBugX

import org.jfree.chart.block.BlockContainer; //导入方法依赖的package包/类
/**
 * This test is for a particular bug that arose just prior to the release
 * of JFreeChart 1.0.10.  A BorderArrangement with LEFT, CENTRE and RIGHT
 * blocks that is too wide, by default, for the available space, wasn't
 * shrinking the centre block as expected.
 */
public void testBugX() {
    RectangleConstraint constraint = new RectangleConstraint(
            new Range(0.0, 200.0), new Range(0.0, 100.0));
    BlockContainer container = new BlockContainer(new BorderArrangement());
    BufferedImage image = new BufferedImage(200, 100,
            BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = image.createGraphics();

    container.add(new EmptyBlock(10.0, 6.0), RectangleEdge.LEFT);
    container.add(new EmptyBlock(20.0, 6.0), RectangleEdge.RIGHT);
    container.add(new EmptyBlock(30.0, 6.0));
    Size2D size = container.arrange(g2, constraint);
    assertEquals(60.0, size.width, EPSILON);
    assertEquals(6.0, size.height, EPSILON);

    container.clear();
    container.add(new EmptyBlock(10.0, 6.0), RectangleEdge.LEFT);
    container.add(new EmptyBlock(20.0, 6.0), RectangleEdge.RIGHT);
    container.add(new EmptyBlock(300.0, 6.0));
    size = container.arrange(g2, constraint);
    assertEquals(200.0, size.width, EPSILON);
    assertEquals(6.0, size.height, EPSILON);


}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:32,代码来源:BorderArrangementTests.java

示例6: testNN

import org.jfree.chart.block.BlockContainer; //导入方法依赖的package包/类
/**
 * Test arrangement with no constraints.
 */
public void testNN() {
    BlockContainer c = createTestContainer1();
    Size2D s = c.arrange(null, RectangleConstraint.NONE);
    assertEquals(90.0, s.width, EPSILON);
    assertEquals(33.0, s.height, EPSILON);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:10,代码来源:GridArrangementTests.java

示例7: testFN

import org.jfree.chart.block.BlockContainer; //导入方法依赖的package包/类
/**
 * Test arrangement with no constraints.
 */
public void testFN() {
    BlockContainer c = createTestContainer1();
    RectangleConstraint constraint = new RectangleConstraint(
        100.0, null, LengthConstraintType.FIXED, 
        0.0, null, LengthConstraintType.NONE
    );
    Size2D s = c.arrange(null, constraint);
    assertEquals(100.0, s.width, EPSILON);
    assertEquals(33.0, s.height, EPSILON);
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:14,代码来源:GridArrangementTests.java

示例8: testNF

import org.jfree.chart.block.BlockContainer; //导入方法依赖的package包/类
/**
 * Test arrangement with a fixed height and no width constraint.
 */
public void testNF() {
    BlockContainer c = createTestContainer1();
    RectangleConstraint constraint = RectangleConstraint.NONE.toFixedHeight(
            100.0);
    Size2D s = c.arrange(null, constraint);
    assertEquals(90.0, s.width, EPSILON);
    assertEquals(100.0, s.height, EPSILON);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:GridArrangementTests.java

示例9: testRF

import org.jfree.chart.block.BlockContainer; //导入方法依赖的package包/类
/**
 * Test arrangement with a range for the width and a fixed height.
 */
public void testRF() {
    BlockContainer c = createTestContainer1();
    RectangleConstraint constraint = new RectangleConstraint(new Range(40.0,
            60.0), 100.0);
    Size2D s = c.arrange(null, constraint);
    assertEquals(60.0, s.width, EPSILON);
    assertEquals(100.0, s.height, EPSILON);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:GridArrangementTests.java

示例10: testRR

import org.jfree.chart.block.BlockContainer; //导入方法依赖的package包/类
/**
 * Test arrangement with a range for the width and height.
 */
public void testRR() {
    BlockContainer c = createTestContainer1();
    RectangleConstraint constraint = new RectangleConstraint(new Range(40.0,
            60.0), new Range(50.0, 70.0));
    Size2D s = c.arrange(null, constraint);
    assertEquals(60.0, s.width, EPSILON);
    assertEquals(50.0, s.height, EPSILON);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:GridArrangementTests.java

示例11: testRN

import org.jfree.chart.block.BlockContainer; //导入方法依赖的package包/类
/**
 * Test arrangement with a range for the width and no height constraint.
 */
public void testRN() {
    BlockContainer c = createTestContainer1();
    RectangleConstraint constraint = RectangleConstraint.NONE.toRangeWidth(
            new Range(40.0, 60.0));
    Size2D s = c.arrange(null, constraint);
    assertEquals(60.0, s.width, EPSILON);
    assertEquals(33.0, s.height, EPSILON);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:GridArrangementTests.java

示例12: testNR

import org.jfree.chart.block.BlockContainer; //导入方法依赖的package包/类
/**
 * Test arrangement with a range for the height and no width constraint.
 */
public void testNR() {
    BlockContainer c = createTestContainer1();
    RectangleConstraint constraint = RectangleConstraint.NONE.toRangeHeight(
            new Range(40.0, 60.0));
    Size2D s = c.arrange(null, constraint);
    assertEquals(90.0, s.width, EPSILON);
    assertEquals(40.0, s.height, EPSILON);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:GridArrangementTests.java

示例13: testNullBlock_FF

import org.jfree.chart.block.BlockContainer; //导入方法依赖的package包/类
/**
 * The arrangement should be able to handle null blocks in the layout.
 */
public void testNullBlock_FF() {
    BlockContainer c = new BlockContainer(new GridArrangement(1, 1));
    c.add(null);
    Size2D s = c.arrange(null, new RectangleConstraint(20, 10));
    assertEquals(20.0, s.getWidth(), EPSILON);
    assertEquals(10.0, s.getHeight(), EPSILON);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:11,代码来源:GridArrangementTests.java

示例14: testNullBlock_FN

import org.jfree.chart.block.BlockContainer; //导入方法依赖的package包/类
/**
 * The arrangement should be able to handle null blocks in the layout.
 */
public void testNullBlock_FN() {
    BlockContainer c = new BlockContainer(new GridArrangement(1, 1));
    c.add(null);
    Size2D s = c.arrange(null, RectangleConstraint.NONE.toFixedWidth(10));
    assertEquals(10.0, s.getWidth(), EPSILON);
    assertEquals(0.0, s.getHeight(), EPSILON);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:11,代码来源:GridArrangementTests.java

示例15: testNullBlock_FR

import org.jfree.chart.block.BlockContainer; //导入方法依赖的package包/类
/**
 * The arrangement should be able to handle null blocks in the layout.
 */
public void testNullBlock_FR() {
    BlockContainer c = new BlockContainer(new GridArrangement(1, 1));
    c.add(null);
    Size2D s = c.arrange(null, new RectangleConstraint(30.0, new Range(5.0,
            10.0)));
    assertEquals(30.0, s.getWidth(), EPSILON);
    assertEquals(5.0, s.getHeight(), EPSILON);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:GridArrangementTests.java


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