| 1 |
|
| 2 |
package org.freehep.graphicsio.cgm; |
| 3 |
|
| 4 |
import java.awt.geom.Point2D; |
| 5 |
import java.io.IOException; |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
public class RestrictedText extends Text { |
| 15 |
|
| 16 |
protected double deltaWidth, deltaHeight; |
| 17 |
|
| 18 |
public RestrictedText() { |
| 19 |
super(4, 5, 1); |
| 20 |
} |
| 21 |
|
| 22 |
public RestrictedText(double deltaWidth, double deltaHeight, Point2D p, |
| 23 |
String text) { |
| 24 |
this(); |
| 25 |
this.deltaWidth = deltaWidth; |
| 26 |
this.deltaHeight = deltaHeight; |
| 27 |
this.p = p; |
| 28 |
this.text = text; |
| 29 |
} |
| 30 |
|
| 31 |
public void write(int tagID, CGMOutputStream cgm) throws IOException { |
| 32 |
cgm.writeVDC(deltaWidth); |
| 33 |
cgm.writeVDC(deltaHeight); |
| 34 |
super.write(tagID, cgm); |
| 35 |
} |
| 36 |
|
| 37 |
public void write(int tagID, CGMWriter cgm) throws IOException { |
| 38 |
cgm.print("RESTRTEXT "); |
| 39 |
cgm.writeVDC(deltaWidth); |
| 40 |
cgm.print(", "); |
| 41 |
cgm.writeVDC(deltaHeight); |
| 42 |
cgm.print(", "); |
| 43 |
cgm.writePoint(p); |
| 44 |
cgm.print(", "); |
| 45 |
writeTextPiece(cgm); |
| 46 |
} |
| 47 |
} |