private void addEdgesWithFill(Styles styles, ShapeWithStyle shapeWithStyle, int[][] coords, int left, int right) { StyleChangeRecord scr = new StyleChangeRecord(); if ((left != 0) || (right != 0)) { IFillStyle fillStyle0 = null; if (left > 0) { fillStyle0 = styles.getFillStyles().get(left - 1); } IFillStyle fillStyle1 = null; if (right > 0) { fillStyle1 = styles.getFillStyles().get(right - 1); } scr.setDefinedStyles(fillStyle0, fillStyle1, null, styles); } shapeWithStyle.addShapeRecord(scr); for (int i = 0; i < coords.length; ++i) { shapeWithStyle.addShapeRecord(new StraightEdgeRecord(coords[i][0], coords[i][1])); } }
private void addEdgesWithFill(Styles styles, ShapeWithStyle shapeWithStyle, int[][] coords, int left, int right) { StyleChangeRecord scr = new StyleChangeRecord(); if ((left != 0) || (right != 0)) { IFillStyle fillStyle0 = null; if (left > 0) { fillStyle0 = styles.getFillStyles().get(left - 1); } IFillStyle fillStyle1 = null; if (right > 0) { fillStyle1 = styles.getFillStyles().get(right - 1); } scr.setDefinedStyles(fillStyle0, fillStyle1, null, styles); } shapeWithStyle.addShapeRecord(scr); for (int i = 0; i < coords.length; ++i) { shapeWithStyle.addShapeRecord(new StraightEdgeRecord(coords[i][0], coords[i][1])); } }
shapeWithStyle.addShapeRecord(startStyle); shapeWithStyle.addShapeRecord(new StraightEdgeRecord(-1 * width, 0)); shapeWithStyle.addShapeRecord(new StraightEdgeRecord(0, -1 * height)); shapeWithStyle.addShapeRecord(new StraightEdgeRecord(width, 0)); shapeWithStyle.addShapeRecord(new StraightEdgeRecord(0, height));
shapeWithStyle.addShapeRecord(startStyle); shapeWithStyle.addShapeRecord(new StraightEdgeRecord(-1 * width, 0)); shapeWithStyle.addShapeRecord(new StraightEdgeRecord(0, -1 * height)); shapeWithStyle.addShapeRecord(new StraightEdgeRecord(width, 0)); shapeWithStyle.addShapeRecord(new StraightEdgeRecord(0, height));
shapeWithStyle.addShapeRecord(startStyle); shapeWithStyle.addShapeRecord(down1Style); addEdgesWithFill(styles, shapeWithStyle, new int[][] {{0, dya}}, 2, 1); addEdgesWithFill(styles, shapeWithStyle, new int[][] {{0, dyb}}, 5, 4); shapeWithStyle.addShapeRecord(down2Style); addEdgesWithFill(styles, shapeWithStyle, new int[][] {{0, dya}}, 3, 2); addEdgesWithFill(styles, shapeWithStyle, new int[][] {{0, dyb}}, 6, 5); shapeWithStyle.addShapeRecord(right1Style); addEdgesWithFill(styles, shapeWithStyle, new int[][] {{dxa, 0}}, 1, 4); addEdgesWithFill(styles, shapeWithStyle, new int[][] {{dxb, 0}}, 2, 5); shapeWithStyle.addShapeRecord(right2Style); addEdgesWithFill(styles, shapeWithStyle, new int[][] {{dxa, 0}}, 4, 7); addEdgesWithFill(styles, shapeWithStyle, new int[][] {{dxb, 0}}, 5, 8);
shapeWithStyle.addShapeRecord(startStyle); shapeWithStyle.addShapeRecord(down1Style); addEdgesWithFill(styles, shapeWithStyle, new int[][] {{0, dya}}, 2, 1); addEdgesWithFill(styles, shapeWithStyle, new int[][] {{0, dyb}}, 5, 4); shapeWithStyle.addShapeRecord(down2Style); addEdgesWithFill(styles, shapeWithStyle, new int[][] {{0, dya}}, 3, 2); addEdgesWithFill(styles, shapeWithStyle, new int[][] {{0, dyb}}, 6, 5); shapeWithStyle.addShapeRecord(right1Style); addEdgesWithFill(styles, shapeWithStyle, new int[][] {{dxa, 0}}, 1, 4); addEdgesWithFill(styles, shapeWithStyle, new int[][] {{dxb, 0}}, 2, 5); shapeWithStyle.addShapeRecord(right2Style); addEdgesWithFill(styles, shapeWithStyle, new int[][] {{dxa, 0}}, 4, 7); addEdgesWithFill(styles, shapeWithStyle, new int[][] {{dxb, 0}}, 5, 8);