Browse Source

Merge pull request #14 in ~NEIL/design from release/10.0 to feature/10.0

* commit 'fd2c37ad581a6efdb850fc1acdf43a815c441d90': (51 commits)
  REPORT-14624【0123回归】输出内置数据集到设计器工作目录覆盖原文件,导出失败 这里转OutputStream时,需要保留原文件,否则覆盖自身时会找不到文件
  CHART-3017 为区域段图例面板指定Parent 传FR10
  代码质量:从源头返回空list
  REPORT-14465 【10.0冒烟】 数字控件“双精度型” 全部展开显示,最底端文字被遮挡
  REPORT-14569 10.0release的alphafine显示问题 定位到是多线程的bug,某些情况下list里放入了之前的线程搜索的结果。目前策略是各线程各自维护一个列表,获取结果后再赋给全局变量
  REPORT-14103 单元格控件设置左父格自动消失 10.0 同步 & REPORT-14558 【回归测试】单元格属性--修改自动调整属性,控件会消失
  CHART-3856 自动播放界面问题
  CHART-3791 从其他图表切换至地图,重置地图数据配置
  pmd
  REPORT-14667 支持通过插件扩展目录树支持的文件后缀
  REPORT-13094 oracle远程设计获取表问题
  REPORT-13094 oracle远程设计获取表问题
  删除无用 import
  MOBILE-19684 同时安装顶部参数插件和导航参数插件时设计器显示重复值
  REPORT-14515 环境切换后模板另存面板没有刷新
  REPORT-13225 移动插件脚本下载位置,并删除无用temp文件
  代码质量
  代码质量
  REPORT-13094 设计器远程,选项中没有设置显示oracle所有表,有一部分逻辑不走服务器
  CHART-2809 大屏自动播放 design
  ...
research/10.0
neil 6 years ago
parent
commit
84fcf08183
  1. 2
      designer-base/src/main/java/com/fr/design/DesignModelAdapter.java
  2. 1
      designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java
  3. 5
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  4. 9
      designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java
  5. 8
      designer-base/src/main/java/com/fr/design/data/datapane/VerticalChoosePane.java
  6. 28
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java
  7. 2
      designer-base/src/main/java/com/fr/design/designer/IntervalConstants.java
  8. 8
      designer-base/src/main/java/com/fr/design/extra/PluginConstants.java
  9. 7
      designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java
  10. 39
      designer-base/src/main/java/com/fr/design/file/HistoryTemplateListCache.java
  11. 28
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java
  12. 15
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java
  13. 23
      designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java
  14. 37
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java
  15. 36
      designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperLinkPane.java
  16. 6
      designer-base/src/main/java/com/fr/design/mainframe/AbstractAppProvider.java
  17. 52
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  18. 2
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  19. 63
      designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java
  20. 1
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  21. 9
      designer-base/src/main/java/com/fr/design/menu/MenuDef.java
  22. 25
      designer-base/src/main/java/com/fr/design/parameter/ParaDefinitePane.java
  23. 4
      designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java
  24. 34
      designer-base/src/main/java/com/fr/design/utils/gui/UIComponentUtils.java
  25. 51
      designer-base/src/main/java/com/fr/design/widget/FRWidgetFactory.java
  26. 18
      designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java
  27. 2
      designer-base/src/main/java/com/fr/file/FileFILE.java
  28. 106
      designer-base/src/main/java/com/fr/file/StashedFILE.java
  29. 48
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java
  30. 45
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java
  31. 3
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkNorthPane.java
  32. 54
      designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java
  33. 19
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java
  34. 10
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java
  35. 19
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java
  36. 2
      designer-chart/src/main/java/com/fr/van/chart/DownloadOnlineSourcesHelper.java
  37. 6
      designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java
  38. 6
      designer-chart/src/main/java/com/fr/van/chart/designer/TableLayout4VanChartHelper.java
  39. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java
  40. 7
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartLineTypePane.java
  41. 7
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartTrendLinePane.java
  42. 10
      designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPane.java
  43. 7
      designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithAlphaPane.java
  44. 7
      designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderWithRadiusPane.java
  45. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java
  46. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java
  47. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java
  48. 19
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java
  49. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java
  50. 5
      designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java
  51. 7
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java
  52. 6
      designer-chart/src/main/java/com/fr/van/chart/range/component/SectionLegendPane.java
  53. 16
      designer-form/src/main/java/com/fr/design/designer/beans/events/CreatorEventListenerTable.java
  54. 3
      designer-form/src/main/java/com/fr/design/designer/beans/events/DesignerEditListener.java
  55. 44
      designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java
  56. 23
      designer-form/src/main/java/com/fr/design/mainframe/FormHierarchyTreePane.java
  57. 40
      designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java
  58. 2
      designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java
  59. 12
      designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java
  60. 32
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java
  61. 20
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  62. 8
      designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java
  63. 24
      designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java
  64. 22
      designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java
  65. 4
      designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java
  66. 68
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java
  67. 2
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java
  68. 4
      designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java
  69. 6
      designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppActivator.java
  70. 14
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/AbstractCellAttrPane.java
  71. 5
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java
  72. 6
      designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java
  73. 5
      designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java
  74. 5
      designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java
  75. 34
      designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java
  76. 8
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java
  77. 20
      designer-realize/src/main/java/com/fr/start/SplashContext.java
  78. 9
      designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java
  79. BIN
      designer-realize/src/main/resources/com/fr/design/images/splash_10_jp.gif

2
designer-base/src/main/java/com/fr/design/DesignModelAdapter.java

@ -134,7 +134,7 @@ public abstract class DesignModelAdapter<T extends BaseBook, S extends JTemplate
*/ */
@Deprecated @Deprecated
public Parameter[] getReportParameters() { public Parameter[] getReportParameters() {
return getTableDataParameters(); return getTemplateParameters();
} }
/** /**

1
designer-base/src/main/java/com/fr/design/EnvChangeEntrance.java

@ -224,6 +224,7 @@ public class EnvChangeEntrance {
@Override @Override
public void doCancel() { public void doCancel() {
envListDialog.dispose(); envListDialog.dispose();
// todo 断开了但是没选择新的环境,那么尝试重连旧环境,等接口
} }
}); });
envListDialog.setVisible(true); envListDialog.setVisible(true);

5
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -24,6 +24,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -482,8 +483,8 @@ public class PreferencePane extends BasicPane {
private JPanel createMemoryPane() { private JPanel createMemoryPane() {
JPanel memoryPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Caching_Template")); JPanel memoryPane = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Caching_Template"));
UILabel memoryLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Max_Caching_Template")); UILabel memoryLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Max_Caching_Template"));
UILabel memoryTipLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Caching_Template_Tip")); UILabel memoryTipLabel = FRWidgetFactory.createLineWrapLabel(
UIComponentUtils.setLineWrap(memoryTipLabel, MEMORY_TIP_LABEL_MAX_WIDTH); com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Preference_Caching_Template_Tip"), MEMORY_TIP_LABEL_MAX_WIDTH);
memoryTipLabel.setBorder(BorderFactory.createEmptyBorder(0, CACHING_GAP, 0, 0)); memoryTipLabel.setBorder(BorderFactory.createEmptyBorder(0, CACHING_GAP, 0, 0));
cachingTemplateSpinner = new UISpinner(0, CACHING_MAX, 1, CACHING_DEFAULT); cachingTemplateSpinner = new UISpinner(0, CACHING_MAX, 1, CACHING_DEFAULT);
JPanel memorySpace = new JPanel(FRGUIPaneFactory.createLeftZeroLayout()); JPanel memorySpace = new JPanel(FRGUIPaneFactory.createLeftZeroLayout());

9
designer-base/src/main/java/com/fr/design/actions/file/WebPreviewUtils.java

@ -1,6 +1,5 @@
package com.fr.design.actions.file; package com.fr.design.actions.file;
import com.fr.base.extension.FileExtension;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.design.fun.PreviewProvider; import com.fr.design.fun.PreviewProvider;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
@ -11,7 +10,6 @@ import com.fr.file.FileNodeFILE;
import com.fr.general.GeneralUtils; import com.fr.general.GeneralUtils;
import com.fr.general.web.ParameterConstants; import com.fr.general.web.ParameterConstants;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.stable.web.AbstractWebletCreator;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import java.util.Collections; import java.util.Collections;
@ -90,13 +88,6 @@ public final class WebPreviewUtils {
java.util.List<String> parameterNameList = new java.util.ArrayList<String>(); java.util.List<String> parameterNameList = new java.util.ArrayList<String>();
java.util.List<String> parameterValueList = new java.util.ArrayList<String>(); java.util.List<String> parameterValueList = new java.util.ArrayList<String>();
// 暂时屏蔽cptx直接访问
if (path.endsWith(FileExtension.CPTX.getSuffix())) {
path = path.substring(0, path.length() - 1);
parameterNameList.add(AbstractWebletCreator.FORMAT);
parameterValueList.add(AbstractWebletCreator.X);
}
parameterNameList.add(actionType); parameterNameList.add(actionType);
parameterValueList.add(path); parameterValueList.add(path);
if (map != null) { if (map != null) {

8
designer-base/src/main/java/com/fr/design/data/datapane/VerticalChoosePane.java

@ -9,6 +9,8 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerBean; import com.fr.design.mainframe.DesignerBean;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import javax.swing.*; import javax.swing.*;
@ -16,6 +18,7 @@ import java.awt.*;
public class VerticalChoosePane extends ChoosePane implements DesignerBean { public class VerticalChoosePane extends ChoosePane implements DesignerBean {
private static final int RIGHTBORDER = 5; private static final int RIGHTBORDER = 5;
private static final int MAX_WIDTH = 60;
public VerticalChoosePane(Previewable previewable) { public VerticalChoosePane(Previewable previewable) {
this(previewable, -1); this(previewable, -1);
@ -40,8 +43,7 @@ public class VerticalChoosePane extends ChoosePane implements DesignerBean {
rs.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, -RIGHTBORDER)); rs.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, -RIGHTBORDER));
UILabel l1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database"), UILabel.LEFT); UILabel l1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database"), UILabel.LEFT);
UILabel l2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Model"), UILabel.LEFT); UILabel l2 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Model"), UILabel.LEFT);
UILabel l3 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Select_Table"), UILabel.LEFT); UILabel l3 = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Database_Select_Table"), MAX_WIDTH, UILabel.LEFT);
if (labelSize > 0) { if (labelSize > 0) {
Dimension pSize = new Dimension(labelSize, 20); Dimension pSize = new Dimension(labelSize, 20);
l1.setPreferredSize(pSize); l1.setPreferredSize(pSize);
@ -52,7 +54,7 @@ public class VerticalChoosePane extends ChoosePane implements DesignerBean {
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{l1, dsNameComboBox}, new Component[]{l1, dsNameComboBox},
new Component[]{l2, schemaBox}, new Component[]{l2, schemaBox},
new Component[]{l3, rs} new Component[]{l3, UIComponentUtils.wrapWithBorderLayoutPane(rs)}
}; };
JPanel content = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_HUGER, LayoutConstants.VGAP_LARGE); JPanel content = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_HUGER, LayoutConstants.VGAP_LARGE);

28
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/FileTableDataPane.java

@ -32,11 +32,11 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.file.FILEChooserPane; import com.fr.file.FILEChooserPane;
import com.fr.file.filter.ChooseFileFilter; import com.fr.file.filter.ChooseFileFilter;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.data.DataSource; import com.fr.general.data.DataSource;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.EncodeConstants; import com.fr.stable.EncodeConstants;
@ -45,13 +45,24 @@ import com.fr.stable.StringUtils;
import com.fr.stable.xml.XMLReadable; import com.fr.stable.xml.XMLReadable;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
import javax.swing.*; import javax.swing.BorderFactory;
import javax.swing.ButtonGroup;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTree;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.tree.DefaultTreeModel; import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel; import javax.swing.tree.TreeSelectionModel;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
@ -99,7 +110,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
private UIRadioButton commaDismenberRadioButton;// 逗号 private UIRadioButton commaDismenberRadioButton;// 逗号
private UIRadioButton otherDismenberRadioButton;// 其他 private UIRadioButton otherDismenberRadioButton;// 其他
private UITextField otherDismenberTextField;// 其他分隔符编辑 private UITextField otherDismenberTextField;// 其他分隔符编辑
private UICheckBox igoreOneMoreDelimiterCheckBox;// 连续分隔符是否作为单一 private UICheckBox ignoreOneMoreDelimiterCheckBox;// 连续分隔符是否作为单一
private UIComboBox charsetComboBox; private UIComboBox charsetComboBox;
private UILabel encodeLabel; private UILabel encodeLabel;
private UILabel dismenberLabel; private UILabel dismenberLabel;
@ -374,7 +385,8 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
bg2.add(spaceDismenberRadioButton); bg2.add(spaceDismenberRadioButton);
bg2.add(commaDismenberRadioButton); bg2.add(commaDismenberRadioButton);
bg2.add(otherDismenberRadioButton); bg2.add(otherDismenberRadioButton);
igoreOneMoreDelimiterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Series_Dismenber_As_Single"), true); ignoreOneMoreDelimiterCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Series_Dismenber_As_Single"), true);
UIComponentUtils.setLineWrap(ignoreOneMoreDelimiterCheckBox);
encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type") + ":"); encodeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Encoding_Type") + ":");
charsetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY); charsetComboBox = new UIComboBox(EncodeConstants.ALL_ENCODING_ARRAY);
Component[][] comps = { Component[][] comps = {
@ -384,7 +396,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
{null,spaceDismenberRadioButton,null}, {null,spaceDismenberRadioButton,null},
{null,commaDismenberRadioButton,null}, {null,commaDismenberRadioButton,null},
{null,otherDismenberRadioButton,otherDismenberTextField}, {null,otherDismenberRadioButton,otherDismenberTextField},
{igoreOneMoreDelimiterCheckBox,null,null} {ignoreOneMoreDelimiterCheckBox,null,null}
}; };
northPane.add(TableLayoutHelper.createTableLayoutPane(comps, rowSize, columnSize),BorderLayout.EAST); northPane.add(TableLayoutHelper.createTableLayoutPane(comps, rowSize, columnSize),BorderLayout.EAST);
} }
@ -586,7 +598,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
} }
editorPane.populate(ttd.getParams()); editorPane.populate(ttd.getParams());
needColumnNameCheckBox.setSelected(ttd.needColumnName()); needColumnNameCheckBox.setSelected(ttd.needColumnName());
igoreOneMoreDelimiterCheckBox.setSelected(ttd.isIgnoreOneMoreDelimiter()); ignoreOneMoreDelimiterCheckBox.setSelected(ttd.isIgnoreOneMoreDelimiter());
charsetComboBox.setSelectedItem(ttd.getCharset()); charsetComboBox.setSelectedItem(ttd.getCharset());
} }
@ -624,7 +636,7 @@ public class FileTableDataPane extends AbstractTableDataPane<FileTableData> {
ttd.setFilePath(filePath); ttd.setFilePath(filePath);
ttd.setParams(this.params); ttd.setParams(this.params);
ttd.setDelimiter(this.showDelimiter()); ttd.setDelimiter(this.showDelimiter());
ttd.setIgnoreOneMoreDelimiter(igoreOneMoreDelimiterCheckBox.isSelected()); ttd.setIgnoreOneMoreDelimiter(ignoreOneMoreDelimiterCheckBox.isSelected());
ttd.setNeedColumnName(needColumnNameCheckBox.isSelected()); ttd.setNeedColumnName(needColumnNameCheckBox.isSelected());
ttd.setCharset((String)charsetComboBox.getSelectedItem()); ttd.setCharset((String)charsetComboBox.getSelectedItem());
fileTableData = ttd; fileTableData = ttd;

2
designer-base/src/main/java/com/fr/design/designer/IntervalConstants.java

@ -29,4 +29,6 @@ public class IntervalConstants {
public static final int INTERVAL_W4 = 22; public static final int INTERVAL_W4 = 22;
public static final int INTERVAL_W5 = 10;
} }

8
designer-base/src/main/java/com/fr/design/extra/PluginConstants.java

@ -1,14 +1,14 @@
package com.fr.design.extra; package com.fr.design.extra;
import com.fr.stable.StableUtils;
import com.fr.workspace.WorkContext;
/** /**
* Created by ibm on 2017/5/25. * Created by ibm on 2017/5/25.
*/ */
public class PluginConstants { public class PluginConstants {
public static final int BYTES_NUM = 1024; public static final int BYTES_NUM = 1024;
private static final String TEMP_PATH = System.getProperty("user.dir") + "/tmp"; public static final String DOWNLOAD_PATH = StableUtils.pathJoin(WorkContext.getCurrent().getPath() + "/cache");
public static final String DOWNLOAD_PATH = System.getProperty("user.dir") + "/download";
//插件依赖的下载位置
public static final String DEPENDENCE_DOWNLOAD_PATH = System.getProperty("user.dir") + "/download/dependence";
public static final String TEMP_FILE = "temp.zip"; public static final String TEMP_FILE = "temp.zip";
public static final String CONNECTION_404 = "404"; public static final String CONNECTION_404 = "404";

7
designer-base/src/main/java/com/fr/design/extra/WebViewDlgHelper.java

@ -16,6 +16,7 @@ import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.PluginStoreConstants; import com.fr.plugin.PluginStoreConstants;
import com.fr.plugin.PluginVerifyException; import com.fr.plugin.PluginVerifyException;
import com.fr.stable.CommonUtils;
import com.fr.stable.EnvChangedListener; import com.fr.stable.EnvChangedListener;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
@ -280,7 +281,11 @@ public class WebViewDlgHelper {
try { try {
if (get()) { if (get()) {
IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), installHome); File scriptZip = new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE));
if(scriptZip.exists()){
IOUtils.unzip(scriptZip, installHome);
CommonUtils.deleteFile(scriptZip);
}
PluginStoreConstants.refreshProps(); // 下载完刷新一下版本号等 PluginStoreConstants.refreshProps(); // 下载完刷新一下版本号等
JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Shop_Installed"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(null, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Shop_Installed"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), JOptionPane.INFORMATION_MESSAGE);
} }

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

