home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / pc / java / in4wjcxu / src / como / commlet / draw / gogroup.java < prev    next >
Encoding:
Java Source  |  1996-08-14  |  1.4 KB  |  72 lines

  1.  
  2. package como.commlet.draw;
  3.  
  4. import como.io.*;
  5. import java.io.*;
  6. import como.util.*;
  7. import java.awt.*;
  8. import java.util.*; import java.lang.*;
  9.  
  10. /******
  11. * GOGroup
  12. */
  13. public class GOGroup extends GraphicsObject
  14. {
  15.     private    Hashtable cont;
  16.     public GOGroup()
  17.     {
  18.         super();
  19.         cont = new Hashtable(10,10);
  20.     }
  21.     public GraphicsObject getNew() {
  22.         return null;
  23.     }
  24.     public GOGroup(String n, Color c)
  25.     {
  26.         name = n;
  27.         color = c;
  28.         cont = new Hashtable(10,10);
  29.     }
  30.     public GraphicsObject get(Object key) {
  31.         if (!cont.containsKey(key)) 
  32.         {
  33.             Debug.msg(100,"GOGroup.get(): No key = " + key);
  34.             return null;
  35.         }
  36.         else return (GraphicsObject) cont.get(key);
  37.     }
  38.     public void put(Object key,GraphicsObject g) {
  39.         cont.put(key,g);
  40.     }
  41.     public void remove(Object key) {
  42.         cont.remove(key);
  43.     }
  44.     public Enumeration keys() {
  45.         return cont.keys();
  46.     }
  47.     public Enumeration elements() {
  48.         return cont.elements();
  49.     }
  50.     public int size() {
  51.         return cont.size();
  52.     }
  53.     public void draw(Graphics g,Color c)
  54.     {
  55.         Enumeration e = cont.elements();
  56.         while (e.hasMoreElements())
  57.         ((GraphicsObject)e.nextElement()).draw(g,c);
  58.     }
  59.     public void draw(Graphics g)
  60.     {
  61.         Enumeration e = cont.elements();
  62.         while (e.hasMoreElements())
  63.         ((GraphicsObject)e.nextElement()).draw(g);
  64.     }
  65.     public void load(ObjectInputStream s) throws IOException{} // TODO
  66.     public void save(ObjectInputStream s) throws IOException{}
  67.     public String toString() {
  68.         return super.toString()+cont;
  69.     }
  70.  
  71. }
  72.