| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
package uk.me.parabola.imgfmt.app.typ; |
| 14 |
|
| 15 |
import java.nio.charset.CharsetEncoder; |
| 16 |
|
| 17 |
import uk.me.parabola.imgfmt.app.ImgFileWriter; |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
public class TypPolygon extends TypElement { |
| 25 |
|
| 26 |
private static final int F_LABEL = 0x10; |
| 27 |
private static final int F_EXTENDED = 0x20; |
| 28 |
|
| 29 |
public void write(ImgFileWriter writer, CharsetEncoder encoder) { |
| 30 |
offset = writer.position(); |
| 31 |
|
| 32 |
ColourInfo colourInfo = xpm.getColourInfo(); |
| 33 |
int scheme = colourInfo.getColourScheme(); |
| 34 |
if (!labels.isEmpty()) |
| 35 |
scheme |= F_LABEL; |
| 36 |
if (fontStyle != 0 || dayFontColour != null) |
| 37 |
scheme |= F_EXTENDED; |
| 38 |
|
| 39 |
writer.put1u(scheme); |
| 40 |
|
| 41 |
colourInfo.write(writer); |
| 42 |
if (xpm.hasImage()) |
| 43 |
xpm.writeImage(writer); |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
if ((scheme & F_LABEL) != 0) |
| 49 |
writeLabelBlock(writer, encoder); |
| 50 |
|
| 51 |
|
| 52 |
if ((scheme & F_EXTENDED) != 0) { |
| 53 |
writeExtendedFontInfo(writer); |
| 54 |
} |
| 55 |
} |
| 56 |
} |