@ -2,7 +2,6 @@ package com.fr.design.file;
import com.fr.base.chart.chartdata.CallbackEvent; import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.base.io.BaseBook; import com.fr.base.io.BaseBook;
import com.fr.base.io.IOFile;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.base.mode.DesignModeContext; import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
@ -10,17 +9,18 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerFrameFileDealerPane; import com.fr.design.mainframe.DesignerFrameFileDealerPane;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.JTemplateFactory;
import com.fr.design.mainframe.JVirtualTemplate; import com.fr.design.mainframe.JVirtualTemplate;
import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignModuleFactory;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.file.FileNodeFILE; import com.fr.file.FileNodeFILE;
import com.fr.file.StashedFILE;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.org.apache.commons.io.FilenameUtils; import com.fr.third.org.apache.commons.io.FilenameUtils;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
@ -315,7 +315,7 @@ public class HistoryTemplateListCache implements CallbackEvent {
/** /**
* 切换环境时暂存打开的模板内容key 是在历史中的indexvalue 是模板xml 内容byte[] * 切换环境时暂存打开的模板内容key 是在历史中的indexvalue 是模板xml 内容byte[]
*/ */
private Map<Integer, byte[]> bytesMap; private Map<Integer, FILE> stashFILEMap;
/** /**
* 切换环境前将正在编辑的模板暂存起来并且在新环境中重新读取一遍暂存的不是模板文件的内容而是模板对象的内容 * 切换环境前将正在编辑的模板暂存起来并且在新环境中重新读取一遍暂存的不是模板文件的内容而是模板对象的内容
@ -326,20 +326,21 @@ public class HistoryTemplateListCache implements CallbackEvent {
*/ */
public void stash() { public void stash() {
FineLoggerFactory.getLogger().info("Env Change Template Stashing..."); FineLoggerFactory.getLogger().info("Env Change Template Stashing...");
if (bytesMap == null) { if (stashFILEMap == null) {
bytesMap = new HashMap<Integer, byte[]>(); stashFILEMap = new HashMap<Integer, FILE>();
} else { } else {
bytesMap.clear(); stashFILEMap.clear();
} }
int size = historyList.size(); int size = historyList.size();
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
JTemplate<?, ?> template = historyList.get(i); JTemplate<?, ?> template = historyList.get(i);
FILE file = template.getEditingFILE();
try { try {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
BaseBook target = template.getTarget(); BaseBook target = template.getTarget();
if (target != null) { if (target != null) {
target.export(outputStream); target.export(outputStream);
bytesMap.put(i, outputStream.toByteArray()); stashFILEMap.put(i, new StashedFILE(file, outputStream.toByteArray()));
} }
// 如果 target == null 那么这个模板是被模板内存优化功能处理过的,不用处理 // 如果 target == null 那么这个模板是被模板内存优化功能处理过的,不用处理
} catch (Exception e) { } catch (Exception e) {
@ -358,27 +359,31 @@ public class HistoryTemplateListCache implements CallbackEvent {
*/ */
public void load() { public void load() {
FineLoggerFactory.getLogger().info("Env Change Template Loading..."); FineLoggerFactory.getLogger().info("Env Change Template Loading...");
if (bytesMap != null && bytesMap.size() != 0) { if (stashFILEMap != null && stashFILEMap.size() != 0) {
int size = historyList.size(); int size = historyList.size();
for (int i = 0; i < size; i++) { for (int i = 0; i < size; i++) {
try { try {
byte[] bytes = bytesMap.get(i); FILE stashedFile = stashFILEMap.get(i);
// 可能有模板 stash 失败的情况,在 load 的时候不更新它 // 可能有模板 stash 失败的情况,在 load 的时候不更新它
if (bytes == null) { // 或者这个模板是被模板内存优化功能处理过的,不用处理
if (stashedFile == null) {
continue; continue;
} }
ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes); JTemplate<?, ?> template = JTemplateFactory.createJTemplate(stashedFile);
BaseBook target = historyList.get(i).getTarget(); if (template != null) {
if (target != null) { historyList.set(i, template);
// todo readStream 这个行为应该上升到 BaseBook 上 // 替换当前正在编辑的模板,使用添加并激活的方式,以便使用统一的入口来处理监听事件
((IOFile) target).readStream(inputStream); if (isCurrentEditingFile(template.getPath())) {
DesignerContext.getDesignerFrame().addAndActivateJTemplate(template);
setCurrentEditingTemplate(template);
FineLoggerFactory.getLogger().info("Env Change Current Editing Template.");
}
} }
// 如果 target == null 那么这个模板是被模板内存优化功能处理过的,不用处理
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
} }
bytesMap.clear(); stashFILEMap.clear();
MutilTempalteTabPane.getInstance().refreshOpenedTemplate(historyList); MutilTempalteTabPane.getInstance().refreshOpenedTemplate(historyList);
MutilTempalteTabPane.getInstance().repaint(); MutilTempalteTabPane.getInstance().repaint();
} }

28
designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java

@ -6,11 +6,11 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itoolbar.UIToolBarUI; import com.fr.design.gui.itoolbar.UIToolBarUI;
import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -23,7 +23,6 @@ import javax.swing.JSplitPane;
import javax.swing.border.EmptyBorder; import javax.swing.border.EmptyBorder;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
import java.awt.Component;
import java.awt.Cursor; import java.awt.Cursor;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout; import java.awt.FlowLayout;
@ -159,14 +158,21 @@ abstract class UIControlPane extends JControlPane {
} }
protected JPanel getLeftTopPane(UIToolbar topToolBar) { protected JPanel getLeftTopPane(UIToolbar topToolBar) {
double p = TableLayout.PREFERRED; UILabel addItemLabel = FRWidgetFactory.createLineWrapLabel(getAddItemText());
double f = TableLayout.FILL;
double[] columnSize = {p, f, isNewStyle() ? TOP_TOOLBAR_WIDTH : TOP_TOOLBAR_WIDTH_SHORT}; topToolBar.setPreferredSize(
double[] rowSize = {TOP_TOOLBAR_HEIGHT}; new Dimension(
Component[][] components = new Component[][]{ isNewStyle() ? TOP_TOOLBAR_WIDTH : TOP_TOOLBAR_WIDTH_SHORT,
new Component[]{new UILabel(getAddItemText()), new JPanel(), topToolBar}, TOP_TOOLBAR_HEIGHT
}; ));
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel toolBarPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
toolBarPane.add(topToolBar, BorderLayout.NORTH);
JPanel leftTopPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
leftTopPane.add(toolBarPane, BorderLayout.EAST);
leftTopPane.add(addItemLabel, BorderLayout.CENTER);
return leftTopPane;
} }
/** /**

15
designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java

@ -3,6 +3,7 @@ package com.fr.design.gui.ibutton;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.event.GlobalNameListener; import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver; import com.fr.design.event.GlobalNameObserver;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import sun.swing.SwingUtilities2; import sun.swing.SwingUtilities2;
@ -25,6 +26,9 @@ import java.util.List;
public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver { public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private static final int TEXT_LENGTH = 3;
private static final int BUTTON_SIZE = 2;
private int currentButtonSize = 0;
protected List<UIToggleButton> labelButtonList; protected List<UIToggleButton> labelButtonList;
protected int selectedIndex = -1; protected int selectedIndex = -1;
private List<T> objectList;// 起到一个render的作用 private List<T> objectList;// 起到一个render的作用
@ -153,6 +157,7 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
if (!ArrayUtils.isEmpty(objects) && textArray.length == objects.length) { if (!ArrayUtils.isEmpty(objects) && textArray.length == objects.length) {
this.objectList = Arrays.asList(objects); this.objectList = Arrays.asList(objects);
} }
currentButtonSize = textArray.length;
labelButtonList = new ArrayList<UIToggleButton>(textArray.length); labelButtonList = new ArrayList<UIToggleButton>(textArray.length);
this.setLayout(getGridLayout(textArray.length)); this.setLayout(getGridLayout(textArray.length));
this.setBorder(getGroupBorder()); this.setBorder(getGroupBorder());
@ -213,10 +218,20 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver {
protected void initButton(UIToggleButton labelButton) { protected void initButton(UIToggleButton labelButton) {
labelButton.setBorderPainted(false); labelButton.setBorderPainted(false);
adjustButton(labelButton);
UIComponentUtils.setLineWrap(labelButton);
labelButtonList.add(labelButton); labelButtonList.add(labelButton);
this.add(labelButton); this.add(labelButton);
} }
private void adjustButton(UIToggleButton labelButton) {
if (labelButton.getText().length() > TEXT_LENGTH && currentButtonSize > BUTTON_SIZE) {
Dimension dimension = labelButton.getPreferredSize();
dimension.height <<= 1;
labelButton.setPreferredSize(dimension);
}
}
protected Border getGroupBorder() { protected Border getGroupBorder() {
return BorderFactory.createEmptyBorder(1, 1, 1, 1); return BorderFactory.createEmptyBorder(1, 1, 1, 1);
} }

23
designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java

@ -4,8 +4,8 @@ import com.fr.base.BaseUtils;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.data.core.DataCoreUtils; import com.fr.data.core.DataCoreUtils;
import com.fr.data.core.db.TableProcedure; import com.fr.data.core.db.TableProcedure;
import com.fr.data.core.db.dialect.DialectFactory; import com.fr.data.core.db.dialect.base.key.check.DataBaseDetail;
import com.fr.data.core.db.dialect.OracleDialect; import com.fr.data.core.db.dialect.base.key.check.DataBaseType;
import com.fr.data.impl.Connection; import com.fr.data.impl.Connection;
import com.fr.data.operator.DataOperator; import com.fr.data.operator.DataOperator;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
@ -13,7 +13,7 @@ import com.fr.design.constants.UIConstants;
import com.fr.design.mainframe.dnd.SerializableTransferable; import com.fr.design.mainframe.dnd.SerializableTransferable;
import com.fr.file.ConnectionConfig; import com.fr.file.ConnectionConfig;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
@ -138,21 +138,16 @@ public class TableViewList extends UIList {
String[] schemas = DataCoreUtils.getDatabaseSchema(datasource); String[] schemas = DataCoreUtils.getDatabaseSchema(datasource);
searchFilter = searchFilter.toLowerCase(); searchFilter = searchFilter.toLowerCase();
boolean isOracle = DataOperator.getInstance().isOracle(datasource);
boolean isOracleSystemSpace = DesignerEnvManager.getEnvManager().isOracleSystemSpace(); boolean isOracleSystemSpace = DesignerEnvManager.getEnvManager().isOracleSystemSpace();
// oracleb不勾选显示所有表,则只显示用户下的(包括存储过程和table表) // oracle不勾选显示所有表,则只显示用户下的(包括存储过程和table表)
if (isOracle && !isOracleSystemSpace) { DataBaseDetail detail = DataOperator.getInstance().getDataBaseDetail(datasource, isOracleSystemSpace);
java.sql.Connection connection = datasource.createConnection(); if (ArrayUtils.isNotEmpty(detail.getSchemas())) {
OracleDialect orcDialect = (OracleDialect)DialectFactory.generateDialect(connection); schemas = detail.getSchemas();
schemas = new String[]{orcDialect.getOracleCurrentUserSchema(connection)};
} }
if (typesFilter.length == 1 && ComparatorUtils.equals(typesFilter[0], TableProcedure.PROCEDURE)) { if (typesFilter.length == 1 && ComparatorUtils.equals(typesFilter[0], TableProcedure.PROCEDURE)) {
return processStoreProcedure(defaultListModel, schemas, datasource, isOracle, searchFilter); return processStoreProcedure(defaultListModel, schemas, datasource, DataBaseType.ORACLE.equals(detail.getType()), searchFilter);
} else { } else {
return processTableAndView(defaultListModel, schemas, datasource, searchFilter, isOracle, typesFilter); return processTableAndView(defaultListModel, schemas, datasource, searchFilter, DataBaseType.ORACLE.equals(detail.getType()), typesFilter);
} }
} }

37
designer-base/src/main/java/com/fr/design/gui/itree/filetree/TemplateFileTree.java

@ -2,8 +2,10 @@ package com.fr.design.gui.itree.filetree;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.extension.FileExtension; import com.fr.base.extension.FileExtension;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.file.NodeAuthProcessor; import com.fr.design.file.NodeAuthProcessor;
import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode;
import com.fr.design.mainframe.App;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
@ -15,7 +17,9 @@ import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set;
/* /*
* 显示Env下的reportlets目录下面的所有cpt文件 * 显示Env下的reportlets目录下面的所有cpt文件
@ -124,9 +128,28 @@ public class TemplateFileTree extends EnvFileTree {
} }
public FileNode[] listFile(String path) { public FileNode[] listFile(String path) {
// 支持插件扩展, 先从env的filter拿, 再从插件拿
Set<FileExtension> supportTypes = createFileExtensionFilter();
return FRContext.getFileNodes().list( return FRContext.getFileNodes().list(
path, path,
new FileExtension[]{FileExtension.CPT, FileExtension.FRM, FileExtension.CHT, FileExtension.XLS, FileExtension.XLSX}); supportTypes.toArray(new FileExtension[supportTypes.size()])
);
}
private Set<FileExtension> createFileExtensionFilter() {
Set<FileExtension> supportTypes = new HashSet<FileExtension>();
if (filter != null) {
for (String temp : filter.getSupportedTypes()) {
supportTypes.add(FileExtension.parse(temp));
}
}
Set<App> apps = ExtraDesignClassManager.getInstance().getArray(App.MARK_STRING);
for (App temp : apps) {
for (String extendsion : temp.defaultExtensions()) {
supportTypes.add(FileExtension.parse(extendsion));
}
}
return supportTypes;
} }
/* /*
@ -205,18 +228,6 @@ public class TemplateFileTree extends EnvFileTree {
if (fileNodes == null) { if (fileNodes == null) {
fileNodes = new FileNode[0]; fileNodes = new FileNode[0];
} }
// 用FileNodeFilter过滤一下
if (filter != null) {
List<FileNode> list = new ArrayList<FileNode>();
for (FileNode fileNode : fileNodes) {
if (filter.accept(fileNode)) {
list.add(fileNode);
}
}
fileNodes = list.toArray(new FileNode[list.size()]);
}
Arrays.sort(fileNodes, new FileNodeComparator(FRContext.getFileNodes().getSupportedTypes())); Arrays.sort(fileNodes, new FileNodeComparator(FRContext.getFileNodes().getSupportedTypes()));
return fileNodes; return fileNodes;

36
designer-base/src/main/java/com/fr/design/hyperlink/AbstractHyperLinkPane.java

@ -4,9 +4,16 @@ import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.editor.ValueEditorPane; import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory; import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.frpane.ReportletParameterViewPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itableeditorpane.ParameterTableModel; import com.fr.design.gui.itableeditorpane.ParameterTableModel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.js.JavaScript; import com.fr.js.JavaScript;
import com.fr.js.LinkAnimateType;
import javax.swing.JPanel;
import java.awt.Dimension;
import java.util.HashMap; import java.util.HashMap;
/** /**
@ -16,6 +23,7 @@ public abstract class AbstractHyperLinkPane<T> extends FurtherBasicBeanPane<T> {
private HashMap hyperLinkEditorMap; private HashMap hyperLinkEditorMap;
private boolean needRenamePane = false; private boolean needRenamePane = false;
protected ReportletParameterViewPane parameterViewPane; protected ReportletParameterViewPane parameterViewPane;
private UIButtonGroup<LinkAnimateType> animateTypeUIButtonGroup;
public AbstractHyperLinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) { public AbstractHyperLinkPane(HashMap hyperLinkEditorMap, boolean needRenamePane) {
@ -41,6 +49,34 @@ public abstract class AbstractHyperLinkPane<T> extends FurtherBasicBeanPane<T> {
public void reset() { public void reset() {
} }
protected JPanel createAnimateTypeUIButtonGroup() {
animateTypeUIButtonGroup = new UIButtonGroup<LinkAnimateType>(
new String[]{LinkAnimateType.RELOAD.toLocaleString(), LinkAnimateType.INCREMENT.toLocaleString()},
new LinkAnimateType[]{LinkAnimateType.RELOAD, LinkAnimateType.INCREMENT});
animateTypeUIButtonGroup.setPreferredSize(new Dimension(120,20));
animateTypeUIButtonGroup.setSelectedIndex(1);
JPanel jp = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();
jp.add(new UILabel(Toolkit.i18nText("Fine-Design_Chart_Link_Animate_Type")));
jp.add(animateTypeUIButtonGroup);
return jp;
}
protected void populateAnimateType(LinkAnimateType animateType) {
if (animateTypeUIButtonGroup != null && animateType != LinkAnimateType.NONE) {
animateTypeUIButtonGroup.setSelectedItem(animateType);
}
}
protected LinkAnimateType updateAnimateType() {
if (animateTypeUIButtonGroup != null) {
return animateTypeUIButtonGroup.getSelectedItem();
}
return LinkAnimateType.NONE;
}
protected int getChartParaType() { protected int getChartParaType() {
return hyperLinkEditorMap != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE; return hyperLinkEditorMap != null ? ParameterTableModel.CHART_NORMAL_USE : ParameterTableModel.NO_CHART_USE;
} }

6
designer-base/src/main/java/com/fr/design/mainframe/AbstractAppProvider.java

@ -8,7 +8,7 @@ import com.fr.stable.fun.mark.API;
* Created by Administrator on 2016/3/17/0017. * Created by Administrator on 2016/3/17/0017.
*/ */
@API(level = App.CURRENT_LEVEL) @API(level = App.CURRENT_LEVEL)
public abstract class AbstractAppProvider<T extends IOFile> extends AbstractProvider implements App{ public abstract class AbstractAppProvider<T extends IOFile> extends AbstractProvider implements App {
public int currentAPILevel() { public int currentAPILevel() {
return CURRENT_LEVEL; return CURRENT_LEVEL;
@ -21,12 +21,12 @@ public abstract class AbstractAppProvider<T extends IOFile> extends AbstractProv
@Override @Override
public void process() { public void process() {
DesignerFrame.registApp(this); JTemplateFactory.register(this);
} }
@Override @Override
public void undo() { public void undo() {
DesignerFrame.removeApp(this); JTemplateFactory.remove(this);
} }
} }

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

@ -51,7 +51,6 @@ import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent; import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener; import com.fr.plugin.observer.PluginEventListener;
import com.fr.stable.CoreConstants;
import com.fr.stable.OperatingSystem; import com.fr.stable.OperatingSystem;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
@ -115,11 +114,9 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
private static final int MENU_HEIGHT = 26; private static final int MENU_HEIGHT = 26;
private static final Integer SECOND_LAYER = new Integer(100); private static final Integer SECOND_LAYER = 100;
private static final Integer TOP_LAYER = new Integer((200)); private static final Integer TOP_LAYER = 200;
private static java.util.List<App<?>> appList = new java.util.ArrayList<App<?>>();
private List<DesignerOpenedListener> designerOpenedListenerList = new ArrayList<>(); private List<DesignerOpenedListener> designerOpenedListenerList = new ArrayList<>();
@ -326,7 +323,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
this.progressDialog = new ProgressDialog(this); this.progressDialog = new ProgressDialog(this);
} }
public void closeAuthorityEditing(){ public void closeAuthorityEditing() {
DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.NORMAL); DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.NORMAL);
WestRegionContainerPane.getInstance().replaceDownPane( WestRegionContainerPane.getInstance().replaceDownPane(
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter())); TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
@ -342,19 +339,22 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
* 注册app. * 注册app.
* *
* @param app 注册app. * @param app 注册app.
* @deprecated use {@link JTemplateFactory#register(App)} instead
*/ */
@Deprecated
public static void registApp(App<?> app) { public static void registApp(App<?> app) {
JTemplateFactory.register(app);
if (app != null) {
appList.add(app);
}
} }
/**
* 移除app
*
* @param app app
* @deprecated use {@link JTemplateFactory#remove(App)} instead
*/
@Deprecated
public static void removeApp(App<?> app) { public static void removeApp(App<?> app) {
JTemplateFactory.remove(app);
if (app != null) {
appList.remove(app);
}
} }
/** /**
@ -1027,21 +1027,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
*/ */
private void openFile(FILE tplFile) { private void openFile(FILE tplFile) {
String fileName = tplFile.getName(); JTemplate jt = JTemplateFactory.createJTemplate(tplFile);
int indexOfLastDot = fileName.lastIndexOf(CoreConstants.DOT);
if (indexOfLastDot < 0) {
return;
}
String fileExtention = fileName.substring(indexOfLastDot + 1);
for (int i = 0, len = appList.size(); i < len; i++) {
App<?> app = appList.get(i);
String[] defaultAppExtentions = app.defaultExtensions();
boolean opened = false;
for (int j = 0; j < defaultAppExtentions.length; j++) {
if (defaultAppExtentions[j].equalsIgnoreCase(fileExtention)) {
// 不要catch
JTemplate jt = app.openTemplate(tplFile);
if (jt == null) { if (jt == null) {
return; return;
} }
@ -1053,14 +1039,6 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
} else { } else {
activeTemplate(jt); activeTemplate(jt);
} }
opened = true;
break;
}
}
if (opened) {
break;
}
}
} }
/** /**

2
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -610,7 +610,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
} else { } else {
JOptionPane.showMessageDialog( JOptionPane.showMessageDialog(
DesignerContext.getDesignerFrame(), DesignerContext.getDesignerFrame(),
Toolkit.i18nText("Fine-Design_Basic_Template_Status_Locked"), Toolkit.i18nText("Fine-Design-Basic_Save_Failure"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Message"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Message"),
JOptionPane.WARNING_MESSAGE); JOptionPane.WARNING_MESSAGE);
return false; return false;

63
designer-base/src/main/java/com/fr/design/mainframe/JTemplateFactory.java

@ -0,0 +1,63 @@
package com.fr.design.mainframe;
import com.fr.file.FILE;
import com.fr.stable.CoreConstants;
import com.fr.third.javax.annotation.Nonnull;
import com.fr.third.javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
public final class JTemplateFactory {
private static final List<App<?>> ALL_APP = new ArrayList<App<?>>();
private JTemplateFactory() {
}
/**
* 生成设计器编辑模板对象
*
* @param file 包含了模板名称类型以及内容的文件
* @return 设计器编辑的模板对象
*/
@Nullable
public static JTemplate<?, ?> createJTemplate(@Nonnull FILE file) {
String fileName = file.getName();
int indexOfLastDot = fileName.lastIndexOf(CoreConstants.DOT);
if (indexOfLastDot < 0) {
return null;
}
String fileExtension = fileName.substring(indexOfLastDot + 1);
for (App<?> app : ALL_APP) {
String[] defaultAppExtensions = app.defaultExtensions();
for (String defaultAppExtension : defaultAppExtensions) {
if (defaultAppExtension.equalsIgnoreCase(fileExtension)) {
JTemplate<?, ?> jt = app.openTemplate(file);
if (jt != null) {
return jt;
}
}
}
}
return null;
}
/**
* 注册app.
*
* @param app 注册app.
*/
public static void register(App<?> app) {
if (app != null) {
ALL_APP.add(app);
}
}
public static void remove(App<?> app) {
if (app != null) {
ALL_APP.remove(app);
}
}
}

1
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java

@ -496,7 +496,6 @@ public abstract class ToolBarMenuDock {
if (WorkContext.getCurrent().isLocal()) { if (WorkContext.getCurrent().isLocal()) {
shortCuts.add(new SoftwareUpdateAction()); shortCuts.add(new SoftwareUpdateAction());
} }
if (AlphaFineConfigManager.isALPHALicAvailable()) { if (AlphaFineConfigManager.isALPHALicAvailable()) {
shortCuts.add(new AlphaFineAction()); shortCuts.add(new AlphaFineAction());
} }

9
designer-base/src/main/java/com/fr/design/menu/MenuDef.java

@ -24,6 +24,7 @@ import java.util.List;
public class MenuDef extends ShortCut { public class MenuDef extends ShortCut {
private static final int MENU_DEFAULTWDITH = 156; private static final int MENU_DEFAULTWDITH = 156;
private static final int BLANK_WIDTH = 30;
protected String name; protected String name;
//右侧属性表弹出框重绘 //右侧属性表弹出框重绘
protected Boolean isEastAttr = false; protected Boolean isEastAttr = false;
@ -410,7 +411,7 @@ public class MenuDef extends ShortCut {
popupMenu = new UIPopupEastAttrMenu(); popupMenu = new UIPopupEastAttrMenu();
popupMenu.setInvoker(button); popupMenu.setInvoker(button);
MenuDef.this.updateEastPopupMenu(popupMenu); MenuDef.this.updateEastPopupMenu(popupMenu);
popupMenu.setPopupSize(new Dimension(MENU_DEFAULTWDITH, popupMenu.getPreferredSize().height)); updatePopupMenuSize();
GUICoreUtils.showPopupMenu(popupMenu, button, 0, button.getSize().height); GUICoreUtils.showPopupMenu(popupMenu, button, 0, button.getSize().height);
} else { } else {
popupMenu = new UIPopupMenu(); popupMenu = new UIPopupMenu();
@ -421,6 +422,12 @@ public class MenuDef extends ShortCut {
} }
}; };
private void updatePopupMenuSize() {
int preferredWidth = popupMenu.getPreferredSize().width - BLANK_WIDTH; // 减少行尾的空白部分
int popupMenuWidth = preferredWidth > MENU_DEFAULTWDITH ? preferredWidth : MENU_DEFAULTWDITH;
popupMenu.setPopupSize(new Dimension(popupMenuWidth, popupMenu.getPreferredSize().height));
}
//ben: for ui test //ben: for ui test
public JPopupMenu getPopupMenu() { public JPopupMenu getPopupMenu() {

25
designer-base/src/main/java/com/fr/design/parameter/ParaDefinitePane.java

@ -1 +1,24 @@
package com.fr.design.parameter; import com.fr.base.Parameter; public interface ParaDefinitePane { public Parameter[] getNoRepeatParas(Parameter[] paras); public void setParameterArray(Parameter[] ps); public Parameter[] getParameterArray(); public void refreshParameter(); public boolean isWithQueryButton(); public void addingParameter2Editor(Parameter p); public void addingParameter2EditorWithQueryButton(Parameter p); public void addingAllParameter2Editor(); } package com.fr.design.parameter;
import com.fr.base.Parameter;
public interface ParaDefinitePane {
Parameter[] getNoRepeatParas(Parameter[] paras);
void setParameterArray(Parameter[] ps);
Parameter[] getParameterArray();
void refreshParameter();
boolean isWithQueryButton();
void addingParameter2Editor(Parameter p);
void addingParameter2EditorWithQueryButton(Parameter p);
void addingAllParameter2Editor();
}

4
designer-base/src/main/java/com/fr/design/style/background/gradient/GradientBackgroundPane.java

@ -6,6 +6,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.style.background.BackgroundDetailPane; import com.fr.design.style.background.BackgroundDetailPane;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.Background; import com.fr.general.Background;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
@ -42,9 +43,8 @@ public class GradientBackgroundPane extends BackgroundDetailPane {
JPanel blankJp = new JPanel(); JPanel blankJp = new JPanel();
gradientBar = new GradientBar(4, 254); gradientBar = new GradientBar(4, 254);
blankJp.add(gradientBar); blankJp.add(gradientBar);
UILabel jl = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Drag_To_Select_Gradient")); UILabel jl = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Drag_To_Select_Gradient"));
jl.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20)); jl.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 20));
UIComponentUtils.setLineWrap(jl);
jl.setHorizontalAlignment(SwingConstants.CENTER); jl.setHorizontalAlignment(SwingConstants.CENTER);
gradientPanel.add(jl, BorderLayout.NORTH); gradientPanel.add(jl, BorderLayout.NORTH);
gradientPanel.add(blankJp, BorderLayout.SOUTH); gradientPanel.add(blankJp, BorderLayout.SOUTH);

34
designer-base/src/main/java/com/fr/design/utils/gui/UIComponentUtils.java

@ -1,8 +1,15 @@
package com.fr.design.utils.gui; package com.fr.design.utils.gui;
import com.fr.design.gui.core.UITextComponent; import com.fr.design.gui.core.UITextComponent;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
/** /**
* 包含 UI 组件相关的工具方法 * 包含 UI 组件相关的工具方法
* Created by plough on 2019/1/11. * Created by plough on 2019/1/11.
@ -48,4 +55,31 @@ public class UIComponentUtils {
} }
comp.setText(prefix + comp.getText()); comp.setText(prefix + comp.getText());
} }
/**
* 将一个组件包装到 BorderLayout 布局的面板中
* @param comp待包装的组件
* @param layoutConstraint添加的方向 BorderLayout.NORTH
* @return 包装好的 JPanel
*/
public static JPanel wrapWithBorderLayoutPane(Component comp, String layoutConstraint) {
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.add(comp, layoutConstraint);
return panel;
}
/**
* 将一个组件包装到 BorderLayout 布局的面板中
* @param comp待包装的组件
* @return 包装好的 JPanel布局方向为 BorderLayout.NORTH
*/
public static JPanel wrapWithBorderLayoutPane(Component comp) {
return wrapWithBorderLayoutPane(comp, BorderLayout.NORTH);
}
public static void setPreferedWidth(JComponent comp, int width) {
Dimension dim = comp.getPreferredSize();
dim.setSize(width, dim.getHeight());
comp.setPreferredSize(dim);
}
} }

51
designer-base/src/main/java/com/fr/design/widget/FRWidgetFactory.java

@ -0,0 +1,51 @@
package com.fr.design.widget;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.utils.gui.UIComponentUtils;
/**
* 创建 widget 的静态工厂
* Created by plough on 2019/1/15.
*/
public class FRWidgetFactory {
// 不可实例化
private FRWidgetFactory() {
throw new AssertionError();
}
/**
* 创建一个可换行的 UILabel
* @param text 标签文字
* @return com.fr.design.gui.ilable.UILabel
*/
public static UILabel createLineWrapLabel(String text) {
UILabel label = new UILabel(text);
UIComponentUtils.setLineWrap(label);
return label;
}
/**
* 创建一个可换行的 UILabel
* @param text 标签文字
* @param lineWidth 最大行宽
* @return com.fr.design.gui.ilable.UILabel
*/
public static UILabel createLineWrapLabel(String text, int lineWidth) {
UILabel label = new UILabel(text);
UIComponentUtils.setLineWrap(label, lineWidth);
return label;
}
/**
* 创建一个可换行可调整水平对齐的 UILabel
* @param text
* @param lineWidth
* @param horizontalAlignment
* @return com.fr.design.gui.ilable.UILabel
*/
public static UILabel createLineWrapLabel(String text, int lineWidth, int horizontalAlignment) {
UILabel label = createLineWrapLabel(text, lineWidth);
label.setHorizontalAlignment(horizontalAlignment);
return label;
}
}

18
designer-base/src/main/java/com/fr/design/widget/WidgetBoundsPaneFactory.java

@ -8,7 +8,6 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
@ -19,19 +18,20 @@ import java.awt.Component;
* Created by plough on 2017/8/7. * Created by plough on 2017/8/7.
*/ */
public class WidgetBoundsPaneFactory { public class WidgetBoundsPaneFactory {
private static final int RIGHT_PANE_WIDTH = 145;
public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height) { public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height) {
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Size")), createRightPane(width, height)}, new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Size")), createRightPane(width, height)},
new Component[]{null, createRightPane(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))}, new Component[]{null, createRightPane(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))},
}; };
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f}; double[] columnSize = {f, RIGHT_PANE_WIDTH};
int[][] rowCount = {{1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}};
final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L6); final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W5, IntervalConstants.INTERVAL_L6);
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
boundsPane.add(panel); boundsPane.add(panel);
return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 280, 24, boundsPane); return new UIExpandablePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Coords_And_Size"), 280, 24, boundsPane);
@ -53,18 +53,18 @@ public class WidgetBoundsPaneFactory {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] northComponents = new Component[][]{ Component[][] northComponents = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Position")), createRightPane(x, y)}, new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Position")), createRightPane(x, y)},
new Component[]{null, createRightPane(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_X_Coordinate"), SwingConstants.CENTER), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Y_Coordinate"), SwingConstants.CENTER))}, new Component[]{null, createRightPane(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_X_Coordinate"), SwingConstants.CENTER), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Y_Coordinate"), SwingConstants.CENTER))},
}; };
Component[][] centerComponents = new Component[][]{ Component[][] centerComponents = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Size")), createRightPane(width, height)}, new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Size")), createRightPane(width, height)},
new Component[]{null, createRightPane(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))}, new Component[]{null, createRightPane(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Width"), SwingConstants.CENTER), new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Height"), SwingConstants.CENTER))},
}; };
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f}; double[] columnSize = {f, RIGHT_PANE_WIDTH};
int[][] rowCount = {{1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}};
final JPanel northPanel = TableLayoutHelper.createGapTableLayoutPane(northComponents, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L6); final JPanel northPanel = TableLayoutHelper.createGapTableLayoutPane(northComponents, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W5, IntervalConstants.INTERVAL_L6);
final JPanel centerPanel = TableLayoutHelper.createGapTableLayoutPane(centerComponents, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L6); final JPanel centerPanel = TableLayoutHelper.createGapTableLayoutPane(centerComponents, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W5, IntervalConstants.INTERVAL_L6);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); northPanel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0));
centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); centerPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));

