From a4767e2c42f3de8c3ad69666e87251070d992ae7 Mon Sep 17 00:00:00 2001 From: zack Date: Tue, 26 Jun 2018 14:14:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BC=8F=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/file/HistoryTemplateListPane.java | 10 ++++++--- .../gui/iprogressbar/ProgressDialog.java | 4 ++-- .../mainframe/loghandler/LogMessageBar.java | 22 ++++++++++--------- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/designer-base/src/com/fr/design/file/HistoryTemplateListPane.java b/designer-base/src/com/fr/design/file/HistoryTemplateListPane.java index 3fc3f1d72..4974e53e4 100644 --- a/designer-base/src/com/fr/design/file/HistoryTemplateListPane.java +++ b/designer-base/src/com/fr/design/file/HistoryTemplateListPane.java @@ -43,18 +43,22 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations, C private JTemplate editingTemplate; private FileToolbarStateChangeListener toobarStateChangeListener; - private static HistoryTemplateListPane THIS; + private static volatile HistoryTemplateListPane THIS; private UIList list; public static final HistoryTemplateListPane getInstance() { if (THIS == null) { - THIS = new HistoryTemplateListPane(); + synchronized (HistoryTemplateListPane.class) { + if (THIS == null) { + THIS = new HistoryTemplateListPane(); + } + } } return THIS; } - public HistoryTemplateListPane() { + private HistoryTemplateListPane() { setLayout(new BorderLayout()); historyList = new ArrayList>(); list = new UIList(new HistoryListDataMode()) { diff --git a/designer-base/src/com/fr/design/gui/iprogressbar/ProgressDialog.java b/designer-base/src/com/fr/design/gui/iprogressbar/ProgressDialog.java index dab3a2e02..f5a1c3c77 100644 --- a/designer-base/src/com/fr/design/gui/iprogressbar/ProgressDialog.java +++ b/designer-base/src/com/fr/design/gui/iprogressbar/ProgressDialog.java @@ -52,6 +52,7 @@ public class ProgressDialog extends UIDialog { FRFont font = FRFont.getInstance().applySize(14).applyForeground(new ColorUIResource(333334)); text.setFont(font); panel.add(text, BorderLayout.SOUTH); + panel.setVisible(true); centerDialog.getContentPane().add(panel); } @@ -63,9 +64,8 @@ public class ProgressDialog extends UIDialog { @Override public void setVisible(boolean b) { - super.setVisible(b); centerDialog.setVisible(b); - centerDialog.setResizable(false); + super.setVisible(b); } public void setProgressValue(int value) { diff --git a/designer-base/src/com/fr/design/mainframe/loghandler/LogMessageBar.java b/designer-base/src/com/fr/design/mainframe/loghandler/LogMessageBar.java index 71a7a7e64..8f6034f77 100644 --- a/designer-base/src/com/fr/design/mainframe/loghandler/LogMessageBar.java +++ b/designer-base/src/com/fr/design/mainframe/loghandler/LogMessageBar.java @@ -1,27 +1,29 @@ package com.fr.design.mainframe.loghandler; -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; - -import javax.swing.JFrame; - import com.fr.design.constants.UIConstants; import com.fr.design.gui.ilable.UILabel; import com.fr.general.Inter; +import javax.swing.JFrame; import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; public class LogMessageBar extends JPanel { private UILabel messageLabel; private int width = 600; - public static LogMessageBar THIS; + public static volatile LogMessageBar THIS; private JFrame dlg = new LogDetailPane().showDialog(); public static LogMessageBar getInstance() { if (THIS == null) { - THIS = new LogMessageBar(); + synchronized (LogMessageBar.class) { + if (THIS == null) { + THIS = new LogMessageBar(); + } + } } return THIS; } @@ -32,7 +34,7 @@ public class LogMessageBar extends JPanel { return bar; } - public LogMessageBar() { + private LogMessageBar() { messageLabel = new UILabel(); setLayout(new BorderLayout()); add(messageLabel, BorderLayout.CENTER);