张世豪
2025-12-12 350782fa02a61cbe112d32905b4ecc39198710cb
src/set/Sets.java
@@ -4,6 +4,7 @@
import zhuye.MapRenderer;
import zhuye.Shouye;
import zhuye.buttonset;
import javax.swing.*;
import javax.swing.filechooser.FileNameExtensionFilter;
@@ -42,7 +43,6 @@
    private JButton baseStationIdEditBtn;
    private JButton handheldEditBtn;
    private JButton checkUpdateBtn;
    private JButton systemDebugButton;
    private JButton feedbackButton;
    private JButton idleTrailEditBtn;
    
@@ -151,7 +151,6 @@
    addRowWithSpacing(panel, idleTrailPanel);
    addRowWithSpacing(panel, feedbackPanel);
    addRowWithSpacing(panel, appVersionPanel);
    panel.add(createDebugPanel());
        
        return panel;
    }
@@ -250,28 +249,8 @@
        gbc.anchor = GridBagConstraints.EAST;
        panel.add(appVersionLabel, gbc);
    checkUpdateBtn = new JButton("检查更新");
    checkUpdateBtn.setFont(new Font("微软雅黑", Font.PLAIN, 12));
    checkUpdateBtn.setBackground(THEME_COLOR);
    checkUpdateBtn.setForeground(Color.WHITE);
    checkUpdateBtn.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20));
    checkUpdateBtn.setPreferredSize(new Dimension(100, 28));
    checkUpdateBtn.setMinimumSize(new Dimension(100, 28));
    checkUpdateBtn.setMaximumSize(new Dimension(100, 28));
        checkUpdateBtn.setFocusPainted(false);
        checkUpdateBtn.addMouseListener(new MouseAdapter() {
            public void mouseEntered(MouseEvent e) {
                checkUpdateBtn.setBackground(new Color(
                    Math.max(THEME_COLOR.getRed() - 20, 0),
                    Math.max(THEME_COLOR.getGreen() - 20, 0),
                    Math.max(THEME_COLOR.getBlue() - 20, 0)
                ));
            }
            public void mouseExited(MouseEvent e) {
                checkUpdateBtn.setBackground(THEME_COLOR);
            }
        });
        checkUpdateBtn = buttonset.createStyledButton("检查更新", THEME_COLOR);
        checkUpdateBtn.setFont(new Font("微软雅黑", Font.PLAIN, 12));
        gbc = new GridBagConstraints();
        gbc.gridx = 2;
