}
public void testIsLeftMiddleRightMouseButton() {
JComponent panel = new JPanel();
panel.setPreferredSize(new Dimension(100, 100));
MouseEvent button1DownEvent = new MouseEvent(panel, 100, 0,
InputEvent.BUTTON1_DOWN_MASK, 50, 50, 1, false);
MouseEvent button1PressedEvent = new MouseEvent(panel, MouseEvent.MOUSE_PRESSED, 0, 0,
50, 50, 1, false, MouseEvent.BUTTON1);
MouseEvent button1Released = new MouseEvent(panel, MouseEvent.MOUSE_RELEASED, 0, 0, 50,
50, 1, false, MouseEvent.BUTTON1);
MouseEvent button1Clicked = new MouseEvent(panel, MouseEvent.MOUSE_CLICKED, 0, 0, 50,
50, 1, false, MouseEvent.BUTTON1);
MouseEvent button1DraggedEvent = new MouseEvent(panel, MouseEvent.MOUSE_DRAGGED, 0, 0,
50, 50, 1, false, MouseEvent.BUTTON1);
MouseEvent button2DownEvent = new MouseEvent(panel, 100, 0,
InputEvent.BUTTON2_DOWN_MASK, 50, 50, 1, false);
MouseEvent button2PressedEvent = new MouseEvent(panel, MouseEvent.MOUSE_PRESSED, 0, 0,
50, 50, 1, false, MouseEvent.BUTTON2);
MouseEvent button2Released = new MouseEvent(panel, MouseEvent.MOUSE_RELEASED, 0, 0, 50,
50, 1, false, MouseEvent.BUTTON2);
MouseEvent button2Clicked = new MouseEvent(panel, MouseEvent.MOUSE_CLICKED, 0, 0, 50,
50, 1, false, MouseEvent.BUTTON2);
MouseEvent button2DraggedEvent = new MouseEvent(panel, MouseEvent.MOUSE_DRAGGED, 0, 0,
50, 50, 1, false, MouseEvent.BUTTON2);
MouseEvent button3DownEvent = new MouseEvent(panel, 100, 0,
InputEvent.BUTTON3_DOWN_MASK, 50, 50, 1, false);
MouseEvent button3PressedEvent = new MouseEvent(panel, MouseEvent.MOUSE_PRESSED, 0, 0,
50, 50, 1, false, MouseEvent.BUTTON3);
MouseEvent button3Released = new MouseEvent(panel, MouseEvent.MOUSE_RELEASED, 0, 0, 50,
50, 1, false, MouseEvent.BUTTON3);
MouseEvent button3Clicked = new MouseEvent(panel, MouseEvent.MOUSE_CLICKED, 0, 0, 50,
50, 1, false, MouseEvent.BUTTON3);
MouseEvent button3DraggedEvent = new MouseEvent(panel, MouseEvent.MOUSE_DRAGGED, 0, 0,
50, 50, 1, false, MouseEvent.BUTTON3);
assertTrue(SwingUtilities.isLeftMouseButton(button1DownEvent));
assertFalse(SwingUtilities.isLeftMouseButton(button2DownEvent));
assertFalse(SwingUtilities.isLeftMouseButton(button3DownEvent));
assertTrue(SwingUtilities.isLeftMouseButton(button1PressedEvent));