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