2
designer-base/src/main/java/com/fr/file/FileFILE.java

@ -201,7 +201,7 @@ public class FileFILE implements FILE {
OutputStream out; OutputStream out;
try { try {
StableUtils.makesureFileExist(file); StableUtils.makesureFileExist(file);
out = new FileOutputStream(file); out = new FileOutputStream(file, true);
} catch (Exception e) { } catch (Exception e) {
throw SessionLocalManager.createLogPackedException(e); throw SessionLocalManager.createLogPackedException(e);
} }

106
designer-base/src/main/java/com/fr/file/StashedFILE.java

@ -0,0 +1,106 @@
package com.fr.file;
import javax.swing.Icon;
import javax.transaction.NotSupportedException;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.OutputStream;
/**
* 切换环境用于暂存的文件类型
*/
public class StashedFILE implements FILE {
private FILE file;
private byte[] content;
public StashedFILE(FILE file, byte[] content) {
this.file = file;
this.content = content;
}
@Override
public String prefix() {
return file.prefix();
}
@Override
public boolean isDirectory() {
return file.isDirectory();
}
@Override
public String getName() {
return file.getName();
}
@Override
public Icon getIcon() {
return file.getIcon();
}
@Override
public String getPath() {
return file.getPath();
}
@Override
public void setPath(String path) {
throw new UnsupportedOperationException();
}
@Override
public FILE getParent() {
throw new UnsupportedOperationException();
}
@Override
public FILE[] listFiles() {
throw new UnsupportedOperationException();
}
@Override
public boolean createFolder(String name) {
throw new UnsupportedOperationException();
}
@Override
public boolean mkfile() throws Exception {
throw new UnsupportedOperationException();
}
@Override
public boolean exists() {
return false;
}
@Override
public void closeTemplate() throws Exception {
// do nothing
}
@Override
public InputStream asInputStream() throws Exception {
return new ByteArrayInputStream(content);
}
@Override
public OutputStream asOutputStream() throws Exception {
throw new NotSupportedException();
}
@Override
public String getEnvFullName() {
return file.getEnvFullName();
}
@Override
public boolean isMemFile() {
return true;
}
@Override
public boolean isEnvFile() {
return false;
}
}

48
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateCellLinkPane.java

@ -8,12 +8,12 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.hyperlink.AbstractHyperLinkPane; import com.fr.design.hyperlink.AbstractHyperLinkPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.ColumnRow; import com.fr.stable.ColumnRow;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import javax.swing.*; import javax.swing.JPanel;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.Dimension;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -53,12 +53,18 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
colRowPane = new ColumnRowVerticalPane(); colRowPane = new ColumnRowVerticalPane();
centerPane.add(colRowPane, BorderLayout.NORTH); centerPane.add(colRowPane, BorderLayout.NORTH);
addPaneInCenter(centerPane);
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"))); parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter")));
parameterViewPane.setPreferredSize(new Dimension(500, 200)); parameterViewPane.setPreferredSize(new Dimension(500, 200));
this.add(parameterViewPane, BorderLayout.SOUTH); this.add(parameterViewPane, BorderLayout.SOUTH);
} }
protected void addPaneInCenter(JPanel centerPane) {
}
@Override @Override
public void populateBean(ChartHyperRelateCellLink ob) { public void populateBean(ChartHyperRelateCellLink ob) {
if (ob == null) { if (ob == null) {
@ -117,9 +123,45 @@ public class ChartHyperRelateCellLinkPane extends AbstractHyperLinkPane<ChartHyp
} }
public static class ChartNoRename extends ChartHyperRelateCellLinkPane { public static class ChartNoRename extends ChartHyperRelateCellLinkPane {
public ChartNoRename() {
super();
}
public ChartNoRename(HashMap hyperLinkEditorMap, boolean needRenamePane) {
super(hyperLinkEditorMap, needRenamePane);
}
protected boolean needRenamePane() { protected boolean needRenamePane() {
return false; return false;
} }
} }
public static class ChartHasAnimateType extends ChartNoRename {
public ChartHasAnimateType() {
super();
}
public ChartHasAnimateType(HashMap hyperLinkEditorMap, boolean needRenamePane) {
super(hyperLinkEditorMap, needRenamePane);
}
@Override
protected void addPaneInCenter(JPanel centerPane) {
centerPane.add(createAnimateTypeUIButtonGroup(), BorderLayout.CENTER);
}
@Override
public void populateBean(ChartHyperRelateCellLink ob) {
super.populateBean(ob);
populateAnimateType(ob.getAnimateType());
}
@Override
public void updateBean(ChartHyperRelateCellLink chartLink) {
super.updateBean(chartLink);
chartLink.setAnimateType(updateAnimateType());
}
}
} }

