Package java.awt.event

Examples of java.awt.event.ComponentEvent


                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


     * Posts a component event to the AWT event queue.
     *
     * @param what
     */
    protected final void fireComponentEvent(int what) {
        JNodeToolkit.postToTarget(new ComponentEvent(targetComponent, what), targetComponent);
    }
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

            if (!fileDialog.isDisplayable()) {
                // make displayable together with owner
                fileDialog.addNotify();
            }
            ci.setVisibleFlag(fileDialog, true);
            postEvent(new ComponentEvent(fileDialog,
                                         ComponentEvent.COMPONENT_SHOWN));
            initOFN();
            boolean ok = false;
            Thread thread = Thread.currentThread();
            thread2fd.put(thread, fileDialog);

            switch (mode) {
            case FileDialog.LOAD:
                ok = (win32.GetOpenFileNameW(ofn) != 0);
                break;
            case FileDialog.SAVE:
                ok = (win32.GetSaveFileNameW(ofn) != 0);
                break;
            default:
                return;

            }
            setValues(ok);
            thread2fd.remove(thread);
            fd2win.remove(fileDialog);
            ci.setVisibleFlag(fileDialog, false);
            postEvent(new ComponentEvent(fileDialog,
                    ComponentEvent.COMPONENT_HIDDEN));
        }
    }
View Full Code Here

{

  public void test(TestHarness harness)
  {
    Button button = new Button();
    ComponentEvent event = new ComponentEvent(button,
                                              ComponentEvent.COMPONENT_MOVED);

    // Check that previous code produced incorrect string representation.
    harness.check(! event.paramString().equalsIgnoreCase(
              "COMPONENT_MOVED java.awt.Rectangle[x=0,y=0,width=0,height=0]"));
   
    // Check that current code produces correct string representation.
    harness.check(event.paramString(), "COMPONENT_MOVED (0,0 0x0)");
   
    // Check that correct string representation is returned when
    // an invalid event ID is given.
    event = new ComponentEvent(button, ComponentEvent.COMPONENT_MOVED + 1024);
    harness.check(event.paramString(), "unknown type");
  }
View Full Code Here

        }

        add("South", j);

        addComponentListener(this);
        componentResized(new ComponentEvent(log, 0));

        restoreInternalPositions();
        validate();
        setVisible(true);
View Full Code Here

            JFtp.mainFrame.setVisible(true);
            JFtp.mainFrame.toFront();

            if(listener != null)
            {
                listener.componentResized(new ComponentEvent(this, 0));
            }
        }
    }
View Full Code Here

            {
                this.dispose();

                if(listener != null)
                {
                    listener.componentResized(new ComponentEvent(this, 0));
                }

                JFtp.mainFrame.setVisible(true);
                JFtp.mainFrame.toFront();
            }
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.