| 1 |
|
| 2 |
package org.freehep.graphicsio.cgm; |
| 3 |
|
| 4 |
import java.io.IOException; |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
public class LineWidth extends CGMTag { |
| 14 |
|
| 15 |
private double width; |
| 16 |
|
| 17 |
public LineWidth() { |
| 18 |
super(5, 3, 1); |
| 19 |
} |
| 20 |
|
| 21 |
public LineWidth(double width) { |
| 22 |
this(); |
| 23 |
this.width = width; |
| 24 |
} |
| 25 |
|
| 26 |
public void write(int tagID, CGMOutputStream cgm) throws IOException { |
| 27 |
if (cgm.getLineWidthSpecificationMode() == LineWidthSpecificationMode.ABSOLUTE) { |
| 28 |
cgm.writeVDC(width); |
| 29 |
} else { |
| 30 |
cgm.writeReal(width); |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
public void write(int tagID, CGMWriter cgm) throws IOException { |
| 35 |
cgm.print("LINEWIDTH "); |
| 36 |
if (cgm.getLineWidthSpecificationMode() == LineWidthSpecificationMode.ABSOLUTE) { |
| 37 |
cgm.writeVDC(width); |
| 38 |
} else { |
| 39 |
cgm.writeReal(width); |
| 40 |
} |
| 41 |
} |
| 42 |
} |