45
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/ChartHyperRelateFloatLinkPane.java

@ -11,14 +11,16 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.hyperlink.AbstractHyperLinkPane; import com.fr.design.hyperlink.AbstractHyperLinkPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import javax.swing.*; import javax.swing.JPanel;
import javax.swing.border.Border; import javax.swing.border.Border;
import javax.swing.border.LineBorder; import javax.swing.border.LineBorder;
import javax.swing.border.TitledBorder; import javax.swing.border.TitledBorder;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -69,6 +71,7 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
centerPane.setBorder(border); centerPane.setBorder(border);
centerPane.add(pane, BorderLayout.NORTH); centerPane.add(pane, BorderLayout.NORTH);
addPaneInCenter(centerPane);
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter"))); parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameter")));
@ -76,6 +79,9 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
this.add(parameterViewPane, BorderLayout.SOUTH); this.add(parameterViewPane, BorderLayout.SOUTH);
} }
protected void addPaneInCenter(JPanel centerPane) {
}
private String[] getFloatNames() { private String[] getFloatNames() {
DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter(); DesignModelAdapter adapter = DesignModelAdapter.getCurrentModelAdapter();
if (adapter != null) { if (adapter != null) {
@ -148,8 +154,41 @@ public class ChartHyperRelateFloatLinkPane extends AbstractHyperLinkPane<ChartHy
} }
public static class ChartNoRename extends ChartHyperRelateFloatLinkPane { public static class ChartNoRename extends ChartHyperRelateFloatLinkPane {
public ChartNoRename() {
}
public ChartNoRename(HashMap hyperLinkEditorMap, boolean needRenamePane) {
super(hyperLinkEditorMap, needRenamePane);
}
protected boolean needRenamePane() { protected boolean needRenamePane() {
return false; return false;
} }
} }
public static class ChartHasAnimateType extends ChartNoRename {
public ChartHasAnimateType() {
}
public ChartHasAnimateType(HashMap hyperLinkEditorMap, boolean needRenamePane) {
super(hyperLinkEditorMap, needRenamePane);
}
@Override
protected void addPaneInCenter(JPanel centerPane) {
centerPane.add(createAnimateTypeUIButtonGroup(), BorderLayout.CENTER);
}
@Override
public void populateBean(ChartHyperRelateFloatLink ob) {
super.populateBean(ob);
populateAnimateType(ob.getAnimateType());
}
@Override
public void updateBean(ChartHyperRelateFloatLink chartLink) {
super.updateBean(chartLink);
chartLink.setAnimateType(updateAnimateType());
}
}
} }

3
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkNorthPane.java

@ -11,7 +11,6 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.js.FormHyperlinkProvider; import com.fr.js.FormHyperlinkProvider;
import com.fr.stable.bridge.StableFactory; import com.fr.stable.bridge.StableFactory;
@ -51,7 +50,7 @@ public class FormHyperlinkNorthPane extends BasicBeanPane<FormHyperlinkProvider>
targetFrameComboBox = formHyperlinkEditors == null ? new UIComboBox() : new UIComboBox(getFormHyperlinkEditNames()); targetFrameComboBox = formHyperlinkEditors == null ? new UIComboBox() : new UIComboBox(getFormHyperlinkEditNames());
targetFrameComboBox.setRenderer(new DefaultListCellRenderer()); targetFrameComboBox.setRenderer(new DefaultListCellRenderer());
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, TableLayout.FILL}; double[] columnSize = {p, TableLayout.FILL};
Component[][] components; Component[][] components;
if (!this.needRenamePane) { if (!this.needRenamePane) {

54
designer-chart/src/main/java/com/fr/design/chart/series/SeriesCondition/impl/FormHyperlinkPane.java

@ -7,13 +7,13 @@ import com.fr.design.hyperlink.AbstractHyperLinkPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.ElementCaseEditorProvider; import com.fr.form.ui.ElementCaseEditorProvider;
import com.fr.js.FormHyperlinkProvider; import com.fr.js.FormHyperlinkProvider;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import com.fr.stable.bridge.StableFactory; import com.fr.stable.bridge.StableFactory;
import javax.swing.*; import javax.swing.BorderFactory;
import java.awt.*; import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.util.HashMap; import java.util.HashMap;
public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvider> { public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvider> {
@ -35,13 +35,18 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH)); this.setBorder(BorderFactory.createEmptyBorder(BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH, BORDER_WIDTH));
northPane = new FormHyperlinkNorthPane(needRenamePane()); northPane = new FormHyperlinkNorthPane(needRenamePane());
this.add(northPane, BorderLayout.NORTH);
addNorthPane(northPane);
parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane()); parameterViewPane = new ReportletParameterViewPane(getChartParaType(), getValueEditorPane(), getValueEditorPane());
this.add(parameterViewPane, BorderLayout.CENTER); this.add(parameterViewPane, BorderLayout.CENTER);
parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters"), null)); parameterViewPane.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Parameters"), null));
} }
protected void addNorthPane(JPanel northPane) {
this.add(northPane, BorderLayout.NORTH);
}
@Override @Override
public String title4PopupWindow() { public String title4PopupWindow() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Form_Link"); return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Hyperlink_Form_Link");
@ -70,7 +75,6 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
formHyperlink.setType(getHyperlinkType()); formHyperlink.setType(getHyperlinkType());
updateBean(formHyperlink); updateBean(formHyperlink);
return formHyperlink; return formHyperlink;
} }
@ -91,6 +95,13 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
} }
public static class ChartNoRename extends FormHyperlinkPane { public static class ChartNoRename extends FormHyperlinkPane {
public ChartNoRename(HashMap hyperLinkEditorMap, boolean needRenamePane) {
super(hyperLinkEditorMap, needRenamePane);
}
public ChartNoRename() {
}
protected boolean needRenamePane() { protected boolean needRenamePane() {
return false; return false;
} }
@ -99,4 +110,37 @@ public class FormHyperlinkPane extends AbstractHyperLinkPane<FormHyperlinkProvid
return ParameterTableModel.CHART_NORMAL_USE; return ParameterTableModel.CHART_NORMAL_USE;
} }
} }
public static class ChartHasAnimateType extends ChartNoRename {
public ChartHasAnimateType(HashMap hyperLinkEditorMap, boolean needRenamePane) {
super(hyperLinkEditorMap, needRenamePane);
}
public ChartHasAnimateType() {
}
@Override
protected void addNorthPane(JPanel northPane) {
JPanel panel = new JPanel(new BorderLayout());
panel.add(northPane, BorderLayout.NORTH);
JPanel animatePane = createAnimateTypeUIButtonGroup();
animatePane.setBorder(BorderFactory.createEmptyBorder(0, 8, 10, 10));
panel.add(animatePane, BorderLayout.CENTER);
this.add(panel, BorderLayout.NORTH);
}
@Override
public void populateBean(FormHyperlinkProvider formHyperlink) {
super.populateBean(formHyperlink);
populateAnimateType(formHyperlink.getAnimateType());
}
@Override
public void updateBean(FormHyperlinkProvider formHyperlink) {
super.updateBean(formHyperlink);
formHyperlink.setAnimateType(updateAnimateType());
}
}
} }

19
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/DatabaseTableDataPane.java

@ -12,10 +12,12 @@ import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.utils.gui.UIComponentUtils;
import javax.swing.*; import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.border.LineBorder; import javax.swing.border.LineBorder;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
@ -29,19 +31,24 @@ public class DatabaseTableDataPane extends BasicPane{
private Object lastSelectObject; private Object lastSelectObject;
public DatabaseTableDataPane(UILabel label) { public DatabaseTableDataPane(UILabel label) {
initComponents(label);
}
private void initComponents(UILabel label) {
initTableCombox(); initTableCombox();
initReviewButton(); initReviewButton();
this.setLayout(new BorderLayout(0,0)); this.setLayout(new BorderLayout(0,0));
if(label != null) { if (label != null) {
this.add(label, BorderLayout.WEST); this.add(label, BorderLayout.WEST);
} }
JPanel pane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE,0)); JPanel pane = new JPanel(new BorderLayout(LayoutConstants.HGAP_LARGE,0));
pane.add(tableNameCombox,BorderLayout.CENTER); pane.add(tableNameCombox,BorderLayout.CENTER);
pane.add(reviewButton,BorderLayout.EAST); pane.add(reviewButton,BorderLayout.EAST);
this.add(pane,BorderLayout.CENTER);
setBorder (); this.add(UIComponentUtils.wrapWithBorderLayoutPane(pane),BorderLayout.CENTER);
setBorder();
} }
protected void setBorder () { protected void setBorder () {

10
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java

@ -13,6 +13,7 @@ import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.utils.gui.UIComponentUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -21,6 +22,8 @@ import java.awt.Dimension;
public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
private static final long serialVersionUID = 4740461028440155147L; private static final long serialVersionUID = 4740461028440155147L;
private static final int TOP = -5; private static final int TOP = -5;
private static final int TABLE_DATA_LABEL_LINE_WRAP_WIDTH = 65;
private static final int TABLE_DATA_PANE_WIDTH = 246;
private DatabaseTableDataPane tableDataPane; private DatabaseTableDataPane tableDataPane;
private AbstractTableDataContentPane dataContentPane; private AbstractTableDataContentPane dataContentPane;
@ -36,8 +39,9 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
} }
private void initDataPane() { private void initDataPane() {
UILabel label = new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TableData")) ; UILabel label = new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TableData"));
label.setPreferredSize(new Dimension(ChartDataPane.LABEL_WIDTH,ChartDataPane.LABEL_HEIGHT)); UIComponentUtils.setLineWrap(label, TABLE_DATA_LABEL_LINE_WRAP_WIDTH);
tableDataPane = new DatabaseTableDataPane(label) { tableDataPane = new DatabaseTableDataPane(label) {
@Override @Override
protected void userEvent() { protected void userEvent() {
@ -46,7 +50,7 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
} }
}; };
tableDataPane.setPreferredSize(new Dimension(246 , 20)); tableDataPane.setPreferredSize(new Dimension(TABLE_DATA_PANE_WIDTH , tableDataPane.getPreferredSize().height));
this.setBorder(BorderFactory.createEmptyBorder(TOP,0,0,0)); this.setBorder(BorderFactory.createEmptyBorder(TOP,0,0,0));
this.add(tableDataPane, BorderLayout.NORTH); this.add(tableDataPane, BorderLayout.NORTH);
} }

19
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java

