From 4dccaabbbfc8a8c55cb996358a04c4d2b036d783 Mon Sep 17 00:00:00 2001 From: Hades Date: Fri, 7 Dec 2018 11:13:53 +0800 Subject: [PATCH 01/17] =?UTF-8?q?REPORT-13280=20=E3=80=90=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1=E5=99=A8=E5=90=AF=E5=8A=A8=E3=80=91=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E5=90=8E=EF=BC=8C=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E5=8D=A1=E6=AD=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/mainframe/CellElementPropertyPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java index 42d4f1d39..7324300eb 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java @@ -67,7 +67,7 @@ public class CellElementPropertyPane extends DockingView { } - public synchronized static CellElementPropertyPane getInstance() { + public static CellElementPropertyPane getInstance() { if (singleton == null) { synchronized (CellElementPropertyPane.class) { if (singleton == null) { From 3c0a90601d03b25ae3819c7ffee9514b5c830698 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 7 Dec 2018 16:47:20 +0800 Subject: [PATCH 02/17] =?UTF-8?q?MOBILE-18551=20=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E3=80=8B=E5=86=B3=E7=AD=96=E6=8A=A5=E8=A1=A8=E3=80=8B?= =?UTF-8?q?tab=E6=A0=B7=E5=BC=8F=E5=A4=9A=E6=A0=B7=E5=8C=96=E3=80=8B?= =?UTF-8?q?=E8=AE=BE=E7=BD=AEtab=E7=9A=84=E5=AD=97=E7=AC=A6=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E3=80=81=E6=96=9C=E4=BD=93=E9=A2=9C=E8=89=B2=E6=97=A0?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/mobile/ui/MobileTemplateStyleDefinePane.java | 4 +++- .../mainframe/mobile/ui/StyleDefinePaneWithSelectConf.java | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java index b499e18d7..feb19463d 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/MobileTemplateStyleDefinePane.java @@ -208,8 +208,10 @@ public abstract class MobileTemplateStyleDefinePane extends BasicBeanPane Date: Fri, 7 Dec 2018 17:49:45 +0800 Subject: [PATCH 03/17] =?UTF-8?q?REPORT-13176=20=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E5=B1=9E=E6=80=A7=E3=80=8Btab=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E5=A4=9A=E6=A0=B7=E5=8C=96=E3=80=8B=E9=BB=98=E8=AE=A4=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E3=80=8B=E9=A2=84=E8=A7=88=E5=A4=84=E5=AD=97=E4=BD=93?= =?UTF-8?q?=E5=A4=AA=E5=B0=8F=EF=BC=8C=E5=A6=82=E6=88=AA=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/mobile/ui/DefaultMobileStyleDefinePane.java | 2 ++ .../fr/design/mainframe/mobile/ui/DownMenuStyleDefinePane.java | 2 ++ .../fr/design/mainframe/mobile/ui/SliderStyleDefinePane.java | 2 ++ .../fr/design/mainframe/mobile/ui/UpMenuStyleDefinePane.java | 2 ++ 4 files changed, 8 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java index 6b2ecec66..2a14bea07 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java @@ -12,6 +12,7 @@ import java.awt.Dimension; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; +import java.awt.RenderingHints; public class DefaultMobileStyleDefinePane extends MobileTemplateStyleDefinePane { @@ -84,6 +85,7 @@ public class DefaultMobileStyleDefinePane extends MobileTemplateStyleDefinePane int panelWidth = dimension.width; int panelHeight = dimension.height; Graphics2D g2d = (Graphics2D) g.create(); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); FRFont frFont = DefaultMobileTemplateStyle.DEFAULT_TAB_FONT.getFont(); FontMetrics fm = GraphHelper.getFontMetrics(frFont); WCardTagLayout cardTagLayout = DefaultMobileStyleDefinePane.this.getTagLayout(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DownMenuStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DownMenuStyleDefinePane.java index 1a0472cbb..70499f302 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DownMenuStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DownMenuStyleDefinePane.java @@ -27,6 +27,7 @@ import java.awt.FlowLayout; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; +import java.awt.RenderingHints; import java.awt.Stroke; import java.util.ArrayList; @@ -151,6 +152,7 @@ public class DownMenuStyleDefinePane extends StyleDefinePaneWithSelectConf { int panelWidth = dimension.width; int panelHeight = dimension.height; Graphics2D g2d = (Graphics2D) g.create(); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); FRFont frFont = this.getTabFontConfig().getFont(); FontMetrics fm = GraphHelper.getFontMetrics(frFont); WCardTagLayout cardTagLayout = DownMenuStyleDefinePane.this.getTagLayout(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SliderStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SliderStyleDefinePane.java index a4cf4e333..a3c138213 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SliderStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/SliderStyleDefinePane.java @@ -24,6 +24,7 @@ import java.awt.FlowLayout; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; +import java.awt.RenderingHints; public class SliderStyleDefinePane extends MobileTemplateStyleDefinePane { private NewColorSelectBox initDotColor; @@ -131,6 +132,7 @@ public class SliderStyleDefinePane extends MobileTemplateStyleDefinePane { Dimension dimension = this.getSize(); int panelHeight = dimension.height; Graphics2D g2d = (Graphics2D) g.create(); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); FRFont frFont = this.getTabFontConfig().getFont(); g2d.setFont(frFont); g2d.setColor(frFont.getForeground()); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UpMenuStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UpMenuStyleDefinePane.java index ea0dba659..003dd04bf 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UpMenuStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UpMenuStyleDefinePane.java @@ -27,6 +27,7 @@ import java.awt.Dimension; import java.awt.FontMetrics; import java.awt.Graphics; import java.awt.Graphics2D; +import java.awt.RenderingHints; import java.awt.Stroke; public class UpMenuStyleDefinePane extends StyleDefinePaneWithSelectConf { @@ -171,6 +172,7 @@ public class UpMenuStyleDefinePane extends StyleDefinePaneWithSelectConf { int panelWidth = dimension.width; int panelHeight = dimension.height; Graphics2D g2d = (Graphics2D) g.create(); + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); FRFont frFont = UpMenuStyleDefinePane.this.fontConfPane.update(); FontMetrics fm = GraphHelper.getFontMetrics(frFont); WCardTagLayout cardTagLayout = UpMenuStyleDefinePane.this.getTagLayout(); From 4e40e10c53650cdaedbb01d2eab453e0b6055b22 Mon Sep 17 00:00:00 2001 From: kerry Date: Sat, 8 Dec 2018 10:45:38 +0800 Subject: [PATCH 04/17] =?UTF-8?q?REPORT-13340=20=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E5=B1=9E=E6=80=A7=E3=80=8Btab=E6=A0=B7=E5=BC=8F?= =?UTF-8?q?=E5=A4=9A=E6=A0=B7=E5=8C=96=E3=80=8B=E6=BB=91=E5=8A=A8=E5=BC=8F?= =?UTF-8?q?=E5=92=8C=E4=B8=8A=E8=8F=9C=E5=8D=95=E5=BC=8F=20=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E5=8C=BA=E5=9F=9F=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/mobile/ui/DefaultMobileStyleDefinePane.java | 2 +- .../fr/design/mainframe/mobile/ui/UpMenuStyleDefinePane.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java index 2a14bea07..7ffd0abe2 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java @@ -86,7 +86,7 @@ public class DefaultMobileStyleDefinePane extends MobileTemplateStyleDefinePane int panelHeight = dimension.height; Graphics2D g2d = (Graphics2D) g.create(); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - FRFont frFont = DefaultMobileTemplateStyle.DEFAULT_TAB_FONT.getFont(); + FRFont frFont = this.getTabFontConfig().getFont(); FontMetrics fm = GraphHelper.getFontMetrics(frFont); WCardTagLayout cardTagLayout = DefaultMobileStyleDefinePane.this.getTagLayout(); int eachWidth = panelWidth / cardTagLayout.getWidgetCount(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UpMenuStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UpMenuStyleDefinePane.java index 003dd04bf..ddd4c202d 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UpMenuStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/UpMenuStyleDefinePane.java @@ -173,7 +173,7 @@ public class UpMenuStyleDefinePane extends StyleDefinePaneWithSelectConf { int panelHeight = dimension.height; Graphics2D g2d = (Graphics2D) g.create(); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); - FRFont frFont = UpMenuStyleDefinePane.this.fontConfPane.update(); + FRFont frFont = this.getTabFontConfig().getFont(); FontMetrics fm = GraphHelper.getFontMetrics(frFont); WCardTagLayout cardTagLayout = UpMenuStyleDefinePane.this.getTagLayout(); int eachWidth = panelWidth / cardTagLayout.getWidgetCount(); From e5d23733bacfea9711f85d80deb170830c4eea4f Mon Sep 17 00:00:00 2001 From: abel Date: Sat, 8 Dec 2018 11:00:15 +0800 Subject: [PATCH 05/17] =?UTF-8?q?REPORT-13029=20JNDI=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E9=9B=86=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/data/datapane/connect/JNDIDefPane.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JNDIDefPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JNDIDefPane.java index 32bc4d4b7..e99d99ca4 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/JNDIDefPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/JNDIDefPane.java @@ -125,7 +125,7 @@ public class JNDIDefPane extends JPanel { } // Properties. - Hashtable contextHashtable = jndiDatabase.getContextHashtable(); + Map contextHashtable = jndiDatabase.getContextHashtable(); Object INITIAL_CONTEXT_FACTORY = contextHashtable.get(Context.INITIAL_CONTEXT_FACTORY); this.JNDIFactoryComboBox.setSelectedItem(INITIAL_CONTEXT_FACTORY == null ? "" : INITIAL_CONTEXT_FACTORY); @@ -148,7 +148,7 @@ public class JNDIDefPane extends JPanel { populateContextAttributes(contextHashtable, this.APPLET_TF, Context.APPLET); } - private void populateContextAttributes(Hashtable properties, UITextField textField, String contextAttr) { + private void populateContextAttributes(Map properties, UITextField textField, String contextAttr) { String PROVIDER_URL = properties.get(contextAttr); if (PROVIDER_URL != null) { textField.setText(PROVIDER_URL); @@ -160,7 +160,7 @@ public class JNDIDefPane extends JPanel { jndiDatabase.setJNDIName(this.jndiNameTextField.getText()); - Hashtable contextHashtable = jndiDatabase.getContextHashtable(); + Map contextHashtable = jndiDatabase.getContextHashtable(); String factoryString = (String)this.JNDIFactoryComboBox.getEditor().getItem(); if (factoryString != null && factoryString.trim().length() > 0) { @@ -186,7 +186,7 @@ public class JNDIDefPane extends JPanel { return jndiDatabase; } - private void updateContextAttributes(Hashtable contextHashtable, UITextField textField, String contextAttr) { + private void updateContextAttributes(Map contextHashtable, UITextField textField, String contextAttr) { String tValue = textField.getText(); if (tValue != null && tValue.trim().length() > 0) { contextHashtable.put(contextAttr, tValue); From 30de22f58db92499d5be7c30ea44511a0d74d32a Mon Sep 17 00:00:00 2001 From: Hades Date: Sat, 8 Dec 2018 15:30:29 +0800 Subject: [PATCH 06/17] =?UTF-8?q?REPORT-13310=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=9D=A5=E5=9B=9E=E5=88=87=E6=8D=A2=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?,=20=E9=9D=9E=E5=B8=B8=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/gui/imenu/UIBasicMenuItemUI.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/imenu/UIBasicMenuItemUI.java b/designer-base/src/main/java/com/fr/design/gui/imenu/UIBasicMenuItemUI.java index 74c65e8ee..61587beef 100644 --- a/designer-base/src/main/java/com/fr/design/gui/imenu/UIBasicMenuItemUI.java +++ b/designer-base/src/main/java/com/fr/design/gui/imenu/UIBasicMenuItemUI.java @@ -667,18 +667,10 @@ public class UIBasicMenuItemUI extends MenuItemUI { } private void installFont(final String prefix, final JComponent menuItem) { - Thread thread = new Thread(new Runnable() { - @Override - public void run() { - if (menuItem == null) { - return; - } - LookAndFeel.installColorsAndFont(menuItem, prefix + ".background", prefix + ".foreground", prefix + ".font"); - } - }); - thread.setName("UIBasicMenuItemUI"); - thread.setDaemon(true); - thread.start(); + if (menuItem == null) { + return; + } + LookAndFeel.installColorsAndFont(menuItem, prefix + ".background", prefix + ".foreground", prefix + ".font"); } protected Dimension getPreferredMenuItemSize(JComponent c, Icon checkIcon, From de75ef5d1f0ad1acfad68e88897a2c12cfa5584b Mon Sep 17 00:00:00 2001 From: XiaXiang Date: Sat, 8 Dec 2018 15:43:19 +0800 Subject: [PATCH 07/17] =?UTF-8?q?REPORT-12854=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=20=E4=BA=A4=E4=BA=92=E4=BF=AE=E6=94=B9=20bug?= =?UTF-8?q?=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../connect/DatabaseConnectionPane.java | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java index 0f52a4c5c..0b37855c9 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java @@ -17,6 +17,7 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; import com.fr.stable.EncodeConstants; +import com.fr.stable.StringUtils; import javax.swing.*; import java.awt.*; @@ -36,8 +37,8 @@ public abstract class DatabaseConnectionPane Date: Sat, 8 Dec 2018 16:00:43 +0800 Subject: [PATCH 08/17] rt --- .../fr/design/data/datapane/connect/DatabaseConnectionPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java index 0b37855c9..fc2045161 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java @@ -73,7 +73,7 @@ public abstract class DatabaseConnectionPane Date: Sat, 8 Dec 2018 16:29:56 +0800 Subject: [PATCH 09/17] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=A9=BA=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/data/datapane/connect/DatabaseConnectionPane.java | 1 - 1 file changed, 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java index fc2045161..fc666f15f 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java @@ -85,7 +85,6 @@ public abstract class DatabaseConnectionPane Date: Sat, 8 Dec 2018 16:44:40 +0800 Subject: [PATCH 10/17] =?UTF-8?q?REPORT-12916=20=E5=8F=A6=E5=AD=98?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E9=80=89=E6=8B=A9=E5=AF=B9=E8=AF=9D=E6=A1=86?= =?UTF-8?q?=E8=A2=AB=E5=8F=A6=E5=AD=98=E6=96=87=E4=BB=B6icon=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=94=81=E5=AE=9A=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/gui/itree/filetree/EnvFileTree.java | 4 +--- .../fr/design/gui/itree/filetree/FileTreeIcon.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java index 550ba715e..d5a9044d5 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/EnvFileTree.java @@ -69,10 +69,8 @@ public class EnvFileTree extends RefreshableJTree { if (treeNode.hasFullAuthority()) { if (lock != null && !node.getUserID().equals(lock)) { name = name + Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked", "(", ")"); - this.setIcon(FileTreeIcon.getIcon(node)); - } else { - this.setIcon(FileTreeIcon.getIcon(node, false)); } + this.setIcon(FileTreeIcon.getIcon(node)); } else { this.setIcon(FileTreeIcon.getFolderHalfImageIcon()); } diff --git a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java index 130240aea..b0e26cc80 100644 --- a/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java +++ b/designer-base/src/main/java/com/fr/design/gui/itree/filetree/FileTreeIcon.java @@ -3,6 +3,7 @@ package com.fr.design.gui.itree.filetree; import com.fr.base.BaseUtils; import com.fr.design.icon.LockIcon; import com.fr.file.filetree.FileNode; +import com.fr.general.ComparatorUtils; import com.fr.stable.StableUtils; import com.fr.workspace.WorkContext; @@ -125,8 +126,16 @@ public class FileTreeIcon { return FOLDER_HALF_IMAGE_ICON; } + /** + * 获取文件节点对应的图标 + * + * @param node 文件节点 + * @return 文件节点的图标 + */ public static Icon getIcon(FileNode node) { - return getIcon(node, node.getLock() != null); + // 如果文件节点锁不为空且不是当前用户锁定的该模板,那么模板ICON 提示用户当前文件节点被锁 + boolean showLock = node.getLock() != null && !ComparatorUtils.equals(node.getUserID(), node.getLock()); + return getIcon(node, showLock); } public static Icon getIcon(FileNode node, boolean isShowLock) { From 3f3bb397cc785c97acc079dccce95d3d789bafc4 Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Sat, 8 Dec 2018 20:10:18 +0800 Subject: [PATCH 11/17] =?UTF-8?q?=E4=B8=8D=E6=98=AF=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E5=86=85=E7=9A=84=E6=96=87=E4=BB=B6=E4=B8=8D=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E8=A7=A3=E9=94=81=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/file/MutilTempalteTabPane.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index b6f18a188..2a00df072 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -206,8 +206,7 @@ public class MutilTempalteTabPane extends JComponent { openedTemplate.remove(jTemplate); closeFormat(jTemplate); HistoryTemplateListCache.getInstance().closeSelectedReport(jTemplate); - // release lock - WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(jTemplate.getPath()); + closeAndFreeLock(jTemplate); } } JTemplate currentTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); @@ -221,7 +220,6 @@ public class MutilTempalteTabPane extends JComponent { if (openedTemplate.size() == 1) { closeOther.setEnabled(false); } - return closeOther; } @@ -698,11 +696,19 @@ public class MutilTempalteTabPane extends JComponent { private void closeTpl(@Nonnull JTemplate specifiedTemplate, @Nonnull String fileName) { HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate); - // release lock - WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(specifiedTemplate.getPath()); + closeAndFreeLock(specifiedTemplate); activeTemplate(fileName); } + private void closeAndFreeLock(@Nonnull JTemplate template) { + FILE file = template.getEditingFILE(); + // 只有是环境内的文件,才执行释放锁 + if (file != null && file.isEnvFile()) { + // release lock + WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(template.getPath()); + } + } + /** * 关闭模板 * From fa38f5327954c87da6e0d1a73a76864de0b9fb2f Mon Sep 17 00:00:00 2001 From: "yaoh.wu" Date: Sat, 8 Dec 2018 21:11:42 +0800 Subject: [PATCH 12/17] =?UTF-8?q?REPORT-12916=20=E5=8F=A6=E5=AD=98?= =?UTF-8?q?=E4=B8=BA=E6=97=B6=E7=9A=84=E6=96=87=E4=BB=B6=E9=94=81=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/file/MutilTempalteTabPane.java | 2 +- .../com/fr/design/mainframe/JTemplate.java | 29 +++++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java index 2a00df072..ab4f2aae3 100644 --- a/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java +++ b/designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java @@ -705,7 +705,7 @@ public class MutilTempalteTabPane extends JComponent { // 只有是环境内的文件,才执行释放锁 if (file != null && file.isEnvFile()) { // release lock - WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(template.getPath()); + WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(file.getPath()); } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java index fa9b181a5..7b80c3fd7 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java @@ -32,6 +32,7 @@ import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.itree.filetree.TemplateFileTree; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.templateinfo.TemplateInfoCollector; import com.fr.design.mainframe.templateinfo.TemplateProcessInfo; @@ -56,6 +57,8 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.ProductConstants; import com.fr.stable.StringUtils; import com.fr.stable.core.UUID; +import com.fr.workspace.WorkContext; +import com.fr.workspace.server.lock.TplOperator; import javax.swing.BorderFactory; import javax.swing.Icon; @@ -587,6 +590,8 @@ public abstract class JTemplate> if (isCancelOperation(chooseResult)) { return false; } + // 源文件 + FILE sourceFile = editingFILE; if (isOkOperation(chooseResult)) { boolean access = false; @@ -596,13 +601,33 @@ public abstract class JTemplate> FineLoggerFactory.getLogger().error(e.getMessage(), e); } if (!access) { - JOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied") + "!", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Message"), JOptionPane.WARNING_MESSAGE); + JOptionPane.showMessageDialog( + DesignerContext.getDesignerFrame(), + Toolkit.i18nText("Fine-Design_Basic_Template_Permission_Denied") + "!", + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Message"), + JOptionPane.WARNING_MESSAGE); return false; } + // 目标文件 editingFILE = fileChooser.getSelectedFILE(); } - return saveNewFile(editingFILE, oldName); + boolean lockedTarget = WorkContext.getCurrent().get(TplOperator.class).saveAs(editingFILE.getPath()); + if (lockedTarget) { + boolean saved = saveNewFile(editingFILE, oldName); + // 目标文件保存成功并且源文件不一致的情况下,把源文件锁释放掉 + if (saved && !ComparatorUtils.equals(editingFILE.getPath(), sourceFile.getPath())) { + WorkContext.getCurrent().get(TplOperator.class).closeAndFreeFile(sourceFile.getPath()); + } + return saved; + } else { + JOptionPane.showMessageDialog( + DesignerContext.getDesignerFrame(), + Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked"), + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Message"), + JOptionPane.WARNING_MESSAGE); + return false; + } } protected boolean saveNewFile(FILE editingFILE, String oldName) { From c6679a32832db047bafdd06b58df77f70f2238e1 Mon Sep 17 00:00:00 2001 From: neil <459208047@qq.com> Date: Mon, 10 Dec 2018 11:39:50 +0800 Subject: [PATCH 13/17] =?UTF-8?q?REPORT-13418=2010.0=20=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E9=BB=98=E8=AE=A4=E8=AF=AD=E8=A8=80=E6=94=B9=E6=88=90?= =?UTF-8?q?=E8=B7=9F9=E4=B8=80=E6=A0=B7,=20=E5=8F=96=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E9=BB=98=E8=AE=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/DesignerEnvManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index d054ab959..73da53d4b 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -112,7 +112,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { private Color paginationLineColor = Color.black; // line color of paper private boolean supportCellEditorDef = false; private boolean isDragPermited = false; - private Locale language = Locale.SIMPLIFIED_CHINESE; + private Locale language = Locale.getDefault(); //2014-8-26默认显示全部, 因为以前的版本, 虽然是false, 实际上是显示所有表, 因此这边要兼容 private boolean useOracleSystemSpace = true; private int cachingTemplateLimit = CACHINGTEMPLATE_LIMIT; From 17031ef1b2d2026ccd20e6e2d417fbad7ddf3926 Mon Sep 17 00:00:00 2001 From: Hades Date: Mon, 10 Dec 2018 12:43:48 +0800 Subject: [PATCH 14/17] =?UTF-8?q?REPORT-12698=20=E5=8D=95=E5=85=83?= =?UTF-8?q?=E6=A0=BC=E8=83=8C=E6=99=AF=E8=AE=BE=E7=BD=AE=E4=B8=BA=E5=9B=BE?= =?UTF-8?q?=E6=A1=88,=20=E5=85=B3=E9=97=AD=E6=A8=A1=E6=9D=BF=E5=90=8E?= =?UTF-8?q?=E5=86=8D=E6=89=93=E5=BC=80,=20=E4=BC=9A=E5=8F=98=E6=88=90?= =?UTF-8?q?=E7=BA=AF=E9=BB=91=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backgroundpane/PatternBackgroundQuickPane.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java index d965151cb..bb8038ac4 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java @@ -52,7 +52,8 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane { } foregroundColorPane = new ColorSelectBox(60); backgroundColorPane = new ColorSelectBox(60); - + foregroundColorPane.setSelectObject(Color.lightGray); + foregroundColorPane.setSelectObject(Color.black); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ @@ -219,7 +220,7 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane { @Override public void reset() { patternButtonArray[0].setSelected(true); - foregroundColorPane.setSelectObject(null); - backgroundColorPane.setSelectObject(null); + foregroundColorPane.setSelectObject(Color.lightGray); + backgroundColorPane.setSelectObject(Color.black); } } From 8456349de848306cf1dfed55a3fa6fcfcd852689 Mon Sep 17 00:00:00 2001 From: Hades Date: Mon, 10 Dec 2018 13:36:16 +0800 Subject: [PATCH 15/17] =?UTF-8?q?=E5=8A=A0=E5=B8=B8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backgroundpane/PatternBackgroundQuickPane.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java index bb8038ac4..5e69d9f82 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/PatternBackgroundQuickPane.java @@ -30,6 +30,8 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane { private int patternIndex = 0; // pattern setIndex. private final static int DEFAULT_DIM_HEIGHT = 210; + private final static Color DEFAULT_FOREGROUND = Color.lightGray; + private final static Color DEFAULT_BACKGROUND = Color.black; private ColorSelectBox foregroundColorPane; private ColorSelectBox backgroundColorPane; private PatternButton[] patternButtonArray; @@ -52,8 +54,8 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane { } foregroundColorPane = new ColorSelectBox(60); backgroundColorPane = new ColorSelectBox(60); - foregroundColorPane.setSelectObject(Color.lightGray); - foregroundColorPane.setSelectObject(Color.black); + foregroundColorPane.setSelectObject(DEFAULT_FOREGROUND); + foregroundColorPane.setSelectObject(DEFAULT_BACKGROUND); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ @@ -220,7 +222,7 @@ public class PatternBackgroundQuickPane extends BackgroundQuickPane { @Override public void reset() { patternButtonArray[0].setSelected(true); - foregroundColorPane.setSelectObject(Color.lightGray); - backgroundColorPane.setSelectObject(Color.black); + foregroundColorPane.setSelectObject(DEFAULT_FOREGROUND); + backgroundColorPane.setSelectObject(DEFAULT_BACKGROUND); } } From d88f4f9dd8c9388f06db45c37e9cc4bf2e08b012 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Mon, 10 Dec 2018 16:41:28 +0800 Subject: [PATCH 16/17] =?UTF-8?q?REPORT-13431=20=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E7=82=B9=E8=AE=B0=E5=BD=95,=20=E9=9C=80=E8=A6=81=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E5=8F=91=E9=80=81=20=E6=8D=A2=E7=94=A8multiple?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E5=90=88=E5=B9=B6=E5=A4=9A=E6=9D=A1=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/InformationCollector.java | 47 ++++++++++--------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java b/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java index 6f3c9bdea..4dafbeccd 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java @@ -104,6 +104,7 @@ public class InformationCollector implements XMLReadable, XMLWriter { private static final String ATTR_TITLE = "title"; private static final String ATTR_USER_NAME = "username"; private static final String ATTR_UUID = "uuid"; + private static final String ATTR_FUNCTION_ARRAY = "functionArray"; private static InformationCollector collector; @@ -232,21 +233,23 @@ public class InformationCollector implements XMLReadable, XMLWriter { if (currentTime - lastTime <= DELTA) { return; } - ArrayList> content = null; - content = getFunctionsContent(current, new Date(lastTime)); + JSONArray content = null; + try { + content = getFunctionsContent(current, new Date(lastTime)); + } catch (JSONException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } boolean success = false; FineLoggerFactory.getLogger().info("Start sent function records to the cloud center..."); String url = CloudCenter.getInstance().acquireUrlByKind(TABLE_FUNCTION_RECORD); - if(content.size() > 0){ - for(int i=0; i 0){ + success = sendFunctionRecord(url, content); //服务器返回true, 说明已经获取成功, 更新最后一次发送时间 if (success) { this.lastTime = dateToString(); + FineLoggerFactory.getLogger().info("Function records successfully sent to the cloud center."); } } - FineLoggerFactory.getLogger().info("Function records successfully sent to the cloud center."); // //先将发送压缩文件这段代码注释,之后提任务 //大数据量下发送压缩zip数据不容易丢失 // try { @@ -265,12 +268,14 @@ public class InformationCollector implements XMLReadable, XMLWriter { // } } - private boolean sendFunctionRecord(String url, Map record) { + private boolean sendFunctionRecord(String url, JSONArray record) { boolean success = false; try { - String recordUrl = url+"?token=" + SiteCenterToken.generateToken() + "&content="+URLEncoder.encode(new JSONObject(record).toString(), EncodeConstants.ENCODING_UTF_8); - String res = HttpToolbox.get(recordUrl); - success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success"); + HashMap para = new HashMap<>(); + para.put("token", SiteCenterToken.generateToken()); + para.put("content", record); + String res = HttpToolbox.post(url, para); + success = ComparatorUtils.equals(new JSONObject(res).get("status"), "success"); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } @@ -437,33 +442,33 @@ public class InformationCollector implements XMLReadable, XMLWriter { }); } - public static ArrayList getFunctionsContent(Date current, Date last){ - ArrayList> records = new ArrayList>(); + public static JSONArray getFunctionsContent(Date current, Date last) throws JSONException{ + JSONArray functionArray = new JSONArray(); QueryCondition condition = QueryFactory.create() .addRestriction(RestrictionFactory.lte(COLUMN_TIME, current)) .addRestriction(RestrictionFactory.gte(COLUMN_TIME, last)); try { DataList focusPoints = MetricRegistry.getMetric().find(FocusPoint.class,condition); - DesignerEnvManager envManager = DesignerEnvManager.getEnvManager(); - String bbsUserName = MarketConfig.getInstance().getBbsUsername(); - String uuid = envManager.getUUID(); + if(!focusPoints.isEmpty()){ for(FocusPoint focusPoint : focusPoints.getList()){ - Map record = new HashMap<>(); + com.fr.json.JSONObject record = new com.fr.json.JSONObject(); record.put(ATTR_ID, focusPoint.getId()); record.put(ATTR_TEXT, focusPoint.getText()); record.put(ATTR_SOURCE, focusPoint.getSource()); record.put(ATTR_TIME, focusPoint.getTime().getTime()); record.put(ATTR_TITLE, focusPoint.getTitle()); - record.put(ATTR_USER_NAME, bbsUserName); - record.put(ATTR_UUID, uuid); - records.add(record); + record.put(ATTR_USER_NAME, MarketConfig.getInstance().getBbsUsername()); + record.put(ATTR_UUID, DesignerEnvManager.getEnvManager().getUUID()); + record.put(ATTR_FUNCTION_ARRAY, functionArray); + functionArray.put(record); } } + } catch (MetricException e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } - return records; + return functionArray; } private class StartStopTime implements XMLReadable, XMLWriter { From 560b0fb626b90e7d46fe23b08d9709f6bd0e59e8 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Mon, 10 Dec 2018 19:02:52 +0800 Subject: [PATCH 17/17] =?UTF-8?q?=E6=AF=8F=E8=BE=BE=E5=88=B0200=E6=9D=A1?= =?UTF-8?q?=E6=97=B6=E5=90=88=E5=B9=B6=E8=AF=B7=E6=B1=82=E5=8F=91=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/InformationCollector.java | 57 ++++++++++++++----- 1 file changed, 42 insertions(+), 15 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java b/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java index 4dafbeccd..047ffc671 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java @@ -105,6 +105,7 @@ public class InformationCollector implements XMLReadable, XMLWriter { private static final String ATTR_USER_NAME = "username"; private static final String ATTR_UUID = "uuid"; private static final String ATTR_FUNCTION_ARRAY = "functionArray"; + private static final int MAX_EACH_REQUEST_RECORD_COUNT = 200; private static InformationCollector collector; @@ -242,14 +243,22 @@ public class InformationCollector implements XMLReadable, XMLWriter { boolean success = false; FineLoggerFactory.getLogger().info("Start sent function records to the cloud center..."); String url = CloudCenter.getInstance().acquireUrlByKind(TABLE_FUNCTION_RECORD); - if(content.length() > 0){ - success = sendFunctionRecord(url, content); + try { + for(int i=0;i 0){ + success = sendFunctionRecord(url, functionArray); + } + } //服务器返回true, 说明已经获取成功, 更新最后一次发送时间 if (success) { this.lastTime = dateToString(); FineLoggerFactory.getLogger().info("Function records successfully sent to the cloud center."); } + }catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); } + // //先将发送压缩文件这段代码注释,之后提任务 //大数据量下发送压缩zip数据不容易丢失 // try { @@ -443,34 +452,52 @@ public class InformationCollector implements XMLReadable, XMLWriter { } public static JSONArray getFunctionsContent(Date current, Date last) throws JSONException{ + //记录当前条数,达到200条合并成一个请求 + int count = 0; JSONArray functionArray = new JSONArray(); QueryCondition condition = QueryFactory.create() .addRestriction(RestrictionFactory.lte(COLUMN_TIME, current)) .addRestriction(RestrictionFactory.gte(COLUMN_TIME, last)); try { DataList focusPoints = MetricRegistry.getMetric().find(FocusPoint.class,condition); - + JSONArray temp = new JSONArray(); if(!focusPoints.isEmpty()){ - for(FocusPoint focusPoint : focusPoints.getList()){ - com.fr.json.JSONObject record = new com.fr.json.JSONObject(); - record.put(ATTR_ID, focusPoint.getId()); - record.put(ATTR_TEXT, focusPoint.getText()); - record.put(ATTR_SOURCE, focusPoint.getSource()); - record.put(ATTR_TIME, focusPoint.getTime().getTime()); - record.put(ATTR_TITLE, focusPoint.getTitle()); - record.put(ATTR_USER_NAME, MarketConfig.getInstance().getBbsUsername()); - record.put(ATTR_UUID, DesignerEnvManager.getEnvManager().getUUID()); - record.put(ATTR_FUNCTION_ARRAY, functionArray); - functionArray.put(record); + for(int i=0;i< focusPoints.getList().size();i++){ + FocusPoint focusPoint = focusPoints.getList().get(i); + if(focusPoint != null){ + if((++count <= MAX_EACH_REQUEST_RECORD_COUNT)){ + temp.put(getOneRecord(focusPoint)); + } else { + count = 0; + functionArray.put(temp); + temp = new JSONArray(); + temp.put(getOneRecord(focusPoint)); + } + if(i == (focusPoints.getList().size() -1)){ + functionArray.put(temp); + } + } } } - } catch (MetricException e) { + } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } return functionArray; } + private static JSONObject getOneRecord(FocusPoint focusPoint) throws JSONException{ + com.fr.json.JSONObject record = new com.fr.json.JSONObject(); + record.put(ATTR_ID, focusPoint.getId()); + record.put(ATTR_TEXT, focusPoint.getText()); + record.put(ATTR_SOURCE, focusPoint.getSource()); + record.put(ATTR_TIME, focusPoint.getTime().getTime()); + record.put(ATTR_TITLE, focusPoint.getTitle()); + record.put(ATTR_USER_NAME, MarketConfig.getInstance().getBbsUsername()); + record.put(ATTR_UUID, DesignerEnvManager.getEnvManager().getUUID()); + return record; + } + private class StartStopTime implements XMLReadable, XMLWriter { private String startDate;