Examples of actionMousePress()


Examples of abbot.tester.JComponentTester.actionMousePress()

    selectedItems = frame.home.getSelectedItems();
    assertEquals("Wrong selected items count", 1, selectedItems.size());
    assertTrue("Piece of furniture not selected", selectedItems.contains(piece));
    // Drag mouse (4,4) pixels out of piece box with magnetism disabled
    Thread.sleep(1000); // Wait 1s to avoid double click
    tester.actionMousePress(planComponent, new ComponentLocation(new Point(
        pieceXPixel + depthPixel / 2, pieceYPixel - widthPixel / 2)));
    tester.actionKeyPress(KeyEvent.VK_SHIFT);
    tester.actionMouseMove(planComponent, new ComponentLocation(new Point(
        pieceXPixel + depthPixel / 2 + 4, pieceYPixel - widthPixel / 2 + 4)));
    tester.actionMouseRelease();
View Full Code Here

Examples of abbot.tester.JComponentTester.actionMousePress()

    widthPixel = Math.round((piece.getWidth()) * planComponent.getScale());
    depthPixel = Math.round((piece.getDepth()) * planComponent.getScale());
    tester.actionMouseMove(planComponent, new ComponentLocation(new Point(
        pieceXPixel + depthPixel / 2, pieceYPixel + widthPixel / 2)));
    Thread.sleep(1000);
    tester.actionMousePress(planComponent, new ComponentLocation(new Point(
        pieceXPixel + depthPixel / 2, pieceYPixel + widthPixel / 2)));
    // Drag mouse (2,4) pixels
    tester.actionMouseMove(planComponent, new ComponentLocation(new Point(
        pieceXPixel + depthPixel / 2 + 2, pieceYPixel + widthPixel / 2 + 4)));
    tester.actionMouseRelease();
View Full Code Here

Examples of abbot.tester.JComponentTester.actionMousePress()

        Math.round((pieceHeight - 4 / planComponent.getScale()) * 2) / 2, piece);

    // 13. Click at point (pieceXPixel - depthPixel / 2, pieceYPixel - widthPixel / 2)
    //     at elevation point of the piece
    float pieceElevation = piece.getElevation();
    tester.actionMousePress(planComponent, new ComponentLocation(new Point(
        pieceXPixel - depthPixel / 2, pieceYPixel - widthPixel / 2)));
    // Drag mouse (2,-4) pixels
    tester.actionMouseMove(planComponent, new ComponentLocation(new Point(
        pieceXPixel - depthPixel / 2 + 2, pieceYPixel - widthPixel / 2 - 4)));
    tester.actionMouseRelease();
View Full Code Here

Examples of abbot.tester.JComponentTester.actionMousePress()

    tester.actionClick(planComponent, 280, 90);
    assertEquals("Wrong selection", 1, frame.home.getSelectedItems().size());
    assertEquals("Selection doesn't contain the first dimension",
        frame.home.getSelectedItems().get(0), firstDimensionLine);
    // Move its end point to (330, 167)
    tester.actionMousePress(planComponent, new ComponentLocation(new Point(280, 167)));
    tester.actionMouseMove(planComponent, new ComponentLocation(new Point(320, 167)));
    // Check its coordinates while Shift key isn't pressed (with magnetism)
    assertEqualsDimensionLine(520, 122, 567.105f, 297.7985f, 0, firstDimensionLine);
    // Check its length with magnetism
    float firstDimensionLineLength = (float)Point2D.distance(
View Full Code Here

Examples of abbot.tester.JComponentTester.actionMousePress()

        frame.home.getSelectedItems().get(0), firstDimensionLine);
    // Check the coordinates of the first dimension
    assertEqualsDimensionLine(520, 122, 567.105f, 297.7985f, 0, firstDimensionLine);
   
    // 19. Select two walls, the piece and a dimension line
    tester.actionMousePress(planComponent, new ComponentLocation(new Point(20, 100)));
    tester.actionMouseMove(planComponent, new ComponentLocation(new Point(200, 200)));
    tester.actionMouseRelease();
    // Check selection
    selectedItems = frame.home.getSelectedItems();
    assertEquals("Selection doesn't contain 4 items", 4, selectedItems.size());   
