forked from fanruan/design
Browse Source
Merge in DESIGN/design from ~TOMMY/design:feature/x to feature/x * commit 'cc31d98171cd7c7de7fdfe19a888dcf445acc9e0': REPORT-60637 国际化 REPORT-60488 视觉优化 REPORT-60637 引导加载页research/11.0
Tommy
3 years ago
11 changed files with 153 additions and 24 deletions
@ -0,0 +1,53 @@
|
||||
package com.fr.design.mainframe.guide.ui; |
||||
|
||||
import com.fr.design.gui.ilable.UILabel; |
||||
import com.fr.design.i18n.Toolkit; |
||||
import com.fr.design.layout.FRGUIPaneFactory; |
||||
|
||||
import javax.swing.JPanel; |
||||
import javax.swing.SwingConstants; |
||||
import java.awt.BorderLayout; |
||||
import java.awt.Color; |
||||
import java.awt.Dimension; |
||||
import java.awt.GridBagConstraints; |
||||
import java.awt.GridBagLayout; |
||||
|
||||
public class GuideLoadingGlassPane extends JPanel { |
||||
private static final String loadingImagePath = "/com/fr/design/mainframe/guide/loading.gif"; |
||||
private static GuideLoadingGlassPane loadingPane; |
||||
|
||||
public static GuideLoadingGlassPane getInstance() { |
||||
if (loadingPane == null) { |
||||
loadingPane = new GuideLoadingGlassPane(); |
||||
} |
||||
return loadingPane; |
||||
} |
||||
|
||||
public GuideLoadingGlassPane() { |
||||
this.setLayout(new GridBagLayout()); |
||||
this.setOpaque(false); |
||||
initComponent(); |
||||
} |
||||
|
||||
public void initComponent() { |
||||
JPanel loadingView = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
||||
loadingView.setOpaque(false); |
||||
loadingView.setPreferredSize(new Dimension(130, 120)); |
||||
|
||||
JPanel imageContainer = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane(); |
||||
imageContainer.setOpaque(false); |
||||
ImagePanel imagePanel = new ImagePanel(loadingImagePath); |
||||
imagePanel.setOpaque(false); |
||||
imagePanel.setPreferredSize(new Dimension(84, 84)); |
||||
imageContainer.add(imagePanel); |
||||
|
||||
UILabel hintLabel = new UILabel(Toolkit.i18nText("Fine-Design_Guide_Loading_Wait")); |
||||
hintLabel.setHorizontalAlignment(SwingConstants.CENTER); |
||||
hintLabel.setForeground(Color.WHITE); |
||||
|
||||
loadingView.add(imageContainer, BorderLayout.NORTH); |
||||
loadingView.add(hintLabel, BorderLayout.SOUTH); |
||||
|
||||
this.add(loadingView, new GridBagConstraints()); |
||||
} |
||||
} |
@ -0,0 +1,28 @@
|
||||
package com.fr.design.mainframe.guide.ui; |
||||
|
||||
import javax.swing.JPanel; |
||||
import java.awt.Graphics; |
||||
import java.awt.Image; |
||||
import java.awt.Toolkit; |
||||
|
||||
/** |
||||
* Created by kerry on 2020-10-23 |
||||
*/ |
||||
public class ImagePanel extends JPanel { |
||||
|
||||
|
||||
private Image image; |
||||
|
||||
public ImagePanel(String imagePath) { |
||||
image = Toolkit.getDefaultToolkit().createImage(ImagePanel.class |
||||
.getResource(imagePath)); |
||||
} |
||||
|
||||
@Override |
||||
public void paintComponent(Graphics g) { |
||||
super.paintComponent(g); |
||||
if (image != null) { |
||||
g.drawImage(image, 0, 0, getWidth(), getHeight(), this); |
||||
} |
||||
} |
||||
} |
Before Width: | Height: | Size: 375 B After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 14 KiB |
Loading…
Reference in new issue