View Javadoc

1   // Copyright 2002, FreeHEP.
2   package org.freehep.graphicsio.emf.gdi;
3   
4   import java.io.IOException;
5   
6   import org.freehep.graphicsio.emf.EMFInputStream;
7   import org.freehep.graphicsio.emf.EMFOutputStream;
8   
9   /**
10   * EMF GradientRectangle
11   * 
12   * @author Mark Donszelmann
13   * @version $Id: GradientRectangle.java 10140 2006-12-07 07:50:41Z duns $
14   */
15  public class GradientRectangle extends Gradient {
16  
17      private int upperLeft, lowerRight;
18  
19      public GradientRectangle(int upperLeft, int lowerRight) {
20          this.upperLeft = upperLeft;
21          this.lowerRight = lowerRight;
22      }
23  
24      public GradientRectangle(EMFInputStream emf) throws IOException {
25          upperLeft = emf.readULONG();
26          lowerRight = emf.readULONG();
27      }
28  
29      public void write(EMFOutputStream emf) throws IOException {
30          emf.writeULONG(upperLeft);
31          emf.writeULONG(lowerRight);
32      }
33  
34      public String toString() {
35          return "  GradientRectangle: " + upperLeft + ", " + lowerRight;
36      }
37  }