|
|
@ -4,13 +4,14 @@ import com.fr.base.BaseUtils; |
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
|
|
|
import com.fr.design.i18n.DesignSizeI18nManager; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
import com.fr.design.worker.save.CallbackSaveWorker; |
|
|
|
import com.fr.design.worker.save.CallbackSaveWorker; |
|
|
|
import com.fr.file.FILE; |
|
|
|
import com.fr.file.FILE; |
|
|
|
import com.fr.file.FileNodeFILE; |
|
|
|
import com.fr.file.FileNodeFILE; |
|
|
|
import com.fr.general.GeneralContext; |
|
|
|
import com.fr.general.IOUtils; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.rpc.ExceptionHandler; |
|
|
|
import com.fr.rpc.ExceptionHandler; |
|
|
|
import com.fr.rpc.RPCInvokerExceptionInfo; |
|
|
|
import com.fr.rpc.RPCInvokerExceptionInfo; |
|
|
@ -22,13 +23,11 @@ import javax.swing.JDialog; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
import javax.swing.SwingWorker; |
|
|
|
import javax.swing.SwingWorker; |
|
|
|
import java.awt.Dimension; |
|
|
|
|
|
|
|
import java.awt.FlowLayout; |
|
|
|
import java.awt.FlowLayout; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.awt.event.WindowAdapter; |
|
|
|
import java.awt.event.WindowAdapter; |
|
|
|
import java.awt.event.WindowEvent; |
|
|
|
import java.awt.event.WindowEvent; |
|
|
|
import java.util.Locale; |
|
|
|
|
|
|
|
import java.util.Set; |
|
|
|
import java.util.Set; |
|
|
|
import java.util.concurrent.ExecutionException; |
|
|
|
import java.util.concurrent.ExecutionException; |
|
|
|
|
|
|
|
|
|
|
@ -42,7 +41,7 @@ public class CheckButton extends UIButton { |
|
|
|
private UILabel message; |
|
|
|
private UILabel message; |
|
|
|
private UIButton okButton; |
|
|
|
private UIButton okButton; |
|
|
|
private JDialog dialog; |
|
|
|
private JDialog dialog; |
|
|
|
private UILabel uiLabel; |
|
|
|
private UILabel imageLabel; |
|
|
|
|
|
|
|
|
|
|
|
public CheckButton() { |
|
|
|
public CheckButton() { |
|
|
|
this.setIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/check.png")); |
|
|
|
this.setIcon(BaseUtils.readIcon("/com/fr/design/images/buttonicon/check.png")); |
|
|
@ -73,7 +72,7 @@ public class CheckButton extends UIButton { |
|
|
|
} |
|
|
|
} |
|
|
|
if (set.isEmpty()) { |
|
|
|
if (set.isEmpty()) { |
|
|
|
okButton.setEnabled(true); |
|
|
|
okButton.setEnabled(true); |
|
|
|
uiLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/correct.png")); |
|
|
|
imageLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/correct.png")); |
|
|
|
message.setText("<html>" + Toolkit.i18nText("Fine_Designer_Check_Font_Success") + "</html>"); |
|
|
|
message.setText("<html>" + Toolkit.i18nText("Fine_Designer_Check_Font_Success") + "</html>"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (dialog != null) { |
|
|
|
if (dialog != null) { |
|
|
@ -163,7 +162,6 @@ public class CheckButton extends UIButton { |
|
|
|
}); |
|
|
|
}); |
|
|
|
checkThread.execute(); |
|
|
|
checkThread.execute(); |
|
|
|
dialog.setVisible(true); |
|
|
|
dialog.setVisible(true); |
|
|
|
dialog.dispose(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -173,7 +171,7 @@ public class CheckButton extends UIButton { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Void callHandler(RPCInvokerExceptionInfo rpcInvokerExceptionInfo) { |
|
|
|
public Void callHandler(RPCInvokerExceptionInfo rpcInvokerExceptionInfo) { |
|
|
|
uiLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/error.png")); |
|
|
|
imageLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/error.png")); |
|
|
|
message.setText("<html>" + Toolkit.i18nText("Fine_Designer_Check_Font_Upgrade") + "</html>"); |
|
|
|
message.setText("<html>" + Toolkit.i18nText("Fine_Designer_Check_Font_Upgrade") + "</html>"); |
|
|
|
okButton.setEnabled(true); |
|
|
|
okButton.setEnabled(true); |
|
|
|
return null; |
|
|
|
return null; |
|
|
@ -185,7 +183,7 @@ public class CheckButton extends UIButton { |
|
|
|
private void initDialogPane() { |
|
|
|
private void initDialogPane() { |
|
|
|
message = new UILabel(); |
|
|
|
message = new UILabel(); |
|
|
|
message.setText(Toolkit.i18nText("Fine-Designer_Check_Font_Checking") + "..."); |
|
|
|
message.setText(Toolkit.i18nText("Fine-Designer_Check_Font_Checking") + "..."); |
|
|
|
uiLabel = new UILabel(); |
|
|
|
imageLabel = new UILabel(); |
|
|
|
okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK")); |
|
|
|
okButton = new UIButton(Toolkit.i18nText("Fine-Design_Report_OK")); |
|
|
|
okButton.setEnabled(false); |
|
|
|
okButton.setEnabled(false); |
|
|
|
okButton.addActionListener(new ActionListener() { |
|
|
|
okButton.addActionListener(new ActionListener() { |
|
|
@ -196,13 +194,13 @@ public class CheckButton extends UIButton { |
|
|
|
dialog = new JDialog(); |
|
|
|
dialog = new JDialog(); |
|
|
|
dialog.setTitle(Toolkit.i18nText("Fine_Designer_Check_Font")); |
|
|
|
dialog.setTitle(Toolkit.i18nText("Fine_Designer_Check_Font")); |
|
|
|
dialog.setModal(true); |
|
|
|
dialog.setModal(true); |
|
|
|
dialog.setSize(new Dimension(getDialogWidth(), 118)); |
|
|
|
dialog.setSize(DesignSizeI18nManager.getInstance().i18nDimension(this.getClass().getName())); |
|
|
|
JPanel jp = new JPanel(); |
|
|
|
JPanel jp = new JPanel(); |
|
|
|
JPanel upPane = new JPanel(); |
|
|
|
JPanel upPane = new JPanel(); |
|
|
|
JPanel downPane = new JPanel(); |
|
|
|
JPanel downPane = new JPanel(); |
|
|
|
uiLabel = new UILabel(BaseUtils.readIcon("com/fr/design/images/waiting.png")); |
|
|
|
imageLabel = new UILabel(IOUtils.readIcon("com/fr/design/images/waiting.png")); |
|
|
|
upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10)); |
|
|
|
upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10)); |
|
|
|
upPane.add(uiLabel); |
|
|
|
upPane.add(imageLabel); |
|
|
|
upPane.add(message); |
|
|
|
upPane.add(message); |
|
|
|
downPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0)); |
|
|
|
downPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0)); |
|
|
|
downPane.add(okButton); |
|
|
|
downPane.add(okButton); |
|
|
@ -213,17 +211,4 @@ public class CheckButton extends UIButton { |
|
|
|
dialog.setResizable(false); |
|
|
|
dialog.setResizable(false); |
|
|
|
dialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(this)); |
|
|
|
dialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(this)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private int getDialogWidth() { |
|
|
|
|
|
|
|
Locale locale = GeneralContext.getLocale(); |
|
|
|
|
|
|
|
if (locale.equals(Locale.US)) { |
|
|
|
|
|
|
|
return 305; |
|
|
|
|
|
|
|
} else if (locale.equals(Locale.JAPAN)) { |
|
|
|
|
|
|
|
return 280; |
|
|
|
|
|
|
|
} else if (locale.equals(Locale.KOREA)) { |
|
|
|
|
|
|
|
return 230; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return 250; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|