Browse Source

Merge branch 'feature/x' of https://code.fineres.com/scm/~fly.li/design into feature/x

feature/x
Fly.Li 2 years ago
parent
commit
865ba04e4a
  1. 74
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 29
      designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java
  3. 3
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  4. 3
      designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java
  5. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java
  6. 2
      designer-base/src/main/java/com/fr/design/gui/ibutton/UITabGroup.java
  7. 7
      designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeAttrChangeListener.java
  8. 50
      designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeRootPane.java
  9. 23
      designer-base/src/main/java/com/fr/design/mainframe/DesignerUIModeConfig.java
  10. 3
      designer-base/src/main/java/com/fr/design/plugin/remind/PluginErrorDesignReminder.java
  11. 81
      designer-base/src/main/java/com/fr/design/widget/component/ReturnTypePane.java
  12. 7
      designer-base/src/main/java/com/fr/env/detect/base/EnvDetectorConfig.java
  13. 12
      designer-base/src/main/java/com/fr/start/server/FineEmbedServer.java
  14. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/data/VanChartMoreCateTableDataContentPane.java
  15. 24
      designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java
  16. 10
      designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java
  17. 2
      designer-form/src/main/java/com/fr/design/fit/NewJForm.java
  18. 23
      designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java
  19. 20
      designer-form/src/main/java/com/fr/design/fit/common/NewUIModeAutoChangeLine.java
  20. 69
      designer-form/src/main/java/com/fr/design/fit/common/NewUIModeRotationDraw.java
  21. 12
      designer-form/src/main/java/com/fr/design/widget/ui/designer/CheckBoxGroupDefinePane.java
  22. 12
      designer-form/src/main/java/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java
  23. 68
      designer-form/src/main/java/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java
  24. 2
      designer-realize/src/main/java/com/fr/design/fit/NewUIModeCellElementPainter.java
  25. 117
      designer-realize/src/main/java/com/fr/design/report/ImageExportPane.java
  26. 12
      designer-realize/src/main/java/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java
  27. 12
      designer-realize/src/main/java/com/fr/design/widget/ui/ComboCheckBoxDefinePane.java
  28. 18
      designer-realize/src/main/java/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java
  29. 17
      designer-realize/src/main/java/com/fr/design/widget/ui/TreeEditorDefinePane.java
  30. 3
      designer-realize/src/main/java/com/fr/grid/GridUtils.java
  31. 9
      designer-realize/src/main/java/com/fr/start/module/DesignerActivator.java
  32. 2
      designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java
  33. 6
      designer-realize/src/main/java/com/fr/start/module/optimized/TenantDBAdapter4Designer.java

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

@ -14,6 +14,7 @@ import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UINoThemeColorButton; import com.fr.design.gui.ibutton.UINoThemeColorButton;
import com.fr.design.gui.ibutton.UIRadioButton;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icombobox.UIDictionaryComboBox; import com.fr.design.gui.icombobox.UIDictionaryComboBox;
@ -26,6 +27,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.iprogressbar.UIProgressBarUI; import com.fr.design.gui.iprogressbar.UIProgressBarUI;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.i18n.Toolkit;
import com.fr.design.jdk.JdkVersion; import com.fr.design.jdk.JdkVersion;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
@ -42,8 +44,10 @@ import com.fr.general.FRFont;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.log.Log4jConfig; import com.fr.general.log.Log4jConfig;
import com.fr.io.attr.ImageExportAttr;
import com.fr.locale.InterProviderFactory; import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.report.ReportConfigManager;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.os.OperatingSystem; import com.fr.stable.os.OperatingSystem;
import com.fr.third.apache.logging.log4j.Level; import com.fr.third.apache.logging.log4j.Level;
@ -55,6 +59,8 @@ import com.fr.workspace.server.vcs.git.config.GcConfig;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.BoxLayout; import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.JComponent;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.JFileChooser; import javax.swing.JFileChooser;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
@ -190,6 +196,14 @@ public class PreferencePane extends BasicPane {
private Timer gcProgressTimer; private Timer gcProgressTimer;
private UIButton gcOkButton = new UIButton(i18nText("Fine-Design_Report_OK")); private UIButton gcOkButton = new UIButton(i18nText("Fine-Design_Report_OK"));
private UIRadioButton previewResolutionBtnS;
private UIRadioButton previewResolutionBtnM;
private UIRadioButton previewRenderSpeed;
private UIRadioButton previewRenderQuality;
private static final int DPI_SCALE_S = 1;
private static final int DPI_SCALE_M = 2;
public PreferencePane() { public PreferencePane() {
this.initComponents(); this.initComponents();
} }
@ -274,6 +288,7 @@ public class PreferencePane extends BasicPane {
JPanel imageCompressPanel = FRGUIPaneFactory.createVerticalTitledBorderPane(i18nText("Fine-Design_Template_Preview_Performance")); JPanel imageCompressPanel = FRGUIPaneFactory.createVerticalTitledBorderPane(i18nText("Fine-Design_Template_Preview_Performance"));
imageCompressPanelCheckBox = new UICheckBox(i18nText("Fine-Design_Image_Compress")); imageCompressPanelCheckBox = new UICheckBox(i18nText("Fine-Design_Image_Compress"));
imageCompressPanel.add(imageCompressPanelCheckBox); imageCompressPanel.add(imageCompressPanelCheckBox);
imageCompressPanel.add(createImageExportSettingPane());
advancePane.add(imageCompressPanel); advancePane.add(imageCompressPanel);
JPanel designerStartupOption = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Startup_Option")); JPanel designerStartupOption = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Startup_Option"));
@ -282,6 +297,34 @@ public class PreferencePane extends BasicPane {
advancePane.add(designerStartupOption); advancePane.add(designerStartupOption);
} }
private JPanel createImageExportSettingPane() {
previewResolutionBtnS = new UIRadioButton(i18nText("Fine-Design_Image_Export_SD"), true);
previewResolutionBtnM = new UIRadioButton(i18nText("Fine-Design_Image_Export_HD"));
ButtonGroup previewResolutionBtnGroup = new ButtonGroup();
previewResolutionBtnGroup.add(previewResolutionBtnS);
previewResolutionBtnGroup.add(previewResolutionBtnM);
previewRenderSpeed = new UIRadioButton(Toolkit.i18nText("Fine-Design_Image_Export_Speed_Priority"));
previewRenderQuality = new UIRadioButton(Toolkit.i18nText("Fine-Design_Image_Export_Quality_First"));
ButtonGroup previewRenderGroup = new ButtonGroup();
previewRenderGroup.add(previewRenderQuality);
previewRenderGroup.add(previewRenderSpeed);
JPanel imageExportSettingPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JComponent[][] templateComps = {
{new UILabel(Toolkit.i18nText("Fine-Design_Report_Engine_Enlarge_Or_Reduce") + ":"), this.previewResolutionBtnS, this.previewResolutionBtnM},
{new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Rendering_Quality") + ":"), this.previewRenderQuality, this.previewRenderSpeed},
};
imageExportSettingPane.add(
TableLayoutHelper.createGapTableLayoutPane(
templateComps,
new double[]{TableLayout.FILL, TableLayout.FILL},
new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL},
20, 0),
BorderLayout.CENTER);
imageExportSettingPane.setBorder(BorderFactory.createEmptyBorder(0, 3, 0, 0));
return imageExportSettingPane;
}
private void createVcsSettingPane(JPanel generalPane) { private void createVcsSettingPane(JPanel generalPane) {
JPanel vcsPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(i18nText("Fine-Design_Vcs_Title")); JPanel vcsPane = FRGUIPaneFactory.createTopVerticalTitledBorderPane(i18nText("Fine-Design_Vcs_Title"));
generalPane.add(vcsPane); generalPane.add(vcsPane);
@ -757,6 +800,25 @@ public class PreferencePane extends BasicPane {
this.startWithEmptyFile.setSelected(designerEnvManager.isStartWithEmptyFile()); this.startWithEmptyFile.setSelected(designerEnvManager.isStartWithEmptyFile());
this.imageCompressPanelCheckBox.setSelected(designerEnvManager.isImageCompress()); this.imageCompressPanelCheckBox.setSelected(designerEnvManager.isImageCompress());
ImageExportAttr attr = ReportConfigManager.getProviderInstance().getImageExportAttr();
if (attr.getPreviewRenderQuality() == ImageExportAttr.RENDER_SPEED) {
previewRenderSpeed.setSelected(true);
} else {
previewRenderQuality.setSelected(true);
}
if (attr.getPreviewResolutionScale() == DPI_SCALE_S) {
previewResolutionBtnS.setSelected(true);
} else {
previewResolutionBtnM.setSelected(true);
}
boolean enabled = WorkContext.getCurrent().isLocal() || WorkContext.getCurrent().isRoot();
previewRenderSpeed.setEnabled(enabled);
previewRenderQuality.setEnabled(enabled);
previewResolutionBtnS.setEnabled(enabled);
previewResolutionBtnM.setEnabled(enabled);
this.cloudAnalyticsDelayCheckBox.setSelected(designerEnvManager.isCloudAnalyticsDelay()); this.cloudAnalyticsDelayCheckBox.setSelected(designerEnvManager.isCloudAnalyticsDelay());
} }
@ -883,6 +945,18 @@ public class PreferencePane extends BasicPane {
} }
}); });
ImageExportAttr attr = ReportConfigManager.getProviderInstance().getImageExportAttr();
if (previewRenderSpeed.isSelected()) {
attr.setPreviewRenderQuality(ImageExportAttr.RENDER_SPEED);
} else {
attr.setPreviewRenderQuality(ImageExportAttr.RENDER_QUALITY);
}
if (previewResolutionBtnS.isSelected()) {
attr.setPreviewResolutionScale(DPI_SCALE_S);
} else {
attr.setPreviewResolutionScale(DPI_SCALE_M);
}
} }
// 如果语言设置改变了,则显示重启对话框 // 如果语言设置改变了,则显示重启对话框

29
designer-base/src/main/java/com/fr/design/data/datapane/ESDStrategyConfigPane.java

