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


Java BlockBorder类代码示例

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


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

示例1: paintDeviationChart

import org.jfree.chart.block.BlockBorder; //导入依赖的package包/类
public void paintDeviationChart(Graphics graphics, int width, int height) {
	prepareData();

	JFreeChart chart = createChart(this.dataset);

	// set the background color for the chart...
	chart.setBackgroundPaint(Color.white);

	// legend settings
	LegendTitle legend = chart.getLegend();
	if (legend != null) {
		legend.setPosition(RectangleEdge.TOP);
		legend.setFrame(BlockBorder.NONE);
		legend.setHorizontalAlignment(HorizontalAlignment.LEFT);
	}

	Rectangle2D drawRect = new Rectangle2D.Double(0, 0, width, height);
	chart.draw((Graphics2D) graphics, drawRect);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:20,代码来源:ROCChartPlotter.java

示例2: createChart

import org.jfree.chart.block.BlockBorder; //导入依赖的package包/类
/**
 * Creates a sample chart.
 *
 * @param dataset  the dataset.
 *
 * @return The chart.
 */
private static JFreeChart createChart(CategoryDataset dataset) {
    JFreeChart chart = ChartFactory.createBarChart(
        "Performance: JFreeSVG vs Batik", null /* x-axis label*/, 
            "Milliseconds" /* y-axis label */, dataset);
    chart.addSubtitle(new TextTitle("Time to generate 1000 charts in SVG " 
            + "format (lower bars = better performance)"));
    chart.setBackgroundPaint(Color.white);
    CategoryPlot plot = (CategoryPlot) chart.getPlot();

    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);
    chart.getLegend().setFrame(BlockBorder.NONE);
    return chart;
}
 
开发者ID:jfree,项目名称:jfree-fxdemos,代码行数:24,代码来源:BarChartFXDemo1.java

示例3: createChart

import org.jfree.chart.block.BlockBorder; //导入依赖的package包/类
/**
 * Creates a sample chart.
 *
 * @param dataset  the dataset.
 *
 * @return The chart.
 */