@ -8,9 +8,16 @@ import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import javax.swing.*; import javax.swing.JPanel;
import javax.swing.border.Border; import javax.swing.border.Border;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.List; import java.util.List;
@ -18,6 +25,7 @@ import java.util.List;
public abstract class ThirdTabPane<T> extends BasicBeanPane<T>{ public abstract class ThirdTabPane<T> extends BasicBeanPane<T>{
private static final long serialVersionUID = 2298609199400393886L; private static final long serialVersionUID = 2298609199400393886L;
private static final int MIN_TAB_HEIGHT = 25;
protected UIButtonGroup tabPane; protected UIButtonGroup tabPane;
protected String[] nameArray; protected String[] nameArray;
public JPanel centerPane; public JPanel centerPane;
@ -49,7 +57,12 @@ public abstract class ThirdTabPane<T> extends BasicBeanPane<T>{
if (!paneList.isEmpty()) { if (!paneList.isEmpty()) {
tabPane = new UIButtonGroup(nameArray); tabPane = new UIButtonGroup(nameArray);
tabPane.setSelectedIndex(0); tabPane.setSelectedIndex(0);
tabPane.setPreferredSize(new Dimension(60 * nameArray.length, 25)); int prefHeight = tabPane.getPreferredSize().height;
int prefWidth = tabPane.getPreferredSize().width + 20; // 暂且加一个偏移量
int minWidth = 60 * nameArray.length;
tabPane.setPreferredSize(
new Dimension(prefWidth > minWidth ? prefWidth : minWidth,
prefHeight > MIN_TAB_HEIGHT ? prefHeight : MIN_TAB_HEIGHT));
tabPane.addActionListener(new ActionListener() { tabPane.addActionListener(new ActionListener() {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {

2
designer-chart/src/main/java/com/fr/van/chart/DownloadOnlineSourcesHelper.java

@ -10,6 +10,7 @@ import com.fr.general.IOUtils;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.plugin.chart.DownloadSourcesEvent; import com.fr.plugin.chart.DownloadSourcesEvent;
import com.fr.stable.CommonUtils;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
@ -140,6 +141,7 @@ public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent {
if (result) { if (result) {
//安装文件 //安装文件
IOUtils.unZipFilesGBK(temp, StableUtils.pathJoin(WorkContext.getCurrent().getPath(), siteInfo.localDir)); IOUtils.unZipFilesGBK(temp, StableUtils.pathJoin(WorkContext.getCurrent().getPath(), siteInfo.localDir));
CommonUtils.deleteFile(file);
} }
} else { } else {
result = false; result = false;

6
designer-chart/src/main/java/com/fr/van/chart/column/VanChartColumnSeriesPane.java

@ -11,7 +11,8 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.backgroundpane.ImageBackgroundQuickPane; import com.fr.design.mainframe.backgroundpane.ImageBackgroundQuickPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.base.AttrSeriesImageBackground; import com.fr.plugin.chart.base.AttrSeriesImageBackground;
import com.fr.plugin.chart.column.VanChartColumnPlot; import com.fr.plugin.chart.column.VanChartColumnPlot;
import com.fr.stable.Constants; import com.fr.stable.Constants;
@ -91,8 +92,9 @@ public class VanChartColumnSeriesPane extends VanChartAbstractPlotSeriesPane {
}; };
JPanel panel2 = TableLayout4VanChartHelper.createGapTableLayoutPane(components2, row, col); JPanel panel2 = TableLayout4VanChartHelper.createGapTableLayoutPane(components2, row, col);
UILabel fillImageLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Filled_With_Image"));
Component[][] components3 = new Component[][]{ Component[][] components3 = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Filled_With_Image")),isFillWithImage}, new Component[]{fillImageLabel, UIComponentUtils.wrapWithBorderLayoutPane(isFillWithImage)},
}; };
JPanel panel3 = TableLayout4VanChartHelper.createGapTableLayoutPane(components3, row, col); JPanel panel3 = TableLayout4VanChartHelper.createGapTableLayoutPane(components3, row, col);

6
designer-chart/src/main/java/com/fr/van/chart/designer/TableLayout4VanChartHelper.java

@ -5,6 +5,8 @@ import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -57,11 +59,11 @@ public class TableLayout4VanChartHelper {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {f, componentWidth}; double[] columnSize = {f, componentWidth};
double[] rowSize = {p, p}; double[] rowSize = {p, p};
UILabel label = new UILabel(title); UILabel label = FRWidgetFactory.createLineWrapLabel(title);
label.setVerticalAlignment(SwingConstants.TOP); label.setVerticalAlignment(SwingConstants.TOP);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{label, component}, new Component[]{label, UIComponentUtils.wrapWithBorderLayoutPane(component)},
}; };
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, COMPONENT_INTERVAL, LayoutConstants.VGAP_LARGE); return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, COMPONENT_INTERVAL, LayoutConstants.VGAP_LARGE);
} }

2
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartHtmlLabelPane.java

@ -14,6 +14,7 @@ import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.base.VanChartHtmlLabel; import com.fr.plugin.chart.base.VanChartHtmlLabel;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
@ -56,6 +57,7 @@ public class VanChartHtmlLabelPane extends JPanel{
public VanChartHtmlLabelPane() { public VanChartHtmlLabelPane() {
useHtml = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Html")); useHtml = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Html"));
UIComponentUtils.setLineWrap(useHtml);
JPanel widthAndHeightPane = createWidthAndHeightPane(); JPanel widthAndHeightPane = createWidthAndHeightPane();
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;

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

@ -6,6 +6,8 @@ import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.base.VanChartAttrLine; import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.type.LineStyle; import com.fr.plugin.chart.type.LineStyle;
import com.fr.stable.Constants; import com.fr.stable.Constants;
@ -52,7 +54,10 @@ public class VanChartLineTypePane extends BasicPane {
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null,null}, new Component[]{null,null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")),lineWidth}, new Component[]{
FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")),
UIComponentUtils.wrapWithBorderLayoutPane(lineWidth)
},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Present")),lineStyle}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Style_Present")),lineStyle},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break")),nullValueBreak}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Null_Value_Break")),nullValueBreak},
}; };

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

@ -13,6 +13,8 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.base.TrendLineType; import com.fr.plugin.chart.base.TrendLineType;
import com.fr.plugin.chart.base.VanChartAttrTrendLine; import com.fr.plugin.chart.base.VanChartAttrTrendLine;
import com.fr.plugin.chart.base.VanChartConstants; import com.fr.plugin.chart.base.VanChartConstants;
@ -65,7 +67,10 @@ public class VanChartTrendLinePane extends BasicPane{
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Name")), trendLineName}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Name")), trendLineName},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")), trendLineStyle}, new Component[]{
FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")),
UIComponentUtils.wrapWithBorderLayoutPane(trendLineStyle)
},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")), trendLineColor}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")), trendLineColor},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Type")), trendLineType}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Type")), trendLineType},
new Component[]{label, periodPane} new Component[]{label, periodPane}

10
designer-chart/src/main/java/com/fr/van/chart/designer/component/border/VanChartBorderPane.java

@ -8,7 +8,8 @@ import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -41,10 +42,13 @@ public class VanChartBorderPane extends BasicPane {
} }
protected Component[][] getUseComponent() { protected Component[][] getUseComponent() {
UILabel lineStyleLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style"));
UILabel colorLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color"));
return new Component[][]{ return new Component[][]{
new Component[]{null,null}, new Component[]{null,null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")),currentLineCombo}, new Component[]{lineStyleLabel, UIComponentUtils.wrapWithBorderLayoutPane(currentLineCombo)},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),currentLineColorPane}, new Component[]{colorLabel, currentLineColorPane},
}; };
} }

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

@ -3,6 +3,8 @@ package com.fr.van.chart.designer.component.border;
import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.VanChartAttrHelper; import com.fr.plugin.chart.VanChartAttrHelper;
import com.fr.plugin.chart.base.AttrBorderWithAlpha; import com.fr.plugin.chart.base.AttrBorderWithAlpha;
@ -29,7 +31,10 @@ public class VanChartBorderWithAlphaPane extends VanChartBorderPane{
protected Component[][] getUseComponent() { protected Component[][] getUseComponent() {
return new Component[][]{ return new Component[][]{
new Component[]{null,null}, new Component[]{null,null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")),currentLineCombo}, new Component[]{
FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")),
UIComponentUtils.wrapWithBorderLayoutPane(currentLineCombo)
},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),currentLineColorPane}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),currentLineColorPane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha")), transparent} new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Alpha")), transparent}
}; };

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

@ -4,6 +4,8 @@ import com.fr.chart.base.AttrBorder;
import com.fr.chart.chartglyph.GeneralInfo; import com.fr.chart.chartglyph.GeneralInfo;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import javax.swing.JSeparator; import javax.swing.JSeparator;
@ -28,7 +30,10 @@ public class VanChartBorderWithRadiusPane extends VanChartBorderPane {
protected Component[][] getUseComponent() { protected Component[][] getUseComponent() {
return new Component[][]{ return new Component[][]{
new Component[]{null,null}, new Component[]{null,null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")),currentLineCombo}, new Component[]{
FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Line_Style")),
UIComponentUtils.wrapWithBorderLayoutPane(currentLineCombo)
},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),currentLineColorPane}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Color")),currentLineColorPane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius")),radius} new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Radius")),radius}
} ; } ;

2
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java

@ -14,6 +14,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.attr.VanChartLegend; import com.fr.plugin.chart.attr.VanChartLegend;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -165,6 +166,7 @@ public class VanChartPlotLegendPane extends BasicPane {
location.setAllToolTips(textArray); location.setAllToolTips(textArray);
customFloatPositionButton = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Float_Position")); customFloatPositionButton = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Float_Position"));
UIComponentUtils.setLineWrap(customFloatPositionButton);
customFloatPositionButton.setEventBannded(true); customFloatPositionButton.setEventBannded(true);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{

2
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java

@ -4,7 +4,6 @@ package com.fr.van.chart.designer.style;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.plugin.chart.attr.VanChartLegend; import com.fr.plugin.chart.attr.VanChartLegend;
import com.fr.plugin.chart.range.VanChartRangeLegend; import com.fr.plugin.chart.range.VanChartRangeLegend;
import com.fr.plugin.chart.type.LegendType; import com.fr.plugin.chart.type.LegendType;
@ -53,6 +52,7 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane {
gradualLegendPane.setParentPane(parent); gradualLegendPane.setParentPane(parent);
//区域段图例面板 //区域段图例面板
sectionLegendPane = createSectionLegendPane(); sectionLegendPane = createSectionLegendPane();
sectionLegendPane.setParentPane(parent);
JPanel panel = new JPanel(new CardLayout()){ JPanel panel = new JPanel(new CardLayout()){
@Override @Override

3
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java

@ -17,6 +17,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.plugin.chart.attr.VanChartTitle; import com.fr.plugin.chart.attr.VanChartTitle;
import com.fr.plugin.chart.vanchart.VanChart; import com.fr.plugin.chart.vanchart.VanChart;
import com.fr.stable.Constants; import com.fr.stable.Constants;
@ -129,6 +130,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
private JPanel createTitleContentPane(double[] row, double[] col){ private JPanel createTitleContentPane(double[] row, double[] col){
titleContent = new TinyFormulaPane(); titleContent = new TinyFormulaPane();
useHtml = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Html")); useHtml = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Html"));
UIComponentUtils.setLineWrap(useHtml);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null ,null}, new Component[]{null ,null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"), SwingConstants.LEFT), titleContent}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Text"), SwingConstants.LEFT), titleContent},
@ -146,6 +148,7 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane<VanChart> {
alignmentPane = new UIButtonGroup<Integer>(alignmentIconArray, alignment); alignmentPane = new UIButtonGroup<Integer>(alignmentIconArray, alignment);
customFloatPositionButton = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Float_Position")); customFloatPositionButton = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Float_Position"));
UIComponentUtils.setLineWrap(customFloatPositionButton);
customFloatPositionButton.setEventBannded(true); customFloatPositionButton.setEventBannded(true);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{

19
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java

@ -20,7 +20,8 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.attr.axis.VanChartAxis; import com.fr.plugin.chart.attr.axis.VanChartAxis;
import com.fr.plugin.chart.base.VanChartConstants; import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.plugin.chart.type.AxisTickLineType; import com.fr.plugin.chart.type.AxisTickLineType;
@ -123,6 +124,7 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
titleAlignPane.setSelectedItem(Constants.CENTER); titleAlignPane.setSelectedItem(Constants.CENTER);
titleContent = new TinyFormulaPane(); titleContent = new TinyFormulaPane();
titleUseHtml = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Html")); titleUseHtml = new UIToggleButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Html"));
UIComponentUtils.setLineWrap(titleUseHtml);
titleTextAttrPane = new ChartTextAttrPane(); titleTextAttrPane = new ChartTextAttrPane();
titleTextRotation = new UINumberDragPane(-ROTATION_MAX,ROTATION_MAX); titleTextRotation = new UINumberDragPane(-ROTATION_MAX,ROTATION_MAX);
if(isXAxis){ if(isXAxis){
@ -136,7 +138,10 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
new Component[]{null,titleUseHtml}, new Component[]{null,titleUseHtml},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout_Position")),titleAlignPane}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layout_Position")),titleAlignPane},
new Component[]{titleTextAttrPane,null}, new Component[]{titleTextAttrPane,null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TextRotation")),titleTextRotation}, new Component[]{
FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TextRotation")),
UIComponentUtils.wrapWithBorderLayoutPane(titleTextRotation)
},
}; };
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, col);
@ -168,7 +173,10 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
labelGapStyle = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Fixed")}); labelGapStyle = new UIButtonGroup<Integer>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Automatic"),com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Fixed")});
labelGapValue = new UITextField(); labelGapValue = new UITextField();
Component[][] gapComponents = new Component[][]{ Component[][] gapComponents = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TextRotation")), labelTextRotation}, new Component[]{
FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_TextRotation")),
UIComponentUtils.wrapWithBorderLayoutPane(labelTextRotation)
},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Label_Interval")), labelGapStyle}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Label_Interval")), labelGapStyle},
}; };
JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(gapComponents, row, col); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(gapComponents, row, col);
@ -250,7 +258,10 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
reversed = new UIButtonGroup<Boolean>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_On"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false}); reversed = new UIButtonGroup<Boolean>(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_On"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Off")}, new Boolean[]{true, false});
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{null, null}, new Component[]{null, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Position")),position}, new Component[]{
FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Axis_Label_Position")),
UIComponentUtils.wrapWithBorderLayoutPane(position)
},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_AxisReversed")),reversed}, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_AxisReversed")),reversed},
} ; } ;

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java

@ -9,6 +9,8 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.plugin.chart.base.AttrTooltip; import com.fr.plugin.chart.base.AttrTooltip;
import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.PlotFactory;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -149,7 +151,7 @@ public class VanChartPlotTooltipPane extends BasicPane {
double[] rowSize = { p,p,p}; double[] rowSize = { p,p,p};
Component[][] components = new Component[3][2]; Component[][] components = new Component[3][2];
components[0] = new Component[]{null,null}; components[0] = new Component[]{null,null};
components[1] = new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Prompt_Box")),followMouse}; components[1] = new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Prompt_Box")), UIComponentUtils.wrapWithBorderLayoutPane(followMouse)};
if(plot.isSupportTooltipSeriesType() && hasTooltipSeriesType()){ if(plot.isSupportTooltipSeriesType() && hasTooltipSeriesType()){
components[2] = new Component[]{showAllSeries,null}; components[2] = new Component[]{showAllSeries,null};

5
designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java

@ -109,6 +109,7 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane{
resetTitleAttr(chart); resetTitleAttr(chart);
//重置监控刷新选项 //重置监控刷新选项
resetRefreshMoreLabelAttr((VanChart)chart); resetRefreshMoreLabelAttr((VanChart)chart);
resetFilterDefinition(chart);
} }
@ -118,6 +119,10 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane{
chart.setTitle(vanChartPlot.getDefaultTitle()); chart.setTitle(vanChartPlot.getDefaultTitle());
} }
//重置数据配置
protected void resetFilterDefinition(Chart chart){
}
//重置监控刷新面板 //重置监控刷新面板
protected void resetRefreshMoreLabelAttr(VanChart chart){ protected void resetRefreshMoreLabelAttr(VanChart chart){

7
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java

@ -6,10 +6,10 @@ import com.fr.chart.chartattr.Plot;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane; import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.map.MapIndependentVanChart; import com.fr.plugin.chart.map.MapIndependentVanChart;
import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.data.VanMapDefinition;
import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper; import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper;
import com.fr.van.chart.designer.type.AbstractVanChartTypePane; import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
@ -129,6 +129,11 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane {
} }
@Override
protected void resetFilterDefinition(Chart chart) {
chart.setFilterDefinition(new VanMapDefinition());
}
protected void resetAttr(Plot plot) { protected void resetAttr(Plot plot) {
sourceChoosePane.resetComponentValue((VanChartMapPlot) plot); sourceChoosePane.resetComponentValue((VanChartMapPlot) plot);
} }

6
designer-chart/src/main/java/com/fr/van/chart/range/component/SectionLegendPane.java

@ -4,9 +4,9 @@ import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula; import com.fr.design.mainframe.chart.gui.style.series.MapColorPickerPaneWithFormula;
import com.fr.plugin.chart.range.SectionLegend; import com.fr.plugin.chart.range.SectionLegend;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.style.VanChartStylePane;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -24,6 +24,10 @@ public class SectionLegendPane extends JPanel{
initComponents(); initComponents();
} }
public void setParentPane(VanChartStylePane parent){
labelFormPane.setParentPane(parent);
}
private void initComponents() { private void initComponents() {
intervalConfigPane = createSectionIntervalConfigPane(this.parent); intervalConfigPane = createSectionIntervalConfigPane(this.parent);
JPanel intervalConfigPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Section_Config"), intervalConfigPane); JPanel intervalConfigPaneWithTitle = TableLayout4VanChartHelper.createExpandablePaneWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Section_Config"), intervalConfigPane);

16
designer-form/src/main/java/com/fr/design/designer/beans/events/CreatorEventListenerTable.java

