1
2 package org.freehep.graphicsio.emf;
3
4 import java.io.IOException;
5 import java.util.logging.Logger;
6
7 import org.freehep.util.io.Tag;
8 import org.freehep.util.io.TaggedInputStream;
9 import org.freehep.util.io.TaggedOutputStream;
10 import org.freehep.graphicsio.emf.gdi.GDIObject;
11
12
13
14
15
16
17
18 public abstract class EMFTag extends Tag implements GDIObject {
19
20
21
22
23 protected static final Logger logger = Logger.getLogger("org.freehep.graphicsio.emf");
24
25
26
27
28
29
30
31 protected EMFTag(int id, int version) {
32 super(id, version);
33 }
34
35 public Tag read(int tagID, TaggedInputStream input, int len)
36 throws IOException {
37
38 return read(tagID, (EMFInputStream) input, len);
39 }
40
41 public abstract EMFTag read(int tagID, EMFInputStream emf, int len)
42 throws IOException;
43
44 public void write(int tagID, TaggedOutputStream output) throws IOException {
45 write(tagID, (EMFOutputStream) output);
46 }
47
48
49
50
51
52
53
54
55
56
57 public void write(int tagID, EMFOutputStream emf) throws IOException {
58
59 }
60
61
62
63
64 public String toString() {
65 return "EMFTag " + getName() + " (" + getTag() + ")";
66 }
67
68
69
70
71
72
73 public void render(EMFRenderer renderer) {
74 logger.warning("EMF tag not supported: " + toString());
75 }
76 }