01: package com.etymon.pj.object.pagemark;
02:
03: import java.io.*;
04: import java.util.*;
05: import com.etymon.pj.object.*;
06:
07: /**
08: Color operator: rg.
09: @author Nassib Nassar
10: */
11: public class Xrg extends PageMarkOperator {
12:
13: public Xrg(PjNumber r, PjNumber g, PjNumber b) {
14: _r = r;
15: _g = g;
16: _b = b;
17: }
18:
19: public PjNumber getR() {
20: return _r;
21: }
22:
23: public PjNumber getG() {
24: return _g;
25: }
26:
27: public PjNumber getB() {
28: return _b;
29: }
30:
31: public long writePdf(OutputStream os) throws IOException {
32: long z = _r.writePdf(os);
33: z = z + write(os, ' ');
34: z = z + _g.writePdf(os);
35: z = z + write(os, ' ');
36: z = z + _b.writePdf(os);
37: z = z + writeln(os, " rg");
38: return z;
39: }
40:
41: /**
42: Returns a deep copy of this object.
43: @return a deep copy of this object.
44: */
45: public Object clone() {
46: return this ;
47: }
48:
49: public boolean equals(Object obj) {
50: if (obj == null) {
51: return false;
52: }
53: if (obj instanceof Xrg) {
54: return ((_r.equals(((Xrg) obj)._r))
55: && (_g.equals(((Xrg) obj)._g)) && (_b
56: .equals(((Xrg) obj)._b)));
57: } else {
58: return false;
59: }
60: }
61:
62: private PjNumber _r;
63: private PjNumber _g;
64: private PjNumber _b;
65:
66: }
|