* Makefile.in (PREPROCESSOR_DEFINES): New macro.
[official-gcc.git] / libjava / java / awt / Container.java
blobdc3d19385709e8fa8d6d4e6f2659fcae462c5779
1 /* Copyright (C) 1999 Cygnus Solutions
3 This file is part of libjava.
5 This software is copyrighted work licensed under the terms of the
6 Libjava License. Please consult the file "LIBJAVA_LICENSE" for
7 details. */
9 package java.awt;
11 /* A very incomplete placeholder. */
13 public abstract class Container extends Component
15 int componentCount;
16 Component[] components;
18 public Component[] getComponents()
20 Component[] result = new Component[componentCount];
21 if (componentCount > 0)
22 System.arraycopy(components, 0, result, 0, componentCount);
23 return result;
26 public Component getComponent (int n)
28 if (n < 0 || n >= componentCount)
29 throw new ArrayIndexOutOfBoundsException("no such component");
30 return components[n];
33 public boolean isAncestorOf (Component comp)
35 for (;;)
37 if (comp == null)
38 return false;
39 if (comp == this)
40 return true;
41 comp = comp.getParent();
45 public Component add (String name, Component comp)
47 /* FIXME */
48 return comp;
51 public void addNotify ()
53 for (int i = componentCount; --i >= 0; )
54 components[i].addNotify();
57 public void setLayout (LayoutManager layout)
58 { /* FIXME */ }