| 1 |
|
| 2 |
package org.freehep.graphicsio.cgm; |
| 3 |
|
| 4 |
import java.io.IOException; |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
public class InteriorStyleSpecificationMode extends CGMTag { |
| 15 |
|
| 16 |
public static final int ABSOLUTE = 0; |
| 17 |
|
| 18 |
public static final int SCALED = 1; |
| 19 |
|
| 20 |
public static final int FRACTIONAL = 2; |
| 21 |
|
| 22 |
public static final int MM = 3; |
| 23 |
|
| 24 |
private int mode; |
| 25 |
|
| 26 |
public InteriorStyleSpecificationMode() { |
| 27 |
super(2, 16, 3); |
| 28 |
} |
| 29 |
|
| 30 |
public InteriorStyleSpecificationMode(int mode) { |
| 31 |
this(); |
| 32 |
this.mode = mode; |
| 33 |
} |
| 34 |
|
| 35 |
public void write(int tagID, CGMOutputStream cgm) throws IOException { |
| 36 |
cgm.setInteriorStyleSpecificationMode(mode); |
| 37 |
cgm.writeEnumerate(mode); |
| 38 |
} |
| 39 |
|
| 40 |
public void write(int tagID, CGMWriter cgm) throws IOException { |
| 41 |
cgm.setInteriorStyleSpecificationMode(mode); |
| 42 |
cgm.print("INTSTYLEMODE "); |
| 43 |
switch (mode) { |
| 44 |
default: |
| 45 |
case ABSOLUTE: |
| 46 |
cgm.print("ABS"); |
| 47 |
break; |
| 48 |
case SCALED: |
| 49 |
cgm.print("SCALED"); |
| 50 |
break; |
| 51 |
case FRACTIONAL: |
| 52 |
cgm.print("FRACTIONAL"); |
| 53 |
break; |
| 54 |
case MM: |
| 55 |
cgm.print("METRIC"); |
| 56 |
break; |
| 57 |
} |
| 58 |
} |
| 59 |
} |