home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-08-14 | 1.4 KB | 72 lines |
-
- package como.commlet.draw;
-
- import como.io.*;
- import java.io.*;
- import como.util.*;
- import java.awt.*;
- import java.util.*; import java.lang.*;
-
- /******
- * GOGroup
- */
- public class GOGroup extends GraphicsObject
- {
- private Hashtable cont;
- public GOGroup()
- {
- super();
- cont = new Hashtable(10,10);
- }
- public GraphicsObject getNew() {
- return null;
- }
- public GOGroup(String n, Color c)
- {
- name = n;
- color = c;
- cont = new Hashtable(10,10);
- }
- public GraphicsObject get(Object key) {
- if (!cont.containsKey(key))
- {
- Debug.msg(100,"GOGroup.get(): No key = " + key);
- return null;
- }
- else return (GraphicsObject) cont.get(key);
- }
- public void put(Object key,GraphicsObject g) {
- cont.put(key,g);
- }
- public void remove(Object key) {
- cont.remove(key);
- }
- public Enumeration keys() {
- return cont.keys();
- }
- public Enumeration elements() {
- return cont.elements();
- }
- public int size() {
- return cont.size();
- }
- public void draw(Graphics g,Color c)
- {
- Enumeration e = cont.elements();
- while (e.hasMoreElements())
- ((GraphicsObject)e.nextElement()).draw(g,c);
- }
- public void draw(Graphics g)
- {
- Enumeration e = cont.elements();
- while (e.hasMoreElements())
- ((GraphicsObject)e.nextElement()).draw(g);
- }
- public void load(ObjectInputStream s) throws IOException{} // TODO
- public void save(ObjectInputStream s) throws IOException{}
- public String toString() {
- return super.toString()+cont;
- }
-
- }
-