From aa505b76ad42e85b89febd69b4a8896167181fba Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 28 Sep 2017 11:20:58 +0800 Subject: [PATCH 1/4] =?UTF-8?q?toolbar=E8=83=8C=E6=99=AF=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/itoolbar/UIToolBarUI.java | 27 +++++-------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/designer_base/src/com/fr/design/gui/itoolbar/UIToolBarUI.java b/designer_base/src/com/fr/design/gui/itoolbar/UIToolBarUI.java index 8d3a66d45..431a5508b 100644 --- a/designer_base/src/com/fr/design/gui/itoolbar/UIToolBarUI.java +++ b/designer_base/src/com/fr/design/gui/itoolbar/UIToolBarUI.java @@ -1,31 +1,16 @@ package com.fr.design.gui.itoolbar; -import java.awt.Component; -import java.awt.Dialog; -import java.awt.Frame; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Window; -import java.awt.event.WindowListener; +import com.fr.design.gui.ibutton.UIToolButtonBorder; +import com.fr.design.gui.icheckbox.UICheckBox; -import javax.swing.AbstractButton; -import javax.swing.JComponent; -import javax.swing.JDialog; -import javax.swing.JRadioButton; -import javax.swing.JToolBar; -import javax.swing.RootPaneContainer; -import javax.swing.SwingUtilities; +import javax.swing.*; import javax.swing.border.Border; import javax.swing.plaf.ComponentUI; import javax.swing.plaf.UIResource; import javax.swing.plaf.metal.MetalToolBarUI; - -import com.fr.design.constants.UIConstants; -import com.fr.design.gui.ibutton.UIToolButtonBorder; -import com.fr.design.gui.icheckbox.UICheckBox; - -import static com.fr.design.utils.ThemeUtils.BACK_COLOR; +import java.awt.*; +import java.awt.event.WindowListener; public class UIToolBarUI extends MetalToolBarUI { public static final String IS_TOOL_BAR_BUTTON_KEY = "JToolBar.isToolbarButton"; @@ -91,7 +76,7 @@ public class UIToolBarUI extends MetalToolBarUI { */ public void paint(Graphics g, JComponent c) { Graphics2D g2 = (Graphics2D) g; - g2.setColor(BACK_COLOR); + g2.setColor(Color.WHITE); g2.fillRect(0, 0, c.getWidth(), c.getHeight()); } From ada421c6a8872850527c211d6c70a1dadc79a126 Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 28 Sep 2017 11:38:40 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E9=A2=84=E8=A7=88=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E8=83=8C=E6=99=AF=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/start/Designer.java | 195 ++++++++++++------------ 1 file changed, 97 insertions(+), 98 deletions(-) diff --git a/designer/src/com/fr/start/Designer.java b/designer/src/com/fr/start/Designer.java index 071c035cc..eca4af14c 100644 --- a/designer/src/com/fr/start/Designer.java +++ b/designer/src/com/fr/start/Designer.java @@ -51,17 +51,17 @@ public class Designer extends BaseDesigner { private static final int TOOLBARPANEVGAP = -4; private static final int PREVIEW_DOWN_X_GAP = 92; private static final int GAP = 7; - + private static final String OLD_ENV_FOLDER_71 = ".FineReport71"; private static final String OLD_ENV_FOLDER_70 = ".FineReport70"; private UserInfoPane userInfoPane; - + private UIButton saveButton; private UIButton undo; private UIButton redo; private UIPreviewButton run; - + /** * 设计器启动的Main方法 @@ -135,30 +135,31 @@ public class Designer extends BaseDesigner { public UILargeToolbar createLargeToolbar() { UILargeToolbar largeToolbar = super.createLargeToolbar(); largeToolbar.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 4)); - largeToolbar.add(new JPanel() { - public Dimension getPreferredSize() { - Dimension dim = super.getPreferredSize(); - dim.width = 1; - return dim; - } - }); + largeToolbar.add(generateEmptyGap(1)); createRunButton(largeToolbar); largeToolbar.add(run); - run.setBackground(UIConstants.TREE_BACKGROUND); - largeToolbar.add(new JPanel() { + run.setBackground(Color.WHITE); + largeToolbar.add(generateEmptyGap(GAP)); + largeToolbar.addSeparator(new Dimension(2, 42)); + largeToolbar.setBorder(new MatteBorder(new Insets(0, 0, 1, 0), UIConstants.LINE_COLOR)); + return largeToolbar; + } + + private JPanel generateEmptyGap(int width) { + JPanel panel = new JPanel() { public Dimension getPreferredSize() { Dimension dim = super.getPreferredSize(); - dim.width = GAP; + dim.width = width; return dim; } - }); - largeToolbar.addSeparator(new Dimension(2, 42)); - largeToolbar.setBorder(new MatteBorder(new Insets(0, 0, 1, 0), UIConstants.LINE_COLOR)); - return largeToolbar; + }; + panel.setBackground(Color.WHITE); + return panel; } /** * 创建上面一排的工具栏按钮 + * * @return 按钮 */ public UIButton[] createUp() { @@ -181,7 +182,7 @@ public class Designer extends BaseDesigner { }); return saveButton; } - + private UIButton createUndoButton() { undo = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/undo.png")); undo.setToolTipText(KeySetUtils.UNDO.getMenuKeySetName()); @@ -290,9 +291,10 @@ public class Designer extends BaseDesigner { /** * 生成工具栏 + * * @param toolbarComponent 工具栏 * @param plus 对象 - * @return 更新后的toolbar + * @return 更新后的toolbar */ public JComponent resetToolBar(JComponent toolbarComponent, ToolBarMenuDockPlus plus) { //如果是处于权限编辑状态 @@ -331,16 +333,15 @@ public class Designer extends BaseDesigner { public JTemplate createNewTemplate() { return new JWorkBook(); } - + /** - * 创建论坛登录面板, chart那边不需要 - * - * @return 面板组件 - * - */ - public Component createBBSLoginPane(){ - if (userInfoPane == null){ - userInfoPane = new UserInfoPane(); + * 创建论坛登录面板, chart那边不需要 + * + * @return 面板组件 + */ + public Component createBBSLoginPane() { + if (userInfoPane == null) { + userInfoPane = new UserInfoPane(); } return userInfoPane; } @@ -358,68 +359,67 @@ public class Designer extends BaseDesigner { protected SplashPane createSplashPane() { return new ReportSplashPane(); } - + /** - * 收集用户信息吗 - * - */ + * 收集用户信息吗 + */ protected void collectUserInformation() { - //定制的就不弹出来了 - if (!ComparatorUtils.equals(ProductConstants.APP_NAME, ProductConstants.DEFAULT_APP_NAME)) { - return; - } - - DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); - final String key = envManager.getActivationKey(); - //本地验证通过 - if(ActiveKeyGenerator.localVerify(key)){ - onLineVerify(envManager, key); - UserInfoLabel.showBBSDialog(); - return; - } - - if(StableUtils.checkDesignerActive(readOldKey())){ - //只要有老的key, 就不弹窗, 下次启动的时候, 在线验证下就行. - String newKey = ActiveKeyGenerator.generateActiveKey(); - envManager.setActivationKey(newKey); - UserInfoLabel.showBBSDialog(); - return; - } - + //定制的就不弹出来了 + if (!ComparatorUtils.equals(ProductConstants.APP_NAME, ProductConstants.DEFAULT_APP_NAME)) { + return; + } + + DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); + final String key = envManager.getActivationKey(); + //本地验证通过 + if (ActiveKeyGenerator.localVerify(key)) { + onLineVerify(envManager, key); + UserInfoLabel.showBBSDialog(); + return; + } + + if (StableUtils.checkDesignerActive(readOldKey())) { + //只要有老的key, 就不弹窗, 下次启动的时候, 在线验证下就行. + String newKey = ActiveKeyGenerator.generateActiveKey(); + envManager.setActivationKey(newKey); + UserInfoLabel.showBBSDialog(); + return; + } + CollectUserInformationDialog activeDialog = new CollectUserInformationDialog( - DesignerContext.getDesignerFrame()); + DesignerContext.getDesignerFrame()); activeDialog.setVisible(true); } - - private void onLineVerify(DesignerEnvManager envManager, final String key){ - int status = envManager.getActiveKeyStatus(); - //没有联网验证过 - if (status != 0) { - Thread authThread = new Thread(new Runnable() { - - @Override - public void run() { - ActiveKeyGenerator.onLineVerify(key); - } - }); - authThread.start(); - } + + private void onLineVerify(DesignerEnvManager envManager, final String key) { + int status = envManager.getActiveKeyStatus(); + //没有联网验证过 + if (status != 0) { + Thread authThread = new Thread(new Runnable() { + + @Override + public void run() { + ActiveKeyGenerator.onLineVerify(key); + } + }); + authThread.start(); + } } - - private File getOldEnvFile(String folderName){ - String userHome = System.getProperty("user.home"); - if (userHome == null) { - userHome = System.getProperty("userHome"); - } - String filePath = StableUtils.pathJoin(userHome, folderName, ProductConstants.APP_NAME + "Env.xml"); + + private File getOldEnvFile(String folderName) { + String userHome = System.getProperty("user.home"); + if (userHome == null) { + userHome = System.getProperty("userHome"); + } + String filePath = StableUtils.pathJoin(userHome, folderName, ProductConstants.APP_NAME + "Env.xml"); return new File(filePath); } - - private String getOldActiveKeyFromFile(File envFile){ + + private String getOldActiveKeyFromFile(File envFile) { if (!envFile.exists()) { - return StringUtils.EMPTY; - } - + return StringUtils.EMPTY; + } + DesignerEnvManager temp = new DesignerEnvManager(); try { XMLTools.readFileXML(temp, envFile); @@ -428,26 +428,25 @@ public class Designer extends BaseDesigner { } return temp.getActivationKey(); } - + //默认只从7.0和711的设计器里读取key - private String readOldKey(){ - File file71 = getOldEnvFile(OLD_ENV_FOLDER_71); - if (!file71.exists()) { - File file70 = getOldEnvFile(OLD_ENV_FOLDER_70); - return getOldActiveKeyFromFile(file70); - } - - return getOldActiveKeyFromFile(file71); + private String readOldKey() { + File file71 = getOldEnvFile(OLD_ENV_FOLDER_71); + if (!file71.exists()) { + File file70 = getOldEnvFile(OLD_ENV_FOLDER_70); + return getOldActiveKeyFromFile(file70); + } + + return getOldActiveKeyFromFile(file71); } - + /** - * 设计器退出时, 做的一些操作. - * - */ - public void shutDown(){ - InformationCollector collector = InformationCollector.getInstance(); - collector.collectStopTime(); - collector.saveXMLFile(); + * 设计器退出时, 做的一些操作. + */ + public void shutDown() { + InformationCollector collector = InformationCollector.getInstance(); + collector.collectStopTime(); + collector.saveXMLFile(); ServletContext.fireServletStopListener(); } From 47193ffb5802520ffc765590ed7c6d9ff18dcd54 Mon Sep 17 00:00:00 2001 From: hzzz Date: Thu, 28 Sep 2017 12:01:40 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E6=A0=8F=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/icon/IconPathConstants.java | 2 +- .../src/com/fr/design/images/control/edit.png | Bin 399 -> 352 bytes 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/icon/IconPathConstants.java b/designer_base/src/com/fr/design/icon/IconPathConstants.java index 4a86bcf6f..ec5fcded3 100644 --- a/designer_base/src/com/fr/design/icon/IconPathConstants.java +++ b/designer_base/src/com/fr/design/icon/IconPathConstants.java @@ -1 +1 @@ -package com.fr.design.icon; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 6.5.6 * Date: 12-12-18 * Time: 上午9:42 * 用于保存所有图标路径的类 */ public class IconPathConstants { private IconPathConstants() { } public static final String ADD_POPMENU_ICON_PATH = "/com/fr/design/images/control/addPopup.png"; public static final String DS_ICON_PATH = "/com/fr/design/images/data/datasource.png"; public static final String CLASS_TD_ICON_PATH = "/com/fr/design/images/data/source/classTableData.png"; public static final String EMB_TD_ICON_PATH = "/com/fr/design/images/data/dataTable.png"; public static final String DS_RELATION_TD_ICON_PATH = "/com/fr/design/images/data/multi.png"; public static final String FILE_TD_ICON_PATH = "/com/fr/design/images/data/file.png"; public static final String DS_TREE_TD_ICON_PATH = "/com/fr/design/images/data/tree.png"; public static final String DS_QUERY_ICON_PATH = "/com/fr/design/images/data/database.png"; public static final String PREVIEW_ICON_PATH = "/com/fr/design/images/m_file/preview.png"; public static final String TD_EDIT_ICON_PATH = "/com/fr/design/images/control/edit.png"; public static final String TD_EL_SHARE_HELP_ICON_PATH = "/com/fr/design/images/control/help_open.png"; public static final String TD_EL_SHARE_CLOSE_ICON_PATH = "/com/fr/design/images/control/help_close.png"; public static final String TD_REMOVE_ICON_PATH = "/com/fr/base/images/cell/control/remove.png"; public static final String TD_CONNECTION_ICON_PATH = "/com/fr/design/images/m_web/connection.png"; public static final String SP_SHOW_ICON_PATH = "/com/fr/design/images/data/store_procedure.png"; public static final String STD_SHOW_ICON_PATH = "/com/fr/design/images/data/dock/serverdatabase.png"; public static final String XMLA_ICON_PATH = "/com/fr/design/images/data/cube.png"; public static final String FORBID_ICON_PATH ="/com/fr/web/images/form/forbid.png"; } \ No newline at end of file +package com.fr.design.icon; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 6.5.6 * Date: 12-12-18 * Time: 上午9:42 * 用于保存所有图标路径的类 */ public class IconPathConstants { private IconPathConstants() { } public static final String ADD_POPMENU_ICON_PATH = "/com/fr/design/images/control/addPopup.png"; public static final String DS_ICON_PATH = "/com/fr/design/images/data/datasource.png"; public static final String CLASS_TD_ICON_PATH = "/com/fr/design/images/data/source/classTableData.png"; public static final String EMB_TD_ICON_PATH = "/com/fr/design/images/data/dataTable.png"; public static final String DS_RELATION_TD_ICON_PATH = "/com/fr/design/images/data/multi.png"; public static final String FILE_TD_ICON_PATH = "/com/fr/design/images/data/file.png"; public static final String DS_TREE_TD_ICON_PATH = "/com/fr/design/images/data/tree.png"; public static final String DS_QUERY_ICON_PATH = "/com/fr/design/images/data/database.png"; public static final String PREVIEW_ICON_PATH = "/com/fr/design/images/m_file/preview.png"; public static final String TD_EDIT_ICON_PATH = "/com/fr/design/images/control/edit.png"; public static final String TD_EL_SHARE_HELP_ICON_PATH = "/com/fr/design/images/control/help_open.png"; public static final String TD_EL_SHARE_CLOSE_ICON_PATH = "/com/fr/design/images/control/help_close.png"; public static final String TD_REMOVE_ICON_PATH = "/com/fr/design/images/control/tab/remove.png"; public static final String TD_CONNECTION_ICON_PATH = "/com/fr/design/images/m_web/connection.png"; public static final String SP_SHOW_ICON_PATH = "/com/fr/design/images/data/store_procedure.png"; public static final String STD_SHOW_ICON_PATH = "/com/fr/design/images/data/dock/serverdatabase.png"; public static final String XMLA_ICON_PATH = "/com/fr/design/images/data/cube.png"; public static final String FORBID_ICON_PATH = "/com/fr/web/images/form/forbid.png"; } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/images/control/edit.png b/designer_base/src/com/fr/design/images/control/edit.png index 7491cb9c23367c4cf94630bd83651bcc83d17318..14ff765e43e622ca8e13d6d9b3db141625ea1942 100644 GIT binary patch literal 352 zcmV-m0iXVfP)Px$8c9S!R5%f1V4xCUB*z?MW3y03#{bR#|NrM?U|>!?d-mimCQ=P@aB$#YWc-&3 zG(;V!SB`<Px$Nl8ROR5%f(lD|vCP!PxOUeZ+54tDD3>_1SQq?4fFRzYwHTJ#?hT8cOb4t5h1 z#6ocrXF(lx>r{tUsjo@SyMz~rrm?|;fUbyW0T3U02hOVcs{(;XG`aCTyz_h-Sqirh@q@V)VKWU3%o*1J zXo>Z=#)S9hVlcIZBrH-B_-@&>-gS$Qa*|rXbeJ`&g Date: Thu, 28 Sep 2017 12:01:50 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E6=A0=8F=E5=9B=BE=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/images/control/tab/remove.png | Bin 0 -> 167 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 designer_base/src/com/fr/design/images/control/tab/remove.png diff --git a/designer_base/src/com/fr/design/images/control/tab/remove.png b/designer_base/src/com/fr/design/images/control/tab/remove.png new file mode 100644 index 0000000000000000000000000000000000000000..6fb2baac51ead86742e20545aa0a62413be50b12 GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|5K|k5|2~(;g&RwlQDDH z6mGYiaof(gobd%$;YW8~2X4ulg}lLC>)IYUq%_XtS$r|Kq4RPN8^beAv5Lrm+Yvy^ O7(8A5T-G@yGywp$2|2L< literal 0 HcmV?d00001