KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nightlabs > editor2d > DrawComponentContainer


1 /**
2  * <copyright>
3  * </copyright>
4  *
5  * $Id: DrawComponentContainer.java 1613 2005-08-24 12:15:04Z marco $
6  */

7 package com.nightlabs.editor2d;
8
9 import java.util.Collection JavaDoc;
10 import java.util.List JavaDoc;
11
12 public interface DrawComponentContainer
13 extends DrawComponent
14 {
15     public static final String JavaDoc CHILD_ADDED = "Child Added";
16     public static final String JavaDoc CHILD_REMOVED = "Child Removed";
17     
18     void addDrawComponent(DrawComponent drawComponent);
19     void removeDrawComponent(DrawComponent drawComponent);
20
21 // MultiLayerDrawComponent getRoot();
22

23     void addDrawComponent(DrawComponent drawComponent, int index);
24     void removeDrawComponent(int index);
25
26     void notifyChildTransform(DrawComponent child);
27
28     List JavaDoc getDrawComponents();
29     void setDrawComponents(List JavaDoc drawComponents);
30
31     /**
32      * This method searches recursively in all child-{@link DrawComponent}s and collects
33      * all instances that either implement a given interface, are or extend a given class.
34      *
35      * @param type A class or an interface which the searched <tt>DrawComponent</tt>s must match.
36      * @param canSelfPackage If <tt>false</tt>, it is assumed that the given class does not contain
37      * itself and the search in this part of the tree is interrupted. If <tt>true</tt>, it will
38      * search in a found instance of the given type for the given type - means the whole tree will
39      * be scanned.
40      * @return A <tt>Collection</tt> with instances of the given <tt>type</tt>.
41      */

42     Collection JavaDoc findDrawComponents(Class JavaDoc type, boolean canSelfPackage);
43
44     /**
45      * Convenience method which calls {@link #findDrawComponents(Class, boolean)} with
46      * <tt>canSelfPackage == false</tt>.
47      */

48     Collection JavaDoc findDrawComponents(Class JavaDoc type);
49 } // DrawComponentContainer
50
Popular Tags