當前位置: 首頁>>代碼示例>>Java>>正文


Java ComponentListener.wait方法代碼示例

本文整理匯總了Java中java.awt.event.ComponentListener.wait方法的典型用法代碼示例。如果您正苦於以下問題:Java ComponentListener.wait方法的具體用法?Java ComponentListener.wait怎麽用?Java ComponentListener.wait使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.event.ComponentListener的用法示例。


在下文中一共展示了ComponentListener.wait方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testAncestorAddedEventWhenComponentAdded

import java.awt.event.ComponentListener; //導入方法依賴的package包/類
public void testAncestorAddedEventWhenComponentAdded() throws Exception {
    frame = createVisibleFrameWithAncestor();
    ancestor.remove(component);
    waitForIdle();
    listener.reset();
    ComponentListener compListener = addComponentListener(component);
    ancestor.add(component);
    waitForIdle();
    synchronized (compListener) {
        compListener.wait(1000);
    }
    assertTrue(listener.getNumEvents() >= 1);
    performChecksInQueue(component, ancestor, AncestorEvent.ANCESTOR_ADDED);
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:15,代碼來源:AncestorEventTest.java

示例2: testAncestorMovedEventWhenAncestorInvisibleAncestorMoved

import java.awt.event.ComponentListener; //導入方法依賴的package包/類
public void testAncestorMovedEventWhenAncestorInvisibleAncestorMoved() throws Exception {
    frame = createVisibleFrameWithAncestor();
    ancestor.setBounds(10, 10, 10, 10);
    ancestor.setVisible(false);
    waitForIdle();
    listener.reset();
    ComponentListener compListener = addComponentListener(component);
    ancestor.setBounds(20, 20, 20, 20);
    waitForIdle();
    synchronized (compListener) {
        compListener.wait(1000);
    }
    assertTrue(listener.getNumEvents() >= 1);
    performChecksInQueue(ancestor, frame.getContentPane(), AncestorEvent.ANCESTOR_MOVED);
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:16,代碼來源:AncestorEventTest.java

示例3: testAncestorMovedEventWhenComponentInvisibleAncestorMoved

import java.awt.event.ComponentListener; //導入方法依賴的package包/類
public void testAncestorMovedEventWhenComponentInvisibleAncestorMoved() throws Exception {
    frame = createVisibleFrameWithAncestor();
    ancestor.setBounds(10, 10, 10, 10);
    component.setVisible(false);
    waitForIdle();
    listener.reset();
    ComponentListener compListener = addComponentListener(component);
    ancestor.setBounds(20, 20, 20, 20);
    waitForIdle();
    synchronized (compListener) {
        compListener.wait(1000);
    }
    assertEquals(0, listener.getNumEvents());
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:15,代碼來源:AncestorEventTest.java

示例4: testAncestorMovedEventWhenAncestorInvisibleComponentMoved

import java.awt.event.ComponentListener; //導入方法依賴的package包/類
public void testAncestorMovedEventWhenAncestorInvisibleComponentMoved() throws Exception {
    frame = createVisibleFrameWithAncestor();
    component.setBounds(10, 10, 10, 10);
    ancestor.setVisible(false);
    waitForIdle();
    listener.reset();
    ComponentListener compListener = addComponentListener(component);
    component.setBounds(20, 20, 20, 20);
    waitForIdle();
    synchronized (compListener) {
        compListener.wait(1000);
    }
    assertTrue(listener.getNumEvents() >= 1);
    performChecksInQueue(component, ancestor, AncestorEvent.ANCESTOR_MOVED);
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:16,代碼來源:AncestorEventTest.java

示例5: testAncestorMovedEventWhenComponentInvisibleComponentMoved

import java.awt.event.ComponentListener; //導入方法依賴的package包/類
public void testAncestorMovedEventWhenComponentInvisibleComponentMoved() throws Exception {
    frame = createVisibleFrameWithAncestor();
    component.setBounds(10, 10, 10, 10);
    component.setVisible(false);
    waitForIdle();
    listener.reset();
    ComponentListener compListener = addComponentListener(component);
    component.setBounds(20, 20, 20, 20);
    waitForIdle();
    synchronized (compListener) {
        compListener.wait(1000);
    }
    assertEquals(1, listener.getNumEvents());
    performChecks(component, ancestor, AncestorEvent.ANCESTOR_MOVED);
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:16,代碼來源:AncestorEventTest.java

示例6: testAncestorMovedEventWhenAncestorMoved

import java.awt.event.ComponentListener; //導入方法依賴的package包/類
public void testAncestorMovedEventWhenAncestorMoved() throws Exception {
    frame = createVisibleFrameWithAncestor();
    ancestor.setBounds(10, 10, 10, 10);
    waitForIdle();
    listener.reset();
    ComponentListener compListener = addComponentListener(component);
    ancestor.setBounds(20, 20, 20, 20);
    waitForIdle();
    synchronized (compListener) {
        compListener.wait(1000);
    }
    assertTrue(listener.getNumEvents() >= 1);
    performChecksInQueue(ancestor, frame.getContentPane(), AncestorEvent.ANCESTOR_MOVED);
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:15,代碼來源:AncestorEventTest.java

示例7: testAncestorMovedEventWhenComponentMoved

import java.awt.event.ComponentListener; //導入方法依賴的package包/類
public void testAncestorMovedEventWhenComponentMoved() throws Exception {
    component.setSize(200, 200);
    waitForIdle();
    assertEquals(0, listener.getNumEvents());
    ComponentListener compListener = addComponentListener(component);
    component.setLocation(20, 20);
    waitForIdle();
    synchronized (compListener) {
        compListener.wait(1000);
    }
    assertEquals(1, listener.getNumEvents());
    performChecks(component, ancestor, AncestorEvent.ANCESTOR_MOVED);
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:14,代碼來源:AncestorEventTest.java


注:本文中的java.awt.event.ComponentListener.wait方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。