@ -15,6 +15,7 @@ import com.fr.esd.util.ESDUtils;
import com.fr.locale.InterProviderFactory; import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.org.quartz.CronExpression;
import javax.swing.AbstractAction; import javax.swing.AbstractAction;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -25,9 +26,11 @@ import java.awt.Desktop;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.net.URI; import java.net.URI;
import java.text.ParseException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Date;
/** /**
* @author rinoux * @author rinoux
@ -36,7 +39,6 @@ import java.util.List;
*/ */
public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> { public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
private static final String CRON_HELP_URL = "http://help.fanruan.com/finereport/doc-view-693.html"; private static final String CRON_HELP_URL = "http://help.fanruan.com/finereport/doc-view-693.html";
private UIRadioButton selectAutoUpdate; private UIRadioButton selectAutoUpdate;
private UIRadioButton selectBySchema; private UIRadioButton selectBySchema;
private UICheckBox shouldEvolve; private UICheckBox shouldEvolve;
@ -131,8 +133,7 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
ob = StrategyConfigHelper.createStrategyConfig(true, false, true); ob = StrategyConfigHelper.createStrategyConfig(true, false, true);
} }
this.strategyConfig = ob; this.strategyConfig = ob;
this.updateInterval.setText(ob.getUpdateInterval() <= 0 ? "0" : String.format("%.0f", ob.getUpdateInterval() / (double) CacheConstants.MILLIS_OF_MINUTE));
this.updateInterval.setText(ob.getUpdateInterval() <= 0 ? "0" : String.valueOf(ob.getUpdateInterval() / (double) CacheConstants.MILLIS_OF_MINUTE));
this.schemaTime.setText(StringUtils.join(",", ob.getUpdateSchema().toArray(new String[0]))); this.schemaTime.setText(StringUtils.join(",", ob.getUpdateSchema().toArray(new String[0])));
this.shouldEvolve.setSelected(ob.shouldEvolve()); this.shouldEvolve.setSelected(ob.shouldEvolve());
this.selectBySchema.setSelected(ob.isScheduleBySchema()); this.selectBySchema.setSelected(ob.isScheduleBySchema());
@ -177,11 +178,19 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
if (ESDUtils.checkUpdateTimeSchema(text)) { if (ESDUtils.checkUpdateTimeSchema(text)) {
if (ESDUtils.isCronExpression(text)) { if (ESDUtils.isCronExpression(text)) {
if (checkCornTimeInterval(text)) {
schemaTimes.add(text); schemaTimes.add(text);
} else {
this.schemaTimeCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Interval_Too_Short"));
this.schemaTimeCheckTips.setVisible(true);
throw new IllegalArgumentException("[ESD]Update schema time interval is to short.");
}
} else { } else {
Collections.addAll(schemaTimes, text.split(",")); Collections.addAll(schemaTimes, text.split(","));
} }
} else { } else {
this.schemaTimeCheckTips.setText(InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Error_Time_Format"));
this.schemaTimeCheckTips.setVisible(true); this.schemaTimeCheckTips.setVisible(true);
throw new IllegalArgumentException("[ESD]Update schema time format error."); throw new IllegalArgumentException("[ESD]Update schema time format error.");
} }
@ -211,7 +220,7 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
private boolean checkUpdateInterval(String intervalValue) { private boolean checkUpdateInterval(String intervalValue) {
try { try {
return !StringUtils.isEmpty(intervalValue) && !(Double.parseDouble(intervalValue) <= 0); return !StringUtils.isEmpty(intervalValue) && !(Integer.parseInt(intervalValue) <= 0);
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
@ -219,6 +228,18 @@ public class ESDStrategyConfigPane extends BasicBeanPane<StrategyConfig> {
return false; return false;
} }
private boolean checkCornTimeInterval (String cronText) {
// 判断后两次更新时间间隔,如果小于1分钟就返回false
try {
CronExpression cron = new CronExpression(cronText);
Date next1 = cron.getNextValidTimeAfter(new Date());
Date next2 = cron.getNextValidTimeAfter(next1);
return next2.getTime() - next1.getTime() >= CacheConstants.MILLIS_OF_MINUTE;
} catch (ParseException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
return false;
}
protected String title4PopupWindow() { protected String title4PopupWindow() {
return InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Cache_Strategy_Config_Title"); return InterProviderFactory.getDesignI18nProvider().i18nText("Fine-Design_ESD_Cache_Strategy_Config_Title");

3
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java

@ -1,5 +1,6 @@
package com.fr.design.data.datapane.connect; package com.fr.design.data.datapane.connect;
import com.fr.base.TemplateUtils;
import com.fr.config.RemoteConfigEvent; import com.fr.config.RemoteConfigEvent;
import com.fr.data.core.db.JDBCSecurityChecker; import com.fr.data.core.db.JDBCSecurityChecker;
import com.fr.data.impl.Connection; import com.fr.data.impl.Connection;
@ -205,7 +206,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
Connection connection = connectionBean.getConnection(); Connection connection = connectionBean.getConnection();
if (connection instanceof JDBCDatabaseConnection) { if (connection instanceof JDBCDatabaseConnection) {
try { try {
JDBCSecurityChecker.checkURL(((JDBCDatabaseConnection) connection).getURL()); JDBCSecurityChecker.checkURL(TemplateUtils.render(((JDBCDatabaseConnection) connection).getURL()));
JDBCSecurityChecker.checkValidationQuery(((JDBCDatabaseConnection) connection).getDbcpAttr().getValidationQuery()); JDBCSecurityChecker.checkValidationQuery(((JDBCDatabaseConnection) connection).getDbcpAttr().getValidationQuery());
} catch (SQLException e) { } catch (SQLException e) {
throw new SQLException(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Invalid_Config", connectionBean.getName()) + ", " + e.getMessage(), e.getCause()); throw new SQLException(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Invalid_Config", connectionBean.getName()) + ", " + e.getMessage(), e.getCause());

3
designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/EmbeddedTableDataPane.java

@ -65,6 +65,9 @@ public class EmbeddedTableDataPane extends AbstractTableDataPane<EmbeddedTableDa
dataJTable.setDefaultEditor(Date.class, new DateEditor(new UIDatePicker(UIDatePicker.STYLE_CN_DATE1))); dataJTable.setDefaultEditor(Date.class, new DateEditor(new UIDatePicker(UIDatePicker.STYLE_CN_DATE1)));
tableStructureChanged(); tableStructureChanged();
// 当前版本已经不会出现Float, 这里兜底一下防止报错
dataJTable.setDefaultRenderer(Float.class, new DoubleRenderer());
// 单击即可编辑 // 单击即可编辑
editbysingleclick(dataJTable, String.class); editbysingleclick(dataJTable, String.class);
editbysingleclick(dataJTable, Date.class); editbysingleclick(dataJTable, Date.class);

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

@ -296,7 +296,7 @@ public class UIButtonGroup<T> extends JPanel implements GlobalNameObserver, UIOb
return selectedIndex; return selectedIndex;
} }
protected void setSelectedIndex(int newSelectedIndex, boolean fireChanged) { public void setSelectedIndex(int newSelectedIndex, boolean fireChanged) {
if (selectedIndex != newSelectedIndex) { if (selectedIndex != newSelectedIndex) {
selectedIndex = newSelectedIndex; selectedIndex = newSelectedIndex;
for (int i = 0; i < labelButtonList.size(); i++) { for (int i = 0; i < labelButtonList.size(); i++) {

2
designer-base/src/main/java/com/fr/design/gui/ibutton/UITabGroup.java

@ -63,7 +63,7 @@ public class UITabGroup extends UIButtonGroup<Integer> {
} }
@Override @Override
protected void setSelectedIndex(int newSelectedIndex, boolean fireChanged) { public void setSelectedIndex(int newSelectedIndex, boolean fireChanged) {
super.setSelectedIndex(newSelectedIndex, false); super.setSelectedIndex(newSelectedIndex, false);
tabChanged(newSelectedIndex); tabChanged(newSelectedIndex);
} }

7
designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeAttrChangeListener.java

@ -0,0 +1,7 @@
package com.fr.design.gui.itree.refreshabletree;
import com.fr.data.impl.TreeAttr;
public interface TreeAttrChangeListener {
void doChange(TreeAttr treeAttr);
}

50
designer-base/src/main/java/com/fr/design/gui/itree/refreshabletree/TreeRootPane.java

@ -10,21 +10,24 @@ import javax.swing.BoxLayout;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.awt.event.MouseListener; import java.util.ArrayList;
import java.util.List;
public class TreeRootPane extends BasicPane { public class TreeRootPane extends BasicPane {
private final List<TreeAttrChangeListener> listeners = new ArrayList<>();
// 是否支持多选(checkBoxTree) // 是否支持多选(checkBoxTree)
//private JCheckBox multipleSelection; //private JCheckBox multipleSelection;
private UICheckBox checkTypeCheckBox; private final UICheckBox checkTypeCheckBox;
// richer:加载的方式,支持异步加载和完全加载 // richer:加载的方式,支持异步加载和完全加载
private UICheckBox loadTypeCheckBox; private final UICheckBox loadTypeCheckBox;
private UICheckBox layerTypeCheckBox; private final UICheckBox layerTypeCheckBox;
private UICheckBox returnFullPathCheckBox; private final UICheckBox returnFullPathCheckBox;
public TreeRootPane() { public TreeRootPane() {
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
@ -41,13 +44,6 @@ public class TreeRootPane extends BasicPane {
checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
loadTypeCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Load_By_Async")); loadTypeCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Load_By_Async"));
loadTypeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); loadTypeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
loadTypeCheckBox.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
UICheckBox checkBox = (UICheckBox) e.getSource();
doLoadTypeChange(checkBox.isSelected());
}
});
loadTypePane.add(loadTypeCheckBox); loadTypePane.add(loadTypeCheckBox);
this.add(loadTypePane); this.add(loadTypePane);
@ -63,11 +59,27 @@ public class TreeRootPane extends BasicPane {
checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); checkTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
returnFullPathPane.add(returnFullPathCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Return_Full_Path"))); returnFullPathPane.add(returnFullPathCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Return_Full_Path")));
returnFullPathCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); returnFullPathCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
addCheckBoxListener();
this.add(returnFullPathPane); this.add(returnFullPathPane);
} }
private void addCheckBoxListener() {
loadTypeCheckBox.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
UICheckBox checkBox = (UICheckBox) e.getSource();
doLoadTypeChange(checkBox.isSelected());
}
});
checkTypeCheckBox.addActionListener(event->fireTreeAttrChangeListener());
loadTypeCheckBox.addActionListener(event->fireTreeAttrChangeListener());
layerTypeCheckBox.addActionListener(event->fireTreeAttrChangeListener());
returnFullPathCheckBox.addActionListener(event->fireTreeAttrChangeListener());
}
private void doLoadTypeChange(Boolean selected) { private void doLoadTypeChange(Boolean selected) {
//给埋点插件提供一个方法,埋埋点用 //给埋点插件提供一个方法,埋埋点用
} }
@ -82,6 +94,7 @@ public class TreeRootPane extends BasicPane {
loadTypeCheckBox.setSelected(treeAttr.isAjax()); loadTypeCheckBox.setSelected(treeAttr.isAjax());
layerTypeCheckBox.setSelected(treeAttr.isSelectLeafOnly()); layerTypeCheckBox.setSelected(treeAttr.isSelectLeafOnly());
returnFullPathCheckBox.setSelected(treeAttr.isReturnFullPath()); returnFullPathCheckBox.setSelected(treeAttr.isReturnFullPath());
fireTreeAttrChangeListener();
} }
public TreeAttr update() { public TreeAttr update() {
@ -93,4 +106,17 @@ public class TreeRootPane extends BasicPane {
return treeAttr; return treeAttr;
} }
public void addTreeAttrChangeListener(TreeAttrChangeListener listener) {
listeners.add(listener);
}
public void fireTreeAttrChangeListener() {
TreeAttr treeAttr = new TreeAttr();
treeAttr.setMultipleSelection(checkTypeCheckBox.isSelected());
treeAttr.setAjax(loadTypeCheckBox.isSelected());
treeAttr.setSelectLeafOnly(layerTypeCheckBox.isSelected());
treeAttr.setReturnFullPath(returnFullPathCheckBox.isSelected());
listeners.forEach(listener -> listener.doChange(treeAttr));
}
} }

23
designer-base/src/main/java/com/fr/design/mainframe/DesignerUIModeConfig.java

@ -1,8 +1,11 @@
package com.fr.design.mainframe; package com.fr.design.mainframe;
import com.fr.base.AutoChangeLineProvider;
import com.fr.base.DefaultAutoChangeLine;
import com.fr.base.ScreenResolution; import com.fr.base.ScreenResolution;
import com.fr.design.fun.ReportLengthUNITProvider; import com.fr.design.fun.ReportLengthUNITProvider;
import com.fr.design.unit.UnitConvertUtil; import com.fr.design.unit.UnitConvertUtil;
import com.fr.form.fit.NewUIModeAutoChangeLine;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
@ -58,6 +61,14 @@ public class DesignerUIModeConfig {
return mode.parseLengthUNIT(unitType); return mode.parseLengthUNIT(unitType);
} }
/**
* 获取不同模式下的换行逻辑
* @return AutoChangeLineProvider
*/
public AutoChangeLineProvider getAutoChangeLineStrategy() {
return mode.getAutoChangeLineStrategy();
}
/** /**
* 获取不同模式下的屏幕分辨率 * 获取不同模式下的屏幕分辨率
* *
@ -75,6 +86,11 @@ public class DesignerUIModeConfig {
return UnitConvertUtil.parseLengthUNIT(unitType); return UnitConvertUtil.parseLengthUNIT(unitType);
} }
@Override
public AutoChangeLineProvider getAutoChangeLineStrategy() {
return new DefaultAutoChangeLine();
}
@Override @Override
protected int getScreenResolution() { protected int getScreenResolution() {
return ScreenResolution.getScreenResolution(); return ScreenResolution.getScreenResolution();
@ -87,6 +103,11 @@ public class DesignerUIModeConfig {
return new PXReportLengthUNIT(); return new PXReportLengthUNIT();
} }
@Override
public AutoChangeLineProvider getAutoChangeLineStrategy() {
return new NewUIModeAutoChangeLine();
}
@Override @Override
protected int getScreenResolution() { protected int getScreenResolution() {
return Constants.DEFAULT_WEBWRITE_AND_SCREEN_RESOLUTION; return Constants.DEFAULT_WEBWRITE_AND_SCREEN_RESOLUTION;
@ -96,6 +117,8 @@ public class DesignerUIModeConfig {
protected abstract ReportLengthUNITProvider parseLengthUNIT(int unitType); protected abstract ReportLengthUNITProvider parseLengthUNIT(int unitType);
public abstract AutoChangeLineProvider getAutoChangeLineStrategy();
protected abstract int getScreenResolution(); protected abstract int getScreenResolution();

3
designer-base/src/main/java/com/fr/design/plugin/remind/PluginErrorDesignReminder.java

@ -9,6 +9,7 @@ import com.fr.plugin.error.PluginErrorRemindHandler;
import com.fr.plugin.error.PluginErrorReminder; import com.fr.plugin.error.PluginErrorReminder;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.collections.CollectionUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
@ -64,7 +65,7 @@ public class PluginErrorDesignReminder implements PluginErrorReminder {
} }
// 获取失效插件名称列表 // 获取失效插件名称列表
List<String> embedPluginNames = PluginErrorRemindHandler.getInvalidateEmbedPluginNames(); List<String> embedPluginNames = PluginErrorRemindHandler.getInvalidateEmbedPluginNames();
if (embedPluginNames.size() > 0) { if (!CollectionUtils.isEmpty(embedPluginNames)) {
// 构建消息 // 构建消息
String message = generateMessageContent(embedPluginNames); String message = generateMessageContent(embedPluginNames);
Notification notification = generateNotification(message, embedPluginNames); Notification notification = generateNotification(message, embedPluginNames);

81
designer-base/src/main/java/com/fr/design/widget/component/CheckBoxDictPane.java → designer-base/src/main/java/com/fr/design/widget/component/ReturnTypePane.java

@ -1,32 +1,29 @@
package com.fr.design.widget.component; package com.fr.design.widget.component;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.*;
import com.fr.design.gui.icombobox.DictionaryComboBox; import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.gui.icombobox.DictionaryConstants; import com.fr.design.gui.icombobox.DictionaryConstants;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.CheckBoxGroup; import com.fr.form.ui.ReturnTypeProvider;
import com.fr.form.ui.ComboCheckBox;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
public class CheckBoxDictPane extends JPanel { public class ReturnTypePane extends JPanel {
private DictionaryComboBox delimiterComboBox; private final DictionaryComboBox delimiterComboBox;
private UIButtonGroup returnTypeComboBox; private final UIButtonGroup returnTypeComboBox;
private DictionaryComboBox startComboBox; private final DictionaryComboBox startComboBox;
private DictionaryComboBox endComboBox; private final DictionaryComboBox endComboBox;
private JPanel returnStringPane; private final JPanel returnStringPane;
public CheckBoxDictPane() { public ReturnTypePane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
delimiterComboBox = new DictionaryComboBox(DictionaryConstants.delimiters, DictionaryConstants.delimiterDisplays); delimiterComboBox = new DictionaryComboBox(DictionaryConstants.delimiters, DictionaryConstants.delimiterDisplays);
delimiterComboBox.setEditable(true); delimiterComboBox.setEditable(true);
@ -42,12 +39,7 @@ public class CheckBoxDictPane extends JPanel {
returnStringPane = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1); returnStringPane = TableLayoutHelper.createGapTableLayoutPane(components, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_W2, IntervalConstants.INTERVAL_L1);
returnTypeComboBox = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Array"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_String")}); returnTypeComboBox = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Array"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_String")});
returnTypeComboBox.addActionListener(new ActionListener() { returnTypeComboBox.addActionListener(e -> checkVisible(returnTypeComboBox.getSelectedIndex()));
@Override
public void actionPerformed(ActionEvent e) {
checkVisible(returnTypeComboBox.getSelectedIndex());
}
});
JPanel headPane = TableLayoutHelper.createGapTableLayoutPane( JPanel headPane = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Date_Selector_Return_Type")), returnTypeComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1); new Component[][]{new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Date_Selector_Return_Type")), returnTypeComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -57,34 +49,33 @@ public class CheckBoxDictPane extends JPanel {
this.add(jPanel); this.add(jPanel);
} }
public void setReturnType(ReturnType returnType) {
int selectIndex = returnType == ReturnType.ARRAY ? 0 : 1;
returnTypeComboBox.setSelectedIndex(selectIndex,true);
checkVisible(selectIndex);
}
public void checkVisible(int selectIndex) { public void checkVisible(int selectIndex) {
returnStringPane.setVisible(selectIndex == 1); returnStringPane.setVisible(selectIndex == 1);
} }
public void populate(ComboCheckBox comboCheckBox) { public void update(ReturnTypeProvider returnTypeProvider) {
this.delimiterComboBox.setSelectedItem(comboCheckBox.getDelimiter()); returnTypeProvider.setDelimiter((String) this.delimiterComboBox.getSelectedItem());
this.returnTypeComboBox.setSelectedIndex(comboCheckBox.isReturnString() ? 1 : 0); returnTypeProvider.setReturnString(this.returnTypeComboBox.getSelectedIndex() != 0);
this.startComboBox.setSelectedItem(comboCheckBox.getStartSymbol()); returnTypeProvider.setStartSymbol((String) this.startComboBox.getSelectedItem());
this.endComboBox.setSelectedItem(comboCheckBox.getEndSymbol()); returnTypeProvider.setEndSymbol((String) this.endComboBox.getSelectedItem());
checkVisible(this.returnTypeComboBox.getSelectedIndex());
} }
public void update(ComboCheckBox comboCheckBox) {
comboCheckBox.setDelimiter((String)this.delimiterComboBox.getSelectedItem()); public void populate(ReturnTypeProvider returnTypeProvider) {
comboCheckBox.setReturnString(this.returnTypeComboBox.getSelectedIndex() != 0); this.delimiterComboBox.setSelectedItem(returnTypeProvider.getDelimiter());
comboCheckBox.setStartSymbol((String)this.startComboBox.getSelectedItem()); this.returnTypeComboBox.setSelectedIndex(returnTypeProvider.isReturnString() ? 1 : 0);
comboCheckBox.setEndSymbol((String)this.endComboBox.getSelectedItem()); this.startComboBox.setSelectedItem(returnTypeProvider.getStartSymbol());
} this.endComboBox.setSelectedItem(returnTypeProvider.getEndSymbol());
public void populate(CheckBoxGroup checkBoxGroup) {
this.delimiterComboBox.setSelectedItem(checkBoxGroup.getDelimiter());
this.returnTypeComboBox.setSelectedIndex(checkBoxGroup.isReturnString() ? 1 : 0);
this.startComboBox.setSelectedItem(checkBoxGroup.getStartSymbol());
this.endComboBox.setSelectedItem(checkBoxGroup.getEndSymbol());
checkVisible(this.returnTypeComboBox.getSelectedIndex()); checkVisible(this.returnTypeComboBox.getSelectedIndex());
} }
public void update(CheckBoxGroup checkBoxGroup) {
checkBoxGroup.setDelimiter((String)this.delimiterComboBox.getSelectedItem()); public enum ReturnType {
checkBoxGroup.setReturnString(this.returnTypeComboBox.getSelectedIndex() != 0); STRING,
checkBoxGroup.setStartSymbol((String)this.startComboBox.getSelectedItem()); ARRAY
checkBoxGroup.setEndSymbol((String)this.endComboBox.getSelectedItem());
} }
} }

7
designer-base/src/main/java/com/fr/env/detect/base/EnvDetectorConfig.java vendored

@ -1,6 +1,5 @@
package com.fr.env.detect.base; package com.fr.env.detect.base;
import com.fr.design.DesignerEnvManager;
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLable; import com.fr.stable.xml.XMLable;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
@ -29,12 +28,6 @@ public class EnvDetectorConfig implements XMLable {
public void setEnabled(boolean enabled) { public void setEnabled(boolean enabled) {
this.enabled = enabled; this.enabled = enabled;
save();
}
private void save() {
DesignerEnvManager.getEnvManager(false).saveXMLFile();
} }
@Override @Override

12
designer-base/src/main/java/com/fr/start/server/FineEmbedServer.java

@ -8,10 +8,16 @@ import com.fr.module.ModuleContext;
*/ */
public abstract class FineEmbedServer { public abstract class FineEmbedServer {
public synchronized static void start() { /**
* 是否正在启动中
*/
private static volatile boolean onStarting = false;
public synchronized static void start() {
onStarting = true;
EventDispatcher.fire(EmbedServerEvent.BeforeStart); EventDispatcher.fire(EmbedServerEvent.BeforeStart);
ModuleContext.getModule(FineEmbedServerActivator.class).start(); ModuleContext.getModule(FineEmbedServerActivator.class).start();
onStarting = false;
EventDispatcher.fire(EmbedServerEvent.AfterStart); EventDispatcher.fire(EmbedServerEvent.AfterStart);
} }
@ -26,4 +32,8 @@ public abstract class FineEmbedServer {
return ModuleContext.getModule(FineEmbedServerActivator.class).isRunning(); return ModuleContext.getModule(FineEmbedServerActivator.class).isRunning();
} }
public static boolean isOnStarting() {
return onStarting;
}
} }

3
designer-chart/src/main/java/com/fr/van/chart/designer/data/VanChartMoreCateTableDataContentPane.java

@ -22,13 +22,14 @@ public class VanChartMoreCateTableDataContentPane extends CategoryPlotMoreCateTa
@Override @Override
public void populateBean(ChartCollection collection) { public void populateBean(ChartCollection collection) {
super.populateBean(collection); super.populateBean(collection);
VanChartRectanglePlot plot = (VanChartRectanglePlot) collection.getSelectedChart().getPlot(); VanChartRectanglePlot plot = collection.getSelectedChart().getPlot();
isSupportMultiCategory = plot.isSupportMultiCategory(); isSupportMultiCategory = plot.isSupportMultiCategory();
checkBoxList(isSupportMultiCategory); checkBoxList(isSupportMultiCategory);
} }
protected void updateMoreCate(NormalTableDataDefinition normal, Plot plot) { protected void updateMoreCate(NormalTableDataDefinition normal, Plot plot) {
super.updateMoreCate(normal, plot); super.updateMoreCate(normal, plot);
isSupportMultiCategory = ((VanChartRectanglePlot) plot).isSupportMultiCategory();
((VanChartPlot) plot).setCategoryNum(getBoxList().size() + 1); ((VanChartPlot) plot).setCategoryNum(getBoxList().size() + 1);
if (!getBoxList().isEmpty()) { if (!getBoxList().isEmpty()) {
plot.getDataSheet().setVisible(false); plot.getDataSheet().setVisible(false);

24
designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java

@ -4,9 +4,6 @@
package com.fr.design.designer.creator; package com.fr.design.designer.creator;
import com.fr.base.chart.BaseChartCollection; import com.fr.base.chart.BaseChartCollection;
import com.fr.base.theme.FineColorFlushUtils;
import com.fr.base.theme.FineColorGather;
import com.fr.base.theme.FineColorManager;
import com.fr.base.theme.FineColorSynchronizer; import com.fr.base.theme.FineColorSynchronizer;
import com.fr.base.theme.FormTheme; import com.fr.base.theme.FormTheme;
import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateTheme;
@ -82,6 +79,9 @@ 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.report.fit.FitProvider;
import com.fr.report.fit.ReportFitAttr;
import com.fr.report.fit.ReportFitConfig;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.third.javax.annotation.Nonnull; import com.fr.third.javax.annotation.Nonnull;
import java.util.Set; import java.util.Set;
@ -486,4 +486,22 @@ public class XCreatorUtils {
} }
} }
public static ReportFitAttr getElementCaseEditorReportFitAttr(ElementCaseEditor editor, FitProvider wbTpl) {
//这边获取到的全局要考虑到服务器的配置
ReportFitAttr fitAttr = wbTpl.getReportFitAttr() == null ? ReportFitConfig.getInstance().getFrmFitAttr() : wbTpl.getReportFitAttr();
return getElementCaseEditorReportFitAttr(editor, fitAttr);
}
public static ReportFitAttr getElementCaseEditorReportFitAttr(ElementCaseEditor editor, ReportFitAttr fitAttr) {
//兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应)
if (editor.getFitStateInPC() == 0) {
editor.setReportFitAttr(null);
}
ReportFitAttr reportFit = editor.getReportFitAttr();
if (fitAttr != null) {
reportFit = fitAttr.fitInBrowser() ? editor.getReportFitAttr() : fitAttr;
}
return editor.getReportFitAttr() == null ? fitAttr : reportFit;
}
} }

