Java 类org.jfree.chart.block.LabelBlock 实例源码

项目:ccu-historian    文件:StandardChartTheme.java   
/**
 * Applies the attributes of this theme to the specified block.
 *
 * @param b  the block.
 */
protected void applyToBlock(Block b) {
    if (b instanceof Title) {
        applyToTitle((Title) b);
    }
    else if (b instanceof LabelBlock) {
        LabelBlock lb = (LabelBlock) b;
        lb.setFont(this.regularFont);
        lb.setPaint(this.legendItemPaint);
    }
}
项目:jfreechart    文件:StandardChartTheme.java   
/**
 * Applies the attributes of this theme to the specified block.
 *
 * @param b  the block.
 */
protected void applyToBlock(Block b) {
    if (b instanceof Title) {
        applyToTitle((Title) b);
    }
    else if (b instanceof LabelBlock) {
        LabelBlock lb = (LabelBlock) b;
        lb.setFont(this.regularFont);
        lb.setPaint(this.legendItemPaint);
    }
}
项目:aya-lang    文件:StandardChartTheme.java   
/**
 * Applies the attributes of this theme to the specified block.
 *
 * @param b  the block.
 */
protected void applyToBlock(Block b) {
    if (b instanceof Title) {
        applyToTitle((Title) b);
    }
    else if (b instanceof LabelBlock) {
        LabelBlock lb = (LabelBlock) b;
        lb.setFont(this.regularFont);
        lb.setPaint(this.legendItemPaint);
    }
}
项目:HTML5_WebSite    文件:StandardChartTheme.java   
/**
 * Applies the attributes of this theme to the specified block.
 *
 * @param b  the block.
 */
protected void applyToBlock(Block b) {
    if (b instanceof Title) {
        applyToTitle((Title) b);
    }
    else if (b instanceof LabelBlock) {
        LabelBlock lb = (LabelBlock) b;
        lb.setFont(this.regularFont);
        lb.setPaint(this.legendItemPaint);
    }
}
项目:populus    文件:StandardChartTheme.java   
/**
 * Applies the attributes of this theme to the specified block.
 *
 * @param b  the block.
 */
protected void applyToBlock(Block b) {
    if (b instanceof Title) {
        applyToTitle((Title) b);
    }
    else if (b instanceof LabelBlock) {
        LabelBlock lb = (LabelBlock) b;
        lb.setFont(this.regularFont);
        lb.setPaint(this.legendItemPaint);
    }
}
项目:PI    文件:StandardChartTheme.java   
/**
 * Applies the attributes of this theme to the specified block.
 *
 * @param b  the block.
 */
protected void applyToBlock(Block b) {
    if (b instanceof Title) {
        applyToTitle((Title) b);
    }
    else if (b instanceof LabelBlock) {
        LabelBlock lb = (LabelBlock) b;
        lb.setFont(this.regularFont);
        lb.setPaint(this.legendItemPaint);
    }
}
项目:ECG-Viewer    文件:StandardChartTheme.java   
/**
 * Applies the attributes of this theme to the specified block.
 *
 * @param b  the block.
 */
protected void applyToBlock(Block b) {
    if (b instanceof Title) {
        applyToTitle((Title) b);
    }
    else if (b instanceof LabelBlock) {
        LabelBlock lb = (LabelBlock) b;
        lb.setFont(this.regularFont);
        lb.setPaint(this.legendItemPaint);
    }
}
项目:astor    文件:StandardChartTheme.java   
/**
 * Applies the attributes of this theme to the specified block.
 *
 * @param b  the block.
 */
protected void applyToBlock(Block b) {
    if (b instanceof Title) {
        applyToTitle((Title) b);
    }
    else if (b instanceof LabelBlock) {
        LabelBlock lb = (LabelBlock) b;
        lb.setFont(this.regularFont);
        lb.setPaint(this.legendItemPaint);
    }
}
项目:group-five    文件:StandardChartTheme.java   
/**
 * Applies the attributes of this theme to the specified block.
 *
 * @param b  the block.
 */
