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


Java DialTextAnnotation.setFont方法代码示例

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


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

示例1: createStandardDialChart

import org.jfree.chart.plot.dial.DialTextAnnotation; //导入方法依赖的package包/类
public JFreeChart createStandardDialChart(String s, String s1, ValueDataset valuedataset, double d, double d1, double d2, int i) {
	DialPlot dialplot = new DialPlot();
	dialplot.setDataset(valuedataset);
	dialplot.setDialFrame(new StandardDialFrame());
	dialplot.setBackground(new DialBackground());
	DialTextAnnotation dialtextannotation = new DialTextAnnotation(s1);
	dialtextannotation.setFont(new Font("Dialog", 1, 14));
	dialtextannotation.setRadius(0.69999999999999996D);
	dialplot.addLayer(dialtextannotation);
	DialValueIndicator dialvalueindicator = new DialValueIndicator(0);
	dialplot.addLayer(dialvalueindicator);
	StandardDialScale standarddialscale = new StandardDialScale(d, d1, -120D, -300D, 10D, 4);
	standarddialscale.setMajorTickIncrement(d2);
	standarddialscale.setMinorTickCount(i);
	standarddialscale.setTickRadius(0.88D);
	standarddialscale.setTickLabelOffset(0.14999999999999999D);
	standarddialscale.setTickLabelFont(new Font("Dialog", 0, 14));
	dialplot.addScale(0, standarddialscale);
	dialplot.addPointer(new org.jfree.chart.plot.dial.DialPointer.Pin());
	DialCap dialcap = new DialCap();
	dialplot.setCap(dialcap);
	return new JFreeChart(s, dialplot);
}
 
开发者ID:mars-sim,项目名称:mars-sim,代码行数:24,代码来源:TemperatureDial.java

示例2: testEquals

import org.jfree.chart.plot.dial.DialTextAnnotation; //导入方法依赖的package包/类
/**
 * Confirm that the equals method can distinguish all the required fields.
 */
public void testEquals() {
    DialTextAnnotation a1 = new DialTextAnnotation("A1");
    DialTextAnnotation a2 = new DialTextAnnotation("A1");
    assertTrue(a1.equals(a2));

    // angle
    a1.setAngle(1.1);
    assertFalse(a1.equals(a2));
    a2.setAngle(1.1);
    assertTrue(a1.equals(a2));

    // radius
    a1.setRadius(9.9);
    assertFalse(a1.equals(a2));
    a2.setRadius(9.9);
    assertTrue(a1.equals(a2));

    // font
    Font f = new Font("SansSerif", Font.PLAIN, 14);
    a1.setFont(f);
    assertFalse(a1.equals(a2));
    a2.setFont(f);
    assertTrue(a1.equals(a2));

    // paint
    a1.setPaint(Color.red);
    assertFalse(a1.equals(a2));
    a2.setPaint(Color.red);
    assertTrue(a1.equals(a2));

    // label
    a1.setLabel("ABC");
    assertFalse(a1.equals(a2));
    a2.setLabel("ABC");
    assertTrue(a1.equals(a2));

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


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