View Full Code Here

Examples of abbot.tester.JComponentTester.actionMousePress()

    HomePieceOfFurniture selectedPiece = Home.getFurnitureSubList(selectedItems).get(0);
    pieceX = selectedPiece.getX();
    pieceY = selectedPiece.getY();
    // Start items duplication
    tester.actionKeyPress(OperatingSystem.isMacOSX() ? KeyEvent.VK_ALT : KeyEvent.VK_CONTROL);
    tester.actionMousePress(planComponent, new ComponentLocation(new Point(50, 170)));
    tester.actionMouseMove(planComponent, new ComponentLocation(new Point(51, 170)));
    // Check selection changed
    assertFalse("Selection didn't change", selectedItems.equals(frame.home.getSelectedItems()));
    assertEquals("Selection doesn't contain 4 items", 4, frame.home.getSelectedItems().size());   
    assertEquals("No new wall", wallsCount + 2, frame.home.getWalls().size());   
View Full Code Here

Examples of abbot.tester.JComponentTester.actionMousePress()

    assertEquals("New pieces created", furnitureCount, frame.home.getFurniture().size());   
    assertEquals("New dimension lines created", dimensionLinesCount, frame.home.getDimensionLines().size());
    tester.actionMouseRelease();
   
    // 22. Duplicate items
    tester.actionMousePress(planComponent, new ComponentLocation(new Point(50, 170)));
    tester.actionMouseMove(planComponent, new ComponentLocation(new Point(50, 190)));
    tester.actionMouseRelease();
    tester.actionKeyRelease(OperatingSystem.isMacOSX() ? KeyEvent.VK_ALT : KeyEvent.VK_CONTROL);
    // Check the duplicated piece moved and the original piece didn't move
    List<Selectable> movedItems = frame.home.getSelectedItems();
View Full Code Here

Examples of abbot.tester.JComponentTester.actionMousePress()

    assertWallsAreJoined(wall1, wall4, wall3);
   
    // 6. Use SELECTION mode
    tester.click(frame.modeButton);
    // Drag and drop cursor from (200, 100) to (300, 180)
    tester.actionMousePress(planComponent,
        new ComponentLocation(new Point(200, 100)));
    tester.actionMouseMove(planComponent,
        new ComponentLocation(new Point(300, 180)));
    tester.actionMouseRelease();
    // Check the selected walls are the second and third ones
View Full Code Here

Examples of abbot.tester.JComponentTester.actionMousePress()

    tester.actionKeyRelease(KeyEvent.VK_SHIFT);
    // Check the second wall was removed from selection
    assertSelectionContains(frame.home, wall3);

     // 9. Drag cursor from (50, 30) to (50, 50)
    tester.actionMousePress(planComponent,
        new ComponentLocation(new Point(50, 30)));
    tester.actionMouseMove(planComponent,
        new ComponentLocation(new Point(50, 50)));
    // Check first wall is selected and that it moved
    assertSelectionContains(frame.home, wall1);
View Full Code Here

Examples of abbot.tester.JComponentTester.actionMousePress()

   
    // 13. Select first wall
    tester.actionClick(planComponent, 100, 100); // Give focus first
    tester.actionClick(planComponent, 40, 30);
    // Drag cursor from (30, 30) to (50, 50) with shift key pressed
    tester.actionMousePress(planComponent,
        new ComponentLocation(new Point(30, 30)));
    tester.actionMouseMove(planComponent,
        new ComponentLocation(new Point(50, 50)));
    tester.actionKeyPress(KeyEvent.VK_SHIFT);
    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.