1 | for (int k = 0; k < blockCount; k++) {↵ | | 1 | for (int k = 0; k < blockCount; k++) {↵
|
2 | int index = (inverted ? blockCount - k - 1 : k);↵ | | 2 | int index = (inverted ? blockCount - k - 1 : k);↵
|
3 | Object[] prev = (Object[]) values.get(index);↵ | | 3 | Object[] prev = (Object[]) values.get(index);↵
|
4 | Object[] curr = (Object[]) values.get(index + 1);↵ | | 4 | Object[] curr = (Object[]) values.get(index + 1);↵
|
5 | int series = 0;↵ | | 5 | int series = 0;↵
|
6 | if (curr[0] == null) {↵ | | 6 | if (curr[0] == null) {↵
|
7 | series = -((Integer) prev[0]).intValue();↵ | | 7 | series = -((Integer) prev[0]).intValue();↵
|
8 | }↵ | | 8 | }↵
|
9 | else {↵ | | 9 | else {↵
|
10 | series = ((Integer) curr[0]).intValue();↵ | | 10 | series = ((Integer) curr[0]).intValue();↵
|
11 | if (series < 0) {↵ | | 11 | if (series < 0) {↵
|
12 | series = -((Integer) prev[0]).intValue();↵ | | 12 | series = -((Integer) prev[0]).intValue();↵
|
13 | }↵ | | 13 | }↵
|
14 | }↵ | | 14 | }↵
|
15 | double v0 = ((Double) prev[1]).doubleValue();↵ | | 15 | double v0 = ((Double) prev[1]).doubleValue();↵
|
16 | double vv0 = rangeAxis.valueToJava2D(v0, dataArea,↵ | | 16 | double vv0 = rangeAxis.valueToJava2D(v0, dataArea,↵
|
17 | plot.getRangeAxisEdge());↵ | | 17 | plot.getRangeAxisEdge());↵
|
|
18 | double v1 = ((Double) curr[1]).doubleValue();↵ | | 18 | double v1 = ((Double) curr[1]).doubleValue();↵
|
19 | double vv1 = rangeAxis.valueToJava2D(v1, dataArea,↵ | | 19 | double vv1 = rangeAxis.valueToJava2D(v1, dataArea,↵
|
20 | plot.getRangeAxisEdge());↵ | | 20 | plot.getRangeAxisEdge());↵
|
|
21 | Shape[] faces = createHorizontalBlock(barX0, barW, vv0, vv1,↵ | | 21 | Shape[] faces = createVerticalBlock(barX0, barW, vv0, vv1,↵
|
22 | inverted);↵ | | 22 | inverted);↵
|
23 | Paint fillPaint = getItemPaint(series, column);↵ | | 23 | Paint fillPaint = getItemPaint(series, column);↵
|
24 | Paint fillPaintDark = fillPaint;↵ | | 24 | Paint fillPaintDark = fillPaint;↵
|
25 | if (fillPaintDark instanceof Color) {↵ | | 25 | if (fillPaintDark instanceof Color) {↵
|
26 | fillPaintDark = ((Color) fillPaint).darker();↵ | | 26 | fillPaintDark = ((Color) fillPaint).darker();↵
|
27 | }↵ | | 27 | }↵
|
28 | boolean drawOutlines = isDrawBarOutline();↵ | | 28 | boolean drawOutlines = isDrawBarOutline();↵
|
29 | Paint outlinePaint = fillPaint;↵ | | 29 | Paint outlinePaint = fillPaint;↵
|
30 | if (drawOutlines) {↵ | | 30 | if (drawOutlines) {↵
|
31 | outlinePaint = getItemOutlinePaint(series, column);↵ | | 31 | outlinePaint = getItemOutlinePaint(series, column);↵
|
32 | g2.setStroke(getItemOutlineStroke(series, column));↵ | | 32 | g2.setStroke(getItemOutlineStroke(series, column));↵
|
33 | }↵ | | 33 | }↵
|
|
34 | for (int f = 0; f < 6; f++) {↵ | | 34 | for (int f = 0; f < 6; f++) {↵
|
35 | if (f == 5) {↵ | | 35 | if (f == 5) {↵
|
36 | g2.setPaint(fillPaint);↵ | | 36 | g2.setPaint(fillPaint);↵
|
37 | }↵ | | 37 | }↵
|
38 | else {↵ | | 38 | else {↵
|
39 | g2.setPaint(fillPaintDark);↵ | | 39 | g2.setPaint(fillPaintDark);↵
|
40 | }↵ | | 40 | }↵
|
41 | g2.fill(faces[f]);↵ | | 41 | g2.fill(faces[f]);↵
|
42 | if (drawOutlines) {↵ | | 42 | if (drawOutlines) {↵
|
43 | g2.setPaint(outlinePaint);↵ | | 43 | g2.setPaint(outlinePaint);↵
|
44 | g2.draw(faces[f]);↵ | | 44 | g2.draw(faces[f]);↵
|
45 | }↵ | | 45 | }↵
|
46 | }↵ | | 46 | }↵
|
|
47 | itemLabelList.add(new Object[] {new Integer(series),↵ | | 47 | itemLabelList.add(new Object[] {new Integer(series),↵
|
48 | faces[5].getBounds2D(),↵ | | 48 | faces[5].getBounds2D(),↵
|
49 | BooleanUtilities.valueOf(v0 < getBase())});↵ | | 49 | BooleanUtilities.valueOf(v0 < getBase())});↵
|
|
50 | // add an item entity, if this information is being collected↵ | | 50 | // add an item entity, if this information is being collected↵
|
51 | EntityCollection entities = state.getEntityCollection();↵ | | 51 | EntityCollection entities = state.getEntityCollection();↵
|
52 | if (entities != null) {↵ | | 52 | if (entities != null) {↵
|
53 | addItemEntity(entities, dataset, series, column, faces[5]);↵ | | 53 | addItemEntity(entities, dataset, series, column, faces[5]);↵
|
54 | | | 54 |
|