张世豪
2025-12-04 3ad76f98fa8b4a9d3d95207cfb4ae4706087c964
src/zhuye/LegendDialog.java
@@ -10,8 +10,9 @@
    public LegendDialog(Component parent, Color ignoredThemeColor) {
        super(parent != null ? (JFrame) SwingUtilities.getWindowAncestor(parent) : null,
              "图例", true);
    // 使用统一宽度,高度缩减为一半
    initializeDialog(UIConfig.DIALOG_WIDTH, UIConfig.DIALOG_HEIGHT / 2);
      int adjustedWidth = (int) Math.round(UIConfig.DIALOG_WIDTH * 0.8);
    int adjustedHeight = (int) Math.round(UIConfig.DIALOG_HEIGHT * 0.4);
    initializeDialog(adjustedWidth, adjustedHeight);
        initializeLegendContent();
        if (parent == null) {
            setLocationRelativeTo(null); // 居中显示
@@ -31,13 +32,6 @@
        mainPanel.setBackground(Color.WHITE);
        mainPanel.setBorder(BorderFactory.createEmptyBorder(15, 15, 10, 15));
        
        // 标题 - 修改为"图例"
        JLabel titleLabel = new JLabel("图例", JLabel.CENTER);
        titleLabel.setFont(new Font("微软雅黑", Font.BOLD, 14));
        titleLabel.setForeground(new Color(60, 60, 60));
        titleLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
        mainPanel.add(titleLabel, BorderLayout.NORTH);
        // 图例内容面板 - 直接添加,不使用滚动条
        JPanel contentPanel = new JPanel();
        contentPanel.setLayout(new BoxLayout(contentPanel, BoxLayout.Y_AXIS));