10
designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java

@ -131,15 +131,7 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
//这边获取到的全局要考虑到服务器的配置 //这边获取到的全局要考虑到服务器的配置
ReportFitAttr fitAttr = wbTpl.getReportFitAttr() == null ? ReportFitConfig.getInstance().getFrmFitAttr() : wbTpl.getReportFitAttr(); ReportFitAttr fitAttr = wbTpl.getReportFitAttr() == null ? ReportFitConfig.getInstance().getFrmFitAttr() : wbTpl.getReportFitAttr();
ElementCaseEditor editor = this.toData(); ElementCaseEditor editor = this.toData();
//兼容之前报表块(之前三个选项为:默认 横向 双向 现在是:横向 双向 不自适应) ReportFitAttr reportFitAttr = XCreatorUtils.getElementCaseEditorReportFitAttr(editor, fitAttr);
if (editor.getFitStateInPC() == 0) {
editor.setReportFitAttr(null);
}
ReportFitAttr reportFit = editor.getReportFitAttr();
if (fitAttr != null) {
reportFit = fitAttr.fitInBrowser() ? editor.getReportFitAttr() : fitAttr;
}
ReportFitAttr reportFitAttr = editor.getReportFitAttr() == null ? fitAttr : reportFit;
BrowserFitPropertyEditor browserFitPropertyEditor = new BrowserFitPropertyEditor(); BrowserFitPropertyEditor browserFitPropertyEditor = new BrowserFitPropertyEditor();
CRPropertyDescriptor extraEditor = browserFitPropertyEditor.createPropertyDescriptor(this.data.getClass(), reportFitAttr); CRPropertyDescriptor extraEditor = browserFitPropertyEditor.createPropertyDescriptor(this.data.getClass(), reportFitAttr);
if (editor.getReportFitAttr() == null) { if (editor.getReportFitAttr() == null) {

2
designer-form/src/main/java/com/fr/design/fit/NewJForm.java

@ -55,7 +55,7 @@ public class NewJForm extends JForm {
public NewJForm(Form form) { public NewJForm(Form form) {
super(form); super(form);
//新建的模板都要加上新表单标志attr //新建的模板都要加上新表单标志attr
form.addAttrMark(NewFormMarkAttr.createNewFormAttr()); getTarget().addAttrMark(NewFormMarkAttr.createNewFormAttr());
init(); init();
} }

23
designer-form/src/main/java/com/fr/design/fit/common/AdaptiveSwitchUtil.java

@ -1,6 +1,7 @@
package com.fr.design.fit.common; package com.fr.design.fit.common;
import com.fr.design.data.DesignTableDataManager; import com.fr.design.data.DesignTableDataManager;
import com.fr.design.designer.creator.XCreatorUtils;
import com.fr.design.fit.NewJForm; import com.fr.design.fit.NewJForm;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
@ -11,6 +12,7 @@ import com.fr.file.MemFILE;
import com.fr.form.fit.NewFormMarkAttr; import com.fr.form.fit.NewFormMarkAttr;
import com.fr.form.main.Form; import com.fr.form.main.Form;
import com.fr.form.main.WidgetGather; import com.fr.form.main.WidgetGather;
import com.fr.form.ui.ElementCaseEditor;
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;
import com.fr.form.ui.container.WAbsoluteLayout; import com.fr.form.ui.container.WAbsoluteLayout;
@ -94,15 +96,36 @@ public class AdaptiveSwitchUtil {
} }
//如果是从旧的设计模板转化为新的设计模式,并且不是全局配置的模板。则更新新模板的Pc端自适应属性 //如果是从旧的设计模板转化为新的设计模式,并且不是全局配置的模板。则更新新模板的Pc端自适应属性
if (newJForm.getTarget().getReportFitAttr() != null && newJForm.isNewJFrom()) { if (newJForm.getTarget().getReportFitAttr() != null && newJForm.isNewJFrom()) {
//兼容处理老模式下报表块自适应属性设置为跟随报表整体自适应
compatibleProcessECReportFitAttr(newJForm.getTarget());
//修改自适应属性 //修改自适应属性
newJForm.getTarget().setReportFitAttr(shiftReportFitAttr(oldForm, newJForm.getTarget().getReportFitAttr().isFitFont())); newJForm.getTarget().setReportFitAttr(shiftReportFitAttr(oldForm, newJForm.getTarget().getReportFitAttr().isFitFont()));
//修改绝对布局中的缩放属性 //修改绝对布局中的缩放属性
processAbsoluteLayoutCompatible(newJForm.getTarget()); processAbsoluteLayoutCompatible(newJForm.getTarget());
} }
TemplateTool.saveForm(newJForm); TemplateTool.saveForm(newJForm);
return newJForm; return newJForm;
} }
private static void compatibleProcessECReportFitAttr(Form form) {
Form.traversalWidget(form.getContainer(), new WidgetGather() {
@Override
public void dealWith(Widget widget) {
ElementCaseEditor editor = (ElementCaseEditor) widget;
ReportFitAttr reportFitAttr = XCreatorUtils.getElementCaseEditorReportFitAttr(editor, form);
if (reportFitAttr.fitStateInPC() != 0) {
editor.setReportFitAttr(reportFitAttr);
}
}
@Override
public boolean dealWithAllCards() {
return true;
}
}, ElementCaseEditor.class);
}
private static void processAbsoluteLayoutCompatible(Form form) { private static void processAbsoluteLayoutCompatible(Form form) {
Form.traversalWidget(form.getContainer(), new WidgetGather() { Form.traversalWidget(form.getContainer(), new WidgetGather() {

20
designer-form/src/main/java/com/fr/design/fit/common/NewUIModeAutoChangeLine.java

@ -1,20 +0,0 @@
package com.fr.design.fit.common;
import com.fr.base.DefaultAutoChangeLine;
import com.fr.base.Style;
import com.fr.stable.unit.UNIT;
import java.awt.Font;
import java.util.List;
public class NewUIModeAutoChangeLine extends DefaultAutoChangeLine {
@Override
public List<String> textAutoChangeLine(String text, Font font, Style style, UNIT unitWidth, int resolution) {
return autoChangeLine(text, font, style, unitWidth, resolution);
}
protected double calculateShowWidth(double paintWidth, Style style, int resolution) {
return paintWidth - style.getPaddingLeft() - style.getPaddingRight() - style.getBorderLeftWidth();
}
}

69
designer-form/src/main/java/com/fr/design/fit/common/NewUIModeRotationDraw.java

@ -1,69 +0,0 @@
package com.fr.design.fit.common;
import com.fr.base.BaseUtils;
import com.fr.base.DefaultRotationTextDrawProvider;
import com.fr.base.GraphHelper;
import com.fr.base.Style;
import com.fr.design.mainframe.PX;
import com.fr.stable.Constants;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics2D;
import java.util.List;
public class NewUIModeRotationDraw extends DefaultRotationTextDrawProvider {
@Override
public void drawRotationText(Graphics2D g2d, String text, Style style, Font rfont, int width, int height, int horizontalAlignment, int resolution) {
FontMetrics cellFM = GraphHelper.getFontMetrics(rfont);
List lineTextList = BaseUtils.getLineTextList(text, style, rfont, height, width, resolution, new NewUIModeAutoChangeLine());
drawRotationText(g2d, lineTextList, style, cellFM, width, height, horizontalAlignment, resolution);
}
protected int calculateTextWidth(int width, Style style) {
return width - style.getPaddingRight();
}
protected double calculateTextX(Style style, int width, int textWidth, int horizontalAlignment, int resolution) {
double textX = padding2PixExcludeRight(style.getPaddingLeft(), resolution);
if (horizontalAlignment == Constants.CENTER) {
textX += (width - textWidth - textX) / 2f;
} else if (horizontalAlignment == Constants.RIGHT) {
textX = width - style.getPaddingRight() - textWidth;
}
return textX;
}
protected int toPXWithResolution(double pt, int resolution) {
return (int) PX.toPixWithResolution(pt, resolution);
}
protected double padding2PixExcludeRight(int padding, int resolution) {
return PX.toPixWithResolution(padding, resolution);
}
protected int calculateTextY(Style style, int height, int textHeight, int textAscent, List lineTextList, int resolution) {
// 计算Y的高度.
int textY = 0;
int textAllHeight = textHeight * lineTextList.size();
double spacingBefore = toPXWithResolution(style.getSpacingBefore(), resolution);
double spacingAfter = toPXWithResolution(style.getSpacingAfter(), resolution);
double lineSpacing = toPXWithResolution(style.getLineSpacing(), resolution);
textAllHeight += spacingBefore + spacingAfter + lineSpacing * lineTextList.size();
if (style.getVerticalAlignment() == Constants.TOP) {
} else if (style.getVerticalAlignment() == Constants.CENTER) {
if (height > textAllHeight) {// 如果所有文本的高度小于当前可以绘区域的高度,就从0开始画字符.
textY = (height - textAllHeight) / 2;
}
} else if (style.getVerticalAlignment() == Constants.BOTTOM) {
if (height > textAllHeight) {
textY = height - textAllHeight;
}
}
textY += textAscent;// 在绘画的时候,必须添加Ascent的高度.
textY += spacingBefore + lineSpacing;//james:加上"段前间距"+“行间距”
return textY;
}
}

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

@ -7,7 +7,7 @@ import com.fr.design.gui.icheckbox.UICheckBox;
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.present.dict.DictionaryPane; import com.fr.design.present.dict.DictionaryPane;
import com.fr.design.widget.component.CheckBoxDictPane; import com.fr.design.widget.component.ReturnTypePane;
import com.fr.design.widget.ui.designer.btn.ButtonGroupDefinePane; import com.fr.design.widget.ui.designer.btn.ButtonGroupDefinePane;
import com.fr.form.ui.CheckBoxGroup; import com.fr.form.ui.CheckBoxGroup;
@ -17,7 +17,7 @@ import java.awt.*;
public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup> { public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup> {
private DictionaryPane dictPane; private DictionaryPane dictPane;
private CheckBoxDictPane checkBoxDictPane; private ReturnTypePane returnTypePane;
private UICheckBox checkbox; private UICheckBox checkbox;
public CheckBoxGroupDefinePane(XCreator xCreator) { public CheckBoxGroupDefinePane(XCreator xCreator) {
@ -40,12 +40,12 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
public JPanel createOtherPane(){ public JPanel createOtherPane(){
checkbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Choose_Type_All")); checkbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Choose_Type_All"));
checkbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); checkbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
checkBoxDictPane = new CheckBoxDictPane(); returnTypePane = new ReturnTypePane();
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[]{checkbox, null }, new Component[]{checkbox, null },
new Component[]{checkBoxDictPane, null}, new Component[]{returnTypePane, null},
}; };
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
@ -56,7 +56,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
@Override @Override
protected void populateSubButtonGroupBean(CheckBoxGroup ob) { protected void populateSubButtonGroupBean(CheckBoxGroup ob) {
this.checkBoxDictPane.populate(ob); this.returnTypePane.populate(ob);
this.dictPane.populateBean(ob.getDictionary()); this.dictPane.populateBean(ob.getDictionary());
checkbox.setSelected(ob.isChooseAll()); checkbox.setSelected(ob.isChooseAll());
} }
@ -66,7 +66,7 @@ public class CheckBoxGroupDefinePane extends ButtonGroupDefinePane<CheckBoxGroup
@Override @Override
protected CheckBoxGroup updateSubButtonGroupBean() { protected CheckBoxGroup updateSubButtonGroupBean() {
CheckBoxGroup ob = (CheckBoxGroup) creator.toData(); CheckBoxGroup ob = (CheckBoxGroup) creator.toData();
checkBoxDictPane.update(ob); returnTypePane.update(ob);
ob.setDictionary(this.dictPane.updateBean()); ob.setDictionary(this.dictPane.updateBean());
ob.setChooseAll(checkbox.isSelected()); ob.setChooseAll(checkbox.isSelected());
return ob; return ob;

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

@ -8,7 +8,7 @@ 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.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.component.CheckBoxDictPane; import com.fr.design.widget.component.ReturnTypePane;
import com.fr.form.ui.ComboCheckBox; import com.fr.form.ui.ComboCheckBox;
@ -17,7 +17,7 @@ import java.awt.*;
public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> { public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox> {
private UICheckBox supportTagCheckBox; private UICheckBox supportTagCheckBox;
private CheckBoxDictPane checkBoxDictPane; private ReturnTypePane returnTypePane;
private UITextField waterMarkDictPane; private UITextField waterMarkDictPane;
private UICheckBox removeRepeatCheckBox; private UICheckBox removeRepeatCheckBox;
@ -40,13 +40,13 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
public JPanel createOtherPane(){ public JPanel createOtherPane(){
supportTagCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Support_Tag"), true); supportTagCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Support_Tag"), true);
supportTagCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); supportTagCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
checkBoxDictPane = new CheckBoxDictPane(); returnTypePane = new ReturnTypePane();
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[]{supportTagCheckBox, null }, new Component[]{supportTagCheckBox, null },
new Component[]{checkBoxDictPane, null}, new Component[]{returnTypePane, null},
}; };
double[] rowSize = {p, p}; double[] rowSize = {p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
@ -56,7 +56,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
} }
protected void populateSubDictionaryEditorBean(ComboCheckBox ob){ protected void populateSubDictionaryEditorBean(ComboCheckBox ob){
this.checkBoxDictPane.populate(ob); this.returnTypePane.populate(ob);
waterMarkDictPane.setText(ob.getWaterMark()); waterMarkDictPane.setText(ob.getWaterMark());
formWidgetValuePane.populate(ob); formWidgetValuePane.populate(ob);
this.supportTagCheckBox.setSelected(ob.isSupportTag()); this.supportTagCheckBox.setSelected(ob.isSupportTag());
@ -65,7 +65,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane<ComboCheckBox>
protected ComboCheckBox updateSubDictionaryEditorBean(){ protected ComboCheckBox updateSubDictionaryEditorBean(){
ComboCheckBox combo = (ComboCheckBox) creator.toData(); ComboCheckBox combo = (ComboCheckBox) creator.toData();
checkBoxDictPane.update(combo); returnTypePane.update(combo);
formWidgetValuePane.update(combo); formWidgetValuePane.update(combo);
combo.setWaterMark(waterMarkDictPane.getText()); combo.setWaterMark(waterMarkDictPane.getText());
combo.setSupportTag(this.supportTagCheckBox.isSelected()); combo.setSupportTag(this.supportTagCheckBox.isSelected());

68
designer-form/src/main/java/com/fr/design/widget/ui/designer/TreeEditorDefinePane.java

@ -1,78 +1,50 @@
package com.fr.design.widget.ui.designer; package com.fr.design.widget.ui.designer;
import com.fr.design.data.DataCreatorUI; import com.fr.design.data.DataCreatorUI;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itree.refreshabletree.TreeRootPane; import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor;
import com.fr.design.widget.component.ReturnTypePane;
import com.fr.form.ui.TreeEditor; import com.fr.form.ui.TreeEditor;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
/* /*
* richer:tree editor * richer:tree editor
*/ */
public class TreeEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEditor> { public class TreeEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEditor> {
private ReturnTypePane returnTypePane;
protected TreeRootPane treeRootPane; protected TreeRootPane treeRootPane;
private UICheckBox mutiSelect;
private UICheckBox loadAsync;
private UICheckBox returnLeaf;
private UICheckBox returnPath;
private AccessibleTreeModelEditor accessibleTreeModelEditor; private AccessibleTreeModelEditor accessibleTreeModelEditor;
public TreeEditorDefinePane(XCreator xCreator) { public TreeEditorDefinePane(XCreator xCreator) {
super(xCreator); super(xCreator);
treeRootPane = new TreeRootPane();
} }
public JPanel createOtherPane() { public JPanel createOtherPane() {
mutiSelect = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Tree_Mutiple_Selection_Or_Not")); treeRootPane = new TreeRootPane();
mutiSelect.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); returnTypePane = new ReturnTypePane();
JPanel panel = FRGUIPaneFactory.createBorderLayout_L_Pane();
loadAsync = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Load_By_Async")); panel.add(treeRootPane, BorderLayout.NORTH);
loadAsync.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); returnTypePane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
loadAsync.addMouseListener(new MouseAdapter() { panel.add(returnTypePane, BorderLayout.CENTER);
@Override treeRootPane.addTreeAttrChangeListener(treeAttr -> {
public void mouseClicked(MouseEvent e) { boolean showReturnTypePane = treeAttr.isMultipleSelection() && !treeAttr.isReturnFullPath();
UICheckBox checkBox = (UICheckBox) e.getSource(); returnTypePane.setVisible(showReturnTypePane);
doLoadTypeChange(checkBox.isSelected()); if (!showReturnTypePane) {
returnTypePane.setReturnType(ReturnTypePane.ReturnType.ARRAY);
} }
}); });
returnLeaf = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Return_Leaf"));
returnLeaf.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
returnPath = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Widget_Return_Path"));
returnPath.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{
new Component[]{mutiSelect},
new Component[]{loadAsync},
new Component[]{returnLeaf},
new Component[]{returnPath}
};
double[] rowSize = {p, p, p, p};
double[] columnSize = {p};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
return panel; return panel;
} }
private void doLoadTypeChange(Boolean selected) {
//给埋点插件提供一个方法,埋埋点用
}
@Override @Override
public String title4PopupWindow() { public String title4PopupWindow() {
return "tree"; return "tree";
@ -89,10 +61,7 @@ public class TreeEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEdi
accessibleTreeModelEditor.setValue(e.getBuildModelConfig()); accessibleTreeModelEditor.setValue(e.getBuildModelConfig());
formWidgetValuePane.populate(e); formWidgetValuePane.populate(e);
treeRootPane.populate(e.getTreeAttr()); treeRootPane.populate(e.getTreeAttr());
mutiSelect.setSelected(e.isMultipleSelection()); returnTypePane.populate(e);
loadAsync.setSelected(e.isAjax());
returnLeaf.setSelected(e.isSelectLeafOnly());
returnPath.setSelected(e.isReturnFullPath());
} }
@ -101,11 +70,8 @@ public class TreeEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEdi
TreeEditor editor = (TreeEditor) creator.toData(); TreeEditor editor = (TreeEditor) creator.toData();
formWidgetValuePane.update(editor); formWidgetValuePane.update(editor);
editor.setTreeAttr(treeRootPane.update()); editor.setTreeAttr(treeRootPane.update());
editor.setMultipleSelection(mutiSelect.isSelected());
editor.setAjax(loadAsync.isSelected());
editor.setSelectLeafOnly(returnLeaf.isSelected());
editor.setReturnFullPath(returnPath.isSelected());
editor.setBuildModelConfig(accessibleTreeModelEditor.getValue()); editor.setBuildModelConfig(accessibleTreeModelEditor.getValue());
returnTypePane.update(editor);
return editor; return editor;
} }

2
designer-realize/src/main/java/com/fr/design/fit/NewUIModeCellElementPainter.java

@ -1,6 +1,6 @@
package com.fr.design.fit; package com.fr.design.fit;
import com.fr.design.fit.common.NewUIModeRotationDraw; import com.fr.form.fit.NewUIModeRotationDraw;
import com.fr.grid.CellElementPainter; import com.fr.grid.CellElementPainter;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import com.fr.report.core.PaintUtils; import com.fr.report.core.PaintUtils;

117
designer-realize/src/main/java/com/fr/design/report/ImageExportPane.java

@ -9,8 +9,9 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.io.attr.ImageExportAttr; import com.fr.io.attr.ImageExportAttr;
import com.fr.io.attr.ReportExportAttr; import com.fr.io.attr.ReportExportAttr;
import com.fr.report.ReportConfigManager;
import java.awt.Color;
import javax.swing.AbstractButton;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.ButtonGroup; import javax.swing.ButtonGroup;
import javax.swing.JComponent; import javax.swing.JComponent;
@ -35,33 +36,26 @@ public class ImageExportPane extends AbstractExportPane {
private UIRadioButton globalFormatJpg; private UIRadioButton globalFormatJpg;
private UIRadioButton globalFormatPng; private UIRadioButton globalFormatPng;
private UIRadioButton previewResolutionBtnS; private UIRadioButton templateThumbnail;
private UIRadioButton previewResolutionBtnM; private UIRadioButton templatePaging;
private UIRadioButton previewRenderSpeed;
private UIRadioButton previewRenderQuality;
private static final int RESOLUTION_S = 96; private static final int RESOLUTION_S = 96;
private static final int RESOLUTION_M = 192; private static final int RESOLUTION_M = 192;
private static final int RESOLUTION_L = 300; private static final int RESOLUTION_L = 300;
private static final int DPI_SCALE_S = 1;
private static final int DPI_SCALE_M = 2;
private static final int GAP = 20; private static final int GAP = 20;
public static final String GLOBAL_CONF = Toolkit.i18nText("Fine-Design_Image_Export_Global_Configuration"); public static final String GLOBAL_CONF = Toolkit.i18nText("Fine-Design_Image_Export_Setting");
private ReportExportAttr reportExportAttr;
public ImageExportPane() { public ImageExportPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); this.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
JPanel globalTitlePane = FRGUIPaneFactory.createTitledBorderPane(GLOBAL_CONF); JPanel globalTitlePane = FRGUIPaneFactory.createTitledBorderPane(GLOBAL_CONF);
JPanel previewSetting = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Basic_Preview")); JPanel tipsTitlePane = FRGUIPaneFactory.createTitledBorderPane(Toolkit.i18nText("Fine-Design_Report_Advice"));
UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Tips"));
tipLabel.setForeground(Color.RED);
tipsTitlePane.add(tipLabel);
this.add(globalTitlePane, BorderLayout.NORTH); this.add(globalTitlePane, BorderLayout.NORTH);
this.add(previewSetting, BorderLayout.CENTER);
initGlobalSettings(); initGlobalSettings();
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -69,6 +63,7 @@ public class ImageExportPane extends AbstractExportPane {
{new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Resolution") + ":"), this.globalResolutionBtnS, this.globalResolutionBtnM, this.globalResolutionBtnL}, {new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Resolution") + ":"), this.globalResolutionBtnS, this.globalResolutionBtnM, this.globalResolutionBtnL},
{new UILabel(Toolkit.i18nText("Fine-Design_Report_Format") + ":"), this.globalFormatJpg, null, this.globalFormatPng}, {new UILabel(Toolkit.i18nText("Fine-Design_Report_Format") + ":"), this.globalFormatJpg, null, this.globalFormatPng},
{new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Rendering_Quality") + ":"), this.globalRenderQuality, null, this.globalRenderSpeed}, {new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Rendering_Quality") + ":"), this.globalRenderQuality, null, this.globalRenderSpeed},
{new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Typesetting") + ":"), this.templateThumbnail, null, this.templatePaging}
}; };
centerPane.add( centerPane.add(
TableLayoutHelper.createCommonTableLayoutPane( TableLayoutHelper.createCommonTableLayoutPane(
@ -77,23 +72,8 @@ public class ImageExportPane extends AbstractExportPane {
new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL}, new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL, TableLayout.FILL},
GAP), GAP),
BorderLayout.CENTER); BorderLayout.CENTER);
centerPane.add(tipsTitlePane,BorderLayout.SOUTH);
globalTitlePane.add(centerPane, BorderLayout.CENTER); globalTitlePane.add(centerPane, BorderLayout.CENTER);
JPanel templateCenterPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JComponent[][] templateComps = {
{new UILabel(Toolkit.i18nText("Fine-Design_Report_Engine_Enlarge_Or_Reduce") + ":"), this.previewResolutionBtnS, this.previewResolutionBtnM},
{new UILabel(Toolkit.i18nText("Fine-Design_Image_Export_Rendering_Quality") + ":"), this.previewRenderQuality, this.previewRenderSpeed},
};
templateCenterPane.add(
TableLayoutHelper.createCommonTableLayoutPane(
templateComps,
new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL},
new double[]{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL},
GAP),
BorderLayout.CENTER);
previewSetting.add(templateCenterPane, BorderLayout.CENTER);
} }
@ -101,36 +81,29 @@ public class ImageExportPane extends AbstractExportPane {
globalResolutionBtnS = new UIRadioButton("96dpi", true); globalResolutionBtnS = new UIRadioButton("96dpi", true);
globalResolutionBtnM = new UIRadioButton("192dpi"); globalResolutionBtnM = new UIRadioButton("192dpi");
globalResolutionBtnL = new UIRadioButton("300dpi"); globalResolutionBtnL = new UIRadioButton("300dpi");
ButtonGroup globalResolutionBtnGroup = new ButtonGroup(); wrapButtonsInButtonGroup(globalResolutionBtnS, globalResolutionBtnM, globalResolutionBtnL);
globalResolutionBtnGroup.add(globalResolutionBtnS);
globalResolutionBtnGroup.add(globalResolutionBtnM);
globalResolutionBtnGroup.add(globalResolutionBtnL);
globalFormatJpg = new UIRadioButton("jpg", true); globalFormatJpg = new UIRadioButton("jpg", true);
globalFormatPng = new UIRadioButton("png"); globalFormatPng = new UIRadioButton("png");
ButtonGroup globalFormatGroup = new ButtonGroup(); wrapButtonsInButtonGroup(globalFormatJpg, globalFormatPng);
globalFormatGroup.add(globalFormatJpg);
globalFormatGroup.add(globalFormatPng);
globalRenderQuality = new UIRadioButton(Toolkit.i18nText("Fine-Design_Image_Export_Quality_First"), true); globalRenderQuality = new UIRadioButton(Toolkit.i18nText("Fine-Design_Image_Export_Quality_First"), true);
globalRenderSpeed = new UIRadioButton(Toolkit.i18nText(("Fine-Design_Image_Export_Speed_Priority"))); globalRenderSpeed = new UIRadioButton(Toolkit.i18nText(("Fine-Design_Image_Export_Speed_Priority")));
ButtonGroup globalRenderGroup = new ButtonGroup(); wrapButtonsInButtonGroup(globalRenderQuality, globalRenderSpeed);
globalRenderGroup.add(globalRenderQuality);
globalRenderGroup.add(globalRenderSpeed);
previewResolutionBtnS = new UIRadioButton("100%", true); templateThumbnail = new UIRadioButton(Toolkit.i18nText("Fine-Design_Image_Export_Thumbnail"));
previewResolutionBtnM = new UIRadioButton("200%"); templatePaging = new UIRadioButton(Toolkit.i18nText("Fine-Design_Image_Export_Paging"));
ButtonGroup previewResolutionBtnGroup = new ButtonGroup(); wrapButtonsInButtonGroup(templateThumbnail, templatePaging);
previewResolutionBtnGroup.add(previewResolutionBtnS);
previewResolutionBtnGroup.add(previewResolutionBtnM);
previewRenderSpeed = new UIRadioButton(Toolkit.i18nText("Fine-Design_Image_Export_Speed_Priority"));
previewRenderQuality = new UIRadioButton(Toolkit.i18nText("Fine-Design_Image_Export_Quality_First"));
ButtonGroup previewRenderGroup = new ButtonGroup();
previewRenderGroup.add(previewRenderQuality);
previewRenderGroup.add(previewRenderSpeed);
} }
private void wrapButtonsInButtonGroup(AbstractButton... buttons) {
if (buttons != null) {
ButtonGroup buttonGroup = new ButtonGroup();
for (AbstractButton button : buttons) {
buttonGroup.add(button);
}
}
}
/** /**
* 展示界面 * 展示界面
@ -150,10 +123,6 @@ public class ImageExportPane extends AbstractExportPane {
updateBean(); updateBean();
} }
private ImageExportAttr getGlobalImageExportAttr() {
return ReportConfigManager.getProviderInstance().getImageExportAttr();
}
/** /**
* 标题 * 标题
* *
@ -166,7 +135,11 @@ public class ImageExportPane extends AbstractExportPane {
@Override @Override
public void populateBean(Object exportAttr) { public void populateBean(Object exportAttr) {
ImageExportAttr attr = getGlobalImageExportAttr(); ReportExportAttr reportExportAttr = (ReportExportAttr) exportAttr;
ImageExportAttr attr = reportExportAttr.getImageExportAttr();
if (attr == null) {
attr = new ImageExportAttr();
}
switch (attr.getResolution()) { switch (attr.getResolution()) {
case 192: case 192:
globalResolutionBtnM.setSelected(true); globalResolutionBtnM.setSelected(true);
@ -187,24 +160,17 @@ public class ImageExportPane extends AbstractExportPane {
} else { } else {
globalRenderQuality.setSelected(true); globalRenderQuality.setSelected(true);
} }
if (attr.isPaging()) {
if (attr.getPreviewRenderQuality() == ImageExportAttr.RENDER_SPEED) { templatePaging.setSelected(true);
previewRenderSpeed.setSelected(true);
} else {
previewRenderQuality.setSelected(true);
}
if (attr.getPreviewResolutionScale() == DPI_SCALE_S) {
previewResolutionBtnS.setSelected(true);
} else { } else {
previewResolutionBtnM.setSelected(true); templateThumbnail.setSelected(true);
} }
} }
@Override @Override
public void updateBean(Object exportAttr) { public void updateBean(Object exportAttr) {
ImageExportAttr attr = getGlobalImageExportAttr(); ReportExportAttr reportExportAttr = (ReportExportAttr) exportAttr;
ImageExportAttr attr = new ImageExportAttr();
if (globalResolutionBtnS.isSelected()) { if (globalResolutionBtnS.isSelected()) {
attr.setResolution(RESOLUTION_S); attr.setResolution(RESOLUTION_S);
} else if (globalResolutionBtnM.isSelected()) { } else if (globalResolutionBtnM.isSelected()) {
@ -222,17 +188,8 @@ public class ImageExportPane extends AbstractExportPane {
} else { } else {
attr.setRenderQuality(ImageExportAttr.RENDER_QUALITY); attr.setRenderQuality(ImageExportAttr.RENDER_QUALITY);
} }
attr.setPaging(templatePaging.isSelected());
if (previewRenderSpeed.isSelected()) { reportExportAttr.setImageExportAttr(attr);
attr.setPreviewRenderQuality(ImageExportAttr.RENDER_SPEED);
} else {
attr.setPreviewRenderQuality(ImageExportAttr.RENDER_QUALITY);
}
if (previewResolutionBtnS.isSelected()) {
attr.setPreviewResolutionScale(DPI_SCALE_S);
} else {
attr.setPreviewResolutionScale(DPI_SCALE_M);
}
} }
@Override @Override

12
designer-realize/src/main/java/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java

@ -9,12 +9,12 @@ import com.fr.design.gui.icheckbox.UICheckBox;
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.component.CheckBoxDictPane; import com.fr.design.widget.component.ReturnTypePane;
import com.fr.form.ui.CheckBoxGroup; import com.fr.form.ui.CheckBoxGroup;
public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup> { public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup> {
CheckBoxDictPane checkBoxDictPane; private ReturnTypePane returnTypePane;
private UICheckBox checkbox; private UICheckBox checkbox;
private ButtonGroupDictPane buttonGroupDictPane; private ButtonGroupDictPane buttonGroupDictPane;
@ -40,13 +40,13 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
checkbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Provide_Choose_All")); checkbox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Provide_Choose_All"));
checkbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); checkbox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
buttonGroupDictPane = new ButtonGroupDictPane(); buttonGroupDictPane = new ButtonGroupDictPane();
checkBoxDictPane = new CheckBoxDictPane(); returnTypePane = new ReturnTypePane();
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[]{buttonGroupDictPane, null }, new Component[]{buttonGroupDictPane, null },
new Component[]{checkbox, null }, new Component[]{checkbox, null },
new Component[]{checkBoxDictPane, null }, new Component[]{returnTypePane, null },
}; };
double[] rowSize = {p, p, p, p}; double[] rowSize = {p, p, p, p};
@ -60,7 +60,7 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
@Override @Override
protected void populateSubFieldEditorBean(CheckBoxGroup ob) { protected void populateSubFieldEditorBean(CheckBoxGroup ob) {
checkBoxDictPane.populate(ob); returnTypePane.populate(ob);
checkbox.setSelected(ob.isChooseAll()); checkbox.setSelected(ob.isChooseAll());
this.buttonGroupDictPane.populate(ob); this.buttonGroupDictPane.populate(ob);
} }
@ -68,7 +68,7 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
@Override @Override
protected CheckBoxGroup updateSubFieldEditorBean() { protected CheckBoxGroup updateSubFieldEditorBean() {
CheckBoxGroup ob = new CheckBoxGroup(); CheckBoxGroup ob = new CheckBoxGroup();
checkBoxDictPane.update(ob); returnTypePane.update(ob);
ob.setChooseAll(checkbox.isSelected()); ob.setChooseAll(checkbox.isSelected());
this.buttonGroupDictPane.update(ob); this.buttonGroupDictPane.update(ob);
return ob; return ob;

12
designer-realize/src/main/java/com/fr/design/widget/ui/ComboCheckBoxDefinePane.java

@ -9,7 +9,7 @@ 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.widget.accessibles.AccessibleDictionaryEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleDictionaryEditor;
import com.fr.design.widget.component.CheckBoxDictPane; import com.fr.design.widget.component.ReturnTypePane;
import com.fr.form.ui.ComboCheckBox; import com.fr.form.ui.ComboCheckBox;
@ -17,7 +17,7 @@ import javax.swing.*;
import java.awt.*; import java.awt.*;
public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<ComboCheckBox> { public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<ComboCheckBox> {
private CheckBoxDictPane checkBoxDictPane; private ReturnTypePane returnTypePane;
private AccessibleDictionaryEditor dictPane; private AccessibleDictionaryEditor dictPane;
private UICheckBox supportTagCheckBox; private UICheckBox supportTagCheckBox;
@ -28,7 +28,7 @@ public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<Comb
@Override @Override
protected JPanel setForthContentPane() { protected JPanel setForthContentPane() {
dictPane = new AccessibleDictionaryEditor(); dictPane = new AccessibleDictionaryEditor();
checkBoxDictPane = new CheckBoxDictPane(); returnTypePane = new ReturnTypePane();
supportTagCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Support_Tag"), true); supportTagCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Support_Tag"), true);
supportTagCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); supportTagCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel advancePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
@ -37,7 +37,7 @@ public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<Comb
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{supportTagCheckBox, null }, new Component[]{supportTagCheckBox, null },
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary")), dictPane }, new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_DS_Dictionary")), dictPane },
new Component[]{checkBoxDictPane, null }, new Component[]{returnTypePane, null },
}; };
double[] rowSize = {p, p, p, p}; double[] rowSize = {p, p, p, p};
@ -52,7 +52,7 @@ public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<Comb
@Override @Override
protected void populateSubCustomWritableRepeatEditorBean(ComboCheckBox e) { protected void populateSubCustomWritableRepeatEditorBean(ComboCheckBox e) {
this.dictPane.setValue(e.getDictionary()); this.dictPane.setValue(e.getDictionary());
this.checkBoxDictPane.populate(e); this.returnTypePane.populate(e);
this.supportTagCheckBox.setSelected(e.isSupportTag()); this.supportTagCheckBox.setSelected(e.isSupportTag());
} }
@ -61,7 +61,7 @@ public class ComboCheckBoxDefinePane extends CustomWritableRepeatEditorPane<Comb
ComboCheckBox combo = new ComboCheckBox(); ComboCheckBox combo = new ComboCheckBox();
combo.setSupportTag(this.supportTagCheckBox.isSelected()); combo.setSupportTag(this.supportTagCheckBox.isSelected());
combo.setDictionary((Dictionary) this.dictPane.getValue()); combo.setDictionary((Dictionary) this.dictPane.getValue());
checkBoxDictPane.update(combo); returnTypePane.update(combo);
return combo; return combo;
} }

18
designer-realize/src/main/java/com/fr/design/widget/ui/TreeComboBoxEditorDefinePane.java

@ -12,12 +12,15 @@ import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor;
import com.fr.design.widget.component.ReturnTypePane;
import com.fr.form.ui.TreeComboBoxEditor; import com.fr.form.ui.TreeComboBoxEditor;
import com.fr.form.ui.TreeEditor; import com.fr.form.ui.TreeEditor;
public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEditor> { public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane<TreeEditor> {
protected AccessibleTreeModelEditor treeSettingPane; protected AccessibleTreeModelEditor treeSettingPane;
private ReturnTypePane returnTypePane;
protected TreeRootPane treeRootPane; protected TreeRootPane treeRootPane;
public TreeComboBoxEditorDefinePane() { public TreeComboBoxEditorDefinePane() {
@ -28,8 +31,18 @@ public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane
@Override @Override
protected JPanel setForthContentPane() { protected JPanel setForthContentPane() {
JPanel content = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel content = FRGUIPaneFactory.createBorderLayout_L_Pane();
content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
treeRootPane = new TreeRootPane(); treeRootPane = new TreeRootPane();
returnTypePane = new ReturnTypePane();
content.add(treeRootPane, BorderLayout.NORTH);
returnTypePane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
content.add(returnTypePane, BorderLayout.CENTER);
treeRootPane.addTreeAttrChangeListener(treeAttr -> {
boolean showReturnTypePane = treeAttr.isMultipleSelection() && !treeAttr.isReturnFullPath();
returnTypePane.setVisible(showReturnTypePane);
if (!showReturnTypePane) {
returnTypePane.setReturnType(ReturnTypePane.ReturnType.ARRAY);
}
});
content.add(treeRootPane, BorderLayout.NORTH); content.add(treeRootPane, BorderLayout.NORTH);
return content; return content;
} }
@ -48,7 +61,6 @@ public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane
} }
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return "treecombobox"; return "treecombobox";
@ -58,6 +70,7 @@ public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane
protected void populateSubCustomWritableRepeatEditorBean(TreeEditor e) { protected void populateSubCustomWritableRepeatEditorBean(TreeEditor e) {
treeSettingPane.setValue(e.getBuildModelConfig()); treeSettingPane.setValue(e.getBuildModelConfig());
treeRootPane.populate(e.getTreeAttr()); treeRootPane.populate(e.getTreeAttr());
returnTypePane.populate(e);
} }
@Override @Override
@ -65,6 +78,7 @@ public class TreeComboBoxEditorDefinePane extends CustomWritableRepeatEditorPane
TreeComboBoxEditor editor = new TreeComboBoxEditor(); TreeComboBoxEditor editor = new TreeComboBoxEditor();
editor.setBuildModelConfig(treeSettingPane.getValue()); editor.setBuildModelConfig(treeSettingPane.getValue());
editor.setTreeAttr(treeRootPane.update()); editor.setTreeAttr(treeRootPane.update());
returnTypePane.update(editor);
return editor; return editor;
} }

17
designer-realize/src/main/java/com/fr/design/widget/ui/TreeEditorDefinePane.java

@ -8,6 +8,7 @@ import com.fr.design.gui.itree.refreshabletree.TreeRootPane;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor; import com.fr.design.mainframe.widget.accessibles.AccessibleTreeModelEditor;
import com.fr.design.widget.component.ReturnTypePane;
import com.fr.form.ui.TreeEditor; import com.fr.form.ui.TreeEditor;
@ -19,6 +20,8 @@ import java.awt.*;
* richer:tree editor * richer:tree editor
*/ */
public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> { public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
private ReturnTypePane returnTypePane;
protected TreeRootPane treeRootPane; protected TreeRootPane treeRootPane;
private AccessibleTreeModelEditor accessibleTreeModelEditor; private AccessibleTreeModelEditor accessibleTreeModelEditor;
@ -32,6 +35,7 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
protected void populateSubFieldEditorBean(TreeEditor e) { protected void populateSubFieldEditorBean(TreeEditor e) {
this.accessibleTreeModelEditor.setValue(e.getBuildModelConfig()); this.accessibleTreeModelEditor.setValue(e.getBuildModelConfig());
treeRootPane.populate(e.getTreeAttr()); treeRootPane.populate(e.getTreeAttr());
returnTypePane.populate(e);
if (this.removeRepeatCheckBox != null) { if (this.removeRepeatCheckBox != null) {
this.removeRepeatCheckBox.setSelected(e.isRemoveRepeat()); this.removeRepeatCheckBox.setSelected(e.isRemoveRepeat());
} }
@ -42,6 +46,7 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
TreeEditor editor = new TreeEditor(); TreeEditor editor = new TreeEditor();
editor.setBuildModelConfig(accessibleTreeModelEditor.getValue()); editor.setBuildModelConfig(accessibleTreeModelEditor.getValue());
editor.setTreeAttr(treeRootPane.update()); editor.setTreeAttr(treeRootPane.update());
returnTypePane.update(editor);
if (this.removeRepeatCheckBox != null) { if (this.removeRepeatCheckBox != null) {
editor.setRemoveRepeat(this.removeRepeatCheckBox.isSelected()); editor.setRemoveRepeat(this.removeRepeatCheckBox.isSelected());
} }
@ -75,9 +80,19 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
protected JPanel setThirdContentPane() { protected JPanel setThirdContentPane() {
JPanel content = FRGUIPaneFactory.createBorderLayout_L_Pane(); JPanel content = FRGUIPaneFactory.createBorderLayout_L_Pane();
content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
treeRootPane = new TreeRootPane(); treeRootPane = new TreeRootPane();
returnTypePane = new ReturnTypePane();
content.add(treeRootPane, BorderLayout.NORTH); content.add(treeRootPane, BorderLayout.NORTH);
returnTypePane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
content.add(returnTypePane, BorderLayout.CENTER);
treeRootPane.addTreeAttrChangeListener(treeAttr -> {
boolean showReturnTypePane = treeAttr.isMultipleSelection() && !treeAttr.isReturnFullPath();
returnTypePane.setVisible(showReturnTypePane);
if (!showReturnTypePane) {
returnTypePane.setReturnType(ReturnTypePane.ReturnType.ARRAY);
}
});
//content.add(treeRootPane, BorderLayout.NORTH);
return content; return content;
} }

3
designer-realize/src/main/java/com/fr/grid/GridUtils.java

@ -448,7 +448,8 @@ public class GridUtils {
int editElementcolumn = editCellElement.getColumn(); int editElementcolumn = editCellElement.getColumn();
UNIT preferredHeight = PaintUtils.analyzeCellElementPreferredHeight( UNIT preferredHeight = PaintUtils.analyzeCellElementPreferredHeight(
editCellElement, editCellElement,
columnWidthList.getRangeValue(editElementcolumn, editElementcolumn + editCellElement.getColumnSpan())); columnWidthList.getRangeValue(editElementcolumn, editElementcolumn + editCellElement.getColumnSpan()),
DesignerUIModeConfig.getInstance().getAutoChangeLineStrategy());
if (editCellElement.getRowSpan() == 1) { if (editCellElement.getRowSpan() == 1) {
rowHeightList.set(editCellElement.getRow(), rowHeightList.set(editCellElement.getRow(),
UNIT.max(preferredHeight, rowHeightList.get(editCellElement.getRow()))); UNIT.max(preferredHeight, rowHeightList.get(editCellElement.getRow())));

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

@ -102,6 +102,8 @@ import com.fr.log.FineLoggerFactory;
import com.fr.log.LogHandler; import com.fr.log.LogHandler;
import com.fr.module.Activator; import com.fr.module.Activator;
import com.fr.module.extension.Prepare; import com.fr.module.extension.Prepare;
import com.fr.plugin.beforeload.embed.DefaultPluginEmbedInfo;
import com.fr.plugin.beforeload.embed.PluginEmbedInfo;
import com.fr.plugin.context.PluginContext; import com.fr.plugin.context.PluginContext;
import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.injectable.PluginModule;
import com.fr.plugin.manage.PluginFilter; import com.fr.plugin.manage.PluginFilter;
@ -154,7 +156,7 @@ import javax.swing.SwingWorker;
public class DesignerActivator extends Activator implements Prepare { public class DesignerActivator extends Activator implements Prepare {
private LogHandler<DesignerLogAppender> logHandler = null; private LogHandler<DesignerLogAppender> logHandler = null;
private static final String PLUGIN_EXPORT_IMAGE_SETTING = "com.fr.plugin.exportimagesettings.v11";
private final Once pushUpdateTask = new Once(new Runnable() { private final Once pushUpdateTask = new Once(new Runnable() {
@Override @Override
public void run() { public void run() {
@ -521,6 +523,11 @@ public class DesignerActivator extends Activator implements Prepare {
}.execute(); }.execute();
} }
}); });
prepareDefaultEmbedPluginInfo();
}
private void prepareDefaultEmbedPluginInfo() {
addMutable(PluginEmbedInfo.KEY, DefaultPluginEmbedInfo.create(PLUGIN_EXPORT_IMAGE_SETTING));
} }
private void startLoginAuthServer() { private void startLoginAuthServer() {

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

@ -125,7 +125,7 @@ public class DesignerStartup extends Activator {
@Override @Override
public void on(Event event, Null param) { public void on(Event event, Null param) {
// 有可能被插件之类的 强制启动了 判断下 // 有可能被插件之类的 强制启动了 判断下
if (FineEmbedServer.isRunning()) { if (FineEmbedServer.isRunning() || FineEmbedServer.isOnStarting()) {
return; return;
} }
startEmbeddedServer(); startEmbeddedServer();

6
designer-realize/src/main/java/com/fr/start/module/optimized/TenantDBAdapter4Designer.java

@ -4,6 +4,7 @@ import com.fr.config.dao.DaoSelectorFactory;
import com.fr.config.dao.swicter.DaoSwitcher; import com.fr.config.dao.swicter.DaoSwitcher;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.event.Event; import com.fr.event.Event;
import com.fr.event.EventDispatcher;
import com.fr.event.Listener; import com.fr.event.Listener;
import com.fr.event.Null; import com.fr.event.Null;
import com.fr.exit.ConfigToPropMigrator; import com.fr.exit.ConfigToPropMigrator;
@ -25,6 +26,7 @@ public class TenantDBAdapter4Designer extends TenantDBAdapter {
@Override @Override
public void on(Event event, Null param) { public void on(Event event, Null param) {
TenantDBAdapter4Designer.super.start(); TenantDBAdapter4Designer.super.start();
afterStart();
} }
}); });
@ -32,7 +34,7 @@ public class TenantDBAdapter4Designer extends TenantDBAdapter {
@Override @Override
public void on(Event event, Null param) { public void on(Event event, Null param) {
if (DaoSelectorFactory.getDaoSelector().useCacheDao()) { if (DaoSelectorFactory.getDaoSelector().useCacheDao()) {
beforeEmbedServerStart(); EventDispatcher.fire(LazyStartupEvent.INSTANCE);
} }
} }
}); });
@ -42,7 +44,7 @@ public class TenantDBAdapter4Designer extends TenantDBAdapter {
} }
} }
private void beforeEmbedServerStart() { private void afterStart() {
DesignerEnvManager.getEnvManager().setPropertiesUsable(false); DesignerEnvManager.getEnvManager().setPropertiesUsable(false);
DaoSwitcher.executeSwitch(); DaoSwitcher.executeSwitch();
ConfigToPropMigrator.getInstance().deletePropertiesCache(); ConfigToPropMigrator.getInstance().deletePropertiesCache();

Loading…
Cancel
Save