本文整理汇总了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);
}
示例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));
}