Examples of actionKeyStroke()


Examples of abbot.tester.JComponentTester.actionKeyStroke()

    tester.actionKeyString("250"); // x start
    tester.actionKeyStroke(KeyEvent.VK_ENTER);
    tester.actionKeyString("200"); // length
    tester.actionKeyStroke(KeyEvent.VK_TAB);
    tester.actionKeyString("45"); // angle
    tester.actionKeyStroke(KeyEvent.VK_ENTER);
    tester.actionKeyString("50"); // offset
    tester.actionKeyStroke(KeyEvent.VK_ENTER);
   

    Collection<DimensionLine> dimensionLines = frame.home.getDimensionLines();
View Full Code Here

Examples of abbot.tester.JComponentTester.actionKeyStroke()

    tester.actionKeyString("200"); // length
    tester.actionKeyStroke(KeyEvent.VK_TAB);
    tester.actionKeyString("45"); // angle
    tester.actionKeyStroke(KeyEvent.VK_ENTER);
    tester.actionKeyString("50"); // offset
    tester.actionKeyStroke(KeyEvent.VK_ENTER);
   

    Collection<DimensionLine> dimensionLines = frame.home.getDimensionLines();
    assertEquals("Incorrect dimension lines count", 1, dimensionLines.size());
    DimensionLine dimensionLine = dimensionLines.iterator().next();
View Full Code Here

Examples of abbot.tester.JComponentTester.actionKeyStroke()

    // Check observer camera is selected
    assertEquals("Wrong selected items count", 1, home.getSelectedItems().size());
    assertTrue("Camera isn't selected", home.getSelectedItems().contains(home.getCamera()));
   
    // 7. Move observer camera at right and down
    tester.actionKeyStroke(KeyEvent.VK_RIGHT);
    tester.actionKeyStroke(KeyEvent.VK_DOWN);
    // Check camera location and angles
    assertCoordinatesAndAnglesEqualCameraLocationAndAngles(100 + 1 / planComponent.getScale(),
        100 + 1 / planComponent.getScale(), 170,
        3 * (float)Math.PI / 4, (float)Math.PI / 16, home.getCamera());
View Full Code Here

Examples of abbot.tester.JComponentTester.actionKeyStroke()

    assertEquals("Wrong selected items count", 1, home.getSelectedItems().size());
    assertTrue("Camera isn't selected", home.getSelectedItems().contains(home.getCamera()));
   
    // 7. Move observer camera at right and down
    tester.actionKeyStroke(KeyEvent.VK_RIGHT);
    tester.actionKeyStroke(KeyEvent.VK_DOWN);
    // Check camera location and angles
    assertCoordinatesAndAnglesEqualCameraLocationAndAngles(100 + 1 / planComponent.getScale(),
        100 + 1 / planComponent.getScale(), 170,
        3 * (float)Math.PI / 4, (float)Math.PI / 16, home.getCamera());
   
View Full Code Here

Examples of abbot.tester.JComponentTester.actionKeyStroke()

    tester.actionKeyPress(KeyEvent.VK_SHIFT);
    // Check piece angle is different from 0�
    assertFalse("Piece orientation shouldn't be magnetized",
        Math.abs(piece.getAngle()) < 1E-10);
    tester.actionKeyRelease(KeyEvent.VK_SHIFT);   
    tester.actionKeyStroke(planComponent, KeyEvent.VK_ESCAPE);
    tester.actionMouseRelease();
    // Check piece angle is 3 * PI / 2 (=-90�)
    assertLocationAndOrientationEqualPiece(
        pieceX, pieceY, (float)Math.PI * 3 / 2, piece);
   
View Full Code Here

Examples of abbot.tester.JComponentTester.actionKeyStroke()

    movedPiece = Home.getFurnitureSubList(frame.home.getSelectedItems()).get(0);
    assertLocationAndOrientationEqualPiece(pieceX + 20 / planComponent.getScale(),
        pieceY + 30 / planComponent.getScale(), selectedPiece.getAngle(), movedPiece);
    assertLocationAndOrientationEqualPiece(pieceX, pieceY, selectedPiece.getAngle(), selectedPiece);
    // Press Escape key
    tester.actionKeyStroke(KeyEvent.VK_ESCAPE);
    // Check no items where duplicated
    assertTrue("Original items not selected", selectedItems.equals(frame.home.getSelectedItems()));
    assertLocationAndOrientationEqualPiece(pieceX, pieceY, selectedPiece.getAngle(), selectedPiece);
    assertEquals("New walls created", wallsCount, frame.home.getWalls().size());   
    assertEquals("New pieces created", furnitureCount, frame.home.getFurniture().size());   
View Full Code Here

Examples of abbot.tester.JComponentTester.actionKeyStroke()

        Math.abs(200 - piece.getX() + piece.getWidth() / 2) < 1E-5);
    assertTrue("Incorrect Y " + piece.getY(),
        Math.abs(200 - piece.getY() + piece.getDepth() / 2) < 1E-5);

    // 4.  Transfer focus to plan view with TAB keys
    tester.actionKeyStroke(KeyEvent.VK_TAB);
    tester.actionKeyStroke(KeyEvent.VK_TAB);
    // Check plan component has focus
    assertTrue("Plan doesn't have the focus", planComponent.isFocusOwner());
    // Check Cut, Copy and Delete actions are enabled in plan view
    assertActionsEnabled(controller, true, true, false, true);
View Full Code Here

Examples of abbot.tester.JComponentTester.actionKeyStroke()

    assertTrue("Incorrect Y " + piece.getY(),
        Math.abs(200 - piece.getY() + piece.getDepth() / 2) < 1E-5);

    // 4.  Transfer focus to plan view with TAB keys
    tester.actionKeyStroke(KeyEvent.VK_TAB);
    tester.actionKeyStroke(KeyEvent.VK_TAB);
    // Check plan component has focus
    assertTrue("Plan doesn't have the focus", planComponent.isFocusOwner());
    // Check Cut, Copy and Delete actions are enabled in plan view
    assertActionsEnabled(controller, true, true, false, true);
View Full Code Here

Examples of abbot.tester.JComponentTester.actionKeyStroke()

    assertEquals("Wrong piece count in home", 1, home.getFurniture().size());
    assertEquals("Wrong wall count in home", 1, home.getWalls().size());
    assertEquals("Wrong dimension count in home", 1, home.getDimensionLines().size());

    // 9. Transfer focus to furniture table
    tester.actionKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_MASK);
    // Check furniture table has focus
    assertTrue("Table doesn't have the focus", furnitureTable.isFocusOwner());
    // Delete selection
    runAction(tester, controller, HomePane.ActionType.DELETE);
    // Check home contains no piece, one wall and one dimension
View Full Code Here

Examples of abbot.tester.JComponentTester.actionKeyStroke()

    // Edit values
    tester.waitForIdle();
    assertTrue("Name text field doesn't have focus", nameTextField.hasFocus());
    // Check text field is selected when it gains focus
    assertEquals("Name text isn't selected", nameTextField.getText(), nameTextField.getSelectedText());
    tester.actionKeyStroke(KeyEvent.VK_TAB);
    tester.actionKeyStroke(KeyEvent.VK_TAB);
    tester.waitForIdle();
    assertTrue("X field doesn't have focus", ((DefaultEditor)xSpinner.getEditor()).getTextField().hasFocus());
    tester.actionKeyStroke(KeyEvent.VK_TAB);
    tester.waitForIdle();
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.