| 1 |
|
| 2 |
package org.freehep.graphicsio.cgm; |
| 3 |
|
| 4 |
import java.io.IOException; |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
public class TextPrecision extends CGMTag { |
| 14 |
|
| 15 |
public static final int STRING = 1; |
| 16 |
|
| 17 |
public static final int CHARACTER = 2; |
| 18 |
|
| 19 |
public static final int STROKE = 3; |
| 20 |
|
| 21 |
private int precision; |
| 22 |
|
| 23 |
public TextPrecision() { |
| 24 |
super(5, 11, 1); |
| 25 |
} |
| 26 |
|
| 27 |
public TextPrecision(int precision) { |
| 28 |
this(); |
| 29 |
this.precision = precision; |
| 30 |
} |
| 31 |
|
| 32 |
public void write(int tagID, CGMOutputStream cgm) throws IOException { |
| 33 |
cgm.writeEnumerate(precision); |
| 34 |
} |
| 35 |
|
| 36 |
public void write(int tagID, CGMWriter cgm) throws IOException { |
| 37 |
cgm.print("TEXTPREC "); |
| 38 |
switch (precision) { |
| 39 |
default: |
| 40 |
case STRING: |
| 41 |
cgm.print("STRING"); |
| 42 |
break; |
| 43 |
case CHARACTER: |
| 44 |
cgm.print("CHAR"); |
| 45 |
break; |
| 46 |
case STROKE: |
| 47 |
cgm.print("STROKE"); |
| 48 |
break; |
| 49 |
} |
| 50 |
} |
| 51 |
} |