@ -1,10 +1,11 @@
package com.fr.design.designer.beans.events; package com.fr.design.designer.beans.events;
import java.util.ArrayList;
import com.fr.design.designer.creator.XComponent; import com.fr.design.designer.creator.XComponent;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import javax.swing.SwingUtilities;
import java.util.ArrayList;
public class CreatorEventListenerTable { public class CreatorEventListenerTable {
protected ArrayList<DesignerEditListener> listeners; protected ArrayList<DesignerEditListener> listeners;
@ -18,7 +19,7 @@ public class CreatorEventListenerTable {
return; return;
} }
for (int i = 0; i < listeners.size(); i++) { for (int i = 0; i < listeners.size(); i++) {
if (ComparatorUtils.equals(listener,listeners.get(i))) { if (ComparatorUtils.equals(listener, listeners.get(i))) {
listeners.set(i, listener); listeners.set(i, listener);
return; return;
} }
@ -26,11 +27,16 @@ public class CreatorEventListenerTable {
listeners.add(listener); listeners.add(listener);
} }
private void fireCreatorModified(DesignerEvent evt) { private void fireCreatorModified(final DesignerEvent evt) {
for (int i = 0; i < listeners.size(); i++) { for (int i = 0; i < listeners.size(); i++) {
DesignerEditListener listener = listeners.get(i); final DesignerEditListener listener = listeners.get(i);
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
listener.fireCreatorModified(evt); listener.fireCreatorModified(evt);
} }
});
}
} }
public void fireCreatorModified(XComponent creator, int eventID) { public void fireCreatorModified(XComponent creator, int eventID) {

3
designer-form/src/main/java/com/fr/design/designer/beans/events/DesignerEditListener.java

@ -4,8 +4,9 @@ import java.util.EventListener;
/** /**
* 界面设计组件触发的编辑处理器接口 * 界面设计组件触发的编辑处理器接口
* @since 6.5.4 *
* @author richer * @author richer
* @since 6.5.4
*/ */
public interface DesignerEditListener extends EventListener { public interface DesignerEditListener extends EventListener {

44
designer-form/src/main/java/com/fr/design/form/parameter/FormParaDesigner.java

@ -3,21 +3,6 @@
*/ */
package com.fr.design.form.parameter; package com.fr.design.form.parameter;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Insets;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.Parameter; import com.fr.base.Parameter;
import com.fr.base.parameter.ParameterUI; import com.fr.base.parameter.ParameterUI;
@ -39,7 +24,17 @@ import com.fr.design.designer.creator.XWAbsoluteLayout;
import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWParameterLayout;
import com.fr.design.designer.properties.FormWidgetAuthorityEditPane; import com.fr.design.designer.properties.FormWidgetAuthorityEditPane;
import com.fr.design.form.util.XCreatorConstants; import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.mainframe.*; import com.fr.design.mainframe.AuthorityEditPane;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.FormArea;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.FormDesignerModeForSpecial;
import com.fr.design.mainframe.FormParaPane;
import com.fr.design.mainframe.FormWidgetDetailPane;
import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.WidgetToolBarPane;
import com.fr.design.parameter.ParaDefinitePane; import com.fr.design.parameter.ParaDefinitePane;
import com.fr.design.parameter.ParameterDesignerProvider; import com.fr.design.parameter.ParameterDesignerProvider;
import com.fr.design.parameter.ParameterPropertyPane; import com.fr.design.parameter.ParameterPropertyPane;
@ -51,9 +46,22 @@ import com.fr.form.ui.WidgetValue;
import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WLayout; import com.fr.form.ui.container.WLayout;
import com.fr.form.ui.container.WParameterLayout; import com.fr.form.ui.container.WParameterLayout;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.JPanel;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.Insets;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/** /**
* Created by IntelliJ IDEA. * Created by IntelliJ IDEA.
* User : Richer * User : Richer
@ -169,7 +177,7 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
this.getEditListenerTable().addListener(new DesignerEditListener() { this.getEditListenerTable().addListener(new DesignerEditListener() {
@Override @Override
public void fireCreatorModified(DesignerEvent evt) { public void fireCreatorModified(final DesignerEvent evt) {
if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) { if (evt.getCreatorEventID() != DesignerEvent.CREATOR_SELECTED) {
paraDefinitePane.setParameterArray( paraDefinitePane.setParameterArray(
paraDefinitePane.getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters())); paraDefinitePane.getNoRepeatParas(DesignModelAdapter.getCurrentModelAdapter().getParameters()));

23
designer-form/src/main/java/com/fr/design/mainframe/FormHierarchyTreePane.java

@ -18,7 +18,6 @@ import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
import com.fr.design.parameter.HierarchyTreePane; import com.fr.design.parameter.HierarchyTreePane;
import javax.swing.Action; import javax.swing.Action;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.Icon; import javax.swing.Icon;
@ -92,7 +91,7 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
public void refreshDockingView() { public void refreshDockingView() {
FormDesigner formDesigner = this.getEditingFormDesigner(); FormDesigner formDesigner = this.getEditingFormDesigner();
removeAll(); removeAll();
if(this.componentTree != null) { if (this.componentTree != null) {
this.componentTree.removeAll(); this.componentTree.removeAll();
} }
if (formDesigner == null) { if (formDesigner == null) {
@ -108,10 +107,10 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
}); });
ComponentTreeModel treeModel = (ComponentTreeModel) componentTree.getModel(); ComponentTreeModel treeModel = (ComponentTreeModel) componentTree.getModel();
XCreator root = (XCreator)treeModel.getRoot(); XCreator root = (XCreator) treeModel.getRoot();
int childCount = treeModel.getChildCount(root); int childCount = treeModel.getChildCount(root);
//按照节点添加para在下的,但这里需要para节点在上,调整一下位置 //按照节点添加para在下的,但这里需要para节点在上,调整一下位置
if(childCount == NODE_LENGTH){ if (childCount == NODE_LENGTH) {
adjustPosition(treeModel, formDesigner); adjustPosition(treeModel, formDesigner);
} }
@ -142,7 +141,7 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
private JPanel getToolBarPane() { private JPanel getToolBarPane() {
UIToolbar toolBar = ToolBarDef.createJToolBar(); UIToolbar toolBar = ToolBarDef.createJToolBar();
toolBar.setUI(new UIToolBarUI(){ toolBar.setUI(new UIToolBarUI() {
@Override @Override
public void paint(Graphics g, JComponent c) { public void paint(Graphics g, JComponent c) {
Graphics2D g2 = (Graphics2D) g; Graphics2D g2 = (Graphics2D) g;
@ -171,7 +170,7 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
FormDesigner designer = getEditingFormDesigner(); FormDesigner designer = getEditingFormDesigner();
for (Action action : designer.getActions()) { for (Action action : designer.getActions()) {
shortCutList.add(new WidgetEnableShortCut((UndoableAction)action)); shortCutList.add(new WidgetEnableShortCut((UndoableAction) action));
} }
return shortCutList.toArray(new ShortCut4JControlPane[shortCutList.size()]); return shortCutList.toArray(new ShortCut4JControlPane[shortCutList.size()]);
@ -183,10 +182,10 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
* @param treeModel * @param treeModel
* @param formDesigner * @param formDesigner
*/ */
private void adjustPosition(ComponentTreeModel treeModel,FormDesigner formDesigner){ private void adjustPosition(ComponentTreeModel treeModel, FormDesigner formDesigner) {
XCreator root = (XCreator)treeModel.getRoot(); XCreator root = (XCreator) treeModel.getRoot();
XCreator firstChild = (XCreator)treeModel.getChild(root,PARA); XCreator firstChild = (XCreator) treeModel.getChild(root, PARA);
if(firstChild.acceptType(XWParameterLayout.class)){ if (firstChild.acceptType(XWParameterLayout.class)) {
return; return;
} }
// 绝对布局作为body的时候 // 绝对布局作为body的时候
@ -195,9 +194,9 @@ public class FormHierarchyTreePane extends FormDockView implements HierarchyTree
else if (firstChild.acceptType(XWAbsoluteBodyLayout.class) && firstChild.getBackupParent() != null) { else if (firstChild.acceptType(XWAbsoluteBodyLayout.class) && firstChild.getBackupParent() != null) {
firstChild = firstChild.getBackupParent(); firstChild = firstChild.getBackupParent();
} }
root.add(firstChild,BODY); root.add(firstChild, BODY);
treeModel.setRoot(root); treeModel.setRoot(root);
componentTree = new ComponentTree(formDesigner,treeModel); componentTree = new ComponentTree(formDesigner, treeModel);
} }
/** /**

40
designer-form/src/main/java/com/fr/design/mainframe/FormWidgetDetailPane.java

@ -7,18 +7,29 @@ import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.form.share.ShareLoader; import com.fr.form.share.ShareLoader;
import com.fr.form.ui.SharableWidgetBindInfo; import com.fr.form.ui.SharableWidgetBindInfo;
import com.fr.log.FineLoggerFactory;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.log.FineLoggerFactory;
import com.fr.share.ShareConstants; import com.fr.share.ShareConstants;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.BorderFactory;
import javax.swing.DefaultComboBoxModel;
import javax.swing.Icon;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.SwingWorker;
import javax.swing.filechooser.FileNameExtensionFilter; import javax.swing.filechooser.FileNameExtensionFilter;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Desktop;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
@ -35,27 +46,19 @@ import java.net.URISyntaxException;
* Time: 下午8:18 * Time: 下午8:18
*/ */
public class FormWidgetDetailPane extends FormDockView{ public class FormWidgetDetailPane extends FormDockView{
private static final int LOCAL_WIDGET_LABEL_WIDTH = 90;
private JPanel tabbedPane;
private UIScrollPane downPane; private UIScrollPane downPane;
private JPanel reuWidgetPanel; private JPanel reuWidgetPanel;
private UIComboBox comboBox; private UIComboBox comboBox;
private SharableWidgetBindInfo[] elCaseBindInfoList; private SharableWidgetBindInfo[] elCaseBindInfoList;
private UIButton deleteButton; private UIButton deleteButton;
private UIButton resetButton;
private JPanel editPanel; private JPanel editPanel;
private JPanel resetPanel; private JPanel resetPanel;
private JPanel menutPanel;
private JPanel menutPanelNorthPane; private JPanel menutPanelNorthPane;
private static final int OFFSET_X = 140;
private static final int OFFSET_Y = 26;
private SwingWorker sw; private SwingWorker sw;
//组件面板是否可以编辑 //组件面板是否可以编辑
private boolean isEdit; private boolean isEdit;
private CardLayout card;
private static final String REPORT_TAB = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Engine_Report");
private static final String CHART_TAB = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_ToolBar_Chart");
public static FormWidgetDetailPane getInstance() { public static FormWidgetDetailPane getInstance() {
if (HOLDER.singleton == null) { if (HOLDER.singleton == null) {
@ -135,14 +138,15 @@ public class FormWidgetDetailPane extends FormDockView{
* 初始化菜单栏面板 * 初始化菜单栏面板
*/ */
private void initMenuPanel() { private void initMenuPanel() {
menutPanel = new JPanel(); JPanel menutPanel = new JPanel();
menutPanel.setLayout(FRGUIPaneFactory.createBorderLayout()); menutPanel.setLayout(FRGUIPaneFactory.createBorderLayout());
menutPanel.setBorder(BorderFactory.createEmptyBorder(3, 10, 10, 15)); menutPanel.setBorder(BorderFactory.createEmptyBorder(3, 10, 10, 15));
// menutPanel.setPreferredSize(new Dimension(240, 48));
menutPanelNorthPane = new JPanel(new BorderLayout()); menutPanelNorthPane = new JPanel(new BorderLayout());
menutPanelNorthPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Local_Widget"), UILabel localWidgetLabel = FRWidgetFactory.createLineWrapLabel(
SwingConstants.HORIZONTAL), BorderLayout.WEST); com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Local_Widget"),
LOCAL_WIDGET_LABEL_WIDTH);
menutPanelNorthPane.add(localWidgetLabel, BorderLayout.WEST);
menutPanelNorthPane.add(initEditButtonPane(), BorderLayout.EAST); menutPanelNorthPane.add(initEditButtonPane(), BorderLayout.EAST);
menutPanelNorthPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0)); menutPanelNorthPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
@ -174,7 +178,7 @@ public class FormWidgetDetailPane extends FormDockView{
*/ */
private JPanel initResetButtonPane() { private JPanel initResetButtonPane() {
resetPanel = new JPanel(); resetPanel = new JPanel();
resetButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Reset")); UIButton resetButton = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Reset"));
resetPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); resetPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
resetButton.setBackground(Color.white); resetButton.setBackground(Color.white);
resetButton.setForeground(new Color(0x333334)); resetButton.setForeground(new Color(0x333334));

2
designer-form/src/main/java/com/fr/design/parameter/RootDesignDefinePane.java

@ -22,6 +22,7 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.widget.accessibles.AccessibleBackgroundEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleBackgroundEditor;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.form.ui.container.WParameterLayout; import com.fr.form.ui.container.WParameterLayout;
import com.fr.general.Background; import com.fr.general.Background;
@ -104,6 +105,7 @@ public class RootDesignDefinePane extends AbstractDataModify<WParameterLayout> {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
labelNameTextField = new UITextField(); labelNameTextField = new UITextField();
displayReport = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Display_Nothing_Before_Query")); displayReport = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Display_Nothing_Before_Query"));
UIComponentUtils.setLineWrap(displayReport);
useParamsTemplate = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Use_Params_Template")); useParamsTemplate = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Use_Params_Template"));
background = new AccessibleBackgroundEditor(); background = new AccessibleBackgroundEditor();
Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"),

12
designer-form/src/main/java/com/fr/design/widget/ui/designer/LabelDefinePane.java

@ -11,6 +11,7 @@ import com.fr.design.gui.style.FRFontPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.design.widget.ui.designer.component.FormWidgetValuePane;
import com.fr.form.ui.Label; import com.fr.form.ui.Label;
@ -24,6 +25,7 @@ import java.awt.*;
* Created by ibm on 2017/8/3. * Created by ibm on 2017/8/3.
*/ */
public class LabelDefinePane extends AbstractDataModify<Label> { public class LabelDefinePane extends AbstractDataModify<Label> {
private static final int WIDGET_VALUE_PANE_WIDTH = 145;
private FormWidgetValuePane formWidgetValuePane; private FormWidgetValuePane formWidgetValuePane;
private UICheckBox isPageSetupVertically; private UICheckBox isPageSetupVertically;
private UICheckBox isStyleAlignmentWrapText; private UICheckBox isStyleAlignmentWrapText;
@ -60,20 +62,20 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {f, WIDGET_VALUE_PANE_WIDTH};
int[][] rowCount = {{1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
UILabel widgetValueLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Estate_Widget_Value")); UILabel widgetValueLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Estate_Widget_Value"));
widgetValueLabel.setVerticalAlignment(SwingConstants.TOP); widgetValueLabel.setVerticalAlignment(SwingConstants.TOP);
UILabel fontLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size")); UILabel fontLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size"));
fontLabel.setVerticalAlignment(SwingConstants.TOP); fontLabel.setVerticalAlignment(SwingConstants.TOP);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{widgetValueLabel, formWidgetValuePane}, new Component[]{widgetValueLabel, formWidgetValuePane},
new Component[]{isStyleAlignmentWrapText, null}, new Component[]{isStyleAlignmentWrapText, null},
new Component[]{isPageSetupVertically, null}, new Component[]{isPageSetupVertically, null},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Display_Position_Similar")), hAlignmentPane}, new Component[]{FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Display_Position_Similar")), hAlignmentPane},
new Component[]{fontLabel, frFontPane}, new Component[]{fontLabel, frFontPane},
}; };
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W4, IntervalConstants.INTERVAL_L1);
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
boundsPane.add(panel); boundsPane.add(panel);

32
designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java

@ -5,27 +5,25 @@ import com.fr.base.iofile.attr.WatermarkAttr;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.designer.creator.XLayoutContainer;
import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.creator.XWFitLayout;
import com.fr.design.designer.creator.cardlayout.XWCardMainBorderLayout;
import com.fr.design.designer.properties.items.FRLayoutTypeItems; import com.fr.design.designer.properties.items.FRLayoutTypeItems;
import com.fr.design.designer.properties.items.Item; import com.fr.design.designer.properties.items.Item;
import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.foldablepane.UIExpandablePane;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.accessibles.AccessibleBodyWatermarkEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleBodyWatermarkEditor;
import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.design.widget.ui.designer.component.WidgetBoundPane; import com.fr.design.widget.ui.designer.component.WidgetBoundPane;
import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteBodyLayout;
import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.form.ui.container.WBodyLayoutType; import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.log.FineLoggerFactory;
import com.fr.report.core.ReportUtils; import com.fr.report.core.ReportUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
@ -33,14 +31,12 @@ import javax.swing.DefaultComboBoxModel;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.util.Arrays;
import java.util.Comparator;
/** /**
* Created by ibm on 2017/8/2. * Created by ibm on 2017/8/2.
*/ */
public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane { public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
private static final int EACH_ROW_COUNT = 4; private static final int MAX_LABEL_WIDTH = 80;
private AccessibleWLayoutBorderStyleEditor borderStyleEditor; private AccessibleWLayoutBorderStyleEditor borderStyleEditor;
private AccessibleBodyWatermarkEditor watermarkEditor; private AccessibleBodyWatermarkEditor watermarkEditor;
@ -77,10 +73,22 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
public JPanel createThirdPane() { public JPanel createThirdPane() {
initLayoutComboBox(); initLayoutComboBox();
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel northPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ double p = TableLayout.PREFERRED;
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Attr_Layout_Type")), layoutCombox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); double f = TableLayout.FILL;
JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ double[] rowSize = {p};
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Scaling_Mode")), comboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); double[] colSize = {MAX_LABEL_WIDTH, f};
UILabel layoutTypeLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Attr_Layout_Type"));
JPanel northPane = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{
new Component[]{layoutTypeLabel, UIComponentUtils.wrapWithBorderLayoutPane(layoutCombox)}},
rowSize, colSize, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
UILabel scaleModeLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Scaling_Mode"));
JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{
new Component[]{scaleModeLabel, UIComponentUtils.wrapWithBorderLayoutPane(comboBox)}},
rowSize, colSize, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
jPanel.add(northPane, BorderLayout.NORTH); jPanel.add(northPane, BorderLayout.NORTH);
jPanel.add(centerPane, BorderLayout.CENTER); jPanel.add(centerPane, BorderLayout.CENTER);
centerPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L5, 0, 0)); centerPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L5, 0, 0));

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

