当前位置: 首页>>代码示例>>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;未经允许,请勿转载。