|
|
@ -29,6 +29,7 @@ import com.fr.design.gui.imenu.UIMenuHighLight; |
|
|
|
import com.fr.design.gui.iprogressbar.ProgressDialog; |
|
|
|
import com.fr.design.gui.iprogressbar.ProgressDialog; |
|
|
|
import com.fr.design.gui.iscrollbar.UIScrollBar; |
|
|
|
import com.fr.design.gui.iscrollbar.UIScrollBar; |
|
|
|
import com.fr.design.gui.itoolbar.UIToolbar; |
|
|
|
import com.fr.design.gui.itoolbar.UIToolbar; |
|
|
|
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.mainframe.loghandler.LogMessageBar; |
|
|
|
import com.fr.design.mainframe.loghandler.LogMessageBar; |
|
|
|
import com.fr.design.mainframe.toolbar.ToolBarMenuDock; |
|
|
|
import com.fr.design.mainframe.toolbar.ToolBarMenuDock; |
|
|
@ -76,7 +77,6 @@ import java.awt.Graphics; |
|
|
|
import java.awt.Insets; |
|
|
|
import java.awt.Insets; |
|
|
|
import java.awt.Point; |
|
|
|
import java.awt.Point; |
|
|
|
import java.awt.Rectangle; |
|
|
|
import java.awt.Rectangle; |
|
|
|
import java.awt.Toolkit; |
|
|
|
|
|
|
|
import java.awt.datatransfer.DataFlavor; |
|
|
|
import java.awt.datatransfer.DataFlavor; |
|
|
|
import java.awt.datatransfer.Transferable; |
|
|
|
import java.awt.datatransfer.Transferable; |
|
|
|
import java.awt.dnd.DnDConstants; |
|
|
|
import java.awt.dnd.DnDConstants; |
|
|
@ -160,9 +160,9 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
//用于判断设计器是否打开了
|
|
|
|
//用于判断设计器是否打开了
|
|
|
|
private boolean designerOpened = false; |
|
|
|
private boolean designerOpened = false; |
|
|
|
|
|
|
|
|
|
|
|
private int contentWidth = (int) (Toolkit.getDefaultToolkit().getScreenSize().getWidth()); |
|
|
|
private int contentWidth = (int) (java.awt.Toolkit.getDefaultToolkit().getScreenSize().getWidth()); |
|
|
|
|
|
|
|
|
|
|
|
private int contentHeight = (int) (Toolkit.getDefaultToolkit().getScreenSize().getHeight()); |
|
|
|
private int contentHeight = (int) (java.awt.Toolkit.getDefaultToolkit().getScreenSize().getHeight()); |
|
|
|
|
|
|
|
|
|
|
|
private WindowAdapter windowAdapter = new WindowAdapter() { |
|
|
|
private WindowAdapter windowAdapter = new WindowAdapter() { |
|
|
|
|
|
|
|
|
|
|
@ -849,18 +849,18 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
editingTemplate.stopEditing(); |
|
|
|
editingTemplate.stopEditing(); |
|
|
|
if (!editingTemplate.getEditingFILE().exists()) { |
|
|
|
if (!editingTemplate.getEditingFILE().exists()) { |
|
|
|
int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), |
|
|
|
int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), |
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + editingTemplate.getEditingFILE() |
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + editingTemplate.getEditingFILE() |
|
|
|
+ "\" ?", ProductConstants.PRODUCT_NAME, JOptionPane.YES_NO_OPTION, |
|
|
|
+ "\" ?", ProductConstants.PRODUCT_NAME, JOptionPane.YES_NO_OPTION, |
|
|
|
JOptionPane.QUESTION_MESSAGE); |
|
|
|
JOptionPane.QUESTION_MESSAGE); |
|
|
|
if (returnVal == JOptionPane.YES_OPTION && editingTemplate.saveTemplate()) { |
|
|
|
if (returnVal == JOptionPane.YES_OPTION && editingTemplate.saveTemplate()) { |
|
|
|
editingTemplate.saveTemplate(); |
|
|
|
editingTemplate.saveTemplate(); |
|
|
|
FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", |
|
|
|
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", |
|
|
|
editingTemplate.getEditingFILE().getName())); |
|
|
|
editingTemplate.getEditingFILE().getName())); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (editingTemplate.saveTemplate()) { |
|
|
|
if (editingTemplate.saveTemplate()) { |
|
|
|
editingTemplate.saveTemplate(); |
|
|
|
editingTemplate.saveTemplate(); |
|
|
|
FineLoggerFactory.getLogger().info(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", |
|
|
|
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", |
|
|
|
editingTemplate.getEditingFILE().getName())); |
|
|
|
editingTemplate.getEditingFILE().getName())); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -957,8 +957,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
|
|
|
|
|
|
|
|
// p:判断一下,如何文件为空或者文件不存在,直接返回.
|
|
|
|
// p:判断一下,如何文件为空或者文件不存在,直接返回.
|
|
|
|
if (tplFile == null || !tplFile.exists()) { |
|
|
|
if (tplFile == null || !tplFile.exists()) { |
|
|
|
JOptionPane.showMessageDialog(this, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Warning_Template_Do_Not_Exsit"), |
|
|
|
JOptionPane.showMessageDialog( |
|
|
|
ProductConstants.PRODUCT_NAME, JOptionPane.INFORMATION_MESSAGE); |
|
|
|
this, |
|
|
|
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Warning_Template_Do_Not_Exsit"), |
|
|
|
|
|
|
|
ProductConstants.PRODUCT_NAME, |
|
|
|
|
|
|
|
JOptionPane.INFORMATION_MESSAGE |
|
|
|
|
|
|
|
); |
|
|
|
DesignerFrameFileDealerPane.getInstance().refresh(); |
|
|
|
DesignerFrameFileDealerPane.getInstance().refresh(); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -968,7 +972,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
} catch (DecryptTemplateException e) { |
|
|
|
} catch (DecryptTemplateException e) { |
|
|
|
JOptionPane.showMessageDialog( |
|
|
|
JOptionPane.showMessageDialog( |
|
|
|
this, |
|
|
|
this, |
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Encrypt_Decrypt_Exception"), |
|
|
|
Toolkit.i18nText("Fine-Design_Encrypt_Decrypt_Exception"), |
|
|
|
UIManager.getString("OptionPane.messageDialogTitle"), |
|
|
|
UIManager.getString("OptionPane.messageDialogTitle"), |
|
|
|
JOptionPane.WARNING_MESSAGE, |
|
|
|
JOptionPane.WARNING_MESSAGE, |
|
|
|
UIManager.getIcon("OptionPane.errorIcon") |
|
|
|
UIManager.getIcon("OptionPane.errorIcon") |
|
|
@ -1027,7 +1031,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
MutilTempalteTabPane.getInstance().setTemTemplate( |
|
|
|
MutilTempalteTabPane.getInstance().setTemTemplate( |
|
|
|
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); |
|
|
|
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
activeTemplate(tplFile, jt); |
|
|
|
activeTemplate(jt); |
|
|
|
} |
|
|
|
} |
|
|
|
opened = true; |
|
|
|
opened = true; |
|
|
|
break; |
|
|
|
break; |
|
|
@ -1042,13 +1046,12 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 激活指定的模板 |
|
|
|
* 激活指定的模板 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param tplFile 模板文件 |
|
|
|
* @param jt 当前报表 |
|
|
|
* @param jt 当前报表 |
|
|
|
|
|
|
|
* @date 2014-10-14-下午6:31:23 |
|
|
|
* @date 2014-10-14-下午6:31:23 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void activeTemplate(FILE tplFile, JTemplate jt) { |
|
|
|
private void activeTemplate(JTemplate jt) { |
|
|
|
// 如果该模板已经打开,则进行激活就可以了
|
|
|
|
// 如果该模板已经打开,则进行激活就可以了
|
|
|
|
int index = HistoryTemplateListPane.getInstance().contains(tplFile.getPath()); |
|
|
|
int index = HistoryTemplateListPane.getInstance().contains(jt); |
|
|
|
List<JTemplate<?, ?>> historyList = HistoryTemplateListPane.getInstance().getHistoryList(); |
|
|
|
List<JTemplate<?, ?>> historyList = HistoryTemplateListPane.getInstance().getHistoryList(); |
|
|
|
if (index != -1) { |
|
|
|
if (index != -1) { |
|
|
|
historyList.get(index).activeJTemplate(index, jt); |
|
|
|
historyList.get(index).activeJTemplate(index, jt); |
|
|
|