Debian Codegraph @

freehep-graphicsio-cgm/src/main/java/org/freehep/graphicsio/cgm/LineCap.java

raw symbols SCIP
1 // Copyright 2001, FreeHEP.
2 package org.freehep.graphicsio.cgm;
3
4 import java.io.IOException;
5
6 /**
7 * LineCap TAG.
8 *
9 * @author Mark Donszelmann
10 * @author Charles Loomis
11 * @version $Id: freehep-graphicsio-cgm/src/main/java/org/freehep/graphicsio/cgm/LineCap.java 278fac7cefaa 2005/12/05 04:00:43 duns $
12 */
13 public class LineCap extends CGMTag {
14
15 public static final int UNSPECIFIED = 1;
16
17 public static final int BUTT = 2;
18
19 public static final int ROUND = 3;
20
21 public static final int MATCH = 3; // for DASH
22
23 public static final int SQUARE = 4;
24
25 public static final int TRIANGLE = 5;
26
27 private int cap;
28
29 private int dash;
30
31 public LineCap() {
32 super(5, 37, 3);
33 }
34
35 public LineCap(int cap) {
36 this(cap, BUTT);
37 }
38
39 public LineCap(int cap, int dash) {
40 this();
41 this.cap = cap;
42 this.dash = dash;
43 }
44
45 public void write(int tagID, CGMOutputStream cgm) throws IOException {
46 cgm.writeIntegerIndex(cap);
47 cgm.writeIntegerIndex(dash);
48 }
49
50 public void write(int tagID, CGMWriter cgm) throws IOException {
51 cgm.print("LINECAP ");
52 cgm.writeInteger(cap);
53 cgm.print(", ");
54 cgm.writeInteger(dash);
55 }
56 }