|
|
@ -6,7 +6,6 @@ import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
import com.fr.general.FRFont; |
|
|
|
import com.fr.general.FRFont; |
|
|
|
import com.fr.general.GeneralContext; |
|
|
|
|
|
|
|
import com.fr.general.IOUtils; |
|
|
|
import com.fr.general.IOUtils; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
import javax.swing.BorderFactory; |
|
|
@ -14,52 +13,65 @@ import javax.swing.Icon; |
|
|
|
import javax.swing.JDialog; |
|
|
|
import javax.swing.JDialog; |
|
|
|
import javax.swing.JLabel; |
|
|
|
import javax.swing.JLabel; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JPanel; |
|
|
|
import javax.swing.JTextArea; |
|
|
|
import javax.swing.JTextPane; |
|
|
|
|
|
|
|
import javax.swing.text.SimpleAttributeSet; |
|
|
|
|
|
|
|
import javax.swing.text.StyleConstants; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
import java.awt.Dimension; |
|
|
|
import java.awt.Dimension; |
|
|
|
import java.awt.FlowLayout; |
|
|
|
import java.awt.FlowLayout; |
|
|
|
import java.awt.Frame; |
|
|
|
import java.awt.Frame; |
|
|
|
|
|
|
|
import java.awt.Insets; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.util.Locale; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 插件启动失败提示窗 |
|
|
|
* 插件启动失败提示窗 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public class PluginErrorRemindDialog extends JDialog implements ActionListener { |
|
|
|
public class PluginErrorRemindDialog extends JDialog implements ActionListener { |
|
|
|
|
|
|
|
|
|
|
|
public PluginErrorRemindDialog(Frame parent, String areaText) { |
|
|
|
private static final String SIM_HEI = "SimHei"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public PluginErrorRemindDialog(Frame parent, String text) { |
|
|
|
super(parent, true); |
|
|
|
super(parent, true); |
|
|
|
//上面的标签面板
|
|
|
|
//上面的标签面板
|
|
|
|
JPanel topPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
|
|
JPanel topPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
|
|
JPanel imagePanel = new JPanel(); |
|
|
|
JPanel imagePanel = new JPanel(); |
|
|
|
Icon icon = IOUtils.readIcon("com/fr/design/images/warnings/warning5.png"); |
|
|
|
Icon icon = IOUtils.readIcon("com/fr/design/images/warnings/icon_WarningIcon_normal.png"); |
|
|
|
|
|
|
|
|
|
|
|
JLabel imageLabel = new JLabel(); |
|
|
|
JLabel imageLabel = new JLabel(); |
|
|
|
imageLabel.setIcon(icon); |
|
|
|
imageLabel.setIcon(icon); |
|
|
|
imagePanel.add(imageLabel); |
|
|
|
imagePanel.add(imageLabel); |
|
|
|
imagePanel.setPreferredSize(new Dimension(130, 100)); |
|
|
|
imagePanel.setPreferredSize(new Dimension(48, 48)); |
|
|
|
|
|
|
|
|
|
|
|
JPanel verticalPanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); |
|
|
|
JPanel verticalPanel = FRGUIPaneFactory.createVerticalFlowLayout_S_Pane(true); |
|
|
|
|
|
|
|
|
|
|
|
JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Title")); |
|
|
|
JLabel label = new JLabel(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Title")); |
|
|
|
label.setFont(FRFont.getInstance().applySize(18).applyStyle(1)); |
|
|
|
label.setFont(FRFont.getInstance().applySize(16).applyName(SIM_HEI)); |
|
|
|
label.setPreferredSize(new Dimension(650, 100)); |
|
|
|
label.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20)); |
|
|
|
|
|
|
|
|
|
|
|
verticalPanel.add(label); |
|
|
|
verticalPanel.add(label); |
|
|
|
|
|
|
|
|
|
|
|
topPanel.add(imagePanel, BorderLayout.WEST); |
|
|
|
topPanel.add(imagePanel, BorderLayout.WEST); |
|
|
|
topPanel.add(verticalPanel, BorderLayout.CENTER); |
|
|
|
topPanel.add(verticalPanel, BorderLayout.CENTER); |
|
|
|
topPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10)); |
|
|
|
topPanel.setPreferredSize(new Dimension(600, 73)); |
|
|
|
|
|
|
|
topPanel.setBorder(BorderFactory.createEmptyBorder(10, 20, 0, 20)); |
|
|
|
|
|
|
|
|
|
|
|
//中间的文本域面板
|
|
|
|
//中间的文本域面板
|
|
|
|
JPanel centerPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
|
|
JPanel centerPanel = FRGUIPaneFactory.createBorderLayout_L_Pane(); |
|
|
|
centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); |
|
|
|
centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); |
|
|
|
centerPanel.setPreferredSize(new Dimension(480, 320)); |
|
|
|
centerPanel.setPreferredSize(new Dimension(580, 269)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JTextPane textPane = new JTextPane(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SimpleAttributeSet attributeSet = new SimpleAttributeSet(); |
|
|
|
|
|
|
|
StyleConstants.setFontFamily(attributeSet, SIM_HEI); |
|
|
|
|
|
|
|
StyleConstants.setLineSpacing(attributeSet, 0.5f); |
|
|
|
|
|
|
|
textPane.setParagraphAttributes(attributeSet, true); |
|
|
|
|
|
|
|
|
|
|
|
JTextArea checkArea = new JTextArea(areaText); |
|
|
|
textPane.setEditable(false); |
|
|
|
checkArea.setEnabled(false); |
|
|
|
textPane.setMargin(new Insets(10, 10, 10, 10)); |
|
|
|
centerPanel.add(checkArea, BorderLayout.CENTER); |
|
|
|
textPane.setText(text); |
|
|
|
|
|
|
|
centerPanel.add(textPane, BorderLayout.CENTER); |
|
|
|
|
|
|
|
|
|
|
|
UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Not_Deal_With")); |
|
|
|
UIButton cancelButton = new UIButton(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Not_Deal_With")); |
|
|
|
UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Deal_With")); |
|
|
|
UIButton okButton = new UIButton(Toolkit.i18nText("Fine-Design_Plugin_Error_Remind_Deal_With")); |
|
|
@ -69,7 +81,7 @@ public class PluginErrorRemindDialog extends JDialog implements ActionListener { |
|
|
|
|
|
|
|
|
|
|
|
// 按钮
|
|
|
|
// 按钮
|
|
|
|
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); |
|
|
|
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); |
|
|
|
buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10)); |
|
|
|
buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 10)); |
|
|
|
buttonPanel.add(cancelButton); |
|
|
|
buttonPanel.add(cancelButton); |
|
|
|
buttonPanel.add(okButton); |
|
|
|
buttonPanel.add(okButton); |
|
|
|
|
|
|
|
|
|
|
@ -80,7 +92,7 @@ public class PluginErrorRemindDialog extends JDialog implements ActionListener { |
|
|
|
this.add(topPanel, BorderLayout.NORTH); |
|
|
|
this.add(topPanel, BorderLayout.NORTH); |
|
|
|
this.add(centerPanel, BorderLayout.CENTER); |
|
|
|
this.add(centerPanel, BorderLayout.CENTER); |
|
|
|
this.add(buttonPanel, BorderLayout.SOUTH); |
|
|
|
this.add(buttonPanel, BorderLayout.SOUTH); |
|
|
|
this.setSize(new Dimension(GeneralContext.getLocale().equals(Locale.US) ? 750 : 600, 500)); |
|
|
|
this.setSize(new Dimension(600, 400)); |
|
|
|
|
|
|
|
|
|
|
|
GUICoreUtils.centerWindow(this); |
|
|
|
GUICoreUtils.centerWindow(this); |
|
|
|
} |
|
|
|
} |
|
|
|