Package java.awt

Examples of java.awt.KeyEventDispatcher.dispatchKeyEvent()


        KeyEvent.CHAR_UNDEFINED);
    KeyEvent ctrlUp = new KeyEvent(p, KeyEvent.KEY_RELEASED, System.currentTimeMillis(), 0, KeyEvent.VK_CONTROL,
        KeyEvent.CHAR_UNDEFINED);
   
    // Pressing when mouse is not over should do nothing
    d.dispatchKeyEvent(ctrlDown)
    Mockito.verifyZeroInteractions(controlManager);
   
    // Now, try it with mouse in the plot area
    Mockito.when(listener.isMouseOutsideOfPlotArea()).thenReturn(false);   
   
View Full Code Here


   
    // Now, try it with mouse in the plot area
    Mockito.when(listener.isMouseOutsideOfPlotArea()).thenReturn(false);   
   
    // Now, it should inform the control manager of the key press
    d.dispatchKeyEvent(ctrlDown);
    Mockito.verify(controlManager, Mockito.atLeastOnce()).informKeyState(KeyEvent.VK_CONTROL, true);
    d.dispatchKeyEvent(ctrlUp);
    Mockito.verify(controlManager, Mockito.atLeastOnce()).informKeyState(KeyEvent.VK_CONTROL, false);
  }
 
View Full Code Here

    Mockito.when(listener.isMouseOutsideOfPlotArea()).thenReturn(false);   
   
    // Now, it should inform the control manager of the key press
    d.dispatchKeyEvent(ctrlDown);
    Mockito.verify(controlManager, Mockito.atLeastOnce()).informKeyState(KeyEvent.VK_CONTROL, true);
    d.dispatchKeyEvent(ctrlUp);
    Mockito.verify(controlManager, Mockito.atLeastOnce()).informKeyState(KeyEvent.VK_CONTROL, false);
  }
 
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.