FileDocCategorySizeDatePackage
HierarchyEvent.javaAPI DocAndroid 1.5 API4589Wed May 06 22:41:54 BST 2009java.awt.event

HierarchyEvent

public class HierarchyEvent extends AWTEvent
This class is not supported in Android 1.0. It is merely provided to maintain interface compatibility with desktop Java implementations.
since
Android 1.0

Fields Summary
private static final long
serialVersionUID
public static final int
HIERARCHY_FIRST
public static final int
HIERARCHY_CHANGED
public static final int
ANCESTOR_MOVED
public static final int
ANCESTOR_RESIZED
public static final int
HIERARCHY_LAST
public static final int
PARENT_CHANGED
public static final int
DISPLAYABILITY_CHANGED
public static final int
SHOWING_CHANGED
private Component
changed
private long
changeFlag
Constructors Summary
public HierarchyEvent(Component source, int id, Component changed, Object changedParent, long changeFlags)


    //???AWT
    /*
    public HierarchyEvent(Component source, int id, Component changed, 
                          Container changedParent) {
        this(source, id, changed, changedParent, 0l);
    }
    */

    //???AWT
    /*
    public HierarchyEvent(Component source, int id, Component changed,
            Container changedParent, long changeFlags) {
        super(source, id);

        this.changed = changed;
        this.changedParent = changedParent;
        this.changeFlag = changeFlags;
    }
    */
    //???AWT: Fake constructor, should be as above.
          
                
        super(source, id);

//        this.changed = changed;
//        this.changedParent = changedParent;
//        this.changeFlag = changeFlags;
    
Methods Summary
public longgetChangeFlags()

        return changeFlag;
    
public java.awt.ComponentgetChanged()

        return changed;
    
public java.awt.ComponentgetComponent()

        return (Component) source;
    
public java.lang.StringparamString()

        /* The format is based on 1.5 release behavior 
         * which can be revealed by the following code:
         * 
         * HierarchyEvent e = new HierarchyEvent(new Button("Button"),
         *          HierarchyEvent.HIERARCHY_CHANGED,
         *          new Panel(), new Container());
         * System.out.println(e);
         */
        String paramString = null;

        switch (id) {
        case HIERARCHY_CHANGED:
            paramString = "HIERARCHY_CHANGED"; //$NON-NLS-1$
            break;
        case ANCESTOR_MOVED:
            paramString = "ANCESTOR_MOVED"; //$NON-NLS-1$
            break;
        case ANCESTOR_RESIZED:
            paramString = "ANCESTOR_RESIZED"; //$NON-NLS-1$
            break;
        default:
            paramString = "unknown type"; //$NON-NLS-1$
        }

        paramString += " ("; //$NON-NLS-1$

        if (id == HIERARCHY_CHANGED) {
            if ((changeFlag & PARENT_CHANGED) > 0) {
                paramString += "PARENT_CHANGED,"; //$NON-NLS-1$
            }
            if ((changeFlag & DISPLAYABILITY_CHANGED) > 0) {
                paramString += "DISPLAYABILITY_CHANGED,"; //$NON-NLS-1$
            }
            if ((changeFlag & SHOWING_CHANGED) > 0) {
                paramString += "SHOWING_CHANGED,"; //$NON-NLS-1$
            }
        }

        //???AWT
        /*
        return paramString + "changed=" + changed +  //$NON-NLS-1$
                ",changedParent=" + changedParent + ")"; //$NON-NLS-1$ //$NON-NLS-2$
        */
        return paramString;