@ -6,10 +6,12 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit ;
import com.fr.design.layout.FRGUIPaneFactory ;
import com.fr.design.mainframe.DesignerContext ;
import com.fr.design.mainframe.DesignerFrameFileDealerPane ;
import com.fr.design.utils.TemplateUtils ;
import com.fr.design.utils.gui.GUICoreUtils ;
import com.fr.file.FileNodeFILE ;
import com.fr.file.filetree.FileNode ;
import com.fr.general.IOUtils ;
import com.fr.stable.StableUtils ;
import com.fr.stable.StringUtils ;
import com.fr.stable.project.ProjectConstants ;
@ -24,7 +26,6 @@ import java.time.format.DateTimeFormatter;
import javax.swing.BorderFactory ;
import javax.swing.JDialog ;
import javax.swing.JPanel ;
import javax.swing.UIManager ;
/ * *
* @author hades
@ -39,13 +40,11 @@ public class LockInfoDialog extends JDialog {
super ( DesignerContext . getDesignerFrame ( ) ) ;
JPanel panel = new JPanel ( new BorderLayout ( ) ) ;
panel . setBorder ( BorderFactory . createEmptyBorder ( 0 , 10 , 0 , 0 ) ) ;
UILabel iconLabel = new UILabel ( UIManager . getIcon ( "OptionPane.warningIcon" ) ) ;
panel . add ( iconLabel , BorderLayout . WEST ) ;
panel . add ( createContentPane ( userInfo ) , BorderLayout . CENTER ) ;
panel . add ( createControlPane ( ) , BorderLayout . SOUTH ) ;
this . getContentPane ( ) . add ( panel ) ;
this . setTitle ( Toolkit . i18nText ( "Fine-Design_Basic_Aler t" ) ) ;
this . setSize ( 400 , 18 0 ) ;
this . setTitle ( Toolkit . i18nText ( "Fine-Design_Basic_Remote_Design_Title_Hin t" ) ) ;
this . setSize ( 400 , 16 0 ) ;
this . setResizable ( false ) ;
this . setModal ( true ) ;
GUICoreUtils . centerWindow ( this ) ;
@ -54,12 +53,21 @@ public class LockInfoDialog extends JDialog {
private JPanel createContentPane ( UserInfo userInfo ) {
JPanel contentPanel = new JPanel ( new BorderLayout ( ) ) ;
contentPanel . setBorder ( BorderFactory . createEmptyBorder ( 15 , 0 , 0 , 0 ) ) ;
contentPanel . add ( new UILabel ( Toolkit . i18nText ( "Fine-Design_Template_Lock_And_SaveAs_Tip" ) ) , BorderLayout . NORTH ) ;
contentPanel . setBorder ( BorderFactory . createEmptyBorder ( 5 , 0 , 0 , 0 ) ) ;
JPanel messagePane = new JPanel ( new BorderLayout ( 13 , 0 ) ) ;
UILabel iconLabel = new UILabel ( IOUtils . readIcon ( "/com/fr/design/images/warnings/warning32.png" ) ) ;
iconLabel . setBorder ( BorderFactory . createEmptyBorder ( 5 , 0 , 0 , 0 ) ) ;
messagePane . add ( iconLabel , BorderLayout . WEST ) ;
UILabel tipLabel = new UILabel ( Toolkit . i18nText ( "Fine-Design_Template_Lock_And_SaveAs_Tip" ) ) ;
tipLabel . setBorder ( BorderFactory . createEmptyBorder ( 0 , 0 , 0 , 0 ) ) ;
messagePane . add ( tipLabel , BorderLayout . CENTER ) ;
contentPanel . add ( messagePane , BorderLayout . NORTH ) ;
JPanel detailInfoPane = FRGUIPaneFactory . createY_AXISBoxInnerContainer_S_Pane ( ) ;
detailInfoPane . setBorder ( BorderFactory . createEmptyBorder ( 10 , 10 , 0 , 0 ) ) ;
detailInfoPane . setBorder ( BorderFactory . createEmptyBorder ( 0 , 45 , 0 , 0 ) ) ;
if ( userInfo ! = null & & StringUtils . isNotEmpty ( userInfo . getUserName ( ) ) ) {
detailInfoPane . add ( createLabel ( Toolkit . i18nText ( "Fine-Design_Template_Lock_Holder" , userInfo . getUserName ( ) ) ) ) ;
UILabel label = createLabel ( Toolkit . i18nText ( "Fine-Design_Template_Lock_Holder" , userInfo . getUserName ( ) ) ) ;
label . setBorder ( BorderFactory . createEmptyBorder ( 0 , 0 , 0 , 0 ) ) ;
detailInfoPane . add ( label ) ;
}
if ( userInfo ! = null & & StringUtils . isNotEmpty ( userInfo . getIp ( ) ) ) {
detailInfoPane . add ( createLabel ( Toolkit . i18nText ( "Fine-Design_Template_Lock_Holder_Ip" , userInfo . getIp ( ) ) ) ) ;
@ -72,12 +80,13 @@ public class LockInfoDialog extends JDialog {
private UILabel createLabel ( String text ) {
UILabel label = new UILabel ( text ) ;
label . setForeground ( Color . GRAY ) ;
label . setBorder ( BorderFactory . createEmptyBorder ( 5 , 0 , 0 , 0 ) ) ;
label . setBorder ( BorderFactory . createEmptyBorder ( 8 , 0 , 0 , 0 ) ) ;
return label ;
}
private JPanel createControlPane ( ) {
JPanel controlPane = new JPanel ( new FlowLayout ( FlowLayout . RIGHT ) ) ;
JPanel controlPane = new JPanel ( new FlowLayout ( FlowLayout . RIGHT , 10 , 5 ) ) ;
controlPane . setBorder ( BorderFactory . createEmptyBorder ( 0 , 0 , 0 , 5 ) ) ;
UIButton saveAsButton = new UIButton ( Toolkit . i18nText ( "Fine_Design_Template_Lock_Save_As" ) ) ;
UIButton cancelButton = new UIButton ( Toolkit . i18nText ( "Fine-Design_Basic_Button_Cancel" ) ) ;
saveAsButton . addActionListener ( new ActionListener ( ) {
@ -105,6 +114,7 @@ public class LockInfoDialog extends JDialog {
public static void show ( UserInfo userInfo ) {
DesignerFrameFileDealerPane . getInstance ( ) . refreshRightToolBarBy ( TemplateTreePane . getInstance ( ) . getFileNode ( ) ) ;
new LockInfoDialog ( userInfo ) ;
}