List of usage examples for org.jfree.chart.annotations CategoryTextAnnotation setPaint
public void setPaint(Paint paint)
From source file:org.operamasks.faces.render.graph.ChartRenderer.java
private CategoryTextAnnotation createCategoryTextAnnotation(UITextAnnotation at, Comparable key) { CategoryTextAnnotation result; String label = at.getText();//from w ww . j av a 2 s . c o m double value = Coercion.coerceToDouble(at.getyValue()); if (at.isDrawArrow()) { Double angle = at.getArrowAngle(); if (angle == null) angle = 0.0; CategoryPointerAnnotation pointer = new CategoryPointerAnnotation(label, key, value, angle * Math.PI / 180.0); Double length = at.getArrowLength(); if (length != null) { pointer.setBaseRadius(length); } Paint arrowColor = at.getArrowColor(); if (arrowColor == null) arrowColor = at.getColor(); if (arrowColor != null) pointer.setArrowPaint(arrowColor); result = pointer; } else { result = new CategoryTextAnnotation(label, key, value); } Font font = at.getFont(); if (font != null) { result.setFont(font); } Paint color = at.getColor(); if (color != null) { result.setPaint(color); } TextAnchor anchor = getTextAnchor(at.getAnchor()); if (anchor != null) { result.setTextAnchor(anchor); } Double rotationAngle = at.getRotationAngle(); if (rotationAngle != null) { result.setRotationAngle(rotationAngle * Math.PI / 180.0); } return result; }