本文整理匯總了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);
}