Browse Source

REPORT-68555 【视觉验收】新建画布/加载动画

bugfix/11.0
方磊 3 years ago
parent
commit
39ba85cdac
  1. 40
      designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java

40
designer-base/src/main/java/com/fr/design/gui/iprogressbar/ProgressDialog.java

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

Loading…
Cancel
Save