1    /*
2    Copyright 2004 by Ralph Hartley
3    This software is licenced under the terms of the
4    Gnu Public Licence
5    */
6    
7    import java.awt.geom.*;
8    
9    /** A special region the covers everything. <br>
10    */
11   public class Everywhere implements java.io.Serializable,Region {
12   
13     private Everywhere() {}
14   
15     private static final long serialVersionUID = Version.getSUID();
16   
17     /**
18      * There is never more than just this one instance. It is unique.
19      */
20     public static Everywhere everywhere = new Everywhere();
21   
22     /** Always returns the whole clip region.
23      */
24     public Area getIn(View view) {
25       return(new Area(view.draw.getClip()));
26     }
27   
28     public String getName(){return("Everywhere");}
29   
30     public String toString() {return(getName());}
31   
32     /**
33      * When reading from a file, Always use the unique instance.
34      */
35     public Object readResolve() throws java.io.ObjectStreamException {
36       return(everywhere);
37     }
38   
39   }
40