| | |
| | | List<Obstacledge.Obstacle> allObstacles = loadObstacles(); |
| | | String allObstaclesCoords = buildAllObstaclesCoordinates(allObstacles); |
| | | |
| | | setVisible(false); |
| | | // 关闭障碍物管理页面 |
| | | dispose(); |
| | | |
| | | SwingUtilities.invokeLater(() -> { |
| | | Shouye shouye = Shouye.getInstance(); |
| | | if (shouye != null) { |
| | | // 传递回调以重新打开障碍物管理页面 |
| | | shouye.startMowingPathPreview( |
| | | landNumber, |
| | | landName, |
| | | boundary, |
| | | allObstaclesCoords, |
| | | null, |
| | | () -> SwingUtilities.invokeLater(() -> setVisible(true)) |
| | | () -> SwingUtilities.invokeLater(() -> { |
| | | // 重新打开障碍物管理页面 |
| | | Window owner = SwingUtilities.getWindowAncestor(shouye); |
| | | ObstacleManagementPage newPage = new ObstacleManagementPage(owner, dikuai); |
| | | newPage.setVisible(true); |
| | | }) |
| | | ); |
| | | } else { |
| | | JOptionPane.showMessageDialog(null, "无法打开主页面进行预览", "提示", JOptionPane.WARNING_MESSAGE); |
| | | setVisible(true); |
| | | } |
| | | }); |
| | | } |