Search in sources :

Example 1 with Paint

use of com.google.code.appengine.awt.Paint in project activityinfo by bedatadriven.

the class ChartRendererJC method getDefaultPaints.

protected Paint[] getDefaultPaints(int count) {
    String[] accents = Theme.getAccents();
    Paint[] paints = new Paint[count];
    for (int i = 0; i != paints.length; ++i) {
        paints[i] = Color.decode(accents[i % accents.length]);
    }
    return paints;
}
Also used : Paint(com.google.code.appengine.awt.Paint) Paint(com.google.code.appengine.awt.Paint)

Example 2 with Paint

use of com.google.code.appengine.awt.Paint in project activityinfo by bedatadriven.

the class ChartRendererJC method computePaints.

private Paint[] computePaints(List<PivotTableData.Axis> categories) {
    Paint[] paints = getDefaultPaints(categories.size());
    Dimension dim = categories.get(0).getDimension();
    if (dim == null) {
        return paints;
    }
    for (int i = 0; i != categories.size(); ++i) {
        CategoryProperties props = dim.getCategories().get(categories.get(i).getCategory());
        if (props != null && props.getColor() != null) {
            paints[i] = new Color(props.getColor());
        }
    }
    return paints;
}
Also used : CategoryProperties(org.activityinfo.shared.report.model.CategoryProperties) Color(com.google.code.appengine.awt.Color) Paint(com.google.code.appengine.awt.Paint) Dimension(org.activityinfo.shared.report.model.Dimension) Paint(com.google.code.appengine.awt.Paint)

Aggregations

Paint (com.google.code.appengine.awt.Paint)2 Color (com.google.code.appengine.awt.Color)1 CategoryProperties (org.activityinfo.shared.report.model.CategoryProperties)1 Dimension (org.activityinfo.shared.report.model.Dimension)1