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

ComponentEvent

public class ComponentEvent 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
COMPONENT_FIRST
public static final int
COMPONENT_LAST
public static final int
COMPONENT_MOVED
public static final int
COMPONENT_RESIZED
public static final int
COMPONENT_SHOWN
public static final int
COMPONENT_HIDDEN
Constructors Summary
public ComponentEvent(Component source, int id)


         
        super(source, id);
    
Methods Summary
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:
         * 
         * ComponentEvent e = new ComponentEvent(new Button("Button"), 
         *          ComponentEvent.COMPONENT_SHOWN);
         * System.out.println(e);
         */

        String idString = null;
        Component c = getComponent();

        switch (id) {
        case COMPONENT_MOVED:
            idString = "COMPONENT_MOVED"; //$NON-NLS-1$
            break;
        case COMPONENT_RESIZED:
            idString = "COMPONENT_RESIZED"; //$NON-NLS-1$
            break;
        case COMPONENT_SHOWN:
            return "COMPONENT_SHOWN"; //$NON-NLS-1$
        case COMPONENT_HIDDEN:
            return "COMPONENT_HIDDEN"; //$NON-NLS-1$
        default:
            return "unknown type"; //$NON-NLS-1$
        }

        return (idString + " (" + c.getX() + "," + c.getY() +  //$NON-NLS-1$ //$NON-NLS-2$
                " " + c.getWidth()+ "x" + c.getHeight() + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$