• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java StandardDialRange类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: TemperaturePanel

import org.jfree.chart.plot.dial.StandardDialRange; //导入依赖的package包/类
public TemperaturePanel() {
	super(new BorderLayout());
	dataset = new DefaultValueDataset(currentT);
	JFreeChart jfreechart = createStandardDialChart("", "Temperature", dataset, -120D, 20D, 10D, 4);
	DialPlot dialplot = (DialPlot)jfreechart.getPlot();
	StandardDialRange standarddialrange = new StandardDialRange(-20D, 20D, Color.blue);
	standarddialrange.setInnerRadius(0.52000000000000002D);
	standarddialrange.setOuterRadius(0.55000000000000004D);
	dialplot.addLayer(standarddialrange);
	StandardDialRange standarddialrange1 = new StandardDialRange(-60D, -20D, Color.orange);
	standarddialrange1.setInnerRadius(0.52000000000000002D);
	standarddialrange1.setOuterRadius(0.55000000000000004D);
	dialplot.addLayer(standarddialrange1);
	StandardDialRange standarddialrange2 = new StandardDialRange(-120D, -60D, Color.red);
	standarddialrange2.setInnerRadius(0.52000000000000002D);
	standarddialrange2.setOuterRadius(0.55000000000000004D);
	dialplot.addLayer(standarddialrange2);
	GradientPaint gradientpaint = new GradientPaint(new Point(), new Color(255, 255, 255), new Point(), new Color(170, 170, 220));
	DialBackground dialbackground = new DialBackground(gradientpaint);
	dialbackground.setGradientPaintTransformer(new StandardGradientPaintTransformer(GradientPaintTransformType.VERTICAL));
	dialplot.setBackground(dialbackground);
	dialplot.removePointer(0);
	org.jfree.chart.plot.dial.DialPointer.Pointer pointer = new org.jfree.chart.plot.dial.DialPointer.Pointer();
	pointer.setFillPaint(Color.yellow);
	dialplot.addPointer(pointer);
	ChartPanel chartpanel = new ChartPanel(jfreechart);
	//chartpanel.setPreferredSize(new Dimension(200, 200));
	//chartpanel.setSize(200, 200);
	chartpanel.setMinimumDrawHeight(150);
	chartpanel.setMaximumDrawHeight(150);
	chartpanel.setMaximumDrawWidth(150);
	chartpanel.setMinimumDrawWidth(150);
	//slider = new JSlider(-120, 20);
	//slider.setMajorTickSpacing(10);
	//slider.setPaintLabels(true);
	//slider.addChangeListener(this);
	add(chartpanel);
	//add(slider, "South");
}
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:40,代码来源:TemperatureDial.java


示例2: testEquals

import org.jfree.chart.plot.dial.StandardDialRange; //导入依赖的package包/类
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    StandardDialRange r1 = new StandardDialRange();
    StandardDialRange r2 = new StandardDialRange();
    assertTrue(r1.equals(r2));

    // lowerBound
    r1.setLowerBound(1.1);
    assertFalse(r1.equals(r2));
    r2.setLowerBound(1.1);
    assertTrue(r1.equals(r2));

    // upperBound
    r1.setUpperBound(11.1);
    assertFalse(r1.equals(r2));
    r2.setUpperBound(11.1);
    assertTrue(r1.equals(r2));

    // paint
    r1.setPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f,
            Color.blue));
    assertFalse(r1.equals(r2));
    r2.setPaint(new GradientPaint(1.0f, 2.0f, Color.red, 3.0f, 4.0f,
            Color.blue));
    assertTrue(r1.equals(r2));

    // check an inherited attribute
    r1.setVisible(false);
    assertFalse(r1.equals(r2));
    r2.setVisible(false);
    assertTrue(r1.equals(r2));
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:35,代码来源:StandardDialRangeTests.java


示例3: testHashCode

import org.jfree.chart.plot.dial.StandardDialRange; //导入依赖的package包/类
/**
 * Two objects that are equal are required to return the same hashCode.
 */
public void testHashCode() {
    StandardDialRange r1 = new StandardDialRange();
    StandardDialRange r2 = new StandardDialRange();
    assertTrue(r1.equals(r2));
    int h1 = r1.hashCode();
    int h2 = r2.hashCode();
    assertEquals(h1, h2);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:12,代码来源:StandardDialRangeTests.java


示例4: fillChart

import org.jfree.chart.plot.dial.StandardDialRange; //导入依赖的package包/类
private void fillChart(String title, float value, int lowerBound, int upperBound) throws Exception {
	DefaultValueDataset dataset = new DefaultValueDataset();
	
	dataset.setValue(value);

	DialPlot plot = new DialPlot();
	plot.setView(0.0d, 0.0d, 1.0d, 1.0d);
	plot.setDataset(0, dataset);
	
	StandardDialFrame frame = new StandardDialFrame();
	plot.setDialFrame(frame);
	DialBackground dialBackground = new DialBackground();
	dialBackground.setGradientPaintTransformer(
			new StandardGradientPaintTransformer(GradientPaintTransformType.VERTICAL));
	plot.setBackground(dialBackground);
	DialTextAnnotation textAnnotation = new DialTextAnnotation( title );
	textAnnotation.setRadius(0.555555555555555555D);
	plot.addLayer(textAnnotation);
	
	DialValueIndicator valueIndicator = new DialValueIndicator(0);
	plot.addLayer(valueIndicator);
	
	StandardDialScale scale1 = new StandardDialScale();
	scale1.setLowerBound( lowerBound );
	scale1.setUpperBound( upperBound );
	scale1.setStartAngle( -140 ); // -120
	scale1.setExtent( -260D ); // -300D 
	scale1.setTickRadius(0.88D);
	scale1.setTickLabelOffset(0.14999999999999999D); 
	scale1.setTickLabelFont(new Font("", Font.TRUETYPE_FONT, 14)); 
	plot.addScale(0, scale1);
	
	StandardDialRange standarddialrange0 = new StandardDialRange( lowerBound, (upperBound*0.6), Color.red);
	standarddialrange0.setInnerRadius(0.52000000000000002D);
	standarddialrange0.setOuterRadius(0.55000000000000004D);
	plot.addLayer(standarddialrange0);
	
	StandardDialRange standarddialrange1 = new StandardDialRange( (upperBound*0.6), (upperBound*0.8), Color.orange);
	standarddialrange1.setInnerRadius(0.52000000000000002D);
	standarddialrange1.setOuterRadius(0.55000000000000004D);
	plot.addLayer(standarddialrange1);
	
	StandardDialRange standarddialrange2 = new StandardDialRange( (upperBound*0.8), upperBound, Color.green);
	standarddialrange2.setInnerRadius(0.52000000000000002D);
	standarddialrange2.setOuterRadius(0.55000000000000004D);
	plot.addLayer(standarddialrange2);
	
	Pointer pointer = new Pointer(0); 
	pointer.setFillPaint(new Color(144, 196, 246));
	plot.addPointer(pointer);
	plot.mapDatasetToScale(0, 0);
	DialCap dialcap = new DialCap();
	dialcap.setRadius(0.0700000000000001D);
	plot.setCap(dialcap);
	
	this.chart = new JFreeChart(plot);
	//this.chart.setBackgroundPaint(new Color(234, 244, 253));
	this.chart.setBackgroundPaint( Color.white );
}
 
开发者ID:billchen198318,项目名称:bamboobsc,代码行数:60,代码来源:CommonMeterChartAction.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SubProtocol类代码示例发布时间:2022-05-22
下一篇:
Java AopTestUtils类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap