Browse Source

Merge remote-tracking branch 'origin/release/10.0' into release/10.0

bugfix/10.0
abel 6 years ago
parent
commit
54f0ad85c3
  1. 3
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java
  2. 43
      designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java
  3. 29
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  4. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartDatapointLabelPane.java
  5. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/CustomDefaultSeriesPane.java
  6. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/CustomTypeConditionSeriesPane.java
  7. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/LineSeriesPane.java
  8. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/RadarSeriesPane.java
  9. 7
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPane.java
  10. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/component/format/CategoryNameFormatPaneWithCheckBox.java
  11. 16
      designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java
  12. 7
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  13. 155
      designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java

3
designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java

@ -188,10 +188,13 @@ public class HistoryTemplateListCache implements CallbackEvent {
/** /**
* 判断是否打开过该模板 * 判断是否打开过该模板
* 由于切换环境不会关闭模板可能存在同名的模板所以该方法不能准确找到所选的模板
* *
* @param filename 文件名 * @param filename 文件名
* @return 文件位置 * @return 文件位置
* @deprecated use HistoryTemplateListCache#contains(com.fr.design.mainframe.JTemplate) instead
*/ */
@Deprecated
public int contains(String filename) { public int contains(String filename) {
for (int i = 0; i < historyList.size(); i++) { for (int i = 0; i < historyList.size(); i++) {
String historyPath = historyList.get(i).getPath(); String historyPath = historyList.get(i).getPath();

43
designer-base/src/main/java/com/fr/design/file/MutilTempalteTabPane.java

@ -18,7 +18,6 @@ import com.fr.log.FineLoggerFactory;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.third.javax.annotation.Nonnull; import com.fr.third.javax.annotation.Nonnull;
import com.fr.third.org.apache.commons.io.FilenameUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import com.fr.workspace.server.lock.TplOperator; import com.fr.workspace.server.lock.TplOperator;
@ -674,9 +673,6 @@ public class MutilTempalteTabPane extends JComponent {
return; return;
} }
//当前激活的模板
String filename = openedTemplate.get(selectedIndex).getPath();
filename = FilenameUtils.standard(filename);
if (!specifiedTemplate.isALLSaved() && !DesignerMode.isVcsMode()) { if (!specifiedTemplate.isALLSaved() && !DesignerMode.isVcsMode()) {
specifiedTemplate.stopEditing(); specifiedTemplate.stopEditing();
int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + specifiedTemplate.getEditingFILE() + "\" ?", int returnVal = JOptionPane.showConfirmDialog(DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Basic_Utils_Would_You_Like_To_Save") + " \"" + specifiedTemplate.getEditingFILE() + "\" ?",
@ -684,20 +680,20 @@ public class MutilTempalteTabPane extends JComponent {
if (returnVal == JOptionPane.YES_OPTION) { if (returnVal == JOptionPane.YES_OPTION) {
specifiedTemplate.saveTemplate(); specifiedTemplate.saveTemplate();
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName())); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Template_Already_Saved", specifiedTemplate.getEditingFILE().getName()));
closeTpl(specifiedTemplate, filename); closeTpl(specifiedTemplate);
} else if (returnVal == JOptionPane.NO_OPTION) { } else if (returnVal == JOptionPane.NO_OPTION) {
closeTpl(specifiedTemplate, filename); closeTpl(specifiedTemplate);
} }
} else { } else {
closeTpl(specifiedTemplate, filename); closeTpl(specifiedTemplate);
} }
} }
private void closeTpl(@Nonnull JTemplate<?, ?> specifiedTemplate, @Nonnull String fileName) { private void closeTpl(@Nonnull JTemplate<?, ?> specifiedTemplate) {
HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate); HistoryTemplateListCache.getInstance().closeSelectedReport(specifiedTemplate);
closeAndFreeLock(specifiedTemplate); closeAndFreeLock(specifiedTemplate);
activeTemplate(fileName); activePrevTemplateAfterClose();
} }
private void closeAndFreeLock(@Nonnull JTemplate<?, ?> template) { private void closeAndFreeLock(@Nonnull JTemplate<?, ?> template) {
@ -729,11 +725,9 @@ public class MutilTempalteTabPane extends JComponent {
} }
/** /**
* 关闭掉一个模板之后该激活的Tab * 关闭掉一个模板之后激活新的待显示模板
*
* @param fileName 关闭掉一个模板之后该激活的Tab的文件名绝对路径
*/ */
private void activeTemplate(String fileName) { private void activePrevTemplateAfterClose() {
if (openedTemplate.isEmpty()) { if (openedTemplate.isEmpty()) {
//新建并激活模板 //新建并激活模板
DesignerContext.getDesignerFrame().addAndActivateJTemplate(); DesignerContext.getDesignerFrame().addAndActivateJTemplate();
@ -742,23 +736,20 @@ public class MutilTempalteTabPane extends JComponent {
temTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); temTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
} else { } else {
//如果关闭的模板是当前选中的模板,则重新激活 // 如果关闭的模板是当前选中的模板,则重新激活当前 selectIndex 的模板;
if (closeIconIndex == selectedIndex) { // selectIndex 没有变化,但是对应的模板已经变成了前一张模板
if (closeIconIndex == maxPaintIndex) { if (closeIconIndex == selectedIndex || isCloseCurrent) {
// 如果 closeIconIndex 是最后一个被渲染画出的,那么预览上一个,防止数组越界
if (closeIconIndex >= maxPaintIndex) {
// selectIndex 不会 <0 因为如果关闭的是打开的最后一个模板,那么关闭之后 openedTemplate.isEmpty() = true
selectedIndex--; selectedIndex--;
} }
} else if (isCloseCurrent) {
//不是通过关闭按钮,而是通过文件关闭菜单关闭的当前模板的,也重新激活
if (selectedIndex > openedTemplate.size() - 1) {
selectedIndex -= 1;
if (selectedIndex < 0) {
selectedIndex = 0;
}
isCloseCurrent = false; isCloseCurrent = false;
} }
} else { // 如果关闭的模板不是当前选中的模板,那么重新获取一下当前模板的 index,激活该 index
//如果关闭的模板不是当前选中的模板,则激活的模板不变 else {
selectedIndex = HistoryTemplateListCache.getInstance().contains(fileName); JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
selectedIndex = HistoryTemplateListCache.getInstance().contains(template);
} }
//如果是已后台关闭的模板,则重新打开文件 //如果是已后台关闭的模板,则重新打开文件
openedTemplate.get(selectedIndex).activeOldJTemplate(); openedTemplate.get(selectedIndex).activeOldJTemplate();

29
designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java

@ -31,6 +31,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;
@ -78,7 +79,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;
@ -162,9 +162,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() {
@ -855,18 +855,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()));
} }
} }
@ -963,8 +963,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;
} }
@ -974,7 +978,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")
@ -1033,7 +1037,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;
@ -1048,13 +1052,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);