@@ -283,62 +262,6 @@
        return panel;
    }
    private JPanel createDebugPanel() {
        JPanel panel = new JPanel(new GridBagLayout());
        panel.setBackground(PANEL_BACKGROUND);
        panel.setAlignmentX(Component.LEFT_ALIGNMENT);
        panel.setMaximumSize(new Dimension(Integer.MAX_VALUE, ROW_HEIGHT));
        panel.setPreferredSize(new Dimension(Integer.MAX_VALUE, ROW_HEIGHT));
        panel.setMinimumSize(new Dimension(0, ROW_HEIGHT));
        GridBagConstraints gbc = new GridBagConstraints();
        JLabel titleLabel = new JLabel("系统调试");
        titleLabel.setFont(new Font("微软雅黑", Font.BOLD, 14));
        titleLabel.setForeground(Color.BLACK);
        titleLabel.setHorizontalAlignment(SwingConstants.RIGHT);
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.weightx = 0;
        gbc.anchor = GridBagConstraints.EAST;
        gbc.insets = new Insets(0, 0, 0, 12);
        panel.add(titleLabel, gbc);
        systemDebugButton = new JButton("系统调试");
        systemDebugButton.setFont(new Font("微软雅黑", Font.PLAIN, 12));
        systemDebugButton.setBackground(new Color(
            Math.max(THEME_COLOR.getRed() - 20, 0),
            Math.max(THEME_COLOR.getGreen() - 20, 0),
            Math.max(THEME_COLOR.getBlue() - 20, 0)));
        systemDebugButton.setForeground(Color.WHITE);
        systemDebugButton.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20));
        systemDebugButton.setPreferredSize(new Dimension(100, 28));
        systemDebugButton.setMinimumSize(new Dimension(100, 28));
        systemDebugButton.setMaximumSize(new Dimension(100, 28));
        systemDebugButton.setFocusPainted(false);
        systemDebugButton.addMouseListener(new MouseAdapter() {
            public void mouseEntered(MouseEvent e) {
                systemDebugButton.setBackground(THEME_COLOR);
            }
            public void mouseExited(MouseEvent e) {
                systemDebugButton.setBackground(new Color(
                    Math.max(THEME_COLOR.getRed() - 20, 0),
                    Math.max(THEME_COLOR.getGreen() - 20, 0),
                    Math.max(THEME_COLOR.getBlue() - 20, 0)));
            }
        });
        gbc = new GridBagConstraints();
        gbc.gridx = 1;
        gbc.gridy = 0;
        gbc.weightx = 1.0;
        gbc.anchor = GridBagConstraints.EAST;
        panel.add(systemDebugButton, gbc);
        return panel;
    }
    private JPanel createFeedbackPanel() {
        JPanel panel = new JPanel(new GridBagLayout());
        panel.setBackground(PANEL_BACKGROUND);
@@ -360,30 +283,8 @@
        gbc.insets = new Insets(0, 0, 0, 12);
        panel.add(titleLabel, gbc);
        feedbackButton = new JButton("反馈");
        feedbackButton = buttonset.createStyledButton("反馈", THEME_COLOR);
        feedbackButton.setFont(new Font("微软雅黑", Font.PLAIN, 12));
        feedbackButton.setBackground(THEME_COLOR);
        feedbackButton.setForeground(Color.WHITE);
        feedbackButton.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20));
        feedbackButton.setPreferredSize(new Dimension(100, 28));
        feedbackButton.setMinimumSize(new Dimension(100, 28));
        feedbackButton.setMaximumSize(new Dimension(100, 28));
        feedbackButton.setFocusPainted(false);
        feedbackButton.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseEntered(MouseEvent e) {
                feedbackButton.setBackground(new Color(
                        Math.max(THEME_COLOR.getRed() - 20, 0),
                        Math.max(THEME_COLOR.getGreen() - 20, 0),
                        Math.max(THEME_COLOR.getBlue() - 20, 0)));
            }
            @Override
            public void mouseExited(MouseEvent e) {
                feedbackButton.setBackground(THEME_COLOR);
            }
        });
        gbc = new GridBagConstraints();
        gbc.gridx = 1;
@@ -528,10 +429,6 @@
            feedbackButton.addActionListener(e -> showFeedbackDialog());
        }
        if (systemDebugButton != null) {
            systemDebugButton.addActionListener(e -> openSystemDebugDialog());
        }
        if (idleTrailEditBtn != null) {
            idleTrailEditBtn.addActionListener(e -> editIdleTrailDuration());
        }
@@ -715,9 +612,8 @@
        photoControls.setAlignmentX(Component.LEFT_ALIGNMENT);
        JLabel photoLabel = new JLabel("选择照片(最多6张):");
        photoLabel.setFont(new Font("微软雅黑", Font.BOLD, 13));
        JButton selectPhotosButton = new JButton("选择照片");
        selectPhotosButton.setFont(new Font("微软雅黑", Font.PLAIN, 12));
        selectPhotosButton.setFocusPainted(false);
    JButton selectPhotosButton = buttonset.createStyledButton("选择照片", THEME_COLOR);
    selectPhotosButton.setFont(new Font("微软雅黑", Font.PLAIN, 12));
        photoControls.add(photoLabel);
        photoControls.add(selectPhotosButton);
    content.add(photoControls);
@@ -737,13 +633,11 @@
        content.add(Box.createRigidArea(new Dimension(0, 20)));
        JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
        JButton cancelButton = new JButton("放弃");
        JButton submitButton = new JButton("提交");
        submitButton.setBackground(THEME_COLOR);
        submitButton.setForeground(Color.WHITE);
        submitButton.setFocusPainted(false);
        cancelButton.setFocusPainted(false);
    JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    JButton cancelButton = buttonset.createStyledButton("放弃", new Color(128, 128, 128));
    cancelButton.setFont(new Font("微软雅黑", Font.PLAIN, 12));
    JButton submitButton = buttonset.createStyledButton("提交", THEME_COLOR);
    submitButton.setFont(new Font("微软雅黑", Font.PLAIN, 12));
        buttonPanel.add(cancelButton);
        buttonPanel.add(submitButton);
@@ -852,12 +746,6 @@
        timer.setRepeats(false);
        timer.start();
    }
    private void openSystemDebugDialog() {
        debug dialog = new debug(this, THEME_COLOR);
        dialog.setLocationRelativeTo(this);
        dialog.setVisible(true);
    }
    
    @Override
    public void setVisible(boolean visible) {