private static JFreeChart createChart(CategoryDataset dataset) {
    JFreeChart chart = ChartFactory.createBarChart(
        "Performance: JFreeSVG vs Batik", null /* x-axis label*/, 
            "Milliseconds" /* y-axis label */, dataset);
    chart.addSubtitle(new TextTitle("Time to generate 1000 charts in SVG " 
            + "format (lower bars = better performance)"));
    chart.setBackgroundPaint(Color.white);
    CategoryPlot plot = (CategoryPlot) chart.getPlot();

    // ******************************************************************
    //  More than 150 demo applications are included with the JFreeChart
    //  Developer Guide...for more information, see:
    //
    //  >   http://www.object-refinery.com/jfreechart/guide.html
    //
    // ******************************************************************

    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    BarRenderer renderer = (BarRenderer) plot.getRenderer();
    renderer.setDrawBarOutline(false);
    chart.getLegend().setFrame(BlockBorder.NONE);
    return chart;
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:32,代码来源:BarChartDemo1.java

示例4: setPropertyValue

import org.jfree.chart.block.BlockBorder; //导入依赖的package包/类
@Override
public void setPropertyValue(Object id, Object value) {
	LegendSettings ts = getValue();
	if (id.equals(LegendSettings.PROPERTY_showLegend))
		ts.setShowLegend((Boolean) value);
	else if (id.equals(LegendSettings.PROPERTY_font))
		ts.setFont(MFontUtil.setMFont(value));
	else if (id.equals(LegendSettings.PROPERTY_position))
		ts.setPosition((EdgeEnum) posD.getEnumValue(value));
	else if (id.equals(LegendSettings.PROPERTY_horizontalAlignment))
		ts.setHorizontalAlignment(((JFreeChartHorizontalAlignmentEnum) hp.getEnumValue(value)).getJFreeChartValue());
	else if (id.equals(LegendSettings.PROPERTY_verticalAlignment))
		ts.setVerticalAlignment(((JFreeChartVerticalAlignmentEnum) vp.getEnumValue(value)).getJFreeChartValue());
	else if (id.equals(LegendSettings.PROPERTY_backgroundPaint))
		ts.setBackgroundPaint((PaintProvider) value);
	else if (id.equals(LegendSettings.PROPERTY_foregroundPaint))
		ts.setForegroundPaint((PaintProvider) value);

	RectangleInsets ri = PadUtil.setPropertyValue(id, value, ts.getPadding());
	if (ri != null)
		ts.setPadding(ri);
	BlockFrame bf = ts.getBlockFrame();
	ri = PadUtil.setPropertyValue(id, value, bf == null ? null : bf.getInsets(), LegendSettings.PROPERTY_blockFrame);
	if (ri != null)
		ts.setBlockFrame(new BlockBorder(ri.getTop(), ri.getLeft(), ri.getBottom(), ri.getRight()));
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:27,代码来源:MLegendSettings.java

示例5: createLegendTitles

import org.jfree.chart.block.BlockBorder; //导入依赖的package包/类
/**
 * Creates {@link LegendTitle}s for all dimensions from the PlotConfiguration of this Plotter2D.
 * Expects that all {@link ValueSource} s in the provided PlotConfiguration use the same
 * {@link DimensionConfig} s.
 */
private List<LegendTitle> createLegendTitles() {
	List<LegendTitle> legendTitles = new LinkedList<LegendTitle>();
	LegendConfiguration legendConfiguration = plotInstance.getCurrentPlotConfigurationClone().getLegendConfiguration();

	LegendTitle legendTitle = new SmartLegendTitle(this, new FlowArrangement(HorizontalAlignment.CENTER, VerticalAlignment.CENTER, 30, 2), new ColumnArrangement(
			HorizontalAlignment.LEFT, VerticalAlignment.CENTER, 0, 2));
	legendTitle.setItemPaint(legendConfiguration.getLegendFontColor());
	
	RectangleEdge position = legendConfiguration.getLegendPosition().getPosition();
	if (position == null) {
		return legendTitles;
	}
	legendTitle.setPosition(position);

	if (legendConfiguration.isShowLegendFrame()) {
		legendTitle.setFrame(new BlockBorder(legendConfiguration.getLegendFrameColor()));
	}
	ColoredBlockContainer wrapper = new ColoredBlockContainer(legendConfiguration.getLegendBackgroundColor());
	wrapper.add(legendTitle.getItemContainer());
	wrapper.setPadding(3, 3, 3, 3);
	legendTitle.setWrapper(wrapper);

	legendTitles.add(legendTitle);
	return legendTitles;
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:31,代码来源:JFreeChartPlotEngine.java

示例6: paintDeviationChart

import org.jfree.chart.block.BlockBorder; //导入依赖的package包/类
public void paintDeviationChart(Graphics graphics, int width, int height) {      
    prepareData();
    
    JFreeChart chart = createChart(this.dataset);
    
    // set the background color for the chart...
    chart.setBackgroundPaint(Color.white);
    
    // legend settings
    LegendTitle legend = chart.getLegend();
    if (legend != null) {
        legend.setPosition(RectangleEdge.TOP);
        legend.setFrame(BlockBorder.NONE);
        legend.setHorizontalAlignment(HorizontalAlignment.LEFT);
    }
    
    Rectangle2D drawRect = new Rectangle2D.Double(0, 0, width, height);
    chart.draw((Graphics2D)graphics, drawRect);
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:20,代码来源:ROCChartPlotter.java

示例7: createChart

import org.jfree.chart.block.BlockBorder; //导入依赖的package包/类
public ChartPanel createChart(final String title,
							  final CategoryDataset dataset,
							  final String xlabel,
							  final String ylable) {
	JFreeChart chart = ChartFactory.createLineChart(title, xlabel, ylable, dataset);
	ChartUtils.setAntiAlias(chart);
	ChartUtils.setLineRender(chart.getCategoryPlot(), false,true);//
	ChartUtils.setXAixs(chart.getCategoryPlot());
	ChartUtils.setYAixs(chart.getCategoryPlot());
	chart.getLegend().setFrame(new BlockBorder(Color.WHITE));
	ChartPanel chartPanel = new ChartPanel(chart);
	return chartPanel;
}
 
开发者ID:Fanping,项目名称:iveely.ml,代码行数:14,代码来源:LineChart.java

示例8: createChart

import org.jfree.chart.block.BlockBorder; //导入依赖的package包/类
public ChartPanel createChart(final String title,
                              final CategoryDataset dataset,
                              final String xlabel,
                              final String ylable) {
    JFreeChart chart = ChartFactory.createBarChart(title, xlabel, ylable, dataset);
    ChartUtils.setAntiAlias(chart);
    ChartUtils.setBarRenderer(chart.getCategoryPlot(), false);
    ChartUtils.setXAixs(chart.getCategoryPlot());
    ChartUtils.setYAixs(chart.getCategoryPlot());
    chart.getLegend().setFrame(new BlockBorder(Color.WHITE));
    ChartPanel chartPanel = new ChartPanel(chart);
    return chartPanel;
}
 
开发者ID:Fanping,项目名称:iveely.ml,代码行数:14,代码来源:BarChart.java

示例9: createChart

import org.jfree.chart.block.BlockBorder; //导入依赖的package包/类
public ChartPanel createChart(String title, DefaultPieDataset dataset) {
    JFreeChart chart = ChartFactory.createPieChart(title, dataset);
    ChartUtils.setAntiAlias(chart);
    ChartUtils.setPieRender(chart.getPlot());
    chart.getLegend().setFrame(new BlockBorder(Color.WHITE));
    chart.getLegend().setPosition(RectangleEdge.RIGHT);
    ChartPanel chartPanel = new ChartPanel(chart);
    return chartPanel;
}
 
开发者ID:Fanping,项目名称:iveely.ml,代码行数:10,代码来源:PieChart.java

示例10: createChart

import org.jfree.chart.block.BlockBorder; //导入依赖的package包/类
public ChartPanel createChart(final String title,
                              final CategoryDataset dataset,
                              final String xlabel,
                              final String ylable) {
    JFreeChart chart = ChartFactory.createStackedBarChart(title, xlabel, ylable, dataset);
    ChartUtils.setAntiAlias(chart);
    ChartUtils.setStackBarRender(chart.getCategoryPlot());
    ChartUtils.setXAixs(chart.getCategoryPlot());
    ChartUtils.setYAixs(chart.getCategoryPlot());
    chart.getLegend().setFrame(new BlockBorder(Color.WHITE));
    ChartPanel chartPanel = new ChartPanel(chart);
    return chartPanel;
}
 
开发者ID:Fanping,项目名称:iveely.ml,代码行数:14,代码来源:StackedBarChart.java

示例11: createLegendTitles

import org.jfree.chart.block.BlockBorder; //导入依赖的package包/类
/**
 * Creates {@link LegendTitle}s for all dimensions from the PlotConfiguration of this Plotter2D.
 * Expects that all {@link ValueSource} s in the provided PlotConfiguration use the same
 * {@link DimensionConfig} s.
 */
private List<LegendTitle> createLegendTitles() {
	List<LegendTitle> legendTitles = new LinkedList<LegendTitle>();
	LegendConfiguration legendConfiguration = plotInstance.getCurrentPlotConfigurationClone().getLegendConfiguration();

	LegendTitle legendTitle = new SmartLegendTitle(this, new FlowArrangement(HorizontalAlignment.CENTER,
			VerticalAlignment.CENTER, 30, 2), new ColumnArrangement(HorizontalAlignment.LEFT, VerticalAlignment.CENTER,
			0, 2));
	legendTitle.setItemPaint(legendConfiguration.getLegendFontColor());

	RectangleEdge position = legendConfiguration.getLegendPosition().getPosition();
	if (position == null) {
		return legendTitles;
	}
	legendTitle.setPosition(position);

	if (legendConfiguration.isShowLegendFrame()) {
		legendTitle.setFrame(new BlockBorder(legendConfiguration.getLegendFrameColor()));
	}
	ColoredBlockContainer wrapper = new ColoredBlockContainer(legendConfiguration.getLegendBackgroundColor());
	wrapper.add(legendTitle.getItemContainer());
	wrapper.setPadding(3, 3, 3, 3);
	legendTitle.setWrapper(wrapper);

	legendTitles.add(legendTitle);
	return legendTitles;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:32,代码来源:JFreeChartPlotEngine.java

示例12: testEquals

import org.jfree.chart.block.BlockBorder; //导入依赖的package包/类
/**
 * Check that the equals() method distinguishes all fields.
 */
public void testEquals() {
    CompositeTitle t1 = new CompositeTitle(new BlockContainer());
    CompositeTitle t2 = new CompositeTitle(new BlockContainer());
    assertEquals(t1, t2);
    assertEquals(t2, t1);
    
    // margin
    t1.setMargin(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertFalse(t1.equals(t2));
    t2.setMargin(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertTrue(t1.equals(t2));
    
    // border
    t1.setBorder(new BlockBorder(Color.red));
    assertFalse(t1.equals(t2));
    t2.setBorder(new BlockBorder(Color.red));
    assertTrue(t1.equals(t2));
   
    // padding
    t1.setPadding(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertFalse(t1.equals(t2));
    t2.setPadding(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertTrue(t1.equals(t2));
    
    // contained titles
    t1.getContainer().add(new TextTitle("T1"));
    assertFalse(t1.equals(t2));
    t2.getContainer().add(new TextTitle("T1"));
    assertTrue(t1.equals(t2));
    
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:35,代码来源:CompositeTitleTests.java

示例13: testEquals

import org.jfree.chart.block.BlockBorder; //导入依赖的package包/类
/**
 * Check that the equals() method distinguishes all fields.
 */
@Test
public void testEquals() {
    CompositeTitle t1 = new CompositeTitle(new BlockContainer());
    CompositeTitle t2 = new CompositeTitle(new BlockContainer());
    assertEquals(t1, t2);
    assertEquals(t2, t1);

    // margin
    t1.setMargin(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertFalse(t1.equals(t2));
    t2.setMargin(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertTrue(t1.equals(t2));

    // border
    t1.setBorder(new BlockBorder(Color.red));
    assertFalse(t1.equals(t2));
    t2.setBorder(new BlockBorder(Color.red));
    assertTrue(t1.equals(t2));

    // padding
    t1.setPadding(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertFalse(t1.equals(t2));
    t2.setPadding(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertTrue(t1.equals(t2));

    // contained titles
    t1.getContainer().add(new TextTitle("T1"));
    assertFalse(t1.equals(t2));
    t2.getContainer().add(new TextTitle("T1"));
    assertTrue(t1.equals(t2));

    t1.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red,
            3.0f, 4.0f, Color.yellow));
    assertFalse(t1.equals(t2));
    t2.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red,
            3.0f, 4.0f, Color.yellow));
    assertTrue(t1.equals(t2));

}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:43,代码来源:CompositeTitleTest.java

示例14: testEquals

import org.jfree.chart.block.BlockBorder; //导入依赖的package包/类
/**
 * Check that the equals() method distinguishes all fields.
 */
@Test
public void testEquals() {
    CompositeTitle t1 = new CompositeTitle(new BlockContainer());
    CompositeTitle t2 = new CompositeTitle(new BlockContainer());
    assertEquals(t1, t2);
    assertEquals(t2, t1);

    // margin
    t1.setMargin(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertFalse(t1.equals(t2));
    t2.setMargin(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertTrue(t1.equals(t2));

    // frame
    t1.setFrame(new BlockBorder(Color.RED));
    assertFalse(t1.equals(t2));
    t2.setFrame(new BlockBorder(Color.RED));
    assertTrue(t1.equals(t2));

    // padding
    t1.setPadding(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertFalse(t1.equals(t2));
    t2.setPadding(new RectangleInsets(1.0, 2.0, 3.0, 4.0));
    assertTrue(t1.equals(t2));

    // contained titles
    t1.getContainer().add(new TextTitle("T1"));
    assertFalse(t1.equals(t2));
    t2.getContainer().add(new TextTitle("T1"));
    assertTrue(t1.equals(t2));

    t1.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.RED,
            3.0f, 4.0f, Color.YELLOW));
    assertFalse(t1.equals(t2));
    t2.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.RED,
            3.0f, 4.0f, Color.YELLOW));
    assertTrue(t1.equals(t2));

}
 
开发者ID:jfree,项目名称:jfreechart,代码行数:43,代码来源:CompositeTitleTest.java

示例15: createLegendTitles

import org.jfree.chart.block.BlockBorder; //导入依赖的package包/类
/**
 * Creates {@link LegendTitle}s for all dimensions from the PlotConfiguration of this Plotter2D.
 * Expects that all {@link ValueSource} s in the provided PlotConfiguration use the same
 * {@link DimensionConfig} s.
 */
private List<LegendTitle> createLegendTitles() {
	List<LegendTitle> legendTitles = new LinkedList<LegendTitle>();
	LegendConfiguration legendConfiguration = plotInstance.getCurrentPlotConfigurationClone().getLegendConfiguration();

	LegendTitle legendTitle = new SmartLegendTitle(this,
			new FlowArrangement(HorizontalAlignment.CENTER, VerticalAlignment.CENTER, 30, 2),
			new ColumnArrangement(HorizontalAlignment.LEFT, VerticalAlignment.CENTER, 0, 2));
	legendTitle.setItemPaint(legendConfiguration.getLegendFontColor());

	RectangleEdge position = legendConfiguration.getLegendPosition().getPosition();
	if (position == null) {
		return legendTitles;
	}
	legendTitle.setPosition(position);

	if (legendConfiguration.isShowLegendFrame()) {
		legendTitle.setFrame(new BlockBorder(legendConfiguration.getLegendFrameColor()));
	}
	ColoredBlockContainer wrapper = new ColoredBlockContainer(legendConfiguration.getLegendBackgroundColor());
	wrapper.add(legendTitle.getItemContainer());
	wrapper.setPadding(3, 3, 3, 3);
	legendTitle.setWrapper(wrapper);

	legendTitles.add(legendTitle);
	return legendTitles;
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:32,代码来源:JFreeChartPlotEngine.java


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