/** * Calculate number of bits needed for line style array length. * * @return number of bits needed for line style array length */ public static int calculateMinLineUBits(Styles styles) { return requireUBCount(styles.lineStyles.size()); }
/** * Calculate number of bits needed for line style array length. * * @return number of bits needed for line style array length */ public static int calculateMinLineUBits(Styles styles) { return requireUBCount(styles.lineStyles.size()); }
private void writeLineStyles(LineStyleArray lineStyles, TagType tagType) { assert lineStyles != null; final int lineStyleCount = lineStyles.size(); writeExtensibleCount(lineStyleCount); for (final ILineStyle lineStyle : lineStyles) { switch (tagType) { case DefineShape: case DefineShape2: case DefineShape3: writeLineStyle((LineStyle)lineStyle, tagType); break; case DefineShape4: writeLineStyle2((LineStyle2)lineStyle, tagType); break; case DefineMorphShape2: writeMorphLineStyle2((MorphLineStyle2)lineStyle, tagType); break; case DefineMorphShape: writeMorphLineStyle((MorphLineStyle)lineStyle); break; default: throw new IllegalArgumentException("Invalid tag: " + tagType); } } }
private void writeLineStyles(LineStyleArray lineStyles, TagType tagType) { assert lineStyles != null; final int lineStyleCount = lineStyles.size(); writeExtensibleCount(lineStyleCount); for (final ILineStyle lineStyle : lineStyles) { switch (tagType) { case DefineShape: case DefineShape2: case DefineShape3: writeLineStyle((LineStyle)lineStyle, tagType); break; case DefineShape4: writeLineStyle2((LineStyle2)lineStyle, tagType); break; case DefineMorphShape2: writeMorphLineStyle2((MorphLineStyle2)lineStyle, tagType); break; case DefineMorphShape: writeMorphLineStyle((MorphLineStyle)lineStyle); break; default: throw new IllegalArgumentException("Invalid tag: " + tagType); } } }
private void writeShapeWithStyle(ShapeWithStyle shape, TagType tagType) { writeFillStyles(shape.getFillStyles(), tagType); writeLineStyles(shape.getLineStyles(), tagType); CurrentStyles currentStyles = new CurrentStyles(); currentStyles.styles = new Styles(shape.getFillStyles(), shape.getLineStyles()); currentStyles.numFillBits = requireUBCount(shape.getFillStyles().size()); currentStyles.numLineBits = requireUBCount(shape.getLineStyles().size()); writeShape(shape, tagType, currentStyles); }
private void writeShapeWithStyle(ShapeWithStyle shape, TagType tagType) { writeFillStyles(shape.getFillStyles(), tagType); writeLineStyles(shape.getLineStyles(), tagType); CurrentStyles currentStyles = new CurrentStyles(); currentStyles.styles = new Styles(shape.getFillStyles(), shape.getLineStyles()); currentStyles.numFillBits = requireUBCount(shape.getFillStyles().size()); currentStyles.numLineBits = requireUBCount(shape.getLineStyles().size()); writeShape(shape, tagType, currentStyles); }