本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}