| | |
| | | updateStopButtonIcon(); |
| | | } |
| | | if (statusLabel != null) { |
| | | // 如果是往返路径绘制,退出时恢复为"待机" |
| | | if (returnPathDrawer != null && returnPathDrawer.isActive()) { |
| | | statusLabel.setText("待机"); |
| | | } else { |
| | | statusLabel.setText(storedStatusBeforeDrawing != null ? storedStatusBeforeDrawing : "待机"); |
| | | } |
| | | } |
| | | storedStatusBeforeDrawing = null; |
| | | } |
| | | |
| | |
| | | mapRenderer.setHandheldMowerIconActive(active); |
| | | } |
| | | |
| | | public void setStatusLabelText(String text) { |
| | | if (statusLabel != null) { |
| | | statusLabel.setText(text); |
| | | } |
| | | } |
| | | |
| | | public boolean startMowerBoundaryCapture() { |
| | | if (mapRenderer == null) { |
| | | return false; |
| | |
| | | if (drawingControlModeActive) { |
| | | updateDrawingControlButtonLabels(); |
| | | if (statusLabel != null) { |
| | | if (returnPathDrawer != null && returnPathDrawer.isActive()) { |
| | | statusLabel.setText("正在绘制往返路径"); |
| | | } else { |
| | | statusLabel.setText(paused ? "绘制暂停" : "绘制中"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void toggleDrawingPause() { |
| | | applyDrawingPauseState(!drawingPaused, true); |
| | |
| | | |
| | | // 显示"正在绘制边界"提示 |
| | | if (drawingBoundaryLabel != null) { |
| | | drawingBoundaryLabel.setVisible(true); |
| | | // 如果是往返路径绘制,不显示此标签(状态栏已显示"正在绘制往返路径") |
| | | boolean isReturnPathDrawing = returnPathDrawer != null && returnPathDrawer.isActive(); |
| | | drawingBoundaryLabel.setVisible(!isReturnPathDrawing); |
| | | } |
| | | |
| | | boolean enableCircleGuidance = drawingShape != null |
| | |
| | | /** |
| | | * 启动往返路径绘制 |
| | | * @param finishCallback 完成绘制时的回调 |
| | | * @param isHandheld 是否使用手持设备模式 |
| | | * @return 是否成功启动 |
| | | */ |
| | | public boolean startReturnPathDrawing(Runnable finishCallback) { |
| | | public boolean startReturnPathDrawing(Runnable finishCallback, boolean isHandheld) { |
| | | if (returnPathDrawer == null) { |
| | | return false; |
| | | } |
| | | return returnPathDrawer.start(finishCallback); |
| | | return returnPathDrawer.start(finishCallback, isHandheld); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | // 创建或显示返回按钮 |
| | | if (pathPreviewReturnButton == null) { |
| | | pathPreviewReturnButton = publicway.buttonset.createStyledButton("返回", null); |
| | | pathPreviewReturnButton.setToolTipText("返回绘制页面"); |
| | | pathPreviewReturnButton.addActionListener(e -> { |
| | | // 使用 Fanhuibutton 创建返回按钮 |
| | | pathPreviewReturnButton = publicway.Fanhuibutton.createReturnButton(e -> { |
| | | // 停止预览 |
| | | stopReturnPathPreview(); |
| | | }); |
| | | pathPreviewReturnButton.setToolTipText("返回绘制页面"); |
| | | } |
| | | |
| | | // 隐藏其他悬浮按钮 |