@ -1,6 +1,7 @@
package com.fr.design.mainframe ;
import com.fr.design.gui.ilable.UILabel ;
import com.fr.design.i18n.Toolkit ;
import com.fr.general.IOUtils ;
import java.awt.Color ;
import java.awt.Component ;
@ -17,9 +18,13 @@ import javax.swing.JPanel;
* /
public class OpenLoadingPane extends JPanel {
private static final ImageIcon LOADING_ICON = new ImageIcon ( IOUtils . readImage ( "/com/fr/design/images/mainframe/loading.gif" ) ) ;
private static final ImageIcon LOADING_ICON = new ImageIcon ( IOUtils . readImage ( "/com/fr/design/images/mainframe/openloading.png" ) ) ;
private static final Color TIP_COLOR = new Color ( 108 , 174 , 235 ) ;
private static final int Y_GAP = 50 ;
private static final int X_GAP = 10 ;
private UILabel loadingLabel ;
private UILabel tipLabel ;
public OpenLoadingPane ( ) {
@ -47,7 +52,12 @@ public class OpenLoadingPane extends JPanel {
int loadingLabelHeight = loadingLabel . getPreferredSize ( ) . height ;
int loadingLabelX = ( width - loadingLabelWidth ) / 2 ;
int loadingLabelY = ( height - loadingLabelHeight ) / 2 ;
int tipLabelWidth = tipLabel . getPreferredSize ( ) . width ;
int tipLabelHeight = tipLabel . getPreferredSize ( ) . height ;
int tipLabelX = ( width - tipLabelWidth ) / 2 + X_GAP ;
int tipLabelY = loadingLabelY + loadingLabelHeight - Y_GAP ;
loadingLabel . setBounds ( loadingLabelX , loadingLabelY , loadingLabelWidth , loadingLabelHeight ) ;
tipLabel . setBounds ( tipLabelX , tipLabelY , tipLabelWidth , tipLabelHeight ) ;
}
@Override
@ -56,7 +66,10 @@ public class OpenLoadingPane extends JPanel {
} ) ;
setBackground ( Color . WHITE ) ;
loadingLabel = new UILabel ( LOADING_ICON ) ;
tipLabel = new UILabel ( Toolkit . i18nText ( "Fine-Design_Open_Template_Loading" ) ) ;
tipLabel . setForeground ( TIP_COLOR ) ;
add ( loadingLabel ) ;
add ( tipLabel ) ;
}
}