1. /*
  2. * @(#)AncestorListener.java 1.12 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing.event;
  8. import java.awt.event.*;
  9. import java.awt.*;
  10. import java.util.*;
  11. import javax.swing.*;
  12. /**
  13. * AncestorListener
  14. *
  15. * Interface to support notification when changes occur to a JComponent or one
  16. * of its ancestors. These include movement and when the component becomes
  17. * visible or invisible, either by the setVisible() method or by being added
  18. * or removed from the component hierarchy.
  19. *
  20. * @version 1.12 12/19/03
  21. * @author Dave Moore
  22. */
  23. public interface AncestorListener extends EventListener {
  24. /**
  25. * Called when the source or one of its ancestors is made visible
  26. * either by setVisible(true) being called or by its being
  27. * added to the component hierarchy. The method is only called
  28. * if the source has actually become visible. For this to be true
  29. * all its parents must be visible and it must be in a hierarchy
  30. * rooted at a Window
  31. */
  32. public void ancestorAdded(AncestorEvent event);
  33. /**
  34. * Called when the source or one of its ancestors is made invisible
  35. * either by setVisible(false) being called or by its being
  36. * remove from the component hierarchy. The method is only called
  37. * if the source has actually become invisible. For this to be true
  38. * at least one of its parents must by invisible or it is not in
  39. * a hierarchy rooted at a Window
  40. */
  41. public void ancestorRemoved(AncestorEvent event);
  42. /**
  43. * Called when either the source or one of its ancestors is moved.
  44. */
  45. public void ancestorMoved(AncestorEvent event);
  46. }