Overview
Package
Class
Use
Tree
Deprecated
Index
All Classes
Help
Prev Class
Next Class
Sample
Document
Class java.awt.event.HierarchyEvent
Inherited members: ShowHide
Deprecated: ShowHide
View: ClientSubclassPackageImplementation
java.awt.event

Class HierarchyEvent

  • java.lang.Object
    • java.util.EventObject
      • java.awt.AWTEvent
        • java.awt.event.HierarchyEvent
  • 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
      static long ACTION_EVENT_MASK
      The event mask for selecting action events.
      public static final long ACTION_EVENT_MASK
      The event mask for selecting action events.
      See Also:
      Constant Field Values
      Inherited member indicator ADJUSTMENT_EVENT_MASK Reveal DetailHide Detail
      static long ADJUSTMENT_EVENT_MASK
      The event mask for selecting adjustment events.
      public static final long ADJUSTMENT_EVENT_MASK
      The event mask for selecting adjustment events.
      See Also:
      Constant Field Values
      Ordinary member indicator ANCESTOR_MOVED Reveal DetailHide Detail
      static int ANCESTOR_MOVED
      The event id indicating an ancestor-Container was moved.
      public static final int ANCESTOR_MOVED
      The event id indicating an ancestor-Container was moved.
      See Also:
      Constant Field Values
      Ordinary member indicator ANCESTOR_RESIZED Reveal DetailHide Detail
      static int ANCESTOR_RESIZED
      The event id indicating an ancestor-Container was resized.
      public static final int ANCESTOR_RESIZED
      The event id indicating an ancestor-Container was resized.
      See Also:
      Constant Field Values
      Inherited member indicator COMPONENT_EVENT_MASK Reveal DetailHide Detail
      static long COMPONENT_EVENT_MASK
      The event mask for selecting component events.
      public static final long COMPONENT_EVENT_MASK
      The event mask for selecting component events.
      See Also:
      Constant Field Values
      Inherited member indicator consumed Reveal DetailHide Detail
      protected boolean consumed
      Controls whether or not the event is sent back down to the peer once the source has processed it - false means it's sent to the peer; true means it's not.
      protected boolean consumed
      Controls whether or not the event is sent back down to the peer once the source has processed it - false means it's sent to the peer; true means it's not. Semantic events always have a 'true' value since they were generated by the peer in response to a low-level event.
      See Also:
      AWTEvent.consume(), AWTEvent.isConsumed()
      Inherited member indicator CONTAINER_EVENT_MASK Reveal DetailHide Detail
      static long CONTAINER_EVENT_MASK
      The event mask for selecting container events.
      public static final long CONTAINER_EVENT_MASK
      The event mask for selecting container events.
      See Also:
      Constant Field Values
      Ordinary member indicator DISPLAYABILITY_CHANGED Reveal DetailHide Detail
      static int DISPLAYABILITY_CHANGED
      A change flag indicates that the HIERARCHY_CHANGED event was generated due to the changing of the hierarchy displayability.
      public static final int DISPLAYABILITY_CHANGED
      A change flag indicates that the HIERARCHY_CHANGED event was generated due to the changing of the hierarchy displayability. To discern the current displayability of the hierarchy, call the Component.isDisplayable method. Displayability changes occur in response to explicit or implicit calls of the Component.addNotify and Component.removeNotify methods.
      See Also:
      Component.isDisplayable(), Component.addNotify(), Component.removeNotify(), Constant Field Values
      Inherited member indicator FOCUS_EVENT_MASK Reveal DetailHide Detail
      static long FOCUS_EVENT_MASK
      The event mask for selecting focus events.
      public static final long FOCUS_EVENT_MASK
      The event mask for selecting focus events.
      See Also:
      Constant Field Values
      Inherited member indicator HIERARCHY_BOUNDS_EVENT_MASK Reveal DetailHide Detail
      static long HIERARCHY_BOUNDS_EVENT_MASK
      The event mask for selecting hierarchy bounds events.
      public static final long HIERARCHY_BOUNDS_EVENT_MASK
      The event mask for selecting hierarchy bounds events.
      See Also:
      Constant Field Values
      Ordinary member indicator HIERARCHY_CHANGED Reveal DetailHide Detail
      static int HIERARCHY_CHANGED
      The event id indicating that modification was made to the entire hierarchy tree.
      public static final int HIERARCHY_CHANGED
      The event id indicating that modification was made to the entire hierarchy tree.
      See Also:
      Constant Field Values
      Inherited member indicator HIERARCHY_EVENT_MASK Reveal DetailHide Detail
      static long HIERARCHY_EVENT_MASK
      The event mask for selecting hierarchy events.
      public static final long HIERARCHY_EVENT_MASK
      The event mask for selecting hierarchy events.
      See Also:
      Constant Field Values
      Ordinary member indicator HIERARCHY_FIRST Reveal DetailHide Detail
      static int HIERARCHY_FIRST
      Marks the first integer id for the range of hierarchy event ids.
      public static final int HIERARCHY_FIRST
      Marks the first integer id for the range of hierarchy event ids.
      See Also:
      Constant Field Values
      Ordinary member indicator HIERARCHY_LAST Reveal DetailHide Detail
      static int HIERARCHY_LAST
      Marks the last integer id for the range of ancestor event ids.
      public static final int HIERARCHY_LAST
      Marks the last integer id for the range of ancestor event ids.
      See Also:
      Constant Field Values
      Inherited member indicator id Reveal DetailHide Detail
      protected int id
      The event's id.
      protected int id
      The event's id.
      See Also:
      AWTEvent.getID(), AWTEvent.AWTEvent(java.lang.Object, int)
      Inherited member indicator INPUT_METHOD_EVENT_MASK Reveal DetailHide Detail
      static long INPUT_METHOD_EVENT_MASK
      The event mask for selecting input method events.
      public static final long INPUT_METHOD_EVENT_MASK
      The event mask for selecting input method events.
      See Also:
      Constant Field Values
      Inherited member indicator INVOCATION_EVENT_MASK Reveal DetailHide Detail
      static long INVOCATION_EVENT_MASK
      The event mask for selecting invocation events.
      public static final long INVOCATION_EVENT_MASK
      The event mask for selecting invocation events.
      See Also:
      Constant Field Values
      Inherited member indicator ITEM_EVENT_MASK Reveal DetailHide Detail
      static long ITEM_EVENT_MASK
      The event mask for selecting item events.
      public static final long ITEM_EVENT_MASK
      The event mask for selecting item events.
      See Also:
      Constant Field Values
      Inherited member indicator KEY_EVENT_MASK Reveal DetailHide Detail
      static long KEY_EVENT_MASK
      The event mask for selecting key events.
      public static final long KEY_EVENT_MASK
      The event mask for selecting key events.
      See Also:
      Constant Field Values
      Inherited member indicator MOUSE_EVENT_MASK Reveal DetailHide Detail
      static long MOUSE_EVENT_MASK
      The event mask for selecting mouse events.
      public static final long MOUSE_EVENT_MASK
      The event mask for selecting mouse events.
      See Also:
      Constant Field Values
      Inherited member indicator MOUSE_MOTION_EVENT_MASK Reveal DetailHide Detail
      static long MOUSE_MOTION_EVENT_MASK
      The event mask for selecting mouse motion events.
      public static final long MOUSE_MOTION_EVENT_MASK
      The event mask for selecting mouse motion events.
      See Also:
      Constant Field Values
      Inherited member indicator MOUSE_WHEEL_EVENT_MASK Reveal DetailHide Detail
      static long MOUSE_WHEEL_EVENT_MASK
      The event mask for selecting mouse wheel events.
      public static final long MOUSE_WHEEL_EVENT_MASK
      The event mask for selecting mouse wheel events.
      Since:
      1.4
      See Also:
      Constant Field Values
      Inherited member indicator PAINT_EVENT_MASK Reveal DetailHide Detail
      static long PAINT_EVENT_MASK
      The event mask for selecting paint events.
      public static final long PAINT_EVENT_MASK
      The event mask for selecting paint events.
      See Also:
      Constant Field Values
      Ordinary member indicator PARENT_CHANGED Reveal DetailHide Detail
      static int PARENT_CHANGED
      A change flag indicates that the HIERARCHY_CHANGED event was generated by a reparenting operation.
      public static final int PARENT_CHANGED
      A change flag indicates that the HIERARCHY_CHANGED event was generated by a reparenting operation.
      See Also:
      Constant Field Values
      Inherited member indicator RESERVED_ID_MAX Reveal DetailHide Detail
      static int RESERVED_ID_MAX
      The maximum value for reserved AWT event IDs.
      public static final int RESERVED_ID_MAX
      The maximum value for reserved AWT event IDs. Programs defining their own event IDs should use IDs greater than this value.
      See Also:
      Constant Field Values
      Ordinary member indicator SHOWING_CHANGED Reveal DetailHide Detail
      static int SHOWING_CHANGED
      A change flag indicates that the HIERARCHY_CHANGED event was generated due to the changing of the hierarchy showing state.
      public static final int SHOWING_CHANGED
      A change flag indicates that the HIERARCHY_CHANGED event was generated due to the changing of the hierarchy showing state. To discern the current showing state of the hierarchy, call the Component.isShowing method. Showing state changes occur when either the displayability or visibility of the hierarchy occurs. Visibility changes occur in response to explicit or implicit calls of the Component.show and Component.hide methods.
      See Also:
      Component.isShowing(), Component.addNotify(), Component.removeNotify(), Component.show(), Component.hide(), Constant Field Values
      Inherited member indicator source Reveal DetailHide Detail
      protected java.lang.Object source
      The object on which the Event initially occurred.
      protected transient java.lang.Object source
      The object on which the Event initially occurred.
      Inherited member indicator TEXT_EVENT_MASK Reveal DetailHide Detail
      static long TEXT_EVENT_MASK
      The event mask for selecting text events.
      public static final long TEXT_EVENT_MASK
      The event mask for selecting text events.
      See Also:
      Constant Field Values
      Inherited member indicator WINDOW_EVENT_MASK Reveal DetailHide Detail
      static long WINDOW_EVENT_MASK
      The event mask for selecting window events.
      public static final long WINDOW_EVENT_MASK
      The event mask for selecting window events.
      See Also:
      Constant Field Values
      Inherited member indicator WINDOW_FOCUS_EVENT_MASK Reveal DetailHide Detail
      static long WINDOW_FOCUS_EVENT_MASK
      The event mask for selecting window focus events.
      public static final long WINDOW_FOCUS_EVENT_MASK
      The event mask for selecting window focus events.
      Since:
      1.4
      See Also:
      Constant Field Values
      Inherited member indicator WINDOW_STATE_EVENT_MASK Reveal DetailHide Detail
      static long WINDOW_STATE_EVENT_MASK
      The event mask for selecting window state events.
      public static final long WINDOW_STATE_EVENT_MASK
      The event mask for selecting window state events.
      Since:
      1.4
      See Also:
      Constant Field Values
    • Constructors 
      Constructor and Description
      Ordinary member indicator HierarchyEvent Reveal DetailHide Detail
      HierarchyEvent(Component source, int id, Component changed, Container changedParent)
      Constructs an HierarchyEvent object to identify a change in the Component hierarchy.
      public HierarchyEvent(Component source, int id, Component changed, Container changedParent)
      Constructs an HierarchyEvent object to identify a change in the Component hierarchy.

      This method throws an IllegalArgumentException if source is null.

      Parameters:
      source - The Component object that originated the event
      id - An integer indicating the type of event. For information on allowable values, see the class description for HierarchyEvent
      changed - The Component at the top of the hierarchy which was changed
      changedParent - The parent of the changed component. This may be the parent before or after the change, depending on the type of change
      Throws:
      java.lang.IllegalArgumentException - if source is null
      See Also:
      EventObject.getSource(), AWTEvent.getID(), getChanged(), getChangedParent()
      Ordinary member indicator HierarchyEvent Reveal DetailHide Detail
      HierarchyEvent(Component source, int id, Component changed, Container changedParent, long changeFlags)
      Constructs an HierarchyEvent object to identify a change in the Component hierarchy.
      public HierarchyEvent(Component source, int id, Component changed, Container changedParent, long changeFlags)
      Constructs an HierarchyEvent object to identify a change in the Component hierarchy.

      This method throws an IllegalArgumentException if source is null.

      Parameters:
      source - The Component object that originated the event
      id - An integer indicating the type of event. For information on allowable values, see the class description for HierarchyEvent
      changed - The Component at the top of the hierarchy which was changed
      changedParent - The parent of the changed component. This may be the parent before or after the change, depending on the type of change
      changeFlags - A bitmask which indicates the type(s) of the HIERARCHY_CHANGED events represented in this event object. For information on allowable values, see the class description for HierarchyEvent
      Throws:
      java.lang.IllegalArgumentException - if source is null
      See Also:
      EventObject.getSource(), AWTEvent.getID(), getChanged(), getChangedParent(), getChangeFlags()
    • Methods 
      Modifier and Type Method and Description
      Inherited member indicator consume Reveal DetailHide Detail
      protected void consume()
      Consumes this event, if this event can be consumed.
      protected void consume()
      Description copied from class: AWTEvent
      Consumes this event, if this event can be consumed. Only low-level, system events can be consumed
      Ordinary member indicator getChanged Reveal DetailHide Detail
      Component getChanged()
      Returns the Component at the top of the hierarchy which was changed.
      public Component getChanged()
      Returns the Component at the top of the hierarchy which was changed.
      Returns:
      the changed Component
      Ordinary member indicator getChangedParent Reveal DetailHide Detail
      Container getChangedParent()
      Returns the parent of the Component returned by getChanged().
      public Container getChangedParent()
      Returns the parent of the Component returned by getChanged(). For a HIERARCHY_CHANGED event where the change was of type PARENT_CHANGED via a call to Container.add, the parent returned is the parent after the add operation. For a HIERARCHY_CHANGED event where the change was of type PARENT_CHANGED via a call to Container.remove, the parent returned is the parent before the remove operation. For all other events and types, the parent returned is the parent during the operation.
      Returns:
      the parent of the changed Component
      Ordinary member indicator getChangeFlags Reveal DetailHide Detail
      long getChangeFlags()
      Returns a bitmask which indicates the type(s) of HIERARCHY_CHANGED events represented in this event object.
      public long getChangeFlags()
      Returns a bitmask which indicates the type(s) of HIERARCHY_CHANGED events represented in this event object. The bits have been bitwise-ored together.
      Returns:
      the bitmask, or 0 if this is not an HIERARCHY_CHANGED event
      Ordinary member indicator getComponent Reveal DetailHide Detail
      Component getComponent()
      Returns the originator of the event.
      public Component getComponent()
      Returns the originator of the event.
      Returns:
      the Component object that originated the event, or null if the object is not a Component.
      Inherited member indicator getID Reveal DetailHide Detail
      int getID()
      Returns the event type.
      public int getID()
      Description copied from class: AWTEvent
      Returns the event type.
      Inherited member indicator getSource Reveal DetailHide Detail
      java.lang.Object getSource()
      The object on which the Event initially occurred.
      public java.lang.Object getSource()
      Description copied from class: java.util.EventObject
      The object on which the Event initially occurred.
      Returns:
      The object on which the Event initially occurred.
      Inherited member indicator isConsumed Reveal DetailHide Detail
      protected boolean isConsumed()
      Returns whether this event has been consumed.
      protected boolean isConsumed()
      Description copied from class: AWTEvent
      Returns whether this event has been consumed.
      Overridden member indicator paramString Reveal DetailHide Detail
      java.lang.String paramString()
      Returns a parameter string identifying this event.
      public java.lang.String paramString()
      Returns a parameter string identifying this event. This method is useful for event-logging and for debugging.
      Overrides:
      paramString in class AWTEvent
      Returns:
      a string identifying the event and its attributes
      Inherited member indicator setSource Reveal DetailHide Detail
      void setSource(java.lang.Object newSource)
      Retargets an event to a new source.
      public void setSource(java.lang.Object newSource)
      Description copied from class: AWTEvent
      Retargets an event to a new source. This method is typically used to retarget an event to a lightweight child Component of the original heavyweight source.

      This method is intended to be used only by event targeting subsystems, such as client-defined KeyboardFocusManagers. It is not for general client use.

      Parameters:
      newSource - the new Object to which the event should be dispatched
      Since:
      1.4
      Inherited member indicator toString Reveal DetailHide Detail
      java.lang.String toString()
      Returns a String representation of this object.
      public java.lang.String toString()
      Description copied from class: AWTEvent
      Returns a String representation of this object.
      Overrides:
      toString in class java.util.EventObject
      Returns:
      A a String representation of this EventObject.
      • 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