|
|
@ -5,7 +5,6 @@ import com.fr.design.dialog.UIDialog; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.os.impl.SupportOSImpl; |
|
|
|
import com.fr.design.os.impl.SupportOSImpl; |
|
|
|
import com.fr.design.utils.DesignUtils; |
|
|
|
import com.fr.design.utils.DesignUtils; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
|
|
|
import com.fr.general.FRFont; |
|
|
|
import com.fr.general.FRFont; |
|
|
|
import com.fr.stable.os.support.OSBasedAction; |
|
|
|
import com.fr.stable.os.support.OSBasedAction; |
|
|
|
import com.fr.stable.os.support.OSSupportCenter; |
|
|
|
import com.fr.stable.os.support.OSSupportCenter; |
|
|
@ -23,9 +22,15 @@ import java.awt.Frame; |
|
|
|
* 加载进度弹窗 |
|
|
|
* 加载进度弹窗 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class ProgressDialog extends UIDialog { |
|
|
|
public class ProgressDialog extends UIDialog { |
|
|
|
private JProgressBar progressBar; |
|
|
|
protected static final FRFont font = DesignUtils |
|
|
|
|
|
|
|
.getDefaultGUIFont() |
|
|
|
|
|
|
|
.applySize(14) |
|
|
|
|
|
|
|
.applyForeground(new ColorUIResource(333334)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected JProgressBar progressBar; |
|
|
|
private JDialog centerDialog; |
|
|
|
private JDialog centerDialog; |
|
|
|
private JLabel text; |
|
|
|
protected JLabel text; |
|
|
|
|
|
|
|
protected JPanel progressPanel; |
|
|
|
|
|
|
|
|
|
|
|
public ProgressDialog(Frame parent) { |
|
|
|
public ProgressDialog(Frame parent) { |
|
|
|
super(parent); |
|
|
|
super(parent); |
|
|
@ -42,30 +47,37 @@ public class ProgressDialog extends UIDialog { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initComponent(Frame parent) { |
|
|
|
private void initComponent(Frame parent) { |
|
|
|
|
|
|
|
initProgressBar(); |
|
|
|
|
|
|
|
initProgressPanel(); |
|
|
|
|
|
|
|
initCenterDialog(parent); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void initCenterDialog(Frame parent) { |
|
|
|
centerDialog = new JDialog(this); |
|
|
|
centerDialog = new JDialog(this); |
|
|
|
centerDialog.setSize(new Dimension(482, 124)); |
|
|
|
centerDialog.setSize(new Dimension(482, 124)); |
|
|
|
centerDialog.setUndecorated(true); |
|
|
|
centerDialog.setUndecorated(true); |
|
|
|
centerDialog.setLocationRelativeTo(parent); |
|
|
|
centerDialog.setLocationRelativeTo(parent); |
|
|
|
JPanel panel = new JPanel(); |
|
|
|
centerDialog.getContentPane().add(progressPanel); |
|
|
|
panel.setBorder(new UIProgressBorder(3, UIConstants.DEFAULT_BG_RULER, 14, 46, 47, 37, 47)); |
|
|
|
} |
|
|
|
panel.setLayout(new BorderLayout(4, 15)); |
|
|
|
|
|
|
|
|
|
|
|
protected void initProgressBar() { |
|
|
|
progressBar = new JProgressBar(); |
|
|
|
progressBar = new JProgressBar(); |
|
|
|
progressBar.setUI(new ModernUIProgressBarUI()); |
|
|
|
progressBar.setUI(new ModernUIProgressBarUI()); |
|
|
|
progressBar.setBorderPainted(false); |
|
|
|
progressBar.setBorderPainted(false); |
|
|
|
progressBar.setOpaque(false); |
|
|
|
progressBar.setOpaque(false); |
|
|
|
progressBar.setBorder(null); |
|
|
|
progressBar.setBorder(null); |
|
|
|
progressBar.setMaximum(1000); |
|
|
|
progressBar.setMaximum(1000); |
|
|
|
panel.add(progressBar, BorderLayout.CENTER); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void initProgressPanel() { |
|
|
|
|
|
|
|
progressPanel = new JPanel(); |
|
|
|
|
|
|
|
progressPanel.setBorder(new UIProgressBorder(3, UIConstants.DEFAULT_BG_RULER, 14, 46, 47, 37, 47)); |
|
|
|
|
|
|
|
progressPanel.setLayout(new BorderLayout(4, 15)); |
|
|
|
|
|
|
|
progressPanel.add(progressBar, BorderLayout.CENTER); |
|
|
|
text = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Project"), JLabel.CENTER); |
|
|
|
text = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Loading_Project"), JLabel.CENTER); |
|
|
|
FRFont font = DesignUtils |
|
|
|
|
|
|
|
.getDefaultGUIFont() |
|
|
|
|
|
|
|
.applySize(14) |
|
|
|
|
|
|
|
.applyForeground(new ColorUIResource(333334)); |
|
|
|
|
|
|
|
text.setFont(font); |
|
|
|
text.setFont(font); |
|
|
|
panel.add(text, BorderLayout.SOUTH); |
|
|
|
progressPanel.add(text, BorderLayout.SOUTH); |
|
|
|
panel.setVisible(true); |
|
|
|
progressPanel.setVisible(true); |
|
|
|
centerDialog.getContentPane().add(panel); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|