|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package com.fr.design.mainframe.check; |
|
|
|
|
|
|
|
|
|
import com.fine.theme.icon.LazyIcon; |
|
|
|
|
import com.formdev.flatlaf.util.ScaledEmptyBorder; |
|
|
|
|
import com.fr.base.BaseUtils; |
|
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
@ -24,7 +25,7 @@ import javax.swing.JDialog;
|
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
import javax.swing.SwingUtilities; |
|
|
|
|
import javax.swing.SwingWorker; |
|
|
|
|
import java.awt.FlowLayout; |
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
|
import java.awt.event.ActionListener; |
|
|
|
|
import java.awt.event.WindowAdapter; |
|
|
|
@ -32,6 +33,10 @@ import java.awt.event.WindowEvent;
|
|
|
|
|
import java.util.Set; |
|
|
|
|
import java.util.concurrent.ExecutionException; |
|
|
|
|
|
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.cell; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.column; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.flex; |
|
|
|
|
import static com.fine.swing.ui.layout.Layouts.row; |
|
|
|
|
import static com.fr.design.dialog.FineJOptionPane.showConfirmDialog; |
|
|
|
|
import static javax.swing.JOptionPane.OK_CANCEL_OPTION; |
|
|
|
|
import static javax.swing.JOptionPane.OK_OPTION; |
|
|
|
@ -73,7 +78,7 @@ public class CheckButton extends UIButton {
|
|
|
|
|
} |
|
|
|
|
if (set.isEmpty()) { |
|
|
|
|
okButton.setEnabled(true); |
|
|
|
|
imageLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/correct.png")); |
|
|
|
|
imageLabel.setIcon(new LazyIcon("success", 20)); |
|
|
|
|
message.setText("<html>" + Toolkit.i18nText("Fine_Designer_Check_Font_Success") + "</html>"); |
|
|
|
|
} else { |
|
|
|
|
if (dialog != null) { |
|
|
|
@ -172,7 +177,7 @@ public class CheckButton extends UIButton {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Void callHandler(RPCInvokerExceptionInfo rpcInvokerExceptionInfo) { |
|
|
|
|
imageLabel.setIcon(BaseUtils.readIcon("com/fr/design/images/error.png")); |
|
|
|
|
imageLabel.setIcon(new LazyIcon("error", 20)); |
|
|
|
|
message.setText("<html>" + Toolkit.i18nText("Fine_Designer_Check_Font_Upgrade") + "</html>"); |
|
|
|
|
okButton.setEnabled(true); |
|
|
|
|
return null; |
|
|
|
@ -198,16 +203,16 @@ public class CheckButton extends UIButton {
|
|
|
|
|
dialog.setSize(DesignSizeI18nManager.getInstance().i18nDimension(this.getClass().getName())); |
|
|
|
|
JPanel jp = new JPanel(); |
|
|
|
|
JPanel upPane = new JPanel(); |
|
|
|
|
JPanel downPane = new JPanel(); |
|
|
|
|
imageLabel = new UILabel(IOUtils.readIcon("com/fr/design/images/waiting.png")); |
|
|
|
|
upPane.setLayout(new FlowLayout(FlowLayout.LEFT, 10, 10)); |
|
|
|
|
upPane.add(imageLabel); |
|
|
|
|
upPane.add(message); |
|
|
|
|
downPane.setLayout(new FlowLayout(FlowLayout.CENTER, 6, 0)); |
|
|
|
|
downPane.add(okButton); |
|
|
|
|
jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS)); |
|
|
|
|
jp.add(upPane); |
|
|
|
|
jp.add(downPane); |
|
|
|
|
JPanel downPane = new JPanel(new BorderLayout()); |
|
|
|
|
imageLabel = new UILabel(new LazyIcon("waiting", 20)); |
|
|
|
|
upPane.add(row(10, |
|
|
|
|
column(cell(imageLabel),flex()), cell(message) |
|
|
|
|
).getComponent()); |
|
|
|
|
downPane.add(okButton, BorderLayout.EAST); |
|
|
|
|
jp.setLayout(new BorderLayout()); |
|
|
|
|
jp.add(column(flex(), cell(upPane), flex()).getComponent()); |
|
|
|
|
jp.add(downPane, BorderLayout.SOUTH); |
|
|
|
|
jp.setBorder(new ScaledEmptyBorder(10, 10, 10,10)); |
|
|
|
|
dialog.add(jp); |
|
|
|
|
dialog.setResizable(false); |
|
|
|
|
dialog.setLocationRelativeTo(SwingUtilities.getWindowAncestor(this)); |
|
|
|
|