| | |
| | | |
| | | // 地块边界 |
| | | boundaryArea = createInfoTextArea(boundaryValue != null ? boundaryValue : "", true, 6); |
| | | contentPanel.add(createTextAreaSection("地块边界", boundaryArea)); |
| | | String boundaryTitle = "地块边界"; |
| | | if (boundaryValue != null && !boundaryValue.trim().isEmpty() && !"-1".equals(boundaryValue.trim())) { |
| | | int boundaryCount = boundaryValue.split(";").length; |
| | | boundaryTitle = "地块边界 (" + boundaryCount + "点)"; |
| | | } |
| | | contentPanel.add(createTextAreaSection(boundaryTitle, boundaryArea)); |
| | | |
| | | // 障碍物坐标 |
| | | obstacleArea = createInfoTextArea(obstacleValue != null ? obstacleValue : "", true, 6); |
| | | contentPanel.add(createTextAreaSection("障碍物坐标", obstacleArea)); |
| | | String obstacleTitle = "障碍物坐标"; |
| | | if (obstacleValue != null && !obstacleValue.trim().isEmpty() && !"-1".equals(obstacleValue.trim())) { |
| | | // 障碍物坐标格式可能是空格分隔的多个障碍物,每个障碍物用分号分隔坐标点 |
| | | // 计算所有障碍物的总坐标点数 |
| | | String[] obstacles = obstacleValue.trim().split("\\s+"); |
| | | int totalObstaclePoints = 0; |
| | | for (String obstacle : obstacles) { |
| | | if (obstacle != null && !obstacle.trim().isEmpty()) { |
| | | totalObstaclePoints += obstacle.split(";").length; |
| | | } |
| | | } |
| | | if (totalObstaclePoints > 0) { |
| | | obstacleTitle = "障碍物坐标 (" + totalObstaclePoints + "点)"; |
| | | } |
| | | } |
| | | contentPanel.add(createTextAreaSection(obstacleTitle, obstacleArea)); |
| | | |
| | | // 割草宽度 |
| | | widthField = createInfoTextField(widthValue != null ? widthValue : "", true); |
| | |
| | | String existingPath = prepareCoordinateForEditor(dikuai.getPlannedPath()); |
| | | String pathSeed = initialGeneratedPath != null ? initialGeneratedPath : existingPath; |
| | | pathArea = createInfoTextArea(pathSeed != null ? pathSeed : "", true, 10); |
| | | contentPanel.add(createTextAreaSection("割草路径坐标", pathArea)); |
| | | String pathTitle = "割草路径坐标"; |
| | | if (pathSeed != null && !pathSeed.trim().isEmpty() && !"-1".equals(pathSeed.trim())) { |
| | | int pathCount = pathSeed.split(";").length; |
| | | pathTitle = "割草路径坐标 (" + pathCount + "点)"; |
| | | } |
| | | contentPanel.add(createTextAreaSection(pathTitle, pathArea)); |
| | | |
| | | JScrollPane dialogScrollPane = new JScrollPane(contentPanel); |
| | | dialogScrollPane.setBorder(BorderFactory.createEmptyBorder()); |