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


Java BlockContainer.getBlocks方法代码示例

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


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

示例1: arrange

import org.jfree.chart.block.BlockContainer; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public Size2D arrange(BlockContainer container, Graphics2D g2,
    RectangleConstraint constraint) {
  List<Block> blocks = container.getBlocks();
  double cellHeight = maxHeight(blocks, g2);
  double cellWidth = maxWidth(blocks, g2);
  int rows = Math.round(blocks.size() / 2.0f);
  for (int i = 0; i < blocks.size(); i++) {
    Block block = blocks.get(i);
    int col = (i<rows?0:1);
    int row = i-col*rows;
    block.setBounds(new Rectangle2D.Double(
        col*cellWidth, row*cellHeight, cellWidth, cellHeight));
  }
  return new Size2D(blocks.size()==1?cellWidth:cellWidth*2, cellHeight*rows);
}
 
开发者ID:uq-eresearch,项目名称:aorra,代码行数:18,代码来源:TwoColumnArrangement.java

示例2: applyToTitle

import org.jfree.chart.block.BlockContainer; //导入方法依赖的package包/类
/**
 * Applies the attributes of this theme to the specified title.
 *
 * @param title  the title.
 */
protected void applyToTitle(Title title) {
    if (title instanceof TextTitle) {
        TextTitle tt = (TextTitle) title;
        tt.setFont(this.largeFont);
        tt.setPaint(this.subtitlePaint);
    }
    else if (title instanceof LegendTitle) {
        LegendTitle lt = (LegendTitle) title;
        if (lt.getBackgroundPaint() != null) {
            lt.setBackgroundPaint(this.legendBackgroundPaint);
        }
        lt.setItemFont(this.regularFont);
        lt.setItemPaint(this.legendItemPaint);
        if (lt.getWrapper() != null) {
            applyToBlockContainer(lt.getWrapper());
        }
    }
    else if (title instanceof PaintScaleLegend) {
        PaintScaleLegend psl = (PaintScaleLegend) title;
        psl.setBackgroundPaint(this.legendBackgroundPaint);
        ValueAxis axis = psl.getAxis();
        if (axis != null) {
            applyToValueAxis(axis);
        }
    }
    else if (title instanceof CompositeTitle) {
        CompositeTitle ct = (CompositeTitle) title;
        BlockContainer bc = ct.getContainer();
        List blocks = bc.getBlocks();
        Iterator iterator = blocks.iterator();
        while (iterator.hasNext()) {
            Block b = (Block) iterator.next();
            if (b instanceof Title) {
                applyToTitle((Title) b);
            }
        }
    }
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:44,代码来源:StandardChartTheme.java


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