/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
@test
@bug 6479820
@library ../../../regtesthelpers
@build Util
@author andrei dmitriev: area=awt.event
@run main SpuriousExitEnter_3
*/
/**
*
"There is a plain JFrame with JButton in it.",
"Let A area is the area inside JButton.",
"Let B area is the area inside JFrame but not inside JButton.",
"Let C area is the area outside JFrame.",
"Now check that the correct events and are in the correct number generates when you",
"move the pointer between those areas.",
" 1) Verify that the Enter and Exit events comes to JButton and JFrame when ",
" you move the pointer between A and B areas.",
" 2) Verify that the Enter and Exit events comes to JButton when you",
" move the pointer between A to C.",
" 3) Verify that the Enter and Exit events comes to JFrame when you",
" move the pointer between B to C.",
*/
public class SpuriousExitEnter_3 {
frameAdapter = new EnterExitAdapter(w);
w.setVisible(true);
//for moving from A outside: don't cross the A area. Move straight to the right.
Point centerC_1 = new Point(w.getLocationOnScreen().x + w.getWidth() + 20, //go right off the border
//for moving from B outside: don't cross the B area. Move straight to the bottom.
//A and B areas
Util.waitForIdle(r);
//A and C areas
Util.waitForIdle(r);
//B and C areas
Util.pointOnComp(w, r);
Util.waitForIdle(r);
w.setVisible(false);
Util.waitForIdle(r);
}
{
//LW case:
//HW case
}
Util.waitForIdle(r);
Util.waitForIdle(r);
Util.waitForIdle(r);
}
// component should get exactly entered of Entered events and exited of Exited events.
{
throw new RuntimeException(adapter.getTarget().getClass().getName()+": incorrect event number: Entered got: " +
+ exited);
}
}
}
}
return target;
}
public int getEnteredEventCount(){
return enteredEventCount;
}
public int getExitedEventCount(){
return exitedEventCount;
}
public void zeroCounters(){
enteredEventCount = 0;
exitedEventCount = 0;
}
}
exitedEventCount ++;
}
}