2
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ChartDatapointLabelPane.java

@ -96,7 +96,7 @@ public class ChartDatapointLabelPane extends BasicPane{
boolean isGuidline = plot.isSupportLeadLine(); boolean isGuidline = plot.isSupportLeadLine();
if(plot.isSupportCategoryFilter()) { if(plot.isSupportCategoryFilter()) {
isCategory = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Format_Category_Name")); isCategory = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Category_Use_Name"));
} }
isSeries = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name")); isSeries = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name"));
isValue = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Value")); isValue = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Value"));

2
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/CustomDefaultSeriesPane.java

@ -240,7 +240,7 @@ public class CustomDefaultSeriesPane extends BasicPane{
isCurve = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Curve_Smooth")); isCurve = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Curve_Smooth"));
lineStyle = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); lineStyle = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
markerPane = new MarkerComboBox(MarkerFactory.getMarkerArray()); markerPane = new MarkerComboBox(MarkerFactory.getMarkerArray());
String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Continue")}; String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Break"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Continue")};
Boolean[] valueArray = {true, false}; Boolean[] valueArray = {true, false};
isNullValueBreak = new UIButtonGroup<Boolean>(nameArray, valueArray); isNullValueBreak = new UIButtonGroup<Boolean>(nameArray, valueArray);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;

2
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/CustomTypeConditionSeriesPane.java

@ -449,7 +449,7 @@ public class CustomTypeConditionSeriesPane extends BasicBeanPane<CustomAttr>{
lineStyle.setPreferredSize(new Dimension(150,20)); lineStyle.setPreferredSize(new Dimension(150,20));
markerPane.setPreferredSize(new Dimension(150,20)); markerPane.setPreferredSize(new Dimension(150,20));
String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Continue")}; String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Break"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Continue")};
Boolean[] valueArray = {true, false}; Boolean[] valueArray = {true, false};
isNullValueBreak = new UIButtonGroup<Boolean>(nameArray, valueArray); isNullValueBreak = new UIButtonGroup<Boolean>(nameArray, valueArray);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;

2
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/LineSeriesPane.java

@ -49,7 +49,7 @@ public class LineSeriesPane extends AbstractPlotSeriesPane{
isCurve = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Curve_Smooth")); isCurve = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Curve_Smooth"));
lineStyle = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); lineStyle = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
markerPane = new MarkerComboBox(MarkerFactory.getMarkerArray()); markerPane = new MarkerComboBox(MarkerFactory.getMarkerArray());
String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Continue")}; String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Break"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Continue")};
Boolean[] valueArray = {true, false}; Boolean[] valueArray = {true, false};
isNullValueBreak = new UIButtonGroup<Boolean>(nameArray, valueArray); isNullValueBreak = new UIButtonGroup<Boolean>(nameArray, valueArray);
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;

2
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/series/RadarSeriesPane.java

@ -45,7 +45,7 @@ public class RadarSeriesPane extends AbstractPlotSeriesPane{
isCurve = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Fill")); isCurve = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Fill"));
lineStyle = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART); lineStyle = new LineComboBox(CoreConstants.STRIKE_LINE_STYLE_ARRAY_4_CHART);
markerPane = new MarkerComboBox(MarkerFactory.getMarkerArray()); markerPane = new MarkerComboBox(MarkerFactory.getMarkerArray());
String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Continue")}; String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Break"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Continue")};
Boolean[] valueArray = {true, false}; Boolean[] valueArray = {true, false};
isNullValueBreak = new UIButtonGroup<Boolean>(nameArray, valueArray); isNullValueBreak = new UIButtonGroup<Boolean>(nameArray, valueArray);

7
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartBeautyPane.java

@ -4,6 +4,7 @@ import com.fr.chart.base.ChartConstants;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -28,7 +29,7 @@ public class VanChartBeautyPane extends BasicBeanPane<Integer> {
double[] columnSize = {f, e}; double[] columnSize = {f, e};
double[] rowSize = {p}; double[] rowSize = {p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style")), styleBox}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Style")), styleBox},
} ; } ;
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
@ -36,8 +37,8 @@ public class VanChartBeautyPane extends BasicBeanPane<Integer> {
} }
protected String[] getNameArray(){ protected String[] getNameArray(){
return new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Default_Name"), return new String[]{Toolkit.i18nText("Fine-Design_Chart_Default_Name"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Top_Down_Shade") Toolkit.i18nText("Fine-Design_Chart_Style_TopDownShade")
}; };
} }
@Override @Override

4
designer-chart/src/main/java/com/fr/van/chart/designer/component/format/CategoryNameFormatPaneWithCheckBox.java

@ -1,6 +1,7 @@
package com.fr.van.chart.designer.component.format; package com.fr.van.chart.designer.component.format;
import com.fr.design.i18n.Toolkit;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -18,6 +19,7 @@ public class CategoryNameFormatPaneWithCheckBox extends VanChartFormatPaneWithCh
@Override @Override
protected String getCheckBoxText() { protected String getCheckBoxText() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Format_Category_Name"); //"分类名" 图表(新特性)标签、提示时有用到
return Toolkit.i18nText("Fine-Design_Chart_Category_Use_Name");
} }
} }

16
designer-form/src/main/java/com/fr/design/actions/FormMobileAttrAction.java