@ -24,9 +24,10 @@ import com.fr.design.mainframe.FormSelectionUtils;
import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.WidgetPropertyPane;
import com.fr.design.mainframe.widget.accessibles.AccessibleBodyWatermarkEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleBodyWatermarkEditor;
import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleWLayoutBorderStyleEditor;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.design.widget.ui.designer.AbstractDataModify; import com.fr.design.widget.ui.designer.AbstractDataModify;
import com.fr.design.widget.ui.designer.component.PaddingBoundPane; import com.fr.design.widget.ui.designer.component.PaddingBoundPane;
import com.fr.form.main.Form;
import com.fr.form.ui.LayoutBorderStyle; import com.fr.form.ui.LayoutBorderStyle;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteBodyLayout; import com.fr.form.ui.container.WAbsoluteBodyLayout;
@ -35,7 +36,6 @@ import com.fr.form.ui.container.WBodyLayoutType;
import com.fr.form.ui.container.WFitLayout; import com.fr.form.ui.container.WFitLayout;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.report.core.ReportUtils; import com.fr.report.core.ReportUtils;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
@ -49,6 +49,7 @@ import java.awt.Dimension;
* Created by ibm on 2017/8/2. * Created by ibm on 2017/8/2.
*/ */
public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> { public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
private static final int ADAPT_LABEL_MAX_WIDTH = 80;
private XWFitLayout xWFitLayout; private XWFitLayout xWFitLayout;
private WFitLayout wFitLayout; private WFitLayout wFitLayout;
private UIComboBox layoutComboBox; private UIComboBox layoutComboBox;
@ -95,19 +96,28 @@ public class FRFitLayoutDefinePane extends AbstractDataModify<WFitLayout> {
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
layoutComboBox = initUIComboBox(FRLayoutTypeItems.ITEMS); layoutComboBox = initUIComboBox(FRLayoutTypeItems.ITEMS);
adaptComboBox = initUIComboBox(FRFitConstraintsItems.ITEMS); adaptComboBox = initUIComboBox(FRFitConstraintsItems.ITEMS);
JPanel adaptComboBoxPane = UIComponentUtils.wrapWithBorderLayoutPane(adaptComboBox);
componentIntervel = new UISpinner(0, Integer.MAX_VALUE, 1, 0); componentIntervel = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
JPanel componentIntervelPane = UIComponentUtils.wrapWithBorderLayoutPane(componentIntervel);
UILabel adaptLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Component_Scale"));
UILabel intervalLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Component_Interval"));
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f}; double adaptLabelColumnWidth = adaptLabel.getPreferredSize().width > ADAPT_LABEL_MAX_WIDTH ? ADAPT_LABEL_MAX_WIDTH : p;
double[] columnSize = {adaptLabelColumnWidth, f};
int[][] rowCount = {{1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}};
JPanel northPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ JPanel northPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Attr_Layout_Type")), layoutComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Attr_Layout_Type")), layoutComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
northPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0)); northPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, 0, 0, 0));
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Component_Scale")), adaptComboBox}, new Component[]{adaptLabel, adaptComboBoxPane},
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Component_Interval")), componentIntervel} new Component[]{intervalLabel, componentIntervelPane}
}; };
JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); JPanel centerPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1);
centerPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L5, 0, 0)); centerPane.setBorder(BorderFactory.createEmptyBorder(IntervalConstants.INTERVAL_L1, IntervalConstants.INTERVAL_L5, 0, 0));

8
designer-form/src/main/java/com/fr/design/widget/ui/designer/mobile/ParaMobileDefinePane.java

@ -21,7 +21,6 @@ import com.fr.form.ui.container.WParameterLayout;
import com.fr.form.ui.container.WSortLayout; import com.fr.form.ui.container.WSortLayout;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.SiteCenter; import com.fr.general.SiteCenter;
import com.fr.json.JSONException;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.report.ExtraReportClassManager; import com.fr.report.ExtraReportClassManager;
import com.fr.report.fun.MobileParamStyleProvider; import com.fr.report.fun.MobileParamStyleProvider;
@ -109,9 +108,9 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane {
Item[] items = new Item[pluginCreators.size() + 1]; Item[] items = new Item[pluginCreators.size() + 1];
MobileParamStyleProvider provider = new DefaultMobileParamStyle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default")); MobileParamStyleProvider provider = new DefaultMobileParamStyle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Default"));
items[0] = new Item(provider.descriptor(), provider); items[0] = new Item(provider.descriptor(), provider);
for (int i = 0; i < pluginCreators.size(); i++) { int i = 1;
provider = pluginCreators.iterator().next(); for (MobileParamStyleProvider mobileParamStyleProvider : pluginCreators) {
items[i + 1] = new Item(provider.descriptor(), provider); items[i++] = new Item(mobileParamStyleProvider.descriptor(), mobileParamStyleProvider);
} }
return items; return items;
} }
@ -161,6 +160,7 @@ public class ParaMobileDefinePane extends MobileWidgetDefinePane {
private UIComboBox getParamLocationComboBox() { private UIComboBox getParamLocationComboBox() {
items = getItems(); items = getItems();
UIComboBox paramLocationComoBox = new UIComboBox(items); UIComboBox paramLocationComoBox = new UIComboBox(items);
paramLocationComoBox.addItemListener(new ItemListener() { paramLocationComoBox.addItemListener(new ItemListener() {
@Override @Override

24
designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java

@ -8,14 +8,22 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellExpandAttr; import com.fr.report.cell.cellattr.CellExpandAttr;
import com.fr.report.cell.cellattr.core.group.*; import com.fr.report.cell.cellattr.core.group.CustomGrouper;
import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.report.cell.cellattr.core.group.FunctionGrouper;
import com.fr.report.cell.cellattr.core.group.RecordGrouper;
import com.fr.report.cell.cellattr.core.group.SummaryGrouper;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.*; import javax.swing.JPanel;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
@ -30,6 +38,7 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
private static final int BIND_GROUP = 0; private static final int BIND_GROUP = 0;
private static final int BIND_SELECTED = 1; private static final int BIND_SELECTED = 1;
private static final int BIND_SUMMARY = 2; private static final int BIND_SUMMARY = 2;
private static final int DATA_SET_LABEL_WIDTH = 60;
private UIButton advancedButton; private UIButton advancedButton;
private FunctionComboBox functionComboBox; private FunctionComboBox functionComboBox;
@ -56,11 +65,10 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
private JPanel layoutPane() { private JPanel layoutPane() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
UILabel dataSetLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Setting")); UILabel dataSetLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Setting"));
dataSetLabel.setPreferredSize(new Dimension(60, 20));
Component[][] components = new Component[][] Component[][] components = new Component[][]
{ {
new Component[]{dataSetLabel, goBox}, new Component[]{dataSetLabel, UIComponentUtils.wrapWithBorderLayoutPane(goBox)},
new Component[]{null, cardPane} new Component[]{null, cardPane}
}; };
goBox.addItemListener(new ItemListener() { goBox.addItemListener(new ItemListener() {
@ -85,7 +93,7 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
} }
}); });
double[] columnSize = {p, f}; double[] columnSize = {DATA_SET_LABEL_WIDTH, f};
double[] rowSize = {p, p}; double[] rowSize = {p, p};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 8, 10); return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 8, 10);
} }

22
designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java

@ -18,7 +18,8 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.data.TableDataColumn; import com.fr.general.data.TableDataColumn;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
@ -193,19 +194,18 @@ public class SelectedDataColumnPane extends BasicPane {
columnNameComboBox.setEditable(true); columnNameComboBox.setEditable(true);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
UILabel dsLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_TableData")); UILabel dsLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_TableData"));
UILabel dpLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Dynamic_Parameter")); UILabel dpLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Dynamic_Parameter"));
UILabel dcLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Data_Column")); UILabel dcLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Data_Column"));
dsLabel.setPreferredSize(new Dimension(60, 20)); double[] rowSize = new double[]{p, p, p};
dpLabel.setPreferredSize(new Dimension(60, 20)); double[] colSize = new double[]{60, f};
dcLabel.setPreferredSize(new Dimension(60, 20));
Component[][] components = { Component[][] components = {
{dsLabel, tableNameComboBox}, {dsLabel, UIComponentUtils.wrapWithBorderLayoutPane(tableNameComboBox)},
{dpLabel, paramButton}, {dpLabel, UIComponentUtils.wrapWithBorderLayoutPane(paramButton)},
{dcLabel, columnNameComboBox} {dcLabel, UIComponentUtils.wrapWithBorderLayoutPane(columnNameComboBox)}
}; };
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(TableLayoutHelper.createGapTableLayoutPane(components, new double[]{p, p, p}, new double[]{p, f}, 8, 10)); this.add(TableLayoutHelper.createGapTableLayoutPane(components, rowSize, colSize, 8, 10));
} }

4
designer-realize/src/main/java/com/fr/design/mainframe/CellWidgetPropertyPane.java

@ -111,6 +111,8 @@ public class CellWidgetPropertyPane extends BasicPane {
if (finalCS.isSelectedOneCell(ePane)) { if (finalCS.isSelectedOneCell(ePane)) {
if (tplEC.getTemplateCellElement(cellElement.getColumn(), cellElement.getRow()) == null) {//cellElement未加入到report中时要添加进去 if (tplEC.getTemplateCellElement(cellElement.getColumn(), cellElement.getRow()) == null) {//cellElement未加入到report中时要添加进去
tplEC.addCellElement(cellElement); tplEC.addCellElement(cellElement);
} else {
cellElement = tplEC.getTemplateCellElement(finalCS.getColumn(), finalCS.getRow());
} }
setCellWidget(cellWidget, cellElement); setCellWidget(cellWidget, cellElement);
} else { } else {
@ -141,6 +143,8 @@ public class CellWidgetPropertyPane extends BasicPane {
if(finalCS.isSelectedOneCell(ePane)){ if(finalCS.isSelectedOneCell(ePane)){
if(tplEC.getTemplateCellElement(cellElement.getColumn(), cellElement.getRow())== null){//cellElement未加入到report中时要添加进去 if(tplEC.getTemplateCellElement(cellElement.getColumn(), cellElement.getRow())== null){//cellElement未加入到report中时要添加进去
tplEC.addCellElement(cellElement); tplEC.addCellElement(cellElement);
} else {
cellElement = tplEC.getTemplateCellElement(finalCS.getColumn(), finalCS.getRow());
} }
setCellWidget(cellWidget, cellElement); setCellWidget(cellWidget, cellElement);
}else{ }else{

68
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/component/AlphaFineDialog.java

@ -489,21 +489,24 @@ public class AlphaFineDialog extends UIDialog {
* @param searchText * @param searchText
*/ */
private void dealWithSearchText(String searchText) { private void dealWithSearchText(String searchText) {
SearchListModel searchListModelTemp = new SearchListModel(new SearchResult());
searchResultList.setModel(searchListModelTemp);
if (searchText.startsWith(ACTION_MARK_SHORT) || searchText.startsWith(ACTION_MARK)) { if (searchText.startsWith(ACTION_MARK_SHORT) || searchText.startsWith(ACTION_MARK)) {
buildActionList(new String[]{getStoreText(searchText)}); buildActionList(new String[]{getStoreText(searchText)}, searchListModelTemp);
} else if (searchText.startsWith(DOCUMENT_MARK_SHORT) || searchText.startsWith(DOCUMENT_MARK)) { } else if (searchText.startsWith(DOCUMENT_MARK_SHORT) || searchText.startsWith(DOCUMENT_MARK)) {
buildDocumentList(new String[]{getStoreText(searchText)}); buildDocumentList(new String[]{getStoreText(searchText)}, searchListModelTemp);
} else if (searchText.startsWith(FILE_MARK_SHORT) || searchText.startsWith(FILE_MARK)) { } else if (searchText.startsWith(FILE_MARK_SHORT) || searchText.startsWith(FILE_MARK)) {
buildFileList(getStoreText(searchText), new String[]{getStoreText(searchText)}); buildFileList(getStoreText(searchText), new String[]{getStoreText(searchText)}, searchListModelTemp);
} else if (searchText.startsWith(CPT_MARK) || searchText.startsWith(FRM_MARK)) { } else if (searchText.startsWith(CPT_MARK) || searchText.startsWith(FRM_MARK)) {
buildFileList(getStoreText(searchText), new String[]{searchText}); buildFileList(getStoreText(searchText), new String[]{searchText}, searchListModelTemp);
} else if (searchText.startsWith(DS_MARK)) { } else if (searchText.startsWith(DS_MARK)) {
buildFileList(getStoreText(searchText), new String[]{DS_NAME + getStoreText(searchText)}); buildFileList(getStoreText(searchText), new String[]{DS_NAME + getStoreText(searchText)}, searchListModelTemp);
} else if (searchText.startsWith(PLUGIN_MARK_SHORT) || searchText.startsWith(PLUGIN_MARK)) { } else if (searchText.startsWith(PLUGIN_MARK_SHORT) || searchText.startsWith(PLUGIN_MARK)) {
buildPluginList(new String[]{getStoreText(searchText)}); buildPluginList(new String[]{getStoreText(searchText)}, searchListModelTemp);
} else if (searchText.startsWith(SIMILAR_MARK)) { } else if (searchText.startsWith(SIMILAR_MARK)) {
buildSimilarList(new String[]{getStoreText(searchText)}); buildSimilarList(new String[]{getStoreText(searchText)}, searchListModelTemp);
} }
searchListModel = searchListModelTemp;
} }
/** /**
@ -535,51 +538,54 @@ public class AlphaFineDialog extends UIDialog {
* @param searchText * @param searchText
*/ */
private void doNormalSearch(String searchText) { private void doNormalSearch(String searchText) {
SearchListModel searchListModelTemp = new SearchListModel(new SearchResult());
searchResultList.setModel(searchListModelTemp);
if (segmentationResult != null) { if (segmentationResult != null) {
buildRecentList(segmentationResult); buildRecentList(segmentationResult, searchListModelTemp);
buildRecommendList(segmentationResult); buildRecommendList(segmentationResult, searchListModelTemp);
buildActionList(segmentationResult); buildActionList(segmentationResult, searchListModelTemp);
buildFileList(searchText, segmentationResult); buildFileList(searchText, segmentationResult, searchListModelTemp);
buildDocumentList(segmentationResult); buildDocumentList(segmentationResult, searchListModelTemp);
buildPluginList(segmentationResult); buildPluginList(segmentationResult, searchListModelTemp);
buildSimilarList(segmentationResult); buildSimilarList(segmentationResult, searchListModelTemp);
} }
searchListModel.addElement(new BottomModel()); searchListModelTemp.addElement(new BottomModel());
searchListModel = searchListModelTemp;
} }
private void buildDocumentList(final String[] searchText) { private void buildDocumentList(final String[] searchText, SearchListModel searchListModelTemp) {
addSearchResult(DocumentSearchManager.getInstance().getLessSearchResult(searchText)); addSearchResult(DocumentSearchManager.getInstance().getLessSearchResult(searchText), searchListModelTemp);
} }
private void buildFileList(String searchStr, final String[] searchText) { private void buildFileList(String searchStr, final String[] searchText, SearchListModel searchListModelTemp) {
addSearchResult(FileSearchManager.getInstance().getLessSearchResult(searchStr, searchText)); addSearchResult(FileSearchManager.getInstance().getLessSearchResult(searchStr, searchText), searchListModelTemp);
} }
private void buildActionList(final String[] searchText) { private void buildActionList(final String[] searchText, SearchListModel searchListModelTemp) {
addSearchResult(ActionSearchManager.getInstance().getLessSearchResult(searchText)); addSearchResult(ActionSearchManager.getInstance().getLessSearchResult(searchText), searchListModelTemp);
} }
private void buildPluginList(final String[] searchText) { private void buildPluginList(final String[] searchText, SearchListModel searchListModelTemp) {
addSearchResult(PluginSearchManager.getInstance().getLessSearchResult(searchText)); addSearchResult(PluginSearchManager.getInstance().getLessSearchResult(searchText), searchListModelTemp);
} }
private void buildRecommendList(final String[] searchText) { private void buildRecommendList(final String[] searchText, SearchListModel searchListModelTemp) {
addSearchResult(RecommendSearchManager.getInstance().getLessSearchResult(searchText)); addSearchResult(RecommendSearchManager.getInstance().getLessSearchResult(searchText), searchListModelTemp);
} }
private void buildRecentList(final String[] searchText) { private void buildRecentList(final String[] searchText, SearchListModel searchListModelTemp) {
addSearchResult(RecentSearchManager.getInstance().getLessSearchResult(searchText)); addSearchResult(RecentSearchManager.getInstance().getLessSearchResult(searchText), searchListModelTemp);
} }
private void buildSimilarList(final String[] searchText) { private void buildSimilarList(final String[] searchText, SearchListModel searchListModelTemp) {
addSearchResult(SimilarSearchManager.getInstance().getLessSearchResult(searchText)); addSearchResult(SimilarSearchManager.getInstance().getLessSearchResult(searchText), searchListModelTemp);
} }
private synchronized void addSearchResult(SearchResult searchResult) { private synchronized void addSearchResult(SearchResult searchResult, SearchListModel searchListModelTemp) {
for (AlphaCellModel object : searchResult) { for (AlphaCellModel object : searchResult) {
AlphaFineHelper.checkCancel(); AlphaFineHelper.checkCancel();
searchListModel.addElement(object); searchListModelTemp.addElement(object);
} }
} }

2
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecentSearchManager.java

@ -57,7 +57,7 @@ public class RecentSearchManager implements AlphaFineSearchProvider {
private Directory directory = null; private Directory directory = null;
private IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_40, analyzer); private IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_40, analyzer);
private IndexWriter indexWriter = null; private IndexWriter indexWriter = null;
private SearchResult recentModelList; private SearchResult recentModelList = new SearchResult();
public static RecentSearchManager getInstance() { public static RecentSearchManager getInstance() {

4
designer-realize/src/main/java/com/fr/design/mainframe/alphafine/search/manager/impl/RecommendSearchManager.java

@ -26,8 +26,8 @@ import java.util.List;
*/ */
public class RecommendSearchManager implements AlphaFineSearchProvider { public class RecommendSearchManager implements AlphaFineSearchProvider {
private static volatile RecommendSearchManager instance; private static volatile RecommendSearchManager instance;
private SearchResult modelList; private SearchResult modelList = new SearchResult();
private SearchResult recommendModelList; private SearchResult recommendModelList = new SearchResult();
private SearchResult complementAdviceModelList; private SearchResult complementAdviceModelList;
private SearchResult moreModelList = new SearchResult(); private SearchResult moreModelList = new SearchResult();

6
designer-realize/src/main/java/com/fr/design/mainframe/app/DesignerAppActivator.java

@ -1,7 +1,7 @@
package com.fr.design.mainframe.app; package com.fr.design.mainframe.app;
import com.fr.design.mainframe.App; import com.fr.design.mainframe.App;
import com.fr.design.mainframe.DesignerFrame; import com.fr.design.mainframe.JTemplateFactory;
import com.fr.module.Activator; import com.fr.module.Activator;
import com.fr.module.extension.Prepare; import com.fr.module.extension.Prepare;
@ -17,7 +17,7 @@ public class DesignerAppActivator extends Activator implements Prepare {
List<App> appList = rightCollectMutable(App.KEY); List<App> appList = rightCollectMutable(App.KEY);
for (App app : appList) { for (App app : appList) {
DesignerFrame.registApp(app); JTemplateFactory.register(app);
} }
} }
@ -26,7 +26,7 @@ public class DesignerAppActivator extends Activator implements Prepare {
List<App> appList = rightCollectMutable(App.KEY); List<App> appList = rightCollectMutable(App.KEY);
for (App app : appList) { for (App app : appList) {
DesignerFrame.removeApp(app); JTemplateFactory.remove(app);
} }
} }

14
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/AbstractCellAttrPane.java

@ -4,6 +4,7 @@ import com.fr.design.mainframe.AbstractAttrPane;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.FloatSelection;
import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.elementcase.TemplateElementCase;
@ -44,8 +45,17 @@ public abstract class AbstractCellAttrPane extends AbstractAttrPane {
* 分成两个方法的意义在于这个面板如果是个对话框那么可以传cellElement进来update 方便重复使用面板 为了对话框做准备 * 分成两个方法的意义在于这个面板如果是个对话框那么可以传cellElement进来update 方便重复使用面板 为了对话框做准备
*/ */
public void updateBean() { public void updateBean() {
updateBean(this.cellElement); if (elementCasePane == null) {
return;
}
cs = (CellSelection) elementCasePane.getSelection();
TemplateElementCase elementCase = elementCasePane.getEditingElementCase(); TemplateElementCase elementCase = elementCasePane.getEditingElementCase();
elementCase.addCellElement(cellElement); TemplateCellElement cellElement = elementCase.getTemplateCellElement(cs.getColumn(), cs.getRow());
if (cellElement == null) {
cellElement = new DefaultTemplateCellElement(cs.getColumn(), cs.getRow());
}
this.cellElement = cellElement;
elementCase.addCellElement(this.cellElement);
updateBean(this.cellElement);
} }
} }

5
designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java

@ -17,7 +17,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.layout.VerticalFlowLayout; import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.EastRegionContainerPane;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.DefaultTemplateCellElement;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
@ -200,8 +200,7 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
fileNamePane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0)); fileNamePane.setBorder(BorderFactory.createEmptyBorder(0,12,0,0));
UILabel showContentLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Content"), SwingConstants.LEFT); UILabel showContentLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Show_Content"), SwingConstants.LEFT);
UILabel toolTipLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip")); UILabel toolTipLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellWrite_ToolTip"));
UIComponentUtils.setLineWrap(toolTipLabel);
JPanel toolTipTextFieldWrapper = new JPanel(new BorderLayout()); JPanel toolTipTextFieldWrapper = new JPanel(new BorderLayout());
toolTipTextFieldWrapper.add(tooltipTextField, BorderLayout.NORTH); toolTipTextFieldWrapper.add(tooltipTextField, BorderLayout.NORTH);

