Package java.awt.event

Examples of java.awt.event.ComponentEvent


        assertNull(handler.scrollBar);
        assertSame(pane, handler.getScrollPane());
        ui.getPreferredSize(tree);
        assertTrue(ui.validCachedPreferredSize);
        handler.getScrollPane().getVerticalScrollBar().setValueIsAdjusting(true);
        handler.componentMoved(new ComponentEvent(tree, ComponentEvent.COMPONENT_MOVED));
        assertNotNull(handler.timer);
        assertSame(handler.scrollBar, pane.getVerticalScrollBar());
        assertEquals(200, handler.timer.getDelay());
        assertSame(handler, handler.timer.getActionListeners()[0]);
        assertTrue(handler.timer.isRunning());
View Full Code Here


  /** {@inheritDoc} */
  @RunsInEDT
  public void eventDispatched(AWTEvent e) {
    if (!(e instanceof ComponentEvent)) return;
    ComponentEvent event = (ComponentEvent) e;
    Component component = event.getComponent();
    // This is our sole means of accessing other AppContexts (if running within an applet). We look for window events
    // beyond OPENED in order to catch windows that have already opened by the time we start listening but which are not
    // in the Frame.getFrames list (i.e. they are on a different context). Specifically watch for COMPONENT_SHOWN on
    // applets, since we may not get frame events for them.
    if (!(component instanceof Applet) && !(component instanceof Window)) return;
View Full Code Here

                handleException(e);
            }
        }
        if (jgvtListeners != null) {
            Iterator iter = jgvtListeners.iterator();
            ComponentEvent ce = new ComponentEvent
                (this, JGVTComponentListener.COMPONENT_TRANSFORM_CHANGED);
            while (iter.hasNext()) {
                JGVTComponentListener l = (JGVTComponentListener)iter.next();
                l.componentTransformChanged(ce);
            }
View Full Code Here

                handleException(e);
            }
        }
        if (jgvtListeners != null) {
            Iterator iter = jgvtListeners.iterator();
            ComponentEvent ce = new ComponentEvent
                (this, JGVTComponentListener.COMPONENT_TRANSFORM_CHANGED);
            while (iter.hasNext()) {
                JGVTComponentListener l = (JGVTComponentListener)iter.next();
                l.componentTransformChanged(ce);
            }
View Full Code Here

            }
            prepare4HierarchyChange();
            visible = false;
            moveFocusOnHide();
            behaviour.setVisible(false);
            postEvent(new ComponentEvent(this, ComponentEvent.COMPONENT_HIDDEN));
            finishHierarchyChange(this, parent, 0);
            notifyInputMethod(null);
            invalidateRealParent();
        } finally {
            toolkit.unlockAWT();
View Full Code Here

        int oldH = this.h;
        setBoundsFields(x, y, w, h, bMask);
        // Moved
        if ((oldX != this.x) || (oldY != this.y)) {
            invalidateRealParent();
            postEvent(new ComponentEvent(this, ComponentEvent.COMPONENT_MOVED));
            spreadHierarchyBoundsEvents(this, HierarchyEvent.ANCESTOR_MOVED);
        }
        // Resized
        if ((oldW != this.w) || (oldH != this.h)) {
            invalidate();
            postEvent(new ComponentEvent(this, ComponentEvent.COMPONENT_RESIZED));
            spreadHierarchyBoundsEvents(this, HierarchyEvent.ANCESTOR_RESIZED);
        }
        if (updateBehavior) {
            behaviour.setBounds(this.x, this.y, this.w, this.h, bMask);
        }
View Full Code Here

            prepare4HierarchyChange();
            mapToDisplay(true);
            validate();
            visible = true;
            behaviour.setVisible(true);
            postEvent(new ComponentEvent(this, ComponentEvent.COMPONENT_SHOWN));
            finishHierarchyChange(this, parent, 0);
            notifyInputMethod(new Rectangle(x, y, w, h));
            invalidateRealParent();
        } finally {
            toolkit.unlockAWT();
View Full Code Here

     * pick up key press or return ' '
     */
    public char getKeyPressed(Object raw) {
     
      try{
        ComponentEvent ex=(ComponentEvent)raw;

        if (ex instanceof KeyEvent)
            return ((KeyEvent) ex).getKeyChar();
        else
            return ' ';
View Full Code Here

    // NOTE: This method may be called by privileged threads.
    //       DO NOT INVOKE CLIENT CODE ON THIS THREAD!
    public void handleResize(Rectangle bounds) {
        ComponentAccessor.setWidth((Component)target, bounds.width);
        ComponentAccessor.setHeight((Component)target, bounds.height);
        postEvent(new ComponentEvent(target, ComponentEvent.COMPONENT_RESIZED));
    }
View Full Code Here

    public void handleMoved(WindowDimensions dims) {
        Point loc = dims.getLocation();
        ComponentAccessor.setX((Component)target, loc.x);
        ComponentAccessor.setY((Component)target, loc.y);
        postEvent(new ComponentEvent(target, ComponentEvent.COMPONENT_MOVED));
    }
View Full Code Here

TOP

Related Classes of java.awt.event.ComponentEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.