protected void applyToBlock(Block b) {
    if (b instanceof Title) {
        applyToTitle((Title) b);
    }
    else if (b instanceof LabelBlock) {
        LabelBlock lb = (LabelBlock) b;
        lb.setFont(this.regularFont);
        lb.setPaint(this.legendItemPaint);
    }
}
项目:manydesigns.cn    文件:StandardChartTheme.java   
/**
 * Applies the attributes of this theme to the specified block.
 *
 * @param b  the block.
 */
protected void applyToBlock(Block b) {
    if (b instanceof Title) {
        applyToTitle((Title) b);
    }
    else if (b instanceof LabelBlock) {
        LabelBlock lb = (LabelBlock) b;
        lb.setFont(this.regularFont);
        lb.setPaint(this.legendItemPaint);
    }
}
项目:buffer_bci    文件:StandardChartTheme.java   
/**
 * Applies the attributes of this theme to the specified block.
 *
 * @param b  the block.
 */
protected void applyToBlock(Block b) {
    if (b instanceof Title) {
        applyToTitle((Title) b);
    }
    else if (b instanceof LabelBlock) {
        LabelBlock lb = (LabelBlock) b;
        lb.setFont(this.regularFont);
        lb.setPaint(this.legendItemPaint);
    }
}
项目:buffer_bci    文件:StandardChartTheme.java   
/**
 * Applies the attributes of this theme to the specified block.
 *
 * @param b  the block.
 */
protected void applyToBlock(Block b) {
    if (b instanceof Title) {
        applyToTitle((Title) b);
    }
    else if (b instanceof LabelBlock) {
        LabelBlock lb = (LabelBlock) b;
        lb.setFont(this.regularFont);
        lb.setPaint(this.legendItemPaint);
    }
}
项目:proyecto-teoria-control-utn-frro    文件:StandardChartTheme.java   
/**
 * Applies the attributes of this theme to the specified block.
 *
 * @param b  the block.
 */
protected void applyToBlock(Block b) {
    if (b instanceof Title) {
        applyToTitle((Title) b);
    }
    else if (b instanceof LabelBlock) {
        LabelBlock lb = (LabelBlock) b;
        lb.setFont(this.regularFont);
        lb.setPaint(this.legendItemPaint);
    }
}
项目:Memetic-Algorithm-for-TSP    文件:StandardChartTheme.java   
/**
 * Applies the attributes of this theme to the specified block.
 *
 * @param b  the block.
 */
