本文整理汇总了Java中org.jfree.chart.annotations.XYTextAnnotation.setBackgroundPaint方法的典型用法代码示例。如果您正苦于以下问题:Java XYTextAnnotation.setBackgroundPaint方法的具体用法?Java XYTextAnnotation.setBackgroundPaint怎么用?Java XYTextAnnotation.setBackgroundPaint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.annotations.XYTextAnnotation
的用法示例。
在下文中一共展示了XYTextAnnotation.setBackgroundPaint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeDataLabels
import org.jfree.chart.annotations.XYTextAnnotation; //导入方法依赖的package包/类
private void makeDataLabels(String category, Set<Report> toolResults, XYPlot xyplot) {
HashMap<Point2D, String> map = makePointList(category, toolResults);
for (Entry<Point2D, String> e : map.entrySet()) {
if (e.getValue() != null) {
Point2D p = e.getKey();
String label = sort(e.getValue());
XYTextAnnotation annotation = new XYTextAnnotation(label, p.getX(), p.getY());
annotation.setTextAnchor(p.getX() < 3 ? TextAnchor.TOP_LEFT : TextAnchor.TOP_CENTER);
annotation.setBackgroundPaint(Color.white);
if (label.toCharArray()[0] == averageLabel) {
annotation.setPaint(Color.magenta);
} else {
annotation.setPaint(Color.blue);
}
annotation.setFont(theme.getRegularFont());
xyplot.addAnnotation(annotation);
}
}
}
示例2: makeDataLabels
import org.jfree.chart.annotations.XYTextAnnotation; //导入方法依赖的package包/类
private void makeDataLabels(OverallResults or, XYPlot xyplot) {
HashMap<Point2D, String> map = makePointList(or);
for (Entry<Point2D, String> e : map.entrySet()) {
if (e.getValue() != null) {
Point2D p = e.getKey();
String label = sort(e.getValue());
XYTextAnnotation annotation = new XYTextAnnotation(label, p.getX(), p.getY());
annotation.setTextAnchor(p.getX() < 3 ? TextAnchor.TOP_LEFT : TextAnchor.TOP_CENTER);
annotation.setBackgroundPaint(Color.white);
// set color of average to black and everything else to blue
if(averageLabel==label.toCharArray()[0]){
annotation.setPaint(Color.magenta);
} else {
annotation.setPaint(Color.blue);
}
annotation.setFont(theme.getRegularFont());
xyplot.addAnnotation(annotation);
}
}
}
示例3: makeGuessingLine
import org.jfree.chart.annotations.XYTextAnnotation; //导入方法依赖的package包/类
public static void makeGuessingLine(XYPlot xyplot) {
// draw guessing line
XYLineAnnotation guessing = new XYLineAnnotation(-5, -5, 100, 100, dashed, Color.red);
xyplot.addAnnotation(guessing);
XYPointerAnnotation worse = makePointer(75, 0, "Worse than guessing", TextAnchor.TOP_CENTER, 90);
xyplot.addAnnotation(worse);
XYPointerAnnotation better = makePointer(25, 100, "Better than guessing", TextAnchor.BOTTOM_CENTER, 270);
xyplot.addAnnotation(better);
XYTextAnnotation stroketext = new XYTextAnnotation(" Random Guess", 88, 107);
stroketext.setTextAnchor(TextAnchor.CENTER_RIGHT);
stroketext.setBackgroundPaint(Color.white);
stroketext.setPaint(Color.red);
stroketext.setFont(theme.getRegularFont());
xyplot.addAnnotation(stroketext);
XYLineAnnotation strokekey = new XYLineAnnotation(58, 107, 68, 107, dashed, Color.red);
xyplot.setBackgroundPaint(Color.white);
xyplot.addAnnotation(strokekey);
}
示例4: makeDataLabels
import org.jfree.chart.annotations.XYTextAnnotation; //导入方法依赖的package包/类
private void makeDataLabels( Set<Report> toolResults, XYPlot xyplot ) {
HashMap<Point2D,String> map = makePointList( toolResults );
for (Entry<Point2D,String> e : map.entrySet() ) {
if ( e.getValue() != null ) {
Point2D p = e.getKey();
String label = sort( e.getValue() );
XYTextAnnotation annotation = new XYTextAnnotation( label, p.getX(), p.getY());
annotation.setTextAnchor( p.getX() < 3 ? TextAnchor.TOP_LEFT : TextAnchor.TOP_CENTER);
annotation.setBackgroundPaint(Color.white);
if (label.toCharArray()[0] == averageLabel)
{
annotation.setPaint(Color.magenta);
} else {
annotation.setPaint(Color.blue);
}
annotation.setFont(theme.getRegularFont());
xyplot.addAnnotation(annotation);
}
}
}