From a541fbdc8812337de120aad3792a2033a5dd7afe Mon Sep 17 00:00:00 2001
From: 张世豪 <979909237@qq.com>
Date: 星期四, 25 十二月 2025 12:23:01 +0800
Subject: [PATCH] 优化了首页
---
src/zhuye/Shouye.java | 404 +++++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 335 insertions(+), 69 deletions(-)
diff --git a/src/zhuye/Shouye.java b/src/zhuye/Shouye.java
index 1dbc337..9d87cf7 100644
--- a/src/zhuye/Shouye.java
+++ b/src/zhuye/Shouye.java
@@ -19,23 +19,24 @@
import gecaoji.Device;
import gecaoji.Gecaoji;
import gecaoji.MowerBoundaryChecker;
+import publicway.buttonset;
import set.Sets;
import set.debug;
import udpdell.UDPServer;
import zhangaiwu.AddDikuai;
-import yaokong.Control04;
import yaokong.RemoteControlDialog;
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Locale;
-import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Consumer;
import java.awt.geom.Point2D;
+import publicway.Gpstoxuzuobiao;
+import publicway.Fanhuibutton;
+
/**
* 棣栭〉鐣岄潰 - 閫傞厤6.5瀵哥珫灞忥紝浣跨敤鐙珛鐨凪apRenderer杩涜缁樺埗
*/
@@ -107,13 +108,18 @@
// 鍦板浘娓叉煋鍣�
private MapRenderer mapRenderer;
+ private boolean pathPreviewActive;
+
private final Consumer<String> serialLineListener = line -> {
SwingUtilities.invokeLater(() -> {
updateDataPacketCountLabel();
- // 濡傛灉鏀跺埌$GNGGA鏁版嵁锛岀珛鍗虫洿鏂版嫋灏�
- if (line != null && line.trim().startsWith("$GNGGA")) {
- if (mapRenderer != null) {
- mapRenderer.forceUpdateIdleMowerTrail();
+ // 濡傛灉鏀跺埌GGA鏁版嵁锛岀珛鍗虫洿鏂版嫋灏�
+ if (line != null) {
+ String trimmed = line.trim();
+ if (trimmed.startsWith("$GNGGA") || trimmed.startsWith("$GPGGA") || trimmed.startsWith("$GBGGA")) {
+ if (mapRenderer != null && !pathPreviewActive) {
+ mapRenderer.forceUpdateIdleMowerTrail();
+ }
}
}
});
@@ -125,7 +131,6 @@
private JPanel floatingButtonColumn;
private Runnable endDrawingCallback;
private JButton pathPreviewReturnButton;
- private boolean pathPreviewActive;
private Runnable pathPreviewReturnAction;
private JButton settingsReturnButton; // 杩斿洖绯荤粺璁剧疆椤甸潰鐨勬偓娴寜閽�
private JButton saveManualBoundaryButton; // 淇濆瓨鎵嬪姩缁樺埗杈圭晫鐨勬寜閽�
@@ -170,6 +175,7 @@
private boolean storedStopButtonActive;
private String storedStatusBeforeDrawing;
private boolean handheldCaptureInlineUiActive;
+ private WangfanDraw returnPathDrawer; // 寰�杩旇矾寰勭粯鍒剁鐞嗗櫒
private Timer handheldCaptureStatusTimer;
private String handheldCaptureStoredStatusText;
private Color handheldStartButtonOriginalBackground;
@@ -209,6 +215,54 @@
// 鍒濆鍖栧湴鍥炬覆鏌撳櫒
mapRenderer = new MapRenderer(visualizationPanel);
applyIdleTrailDurationFromSettings();
+
+ // 鍒濆鍖栧線杩旇矾寰勭粯鍒剁鐞嗗櫒
+ returnPathDrawer = new WangfanDraw(this, mapRenderer, new WangfanDraw.DrawingHelper() {
+ @Override
+ public double[] resolveBaseLatLon() {
+ return resolveCircleBaseLatLon();
+ }
+
+ @Override
+ public Coordinate getLatestCoordinate() {
+ return Shouye.this.getLatestCoordinate();
+ }
+
+ @Override
+ public double parseDMToDecimal(String dmm, String direction) {
+ return Shouye.this.parseDMToDecimal(dmm, direction);
+ }
+
+ @Override
+ public double[] convertLatLonToLocal(double lat, double lon, double baseLat, double baseLon) {
+ return Shouye.this.convertLatLonToLocal(lat, lon, baseLat, baseLon);
+ }
+
+ @Override
+ public boolean arePointsClose(Point2D.Double a, Point2D.Double b) {
+ return Shouye.this.arePointsClose(a, b);
+ }
+
+ @Override
+ public void enterDrawingControlMode() {
+ Shouye.this.enterDrawingControlMode();
+ }
+
+ @Override
+ public void exitDrawingControlMode() {
+ Shouye.this.exitDrawingControlMode();
+ }
+
+ @Override
+ public boolean isDrawingPaused() {
+ return drawingPaused;
+ }
+ });
+
+ // 璁剧疆 MapRenderer 鐨勫線杩旇矾寰勭粯鍒剁鐞嗗櫒
+ if (mapRenderer != null) {
+ mapRenderer.setReturnPathDrawer(returnPathDrawer);
+ }
// 鍒濆鍖栧璇濇寮曠敤涓簄ull锛屽欢杩熷垱寤�
legendDialog = null;
@@ -511,7 +565,7 @@
private void showSettingsReturnButton() {
ensureFloatingButtonInfrastructure();
if (settingsReturnButton == null) {
- settingsReturnButton = createFloatingTextButton("杩斿洖");
+ settingsReturnButton = Fanhuibutton.createReturnButton(null);
settingsReturnButton.setToolTipText("杩斿洖绯荤粺璁剧疆");
settingsReturnButton.addActionListener(e -> {
// 鍏抽棴鎵�鏈夌浉鍏虫ā寮�
@@ -789,7 +843,7 @@
try {
ImageIcon settingsIcon = new ImageIcon("image/sets.png");
// 璋冩暣鍥剧墖澶у皬浠ラ�傚簲鎸夐挳
- Image scaledImage = settingsIcon.getImage().getScaledInstance(30, 30, Image.SCALE_SMOOTH);
+ Image scaledImage = settingsIcon.getImage().getScaledInstance(25, 25, Image.SCALE_SMOOTH);
settingsBtn.setIcon(new ImageIcon(scaledImage));
} catch (Exception e) {
// 濡傛灉鍥剧墖鍔犺浇澶辫触锛屼娇鐢ㄩ粯璁ゆ枃鏈�
@@ -1155,15 +1209,15 @@
controlPanel = new JPanel(new BorderLayout());
controlPanel.setBackground(PANEL_BACKGROUND);
controlPanel.setBorder(BorderFactory.createEmptyBorder(15, 20, 15, 20));
- controlPanel.setPreferredSize(new Dimension(0, 100));
+ controlPanel.setPreferredSize(new Dimension(0, 80));
JPanel buttonPanel = new JPanel(new GridLayout(1, 2, 20, 0));
buttonPanel.setBackground(PANEL_BACKGROUND);
- startBtn = createControlButton("鏆傚仠", THEME_COLOR);
+ startBtn = createControlButton("鏆傚仠鍓茶崏", THEME_COLOR);
updateStartButtonAppearance();
- stopBtn = createControlButton("缁撴潫", Color.ORANGE);
+ stopBtn = createControlButton("缁撴潫鍓茶崏", Color.ORANGE);
updateStopButtonIcon();
buttonPanel.add(startBtn);
@@ -1269,7 +1323,8 @@
button.setFont(new Font("寰蒋闆呴粦", Font.BOLD, 16));
button.setBackground(color);
button.setForeground(Color.WHITE);
- button.setBorder(BorderFactory.createEmptyBorder(15, 0, 15, 0));
+ button.setPreferredSize(new Dimension(0, 50));
+ button.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
button.setFocusPainted(false);
// 鎮仠鏁堟灉
@@ -1361,6 +1416,8 @@
remoteBtn.addActionListener(e -> showRemoteControlDialog());
areaSelectBtn.addActionListener(e -> {
// 鐐瑰嚮鈥滃湴鍧椻�濈洿鎺ユ墦寮�鍦板潡绠$悊瀵硅瘽妗嗭紙鑻ラ渶瑕佸彲浼犲叆鐗瑰畾鍦板潡缂栧彿锛�
+// Dikuaiguanli.showDikuaiManagement(this, null);
+ // 鐩存帴杩涘叆鍦板潡绠$悊鐣岄潰
Dikuaiguanli.showDikuaiManagement(this, null);
});
baseStationBtn.addActionListener(e -> showBaseStationDialog());
@@ -1839,7 +1896,11 @@
}
private void handleDrawingStopFromControlPanel() {
- if (endDrawingCallback != null) {
+ // 濡傛灉鏄線杩旇矾寰勭粯鍒舵ā寮忥紝璋冪敤瀹屾垚缁樺埗鍥炶皟
+ if (returnPathDrawer != null && returnPathDrawer.isActive()) {
+ returnPathDrawer.stop();
+ returnPathDrawer.executeFinishCallback();
+ } else if (endDrawingCallback != null) {
endDrawingCallback.run();
} else {
addzhangaiwu.finishDrawingSession();
@@ -2067,11 +2128,16 @@
updateStartButtonAppearance();
}
if (stopBtn != null) {
- stopBtn.setText("缁撴潫");
+ stopBtn.setText("缁撴潫鍓茶崏");
updateStopButtonIcon();
}
if (statusLabel != null) {
- statusLabel.setText(storedStatusBeforeDrawing != null ? storedStatusBeforeDrawing : "寰呮満");
+ // 濡傛灉鏄線杩旇矾寰勭粯鍒讹紝閫�鍑烘椂鎭㈠涓�"寰呮満"
+ if (returnPathDrawer != null && returnPathDrawer.isActive()) {
+ statusLabel.setText("寰呮満");
+ } else {
+ statusLabel.setText(storedStatusBeforeDrawing != null ? storedStatusBeforeDrawing : "寰呮満");
+ }
}
storedStatusBeforeDrawing = null;
}
@@ -2086,7 +2152,8 @@
startBtn.setText(drawingPaused ? "寮�濮嬬粯鍒�" : "鏆傚仠缁樺埗");
}
if (stopBtn != null) {
- stopBtn.setText("缁撴潫缁樺埗");
+ // 濡傛灉鏄線杩旇矾寰勭粯鍒舵ā寮忥紝鏄剧ず"瀹屾垚缁樺埗"锛屽惁鍒欐樉绀�"缁撴潫缁樺埗"
+ stopBtn.setText((returnPathDrawer != null && returnPathDrawer.isActive()) ? "瀹屾垚缁樺埗" : "缁撴潫缁樺埗");
}
}
@@ -2104,17 +2171,16 @@
if (startBtn == null) {
return;
}
- String iconPath = startButtonShowingPause ? "image/start0.png" : "image/start1.png";
- startBtn.setText(startButtonShowingPause ? "鏆傚仠" : "寮�濮�");
- applyButtonIcon(startBtn, iconPath);
+ startBtn.setText(startButtonShowingPause ? "鏆傚仠鍓茶崏" : "寮�濮嬪壊鑽�");
+ startBtn.setIcon(null);
}
private void updateStopButtonIcon() {
if (stopBtn == null) {
return;
}
- String iconPath = stopButtonActive ? "image/stop1.png" : "image/stop0.png";
- applyButtonIcon(stopBtn, iconPath);
+ stopBtn.setText("缁撴潫鍓茶崏");
+ stopBtn.setIcon(null);
}
private void toggleBluetoothConnection() {
@@ -2382,6 +2448,12 @@
mapRenderer.setHandheldMowerIconActive(active);
}
+ public void setStatusLabelText(String text) {
+ if (statusLabel != null) {
+ statusLabel.setText(text);
+ }
+ }
+
public boolean startMowerBoundaryCapture() {
if (mapRenderer == null) {
return false;
@@ -2923,10 +2995,10 @@
private void ensureBluetoothIconsLoaded() {
if (bluetoothIcon == null) {
- bluetoothIcon = loadScaledIcon("image/blue.png", 28, 28);
+ bluetoothIcon = loadScaledIcon("image/blue.png", 25, 25);
}
if (bluetoothLinkedIcon == null) {
- bluetoothLinkedIcon = loadScaledIcon("image/bluelink.png", 28, 28);
+ bluetoothLinkedIcon = loadScaledIcon("image/bluelink.png", 25, 25);
}
}
@@ -3025,7 +3097,11 @@
if (drawingControlModeActive) {
updateDrawingControlButtonLabels();
if (statusLabel != null) {
- statusLabel.setText(paused ? "缁樺埗鏆傚仠" : "缁樺埗涓�");
+ if (returnPathDrawer != null && returnPathDrawer.isActive()) {
+ statusLabel.setText("姝e湪缁樺埗寰�杩旇矾寰�");
+ } else {
+ statusLabel.setText(paused ? "缁樺埗鏆傚仠" : "缁樺埗涓�");
+ }
}
}
}
@@ -3045,12 +3121,15 @@
enterDrawingControlMode();
// 闅愯棌杩斿洖璁剧疆鎸夐挳锛堝鏋滄樉绀虹粯鍒舵寜閽紝鍒欎笉搴旇鏄剧ず杩斿洖鎸夐挳锛�
- if (settingsReturnButton != null) {
- settingsReturnButton.setVisible(false);
- }
+// if (settingsReturnButton != null) {
+// settingsReturnButton.setVisible(false);
+// }
// 鏄剧ず"姝e湪缁樺埗杈圭晫"鎻愮ず
if (drawingBoundaryLabel != null) {
+ // 濡傛灉鏄線杩旇矾寰勭粯鍒讹紝涓嶆樉绀烘鏍囩锛堢姸鎬佹爮宸叉樉绀�"姝e湪缁樺埗寰�杩旇矾寰�"锛�
+// boolean isReturnPathDrawing = returnPathDrawer != null && returnPathDrawer.isActive();
+// drawingBoundaryLabel.setVisible(!isReturnPathDrawing);
drawingBoundaryLabel.setVisible(true);
}
@@ -3645,34 +3724,11 @@
}
private double parseDMToDecimal(String dmm, String direction) {
- if (dmm == null || dmm.trim().isEmpty()) {
- return Double.NaN;
- }
- try {
- String trimmed = dmm.trim();
- int dotIndex = trimmed.indexOf('.');
- if (dotIndex < 2) {
- return Double.NaN;
- }
- int degrees = Integer.parseInt(trimmed.substring(0, dotIndex - 2));
- double minutes = Double.parseDouble(trimmed.substring(dotIndex - 2));
- double decimal = degrees + minutes / 60.0;
- if ("S".equalsIgnoreCase(direction) || "W".equalsIgnoreCase(direction)) {
- decimal = -decimal;
- }
- return decimal;
- } catch (NumberFormatException ex) {
- return Double.NaN;
- }
+ return Gpstoxuzuobiao.parseDMToDecimal(dmm, direction);
}
private double[] convertLatLonToLocal(double lat, double lon, double baseLat, double baseLon) {
- double deltaLat = lat - baseLat;
- double deltaLon = lon - baseLon;
- double meanLatRad = Math.toRadians((baseLat + lat) / 2.0);
- double eastMeters = deltaLon * METERS_PER_DEGREE_LAT * Math.cos(meanLatRad);
- double northMeters = deltaLat * METERS_PER_DEGREE_LAT;
- return new double[]{eastMeters, northMeters};
+ return Gpstoxuzuobiao.convertLatLonToLocal(lat, lon, baseLat, baseLon);
}
private CircleSolution fitCircleFromPoints(List<double[]> points) {
@@ -3791,9 +3847,8 @@
endDrawingButton.setVisible(false);
}
if (pathPreviewReturnButton == null) {
- pathPreviewReturnButton = createFloatingTextButton("杩斿洖");
+ pathPreviewReturnButton = Fanhuibutton.createReturnButton(e -> handlePathPreviewReturn());
pathPreviewReturnButton.setToolTipText("杩斿洖鏂板鍦板潡姝ラ");
- pathPreviewReturnButton.addActionListener(e -> handlePathPreviewReturn());
}
pathPreviewReturnButton.setVisible(true);
if (floatingButtonPanel != null) {
@@ -4114,18 +4169,229 @@
}
-
- // 娴嬭瘯鏂规硶
- public static void main(String[] args) {
- JFrame frame = new JFrame("AutoMow - 棣栭〉");
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setSize(400, 800);
- frame.setLocationRelativeTo(null);
-
- Shouye shouye = new Shouye();
- frame.add(shouye);
-
- frame.setVisible(true);
- UDPServer.startAsync();//鍚姩鏁版嵁鎺ユ敹绾跨▼
+ /**
+ * 鍚姩寰�杩旇矾寰勭粯鍒�
+ * @param finishCallback 瀹屾垚缁樺埗鏃剁殑鍥炶皟
+ * @param isHandheld 鏄惁浣跨敤鎵嬫寔璁惧妯″紡
+ * @return 鏄惁鎴愬姛鍚姩
+ */
+ public boolean startReturnPathDrawing(Runnable finishCallback, boolean isHandheld) {
+ if (returnPathDrawer == null) {
+ return false;
+ }
+ return returnPathDrawer.start(finishCallback, isHandheld);
}
+
+ /**
+ * 鍋滄寰�杩旇矾寰勭粯鍒�
+ */
+ public void stopReturnPathDrawing() {
+ if (returnPathDrawer != null) {
+ returnPathDrawer.stop();
+ }
+ }
+
+ /**
+ * 鑾峰彇寰�杩旇矾寰勭粯鍒剁鐞嗗櫒
+ */
+ public WangfanDraw getReturnPathDrawer() {
+ return returnPathDrawer;
+ }
+
+ /**
+ * 鍚姩寰�杩旇矾寰勯瑙�
+ * @param coordinatesStr 璺緞鍧愭爣瀛楃涓� (x,y;x,y)
+ * @param returnCallback 杩斿洖鍥炶皟
+ */
+ public void startReturnPathPreview(String coordinatesStr, Runnable returnCallback) {
+ if (returnPathDrawer == null || coordinatesStr == null || coordinatesStr.isEmpty()) {
+ return;
+ }
+
+ // 瑙f瀽鍧愭爣
+ List<Point2D.Double> points = new ArrayList<>();
+ String[] pairs = coordinatesStr.split(";");
+ for (String pair : pairs) {
+ String[] xy = pair.split(",");
+ if (xy.length == 2) {
+ try {
+ double x = Double.parseDouble(xy[0]);
+ double y = Double.parseDouble(xy[1]);
+ points.add(new Point2D.Double(x, y));
+ } catch (NumberFormatException e) {
+ // 蹇界暐鏃犳晥鍧愭爣
+ }
+ }
+ }
+
+ if (points.isEmpty()) {
+ JOptionPane.showMessageDialog(this, "娌℃湁鏈夋晥鐨勮矾寰勭偣鍙瑙�", "鎻愮ず", JOptionPane.WARNING_MESSAGE);
+ return;
+ }
+
+ // 璁剧疆棰勮鐐�
+ returnPathDrawer.setPoints(points);
+ if (mapRenderer != null) {
+ mapRenderer.setPreviewReturnPath(points);
+ }
+
+ // 寮�鍚瑙堟ā寮�
+ pathPreviewActive = true;
+ if (mapRenderer != null) {
+ mapRenderer.clearIdleTrail();
+ }
+ pathPreviewReturnAction = returnCallback;
+
+ // 纭繚鎮诞鎸夐挳鍩虹璁炬柦宸插垱寤�
+ ensureFloatingButtonInfrastructure();
+
+ // 鍒涘缓鎴栨樉绀鸿繑鍥炴寜閽�
+ if (pathPreviewReturnButton == null) {
+ // 浣跨敤 Fanhuibutton 鍒涘缓杩斿洖鎸夐挳
+ pathPreviewReturnButton = publicway.Fanhuibutton.createReturnButton(e -> {
+ // 鍋滄棰勮
+ stopReturnPathPreview();
+ });
+ pathPreviewReturnButton.setToolTipText("杩斿洖缁樺埗椤甸潰");
+ }
+
+ // 闅愯棌鍏朵粬鎮诞鎸夐挳
+ hideFloatingDrawingControls();
+
+ // 鏄剧ず杩斿洖鎸夐挳
+ pathPreviewReturnButton.setVisible(true);
+ floatingButtonPanel.setVisible(true);
+ if (floatingButtonPanel.getParent() != visualizationPanel) {
+ visualizationPanel.add(floatingButtonPanel, BorderLayout.SOUTH);
+ }
+ rebuildFloatingButtonColumn();
+
+ visualizationPanel.revalidate();
+ visualizationPanel.repaint();
+ }
+
+ /**
+ * 鍋滄寰�杩旇矾寰勯瑙�
+ */
+ private void stopReturnPathPreview() {
+ pathPreviewActive = false;
+
+ // 娓呯┖棰勮鐐�
+ if (returnPathDrawer != null) {
+ returnPathDrawer.clearPoints();
+ }
+ if (mapRenderer != null) {
+ mapRenderer.setPreviewReturnPath(null);
+ }
+
+ // 闅愯棌杩斿洖鎸夐挳
+ if (pathPreviewReturnButton != null) {
+ pathPreviewReturnButton.setVisible(false);
+ }
+
+ // 闅愯棌鎮诞闈㈡澘
+ if (floatingButtonPanel != null) {
+ floatingButtonPanel.setVisible(false);
+ }
+
+ // 鎵ц杩斿洖鍥炶皟
+ if (pathPreviewReturnAction != null) {
+ pathPreviewReturnAction.run();
+ }
+ }
+
+ /**
+ * 鏄剧ず杈圭晫棰勮锛堝師濮嬭竟鐣�-绱壊锛屼紭鍖栧悗杈圭晫-缁胯壊锛�
+ * @param dikuai 鍦板潡瀵硅薄
+ * @param optimizedBoundary 浼樺寲鍚庣殑杈圭晫鍧愭爣瀛楃涓�
+ * @param returnCallback 杩斿洖鍥炶皟
+ */
+ public static void showBoundaryPreview(dikuai.Dikuai dikuai, String optimizedBoundary, Runnable returnCallback) {
+ Shouye shouye = getInstance();
+ if (shouye == null || shouye.mapRenderer == null || dikuai == null) {
+ return;
+ }
+
+ // 鑾峰彇鍘熷杈圭晫XY鍧愭爣
+ String originalBoundaryXY = dikuai.getBoundaryOriginalXY();
+
+ // 璁剧疆杈圭晫棰勮
+ shouye.mapRenderer.setBoundaryPreview(originalBoundaryXY, optimizedBoundary);
+
+ // 鍋滄缁樺埗鍓茶崏鏈哄疄鏃舵嫋灏�
+ if (shouye.mapRenderer != null) {
+ shouye.mapRenderer.setIdleTrailSuppressed(true);
+ }
+
+ // 璁剧疆杩斿洖鍥炶皟
+ shouye.pathPreviewReturnAction = returnCallback;
+ shouye.pathPreviewActive = true;
+
+ // 纭繚鎮诞鎸夐挳鍩虹璁炬柦宸插垱寤�
+ shouye.ensureFloatingButtonInfrastructure();
+
+ // 鍒涘缓鎴栨樉绀鸿繑鍥炴寜閽�
+ if (shouye.pathPreviewReturnButton == null) {
+ shouye.pathPreviewReturnButton = publicway.Fanhuibutton.createReturnButton(e -> shouye.handleBoundaryPreviewReturn());
+ shouye.pathPreviewReturnButton.setToolTipText("杩斿洖杈圭晫缂栬緫椤甸潰");
+ }
+
+ // 闅愯棌鍏朵粬鎮诞鎸夐挳
+ shouye.hideFloatingDrawingControls();
+
+ // 鏄剧ず杩斿洖鎸夐挳
+ shouye.pathPreviewReturnButton.setVisible(true);
+ if (shouye.floatingButtonPanel != null) {
+ shouye.floatingButtonPanel.setVisible(true);
+ if (shouye.floatingButtonPanel.getParent() != shouye.visualizationPanel) {
+ shouye.visualizationPanel.add(shouye.floatingButtonPanel, BorderLayout.SOUTH);
+ }
+ }
+ shouye.rebuildFloatingButtonColumn();
+
+ shouye.visualizationPanel.revalidate();
+ shouye.visualizationPanel.repaint();
+ }
+
+ /**
+ * 澶勭悊杈圭晫棰勮杩斿洖
+ */
+ private void handleBoundaryPreviewReturn() {
+ Runnable callback = pathPreviewReturnAction;
+ exitBoundaryPreview();
+ if (callback != null) {
+ callback.run();
+ }
+ }
+
+ /**
+ * 閫�鍑鸿竟鐣岄瑙�
+ */
+ private void exitBoundaryPreview() {
+ pathPreviewActive = false;
+
+ // 鎭㈠缁樺埗鍓茶崏鏈哄疄鏃舵嫋灏�
+ if (mapRenderer != null) {
+ mapRenderer.setIdleTrailSuppressed(false);
+ }
+
+ // 娓呴櫎杈圭晫棰勮
+ if (mapRenderer != null) {
+ mapRenderer.clearBoundaryPreview();
+ }
+
+ // 闅愯棌杩斿洖鎸夐挳
+ if (pathPreviewReturnButton != null) {
+ pathPreviewReturnButton.setVisible(false);
+ }
+
+ // 闅愯棌鎮诞闈㈡澘
+ if (floatingButtonPanel != null) {
+ floatingButtonPanel.setVisible(false);
+ }
+
+ visualizationPanel.revalidate();
+ visualizationPanel.repaint();
+ }
+
}
\ No newline at end of file
--
Gitblit v1.10.0