// Check one dimension is selected
assertEquals("Wrong selection", 1, frame.home.getSelectedItems().size());
assertEquals("Selection doesn't contain the second dimension",
frame.home.getSelectedItems().get(0), orderedDimensionLines.get(1));
// Check the size of the created dimension lines
DimensionLine firstDimensionLine = orderedDimensionLines.get(0);
assertEqualsDimensionLine(520, 122, 520, 298, 0, firstDimensionLine);
assertEqualsDimensionLine(42, 310, 498, 310, 20, orderedDimensionLines.get(1));
// 16. Select the first dimension line
tester.click(frame.selectButton);
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(
firstDimensionLine.getXStart(), firstDimensionLine.getYStart(),
firstDimensionLine.getXEnd(), firstDimensionLine.getYEnd());
assertTrue("Incorrect length 182 " + firstDimensionLineLength,
Math.abs(182 - firstDimensionLineLength) < 1E-4);
// Press Shift key
tester.actionKeyPress(KeyEvent.VK_SHIFT);
// Check its coordinates while Shift key is pressed (with no magnetism)