本文整理汇总了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);
}
示例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);
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}