protected void applyToBlock(Block b) {
    if (b instanceof Title) {
        applyToTitle((Title) b);
    }
    else if (b instanceof LabelBlock) {
        LabelBlock lb = (LabelBlock) b;
        lb.setFont(this.regularFont);
        lb.setPaint(this.legendItemPaint);
    }
}
项目:jcommerce    文件:ReportManagerImpl.java   
public String getPieChart(String type , String title , Map hashMap , Date startDate , Date endDate) {
    CHARTS_PATH = "C://" + type + startDate.getTime()+endDate.getTime()+".jpg";
    File file = new File(CHARTS_PATH);
    if(file.exists()){
        file.delete();
    }
    try {
        DefaultPieDataset dataset = new DefaultPieDataset();
        for(Object o : hashMap.keySet()){
            dataset.setValue(String.valueOf(o), Integer.parseInt((String) hashMap.get(o)));
        }
        JFreeChart chart = ChartFactory.createPieChart3D( title,       // 图表标题
                  dataset,     // 绘图数据集
                  false,       // 设定是否显示图例
                  false,       // 设定是否显示图例名称
                  false);      // 设定是否生成链接
        chart.setAntiAlias(false);

        PiePlot pieplot = (PiePlot)chart.getPlot();
        pieplot.setLabelFont(new Font("宋体", 0, 15));
        pieplot.setNoDataMessage("NO DATA!");
        pieplot.setCircular(true);
        pieplot.setLabelGap(0.02D);
        pieplot.setBackgroundPaint(new Color(199,237,204));
                pieplot.setLabelGenerator(new StandardPieSectionLabelGenerator(
                "{0} {2}",
                NumberFormat.getNumberInstance(),
                new DecimalFormat("0.00%")));
        pieplot.setForegroundAlpha(0.6f);

        LegendTitle legendtitle = new LegendTitle(chart.getPlot());
        legendtitle.setWidth(100D);
        BlockContainer blockcontainer = new BlockContainer(new BorderArrangement());
        blockcontainer.setBorder(new BlockBorder(1.0D, 1.0D, 1.0D, 1.0D));


        LabelBlock labelblock = new LabelBlock("Percent:", new Font("宋体", 1, 16));
        labelblock.setPadding(5D, 5D, 5D, 5D);
        blockcontainer.add(labelblock, RectangleEdge.TOP);
        BlockContainer blockcontainer1 = legendtitle.getItemContainer();
        blockcontainer1.setPadding(2D, 10D, 5D, 2D);
        blockcontainer.add(blockcontainer1);
        legendtitle.setWrapper(blockcontainer);
        legendtitle.setPosition(RectangleEdge.RIGHT);
        legendtitle.setHorizontalAlignment(HorizontalAlignment.LEFT);
        chart.addSubtitle(legendtitle);
        chart.setBackgroundPaint(new Color(199,237,204));

        TextTitle pcTitle = chart.getTitle();
        pcTitle.setFont(new Font("汉真广标", Font.BOLD, 21));
        pcTitle.setPaint(Color.RED);

        ChartUtilities.saveChartAsJPEG(file, chart, CHARTS_WIDTH, CHARTS_HEIGHT);
    } catch (Exception e) {
        e.printStackTrace();
    }
    return CHARTS_PATH;
}
项目:jcommerce    文件:ReportManagerImpl.java   
public String getPieChart(String type , String title , Map hashMap , Date startDate , Date endDate) {
    CHARTS_PATH = "C://" + type + startDate.getTime()+endDate.getTime()+".jpg";
    File file = new File(CHARTS_PATH);
    if(file.exists()){
        file.delete();
    }
    try {
        DefaultPieDataset dataset = new DefaultPieDataset();
        for(Object o : hashMap.keySet()){
            dataset.setValue(String.valueOf(o), Integer.parseInt((String) hashMap.get(o)));
        }
        JFreeChart chart = ChartFactory.createPieChart3D( title,       // 图表标题
                  dataset,     // 绘图数据集
                  false,       // 设定是否显示图例
                  false,       // 设定是否显示图例名称
                  false);      // 设定是否生成链接
        chart.setAntiAlias(false);

        PiePlot pieplot = (PiePlot)chart.getPlot();
        pieplot.setLabelFont(new Font("宋体", 0, 15));
        pieplot.setNoDataMessage("NO DATA!");
        pieplot.setCircular(true);
        pieplot.setLabelGap(0.02D);
        pieplot.setBackgroundPaint(new Color(199,237,204));
                pieplot.setLabelGenerator(new StandardPieSectionLabelGenerator(
                "{0} {2}",
                NumberFormat.getNumberInstance(),
                new DecimalFormat("0.00%")));
        pieplot.setForegroundAlpha(0.6f);

        LegendTitle legendtitle = new LegendTitle(chart.getPlot());
        legendtitle.setWidth(100D);
        BlockContainer blockcontainer = new BlockContainer(new BorderArrangement());
        blockcontainer.setBorder(new BlockBorder(1.0D, 1.0D, 1.0D, 1.0D));


        LabelBlock labelblock = new LabelBlock("Percent:", new Font("宋体", 1, 16));
        labelblock.setPadding(5D, 5D, 5D, 5D);
        blockcontainer.add(labelblock, RectangleEdge.TOP);
        BlockContainer blockcontainer1 = legendtitle.getItemContainer();
        blockcontainer1.setPadding(2D, 10D, 5D, 2D);
        blockcontainer.add(blockcontainer1);
        legendtitle.setWrapper(blockcontainer);
        legendtitle.setPosition(RectangleEdge.RIGHT);
        legendtitle.setHorizontalAlignment(HorizontalAlignment.LEFT);
        chart.addSubtitle(legendtitle);
        chart.setBackgroundPaint(new Color(199,237,204));

        TextTitle pcTitle = chart.getTitle();
        pcTitle.setFont(new Font("汉真广标", Font.BOLD, 21));
        pcTitle.setPaint(Color.RED);

        ChartUtilities.saveChartAsJPEG(file, chart, CHARTS_WIDTH, CHARTS_HEIGHT);
    } catch (Exception e) {
        e.printStackTrace();
    }
    return CHARTS_PATH;
}