6
designer-realize/src/main/java/com/fr/design/mainframe/socketio/DesignerSocketIO.java

@ -82,6 +82,10 @@ public class DesignerSocketIO {
socketIO.get().on(Socket.EVENT_DISCONNECT, new Emitter.Listener() { socketIO.get().on(Socket.EVENT_DISCONNECT, new Emitter.Listener() {
@Override @Override
public void call(Object... objects) { public void call(Object... objects) {
/*
* todo 远程心跳断开不一定 socketio 断开 和远程紧密相关的业务都绑定在心跳上切换成心跳断开之后进行提醒
* socketio 只用推日志和通知配置变更
*/
if (status != Status.Disconnecting) { if (status != Status.Disconnecting) {
try { try {
SwingUtilities.invokeAndWait(new Runnable() { SwingUtilities.invokeAndWait(new Runnable() {
@ -114,7 +118,7 @@ public class DesignerSocketIO {
Integer[] ports = WorkContext.getCurrent().get(SocketInfoOperator.class).getPort(); Integer[] ports = WorkContext.getCurrent().get(SocketInfoOperator.class).getPort();
WorkspaceConnection connection = WorkContext.getCurrent().getConnection(); WorkspaceConnection connection = WorkContext.getCurrent().getConnection();
String[] result = new String[ports.length]; String[] result = new String[ports.length];
for (int i = 0; i < ports.length; i++ ) { for (int i = 0; i < ports.length; i++) {
result[i] = String.format("%s://%s:%s%s?%s=%s&%s=%s", result[i] = String.format("%s://%s:%s%s?%s=%s&%s=%s",
url.getProtocol(), url.getProtocol(),
url.getHost(), url.getHost(),

5
designer-realize/src/main/java/com/fr/design/webattr/WebCssPane.java

@ -6,7 +6,7 @@ import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.file.FILEChooserPane; import com.fr.file.FILEChooserPane;
import com.fr.file.filter.ChooseFileFilter; import com.fr.file.filter.ChooseFileFilter;
@ -46,8 +46,7 @@ public class WebCssPane extends BasicPane {
northPane.add(localText, FlowLayout.CENTER); northPane.add(localText, FlowLayout.CENTER);
northPane.add(chooseFile, FlowLayout.RIGHT); northPane.add(chooseFile, FlowLayout.RIGHT);
outnorth.add(northPane,BorderLayout.NORTH); outnorth.add(northPane,BorderLayout.NORTH);
UILabel infor = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CSS_Warning")); UILabel infor = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CSS_Warning"));
UIComponentUtils.setLineWrap(infor);
infor.setForeground(new Color(207, 42, 39)); infor.setForeground(new Color(207, 42, 39));
outnorth.add(infor,BorderLayout.CENTER); outnorth.add(infor,BorderLayout.CENTER);
this.add(outnorth, BorderLayout.NORTH); this.add(outnorth, BorderLayout.NORTH);

5
designer-realize/src/main/java/com/fr/design/webattr/WebJsPane.java

@ -8,7 +8,7 @@ import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.file.FILEChooserPane; import com.fr.file.FILEChooserPane;
import com.fr.file.filter.ChooseFileFilter; import com.fr.file.filter.ChooseFileFilter;
@ -96,8 +96,7 @@ public class WebJsPane extends BasicPane {
northPane.add(localText); northPane.add(localText);
northPane.add(chooseFile); northPane.add(chooseFile);
firstnorth.add(northPane,BorderLayout.NORTH); firstnorth.add(northPane,BorderLayout.NORTH);
infor1 = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING1")); infor1 = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JS_WARNING1"));
UIComponentUtils.setLineWrap(infor1);
infor1.setForeground(new Color(207, 42, 39)); infor1.setForeground(new Color(207, 42, 39));
firstnorth.add(infor1,BorderLayout.CENTER); firstnorth.add(infor1,BorderLayout.CENTER);

34
designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java

@ -16,7 +16,8 @@ import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.MenuKeySet; import com.fr.design.menu.MenuKeySet;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.selection.QuickEditor; import com.fr.design.selection.QuickEditor;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.quickeditor.cellquick.layout.CellElementBarLayout; import com.fr.quickeditor.cellquick.layout.CellElementBarLayout;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
@ -46,19 +47,9 @@ import java.util.ArrayList;
*/ */
public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> { public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
protected static final Dimension LABEL_DIMENSION = new Dimension(60, 20);
/**
* 面板配置
*/
protected UITextField columnRowTextField;
protected TemplateCellElement cellElement;
/**
* 占位label
*/
protected final Dimension LABEL_DIMENSION = new Dimension(60, 20);
protected final UILabel EMPTY_LABEL = new UILabel();
protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3; protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3;
private static final int INSERT_CONTENT_LABEL_WIDTH = 60;
/** /**
* 滚动条相关配置 * 滚动条相关配置
@ -70,6 +61,15 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
private int maxHeight = 280; private int maxHeight = 280;
private static final int TITLE_HEIGHT = 50; private static final int TITLE_HEIGHT = 50;
/**
* 面板配置
*/
protected UITextField columnRowTextField;
protected TemplateCellElement cellElement;
// 占位label
protected final UILabel EMPTY_LABEL = new UILabel();
private UIComboBox comboBox; private UIComboBox comboBox;
private UpdateAction[] cellInsertActions; private UpdateAction[] cellInsertActions;
private int selectedIndex; private int selectedIndex;
@ -207,16 +207,14 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
private JPanel initTopContent() { private JPanel initTopContent() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {p, f}; double[] columnSize = {INSERT_CONTENT_LABEL_WIDTH, f};
double[] rowSize = {p, p}; double[] rowSize = {p, p};
UILabel cellLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cell")); UILabel cellLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cell"));
cellLabel.setPreferredSize(LABEL_DIMENSION); UILabel insertContentLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element"));
UILabel insertContentLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element"));
insertContentLabel.setPreferredSize(LABEL_DIMENSION);
initCellElementEditComboBox(); initCellElementEditComboBox();
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()}, new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()},
new Component[]{insertContentLabel, comboBox}, new Component[]{insertContentLabel, UIComponentUtils.wrapWithBorderLayoutPane(comboBox)},
}; };
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP);
} }

8
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -26,8 +26,9 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.cell.AbstractDSCellEditorPane; import com.fr.design.mainframe.cell.AbstractDSCellEditorPane;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.design.widget.FRWidgetFactory;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.quickeditor.CellQuickEditor; import com.fr.quickeditor.CellQuickEditor;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
@ -251,8 +252,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
groupPane.setListener(groupListener); groupPane.setListener(groupListener);
double[] rowSize = {P}, columnSize = {P, F}; double[] rowSize = {P}, columnSize = {P, F};
UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Filter_Conditions")); UILabel uiLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Filter_Conditions"));
uiLabel.setPreferredSize(LABEL_DIMENSION);
condition = new DSColumnConditionAction(); condition = new DSColumnConditionAction();
if (tc != null) { if (tc != null) {
condition.setEditingComponent(tc); condition.setEditingComponent(tc);
@ -262,7 +262,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
condition.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); condition.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit"));
conditionUIButton = new UIButton(condition); conditionUIButton = new UIButton(condition);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{uiLabel, conditionUIButton} new Component[]{uiLabel, UIComponentUtils.wrapWithBorderLayoutPane(conditionUIButton)}
}; };
conditionPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); conditionPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP);
this.createScrollPane(); this.createScrollPane();

20
designer-realize/src/main/java/com/fr/start/SplashContext.java

@ -1,5 +1,6 @@
package com.fr.start; package com.fr.start;
import com.fr.design.DesignerEnvManager;
import com.fr.design.mainframe.bbs.BBSConstants; import com.fr.design.mainframe.bbs.BBSConstants;
import com.fr.event.Event; import com.fr.event.Event;
import com.fr.event.EventDispatcher; import com.fr.event.EventDispatcher;
@ -22,8 +23,8 @@ import java.util.concurrent.TimeUnit;
*/ */
public class SplashContext { public class SplashContext {
public static final String SPLASH_PATH = "/com/fr/design/images/splash_10.gif"; public static final String SPLASH_PATH = getSplashPath();
public static final String SPLASH_CACHE_NAME = "splash_10.gif"; public static final String SPLASH_CACHE_NAME = getSplashCacheName();
private static final int FETCH_ONLINE_MAX_TIMES = 50; private static final int FETCH_ONLINE_MAX_TIMES = 50;
private static final SplashContext SPLASH_CONTEXT = new SplashContext(); private static final SplashContext SPLASH_CONTEXT = new SplashContext();
@ -164,4 +165,19 @@ public class SplashContext {
return false; return false;
} }
private static String getSplashPath() {
if (DesignerEnvManager.getEnvManager().getLanguage().equals(Locale.JAPAN)) {
return "/com/fr/design/images/splash_10_jp.gif";
} else {
return "/com/fr/design/images/splash_10.gif";
}
}
private static String getSplashCacheName() {
if (DesignerEnvManager.getEnvManager().getLanguage().equals(Locale.JAPAN)) {
return "splash_10_jp.gif";
} else {
return "splash_10.gif";
}
}
} }

9
designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

@ -82,16 +82,15 @@ public class DesignerStartup extends Activator {
*/ */
private void registerEnvListener() { private void registerEnvListener() {
/*切换环境前,关闭所有相关模块,最后执行*/
/*切换环境前,关闭所有相关模块*/ listenEvent(WorkspaceEvent.BeforeSwitch, new Listener<Workspace>(Integer.MIN_VALUE) {
listenEvent(WorkspaceEvent.BeforeSwitch, new Listener<Workspace>() {
@Override @Override
public void on(Event event, Workspace current) { public void on(Event event, Workspace current) {
getSub(EnvBasedModule.class).stop(); getSub(EnvBasedModule.class).stop();
} }
}); });
/*切换环境后,重新启动所有相关模块*/ /*切换环境后,重新启动所有相关模块,最先执行*/
listenEvent(WorkspaceEvent.AfterSwitch, new Listener<Workspace>(Integer.MAX_VALUE) { listenEvent(WorkspaceEvent.AfterSwitch, new Listener<Workspace>(Integer.MAX_VALUE) {
@Override @Override
@ -110,7 +109,7 @@ public class DesignerStartup extends Activator {
} }
} }
}); });
/*切换环境前,存储一下打开的所有文件对象,优先级高于默认优先级,要先于 关闭相关模块部分 被触发*/ /*切换环境前,存储一下打开的所有文件对象,要先于 关闭相关模块部分 被触发*/
listenEvent(WorkspaceEvent.BeforeSwitch, new Listener<Workspace>(Integer.MAX_VALUE) { listenEvent(WorkspaceEvent.BeforeSwitch, new Listener<Workspace>(Integer.MAX_VALUE) {
@Override @Override
public void on(Event event, Workspace workspace) { public void on(Event event, Workspace workspace) {

BIN
designer-realize/src/main/resources/com/fr/design/images/splash_10_jp.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 MiB

Loading…
Cancel
Save