java.awt.event

Class HierarchyEvent

  • java.lang.Object
  • All Implemented Interfaces:
    java.io.Serializable
    public class HierarchyEvent extends AWTEvent
    An event which indicates a change to the Component hierarchy to which Component belongs.
    • Hierarchy Change Events (HierarchyListener)
      • addition of an ancestor
      • removal of an ancestor
      • hierarchy made displayable
      • hierarchy made undisplayable
      • hierarchy shown on the screen (both visible and displayable)
      • hierarchy hidden on the screen (either invisible or undisplayable)
    • Ancestor Reshape Events (HierarchyBoundsListener)
      • an ancestor was resized
      • an ancestor was moved

    Hierarchy events are provided for notification purposes ONLY. The AWT will automatically handle changes to the hierarchy internally so that GUI layout and displayability works properly regardless of whether a program is receiving these events or not.

    This event is generated by a Container object (such as a Panel) when the Container is added, removed, moved, or resized, and passed down the hierarchy. It is also generated by a Component object when that object's addNotify, removeNotify, show, or hide method is called. The ANCESTOR_MOVED and ANCESTOR_RESIZED events are dispatched to every HierarchyBoundsListener or HierarchyBoundsAdapter object which registered to receive such events using the Component's addHierarchyBoundsListener method. (HierarchyBoundsAdapter objects implement the HierarchyBoundsListener interface.) The HIERARCHY_CHANGED events are dispatched to every HierarchyListener object which registered to receive such events using the Component's addHierarchyListener method. Each such listener object gets this HierarchyEvent when the event occurs.

    An unspecified behavior will be caused if the id parameter of any particular HierarchyEvent instance is not in the range from HIERARCHY_FIRST to HIERARCHY_LAST.
    The changeFlags parameter of any HierarchyEvent instance takes one of the following values:

    • HierarchyEvent.PARENT_CHANGED
    • HierarchyEvent.DISPLAYABILITY_CHANGED
    • HierarchyEvent.SHOWING_CHANGED
    Assigning the value different from listed above will cause unspecified behavior.
    Since:
    1.3
    See Also:
    HierarchyListener, HierarchyBoundsAdapter, HierarchyBoundsListener, Serialized Form
    • Fields 
      Modifier and Type Field and Description
      Inherited member indicator ACTION_EVENT_MASK Reveal DetailHide Detail
      The event mask for selecting action events.
      Inherited member indicator ADJUSTMENT_EVENT_MASK Reveal DetailHide Detail
      The event mask for selecting adjustment events.
      Ordinary member indicator ANCESTOR_MOVED Reveal DetailHide Detail
      The event id indicating an ancestor-Container was moved.
      Ordinary member indicator ANCESTOR_RESIZED Reveal DetailHide Detail
      The event id indicating an ancestor-Container was resized.
      Inherited member indicator COMPONENT_EVENT_MASK Reveal DetailHide Detail
      The event mask for selecting component events.
      Inherited member indicator CONTAINER_EVENT_MASK Reveal DetailHide Detail
      The event mask for selecting container events.
      Ordinary member indicator DISPLAYABILITY_CHANGED Reveal DetailHide Detail
      A change flag indicates that the HIERARCHY_CHANGED event was generated due to the changing of the hierarchy displayability.
      Inherited member indicator FOCUS_EVENT_MASK Reveal DetailHide Detail
      The event mask for selecting focus events.
      Inherited member indicator HIERARCHY_BOUNDS_EVENT_MASK Reveal DetailHide Detail
      The event mask for selecting hierarchy bounds events.
      Ordinary member indicator HIERARCHY_CHANGED Reveal DetailHide Detail
      The event id indicating that modification was made to the entire hierarchy tree.
      Inherited member indicator HIERARCHY_EVENT_MASK Reveal DetailHide Detail
      The event mask for selecting hierarchy events.
      Ordinary member indicator HIERARCHY_FIRST Reveal DetailHide Detail
      Marks the first integer id for the range of hierarchy event ids.
      Ordinary member indicator HIERARCHY_LAST Reveal DetailHide Detail
      Marks the last integer id for the range of ancestor event ids.
      Inherited member indicator INPUT_METHOD_EVENT_MASK Reveal DetailHide Detail
      The event mask for selecting input method events.
      Inherited member indicator INVOCATION_EVENT_MASK Reveal DetailHide Detail
      The event mask for selecting invocation events.
      Inherited member indicator ITEM_EVENT_MASK Reveal DetailHide Detail
      The event mask for selecting item events.
      Inherited member indicator KEY_EVENT_MASK Reveal DetailHide Detail
      The event mask for selecting key events.
      Inherited member indicator MOUSE_EVENT_MASK Reveal DetailHide Detail
      The event mask for selecting mouse events.
      Inherited member indicator MOUSE_MOTION_EVENT_MASK Reveal DetailHide Detail
      The event mask for selecting mouse motion events.
      Inherited member indicator MOUSE_WHEEL_EVENT_MASK Reveal DetailHide Detail
      The event mask for selecting mouse wheel events.
      Inherited member indicator PAINT_EVENT_MASK Reveal DetailHide Detail
      The event mask for selecting paint events.
      Ordinary member indicator PARENT_CHANGED Reveal DetailHide Detail
      A change flag indicates that the HIERARCHY_CHANGED event was generated by a reparenting operation.
      Inherited member indicator RESERVED_ID_MAX Reveal DetailHide Detail
      The maximum value for reserved AWT event IDs.
      Ordinary member indicator SHOWING_CHANGED Reveal DetailHide Detail
      A change flag indicates that the HIERARCHY_CHANGED event was generated due to the changing of the hierarchy showing state.
      Inherited member indicator TEXT_EVENT_MASK Reveal DetailHide Detail
      The event mask for selecting text events.
      Inherited member indicator WINDOW_EVENT_MASK Reveal DetailHide Detail
      The event mask for selecting window events.
      Inherited member indicator WINDOW_FOCUS_EVENT_MASK Reveal DetailHide Detail
      The event mask for selecting window focus events.
      Inherited member indicator WINDOW_STATE_EVENT_MASK Reveal DetailHide Detail
      The event mask for selecting window state events.
    • Constructors 
      Constructor and Description
      Ordinary member indicator HierarchyEvent Reveal DetailHide Detail
      Constructs an HierarchyEvent object to identify a change in the Component hierarchy.
      Ordinary member indicator HierarchyEvent Reveal DetailHide Detail
      Constructs an HierarchyEvent object to identify a change in the Component hierarchy.
    • Methods 
      Modifier and Type Method and Description
      Ordinary member indicator getChanged Reveal DetailHide Detail
      Returns the Component at the top of the hierarchy which was changed.
      Ordinary member indicator getChangedParent Reveal DetailHide Detail
      Returns the parent of the Component returned by getChanged().
      Ordinary member indicator getChangeFlags Reveal DetailHide Detail
      Returns a bitmask which indicates the type(s) of HIERARCHY_CHANGED events represented in this event object.
      Ordinary member indicator getComponent Reveal DetailHide Detail
      Returns the originator of the event.
      Inherited member indicator getID Reveal DetailHide Detail
      Returns the event type.
      Inherited member indicator getSource Reveal DetailHide Detail
      The object on which the Event initially occurred.
      Overridden member indicator paramString Reveal DetailHide Detail
      Returns a parameter string identifying this event.
      Inherited member indicator setSource Reveal DetailHide Detail
      Retargets an event to a new source.
      Inherited member indicator toString Reveal DetailHide Detail
      Returns a String representation of this object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
This document was created by Dulcet from the OpenJDK sources. Copyright © 1993, 2012 Oracle and/or its affiliates. All rights reserved.

SourceForge