You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.8 KiB
66 lines
1.8 KiB
package com.fr.design.mainframe; |
|
|
|
import com.fr.design.components.loading.LoadingPane; |
|
import com.fr.design.gui.ilable.UILabel; |
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import javax.swing.Timer; |
|
import java.awt.AlphaComposite; |
|
import java.awt.Component; |
|
import java.awt.Container; |
|
import java.awt.Dimension; |
|
import java.awt.LayoutManager; |
|
|
|
/** |
|
* @author hades |
|
* @version 10.0 |
|
* Created by hades on 2021/4/12 |
|
*/ |
|
public class TransparentPane extends LoadingPane { |
|
|
|
private UILabel label; |
|
|
|
private double prec = 0.56; |
|
|
|
public TransparentPane() { |
|
|
|
super(); |
|
label = new UILabel(Toolkit.i18nText("Fine-Design_Saving_Template_Tip")); |
|
add(label); |
|
} |
|
|
|
protected LayoutManager getCoverLayout() { |
|
return new LayoutManager() { |
|
|
|
@Override |
|
public void removeLayoutComponent(Component comp) { |
|
} |
|
|
|
@Override |
|
public Dimension preferredLayoutSize(Container parent) { |
|
return parent.getPreferredSize(); |
|
} |
|
|
|
@Override |
|
public Dimension minimumLayoutSize(Container parent) { |
|
return null; |
|
} |
|
|
|
@Override |
|
public void layoutContainer(Container parent) { |
|
int width = parent.getParent().getWidth(); |
|
int height = parent.getParent().getHeight(); |
|
int labelWidth = label.getPreferredSize().width; |
|
int labelHeight = label.getPreferredSize().height; |
|
int labelX = (width - labelWidth) / 2; |
|
int labelY = (int) ((height - labelHeight) * prec); |
|
label.setBounds(labelX, labelY, labelWidth, labelHeight); |
|
} |
|
|
|
@Override |
|
public void addLayoutComponent(String name, Component comp) { |
|
} |
|
}; |
|
} |
|
|
|
}
|
|
|