MouseModifiersUnitTest_Extra.java revision 870
870N/A static int [] mouseButtons;
870N/A static int [] mouseButtonDownMasks;
870N/A //an arrays representing a modifiersEx of extra mouse buttons while using ALT/CTRL/SHIFT or none of them
870N/A static int [] modifiersExStandard;
870N/A static int [] modifiersExStandardSHIFT;
870N/A static int [] modifiersExStandardCTRL;
870N/A static int [] modifiersExStandardALT;
870N/A // final static int [] mouseButtons = new int [] {MouseEvent.BUTTON1_MASK, MouseEvent.BUTTON2_MASK, MouseEvent.BUTTON3_MASK};
870N/A dumpValues(button, modifiers, modifiersStandard, modifiersEx, curStandardExModifiers[index]);
870N/A// System.out.println(">>>>>>>>>>>>>>> Pressed. modifiersEx "+modifiersEx +" : "+!= curStandardExModifiers");
870N/A switch (testModifier){
870N/A MessageLogger.reportError("Test failed : Released/Clicked. extModifiers = " +h.get("extModifiers")+" instead of : "+ethalon);
870N/A switch (testModifier){
870N/A MessageLogger.reportError("Test failed : Pressed. extModifiers = " +h.get("extModifiers")+" instead of : "+ethalon);
870N/A MessageLogger.reportError("Test failed : checkButton. button in paramString() doesn't equal to button being pressed.");
870N/A dumpValues(button, modifiers, modifiersStandard, modifiersEx, curStandardExModifiers[index]);
870N/A dumpValues(button, modifiers, modifiersStandard, modifiersEx, curStandardExModifiers[index]);
870N/A int [] curStandardExModifiers;
870N/A switch (testModifier){
870N/A return curStandardExModifiers;
870N/A setVisible(true);
870N/A switch (testModifier){
870N/A robot.mouseMove(getLocationOnScreen().x + getWidth()/2, getLocationOnScreen().y + getHeight()/2);
870N/A robot.mouseMove(getLocationOnScreen().x + getWidth()/2, getLocationOnScreen().y + getHeight()/2);
870N/A robot.mouseMove(getLocationOnScreen().x + getWidth()/2, getLocationOnScreen().y + getHeight()/2);
870N/A robot.mouseMove(getLocationOnScreen().x + getWidth()/2, getLocationOnScreen().y + getHeight()/2);
870N/A //**************************************************************************************************
870N/A public static void dumpValues(int button, int modifiers, int modifiersStandard, int modifiersEx, int modifiersExStandard){
870N/A System.out.println("Button = "+button + "Modifiers = "+ modifiers + "standard = "+ modifiersStandard);
870N/A System.out.println("Button = "+button + "ModifiersEx = "+ modifiersEx + "standardEx = "+ modifiersExStandard);
870N/A public static void initAdapters(){
870N/A // So we need to get the number of extra buttons on the mouse: "MouseInfo.getNumberOfButtons() - 3"
870N/A // and multyply on 3 because each button will generate three events : PRESS, RELEASE and CLICK.
870N/A System.out.println("There are less then 4 buttons on the mouse. The test may not be accomplished. Skipping.");
870N/Aclass MessageLogger{