@ -3,11 +3,15 @@ package com.fr.design.actions;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.iofile.attr.MobileOnlyTemplateAttrMark; import com.fr.base.iofile.attr.MobileOnlyTemplateAttrMark;
import com.fr.design.actions.JTemplateAction; import com.fr.design.actions.JTemplateAction;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWAbsoluteBodyLayout;
import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.form.mobile.FormMobileAttrPane; import com.fr.design.form.mobile.FormMobileAttrPane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.FormArea; import com.fr.design.mainframe.FormArea;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.JForm; import com.fr.design.mainframe.JForm;
import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
@ -73,6 +77,9 @@ public class FormMobileAttrAction extends JTemplateAction<JForm> {
formTpl.setFormMobileAttr(formMobileAttr); // 会调整 body 的自适应布局,放到最后 formTpl.setFormMobileAttr(formMobileAttr); // 会调整 body 的自适应布局,放到最后
((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified(); ((FormArea)jf.getFormDesign().getParent()).onMobileAttrModified();
jf.getFormDesign().getSelectionModel().setSelectedCreator(jf.getFormDesign().getRootComponent()); jf.getFormDesign().getSelectionModel().setSelectedCreator(jf.getFormDesign().getRootComponent());
//改变布局为自适应布局,只在移动端属性设置保存后改变一次
doChangeBodyLayout();
WidgetPropertyPane.getInstance().refreshDockingView(); WidgetPropertyPane.getInstance().refreshDockingView();
jf.fireTargetModified(); jf.fireTargetModified();
} }
@ -80,6 +87,15 @@ public class FormMobileAttrAction extends JTemplateAction<JForm> {
dialog.setVisible(true); dialog.setVisible(true);
} }
private void doChangeBodyLayout(){
FormDesigner formDesigner = WidgetPropertyPane.getInstance().getEditingFormDesigner();
XLayoutContainer rootLayout = formDesigner.getRootComponent();
if (rootLayout.getComponentCount() == 1 && rootLayout.getXCreator(0).acceptType(XWAbsoluteBodyLayout.class)) {
rootLayout = (XWAbsoluteBodyLayout) rootLayout.getXCreator(0);
}
((XWFitLayout)formDesigner.getRootComponent()).switch2FitBodyLayout(rootLayout);
}
@Focus(id = "com.fr.mobile.mobile_template_frm", text = "Fine-Design_Function_Mobile_Template_Frm", source = Original.EMBED) @Focus(id = "com.fr.mobile.mobile_template_frm", text = "Fine-Design_Function_Mobile_Template_Frm", source = Original.EMBED)
private void recordFunction() { private void recordFunction() {
// do nothing // do nothing

7
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java

@ -137,14 +137,9 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
XLayoutContainer rootLayout = selectedBodyLayout(formDesigner); XLayoutContainer rootLayout = selectedBodyLayout(formDesigner);
if (rootLayout != formDesigner.getRootComponent() if (rootLayout != formDesigner.getRootComponent()
&& formDesigner.getSelectionModel().getSelection().getSelectedCreator() == formDesigner.getRootComponent()) { && formDesigner.getSelectionModel().getSelection().getSelectedCreator() == formDesigner.getRootComponent()) {
//原单例面板populate根据当前样式populate属性面板,现加入移动端逻辑:可能需要根据面板属性改变样式
Form form = formDesigner.getTarget();
if (form.getFormMobileAttr().isMobileOnly() && form.getFormMobileAttr().isAdaptivePropertyAutoMatch()) {
((XWFitLayout)formDesigner.getRootComponent()).switch2FitBodyLayout(rootLayout);
} else {
formDesigner.getSelectionModel().setSelectedCreators( formDesigner.getSelectionModel().setSelectedCreators(
FormSelectionUtils.rebuildSelection(xWFitLayout, new Widget[]{selectedBodyLayout(formDesigner).toData()})); FormSelectionUtils.rebuildSelection(xWFitLayout, new Widget[]{selectedBodyLayout(formDesigner).toData()}));
}
} }
paddingBound.populate(ob); paddingBound.populate(ob);
layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue()); layoutComboBox.setSelectedIndex(ob.getBodyLayoutType().getTypeValue());

155
designer-realize/src/main/java/com/fr/design/mainframe/InformationCollector.java

@ -5,11 +5,6 @@ package com.fr.design.mainframe;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.config.MarketConfig; import com.fr.config.MarketConfig;
import com.fr.data.core.db.DBUtils;
import com.fr.data.core.db.dialect.DialectFactory;
import com.fr.data.core.db.dml.Delete;
import com.fr.data.core.db.dml.Select;
import com.fr.data.core.db.dml.Table;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.errorinfo.ErrorInfoUploader; import com.fr.design.mainframe.errorinfo.ErrorInfoUploader;
import com.fr.design.mainframe.templateinfo.TemplateInfoCollector; import com.fr.design.mainframe.templateinfo.TemplateInfoCollector;
@ -19,18 +14,13 @@ import com.fr.general.DateUtils;
import com.fr.general.DesUtils; import com.fr.general.DesUtils;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.general.http.HttpClient;
import com.fr.general.http.HttpToolbox; import com.fr.general.http.HttpToolbox;
import com.fr.intelli.record.FocusPoint; import com.fr.intelli.record.FocusPoint;
import com.fr.intelli.record.MetricException;
import com.fr.intelli.record.MetricRegistry; import com.fr.intelli.record.MetricRegistry;
import com.fr.json.JSONArray; import com.fr.json.JSONArray;
import com.fr.json.JSONException; import com.fr.json.JSONException;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.log.message.ParameterMessage;
import com.fr.record.DBRecordXManager;
import com.fr.stable.ArrayUtils;
import com.fr.stable.EncodeConstants; import com.fr.stable.EncodeConstants;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
@ -58,17 +48,15 @@ import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.OutputStreamWriter; import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.DateFormat; import java.text.DateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
/** /**
* @author neil * @author neil
@ -79,7 +67,7 @@ public class InformationCollector implements XMLReadable, XMLWriter {
// 24小时上传一次 // 24小时上传一次
private static final long DELTA = 24 * 3600 * 1000L; private static final long DELTA = 24 * 3600 * 1000L;
private static final long SEND_DELAY = 30 * 1000L; private static final long SEND_DELAY = 300 * 1000L;
private static final String FILE_NAME = "fr.info"; private static final String FILE_NAME = "fr.info";
private static final String XML_START_STOP_LIST = "StartStopList"; private static final String XML_START_STOP_LIST = "StartStopList";
private static final String XML_START_STOP = "StartStop"; private static final String XML_START_STOP = "StartStop";
@ -226,12 +214,7 @@ public class InformationCollector implements XMLReadable, XMLWriter {
if (currentTime - lastTime <= DELTA) { if (currentTime - lastTime <= DELTA) {
return; return;
} }
JSONArray content = null; JSONArray content = getFunctionsContent(currentTime, lastTime);
try {
content = getFunctionsContent(currentTime, lastTime);
} catch (JSONException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
boolean success = false; boolean success = false;
FineLoggerFactory.getLogger().info("Start sent function records to the cloud center..."); FineLoggerFactory.getLogger().info("Start sent function records to the cloud center...");
String url = CloudCenter.getInstance().acquireUrlByKind(TABLE_FUNCTION_RECORD); String url = CloudCenter.getInstance().acquireUrlByKind(TABLE_FUNCTION_RECORD);
@ -443,7 +426,7 @@ public class InformationCollector implements XMLReadable, XMLWriter {
}); });
} }
public static JSONArray getFunctionsContent(long current, long last) throws JSONException{ public JSONArray getFunctionsContent(long current, long last) {
//记录当前条数,达到200条合并成一个请求 //记录当前条数,达到200条合并成一个请求
int count = 0; int count = 0;
JSONArray functionArray = new JSONArray(); JSONArray functionArray = new JSONArray();
@ -452,21 +435,20 @@ public class InformationCollector implements XMLReadable, XMLWriter {
.addRestriction(RestrictionFactory.gte(COLUMN_TIME, last)); .addRestriction(RestrictionFactory.gte(COLUMN_TIME, last));
try { try {
DataList<FocusPoint> focusPoints = MetricRegistry.getMetric().find(FocusPoint.class,condition); DataList<FocusPoint> focusPoints = MetricRegistry.getMetric().find(FocusPoint.class,condition);
JSONArray temp = new JSONArray(); TreeSet<FunctionRecord> focusPointsList = new TreeSet<>();
if(!focusPoints.isEmpty()){ if(!focusPoints.isEmpty()){
for(int i=0;i< focusPoints.getList().size();i++){ for(int i=0;i< focusPoints.getList().size();i++){
FocusPoint focusPoint = focusPoints.getList().get(i); FocusPoint focusPoint = focusPoints.getList().get(i);
if(focusPoint != null){ if(focusPoint != null){
if((++count <= MAX_EACH_REQUEST_RECORD_COUNT)){ if((++count <= MAX_EACH_REQUEST_RECORD_COUNT)){
temp.put(getOneRecord(focusPoint)); focusPointsList.add(getOneRecord(focusPoint));
} else { } else {
count = 0; count = 0;
functionArray.put(temp); functionArray.put(setToJSONArray(focusPointsList));
temp = new JSONArray(); focusPointsList.add(getOneRecord(focusPoint));
temp.put(getOneRecord(focusPoint));
} }
if(i == (focusPoints.getList().size() -1)){ if(i == (focusPoints.getList().size() -1)){
functionArray.put(temp); functionArray.put(setToJSONArray(focusPointsList));
} }
} }
} }
@ -478,16 +460,33 @@ public class InformationCollector implements XMLReadable, XMLWriter {
return functionArray; return functionArray;
} }
private static JSONObject getOneRecord(FocusPoint focusPoint) throws JSONException{ private FunctionRecord getOneRecord(FocusPoint focusPoint) {
FunctionRecord functionRecord = new FunctionRecord();
functionRecord.setId(focusPoint.getId() == null?StringUtils.EMPTY : focusPoint.getId());
functionRecord.setText(focusPoint.getText() == null?StringUtils.EMPTY : focusPoint.getText());
functionRecord.setSource(focusPoint.getSource());
functionRecord.setTime(focusPoint.getTime().getTime());
functionRecord.setTitle(focusPoint.getTitle() == null?StringUtils.EMPTY : focusPoint.getTitle());
functionRecord.setUsername(MarketConfig.getInstance().getBbsUsername() == null?StringUtils.EMPTY : MarketConfig.getInstance().getBbsUsername());
functionRecord.setUuid(DesignerEnvManager.getEnvManager().getUUID() == null?StringUtils.EMPTY : DesignerEnvManager.getEnvManager().getUUID());
return functionRecord;
}
private JSONArray setToJSONArray(Set set) throws JSONException {
JSONArray jsonArray = new JSONArray();
for(Iterator iter = set.iterator(); iter.hasNext(); ) {
FunctionRecord functionRecord = (FunctionRecord)iter.next();
com.fr.json.JSONObject record = new com.fr.json.JSONObject(); com.fr.json.JSONObject record = new com.fr.json.JSONObject();
record.put(ATTR_ID, focusPoint.getId()); record.put(ATTR_ID, functionRecord.getId());
record.put(ATTR_TEXT, focusPoint.getText()); record.put(ATTR_TEXT, functionRecord.getText());
record.put(ATTR_SOURCE, focusPoint.getSource()); record.put(ATTR_SOURCE, functionRecord.getSource());
record.put(ATTR_TIME, focusPoint.getTime().getTime()); record.put(ATTR_TIME, functionRecord.getTime());
record.put(ATTR_TITLE, focusPoint.getTitle()); record.put(ATTR_TITLE, functionRecord.getTitle());
record.put(ATTR_USER_NAME, MarketConfig.getInstance().getBbsUsername()); record.put(ATTR_USER_NAME, functionRecord.getUsername());
record.put(ATTR_UUID, DesignerEnvManager.getEnvManager().getUUID()); record.put(ATTR_UUID, functionRecord.getUuid());
return record; jsonArray.put(record);
}
return jsonArray;
} }
private class StartStopTime implements XMLReadable, XMLWriter { private class StartStopTime implements XMLReadable, XMLWriter {
@ -529,4 +528,84 @@ public class InformationCollector implements XMLReadable, XMLWriter {
} }
private class FunctionRecord implements Comparable{
private String id;
private String text;
private int source;
private long time;
private String title;
private String username;
private String uuid;
public FunctionRecord(){
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public int getSource() {
return source;
}
public void setSource(int source) {
this.source = source;
}
public long getTime() {
return time;
}
public void setTime(long time) {
this.time = time;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
@Override
public int compareTo(Object o) {
FunctionRecord functionRecord = (FunctionRecord) o;
if(this.getId().equals((functionRecord.getId())) && this.getText().equals(functionRecord.getText())
&& this.getSource() == functionRecord.getSource() && this.getTime() == functionRecord.getTime()
&& this.getTitle().equals(functionRecord.getTitle()) && this.getUsername().equals(functionRecord.getUsername())
&& this.getUuid().equals(functionRecord.getUuid())){
return 0;
}
return 1;
}
}
} }
Loading…
Cancel
Save