Browse Source

Merge pull request #11194 in DESIGN/design from final/11.0 to persist/11.0

* commit '38ab7e9ba200f38a2d1a2212d683d2cffa514dee': (30 commits)
  REPORT-86045 FR11决策报表假保存-报表块内撤销后,再编辑除此报表块外部分,保存模板 实际未保存
  REPORT-87576 取色板使用后会让fr卡住。可稳定复现
  REPORT-87013 设计器11.0.11更新日志显示的信息是重复的
  REPORT-87843 复制特定文件夹名称,“的副本”后缀位置异常
  REPORT-87787 新增启动报错, File not exists:/com/fr/design/images/platform/platform
  REPORT-82895 单元格重复冻结优化 打开报错处理
  REPORT-87566 【单元格重复冻结】FRM-22.12.26的release分支,FRM设置冻结的窗口确认时无响应且日志有空指针报错
  REPORT-82895 单元格重复冻结优化 抽取判断逻辑
  REPORT-87323 还原改动,导致未输参数就出现数据集预览结果
  REPORT-87102 单元格重复冻结-新前端-交互-历史模板在未勾选重复结尾行的情况下冻结结尾行是可选的
  REPORT-87102 单元格重复冻结-新前端-交互-历史模板在未勾选重复结尾行的情况下冻结结尾行是可选的
  REPORT-86482 更新日志获取时间范围问题
  REPORT-87124 国际化设计器需要对服务平台做下隐藏
  REPORT-87060 Swing界面操作在Swing线程避免线程卡死
  REPORT-85618 【FR设计器-移动端】组件顺序-frm模板,组件修改名称后,body-移动端-组件顺序会排到最后一位
  REPORT-85618 【FR设计器-移动端】组件顺序-frm模板,组件修改名称后,body-移动端-组件顺序会排到最后一位
  REPORT-86809 单元格重复冻结-新前端-交互问题
  REPORT-86364 服务平台设计器适配
  REPORT-86364 服务平台设计器适配
  REPORT-86364 服务平台设计器适配
  ...
fix-lag
superman 2 years ago
parent
commit
5d8744f792
  1. 16
      designer-base/src/main/java/com/fr/design/DesignModelAdapter.java
  2. 4
      designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java
  3. 21
      designer-base/src/main/java/com/fr/design/file/FileOperationHelper.java
  4. 98
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java
  5. 10
      designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java
  6. 41
      designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java
  7. 9
      designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java
  8. 13
      designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java
  9. 30
      designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java
  10. 10
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  11. 21
      designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java
  12. 3
      designer-base/src/main/resources/com/fr/design/images/platform/platform_normal.svg
  13. 12
      designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java
  14. 1
      designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java
  15. 88
      designer-form/src/main/java/com/fr/design/mainframe/JForm.java
  16. 7
      designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java
  17. 11
      designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java
  18. 67
      designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java
  19. 4
      designer-realize/src/main/java/com/fr/design/report/freeze/FormECRepeatAndFreezeSettingPane.java
  20. 25
      designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java
  21. 37
      designer-realize/src/main/java/com/fr/design/report/freeze/FreezePagePane.java
  22. 259
      designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java
  23. 2
      designer-realize/src/main/java/com/fr/start/MainDesigner.java

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

@ -276,22 +276,28 @@ public abstract class DesignModelAdapter<T extends BaseBook, S extends JTemplate
protected void addTableDataParameters(Map<String, ParameterProvider> map, Filter<ParameterProvider> filter) { protected void addTableDataParameters(Map<String, ParameterProvider> map, Filter<ParameterProvider> filter) {
Iterator<String> it = this.getBook().getTableDataNameIterator(); Iterator<String> it = this.getBook().getTableDataNameIterator();
List<String> names = new ArrayList<>();
try { try {
// 清空下缓存 List<TableData> tableDatas = new ArrayList<>();
tableDataParametersMap.clear();
while (it.hasNext()) { while (it.hasNext()) {
String name = it.next(); String name = it.next();
TableData tableData = this.getBook().getTableData(name); TableData tableData = this.getBook().getTableData(name);
ParameterProvider[] parameterProviders = DataOperator.getInstance().getTableDataParameters(tableData); tableDatas.add(tableData);
names.add(name);
}
ParameterProvider[][] totalParameterProviders = DataOperator.getInstance().getTotalTableDataParameters(tableDatas);
tableDataParametersMap.clear();
for (int i = 0; i < totalParameterProviders.length; i++) {
ParameterProvider[] parameterProviders = totalParameterProviders[i];
if (filter != null) { if (filter != null) {
ParameterApplyHelper.addPara2Map(map, parameterProviders, filter, null, ParameterSource.DEFAULT_SOURCE); ParameterApplyHelper.addPara2Map(map, parameterProviders, filter, null, ParameterSource.DEFAULT_SOURCE);
} else { } else {
ParameterApplyHelper.addPara2Map(map, parameterProviders, null, ParameterSource.TEMPLATE_SOURCE); ParameterApplyHelper.addPara2Map(map, parameterProviders, null, ParameterSource.TEMPLATE_SOURCE);
} }
tableDataParametersMap.put(name, parameterProviders); tableDataParametersMap.put(names.get(i), parameterProviders);
} }
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e, e.getMessage());
} }
} }

4
designer-base/src/main/java/com/fr/design/actions/help/AboutPane.java

@ -126,8 +126,8 @@ public class AboutPane extends JPanel {
if (GeneralContext.getLocale().equals(Locale.TAIWAN)) { if (GeneralContext.getLocale().equals(Locale.TAIWAN)) {
return; return;
} }
boxCenterAlignmentPane = new BoxCenterAligmentPane("QQ: " + CloudCenter.getInstance().acquireUrlByKind("help.qq")); JPanel servicePlatformPane = getURLActionPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Service_Platform"), CloudCenter.getInstance().acquireUrlByKind("service.platform"));
contentPane.add(boxCenterAlignmentPane); contentPane.add(servicePlatformPane);
} }
// 是否显示鸣谢面板 // 是否显示鸣谢面板

21
designer-base/src/main/java/com/fr/design/file/FileOperationHelper.java

@ -127,7 +127,7 @@ public class FileOperationHelper {
WARNING_MESSAGE); WARNING_MESSAGE);
return StringUtils.EMPTY; return StringUtils.EMPTY;
} }
String name = getNoRepeatedName4Paste(targetDir, sourceFile.getName()); String name = getNoRepeatedName4Paste(targetDir, sourceFile);
String targetFile = StableUtils.pathJoin(targetDir, name); String targetFile = StableUtils.pathJoin(targetDir, name);
if (sourceFile.isDirectory()) { if (sourceFile.isDirectory()) {
copyDir(sourcePath, targetFile, withCopyVcs); copyDir(sourcePath, targetFile, withCopyVcs);
@ -177,19 +177,22 @@ public class FileOperationHelper {
* 重名处理 * 重名处理
* *
* @param targetDir * @param targetDir
* @param oldName * @param sourceFile
* @return * @return
*/ */
private String getNoRepeatedName4Paste(String targetDir, String oldName) { private String getNoRepeatedName4Paste(String targetDir, FileNode sourceFile) {
String oldName = sourceFile.getName();
while (isNameRepeaded(targetDir, oldName)) { while (isNameRepeaded(targetDir, oldName)) {
int index = oldName.lastIndexOf("."); if (sourceFile.isDirectory()) {
if (index > 0) {
String oName = oldName.substring(0, index);
oName = oName + Toolkit.i18nText("Fine-Design_Table_Data_Copy_Of_Table_Data");
oldName = oName.concat(oldName.substring(index));
} else {
//目录重名 //目录重名
oldName = oldName + Toolkit.i18nText("Fine-Design_Table_Data_Copy_Of_Table_Data"); oldName = oldName + Toolkit.i18nText("Fine-Design_Table_Data_Copy_Of_Table_Data");
} else {
int index = oldName.lastIndexOf(".");
if (index > 0) {
String oName = oldName.substring(0, index);
oName = oName + Toolkit.i18nText("Fine-Design_Table_Data_Copy_Of_Table_Data");
oldName = oName.concat(oldName.substring(index));
}
} }
} }
return oldName; return oldName;

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

@ -31,7 +31,6 @@ import java.awt.Color;
import java.awt.Cursor; import java.awt.Cursor;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.FlowLayout; import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Frame; import java.awt.Frame;
import java.awt.Graphics; import java.awt.Graphics;
import java.awt.Graphics2D; import java.awt.Graphics2D;
@ -241,51 +240,12 @@ public abstract class UIControlPane extends JControlPane {
} }
private void hideDialog() { private void hideDialog() {
// 检查是否有子弹窗,如果有,则不隐藏 if (needToHidePopupEditDialog()) {
for (Window window : getOwnedWindows()) { saveSettings();
if (window.isVisible()) { setVisible(false);
return; PopupDialogSaveAction saveAction = OSSupportCenter.getAction(PopupDialogSaveAction.class);
} saveAction.unregister();
}
// 如果有可见模态对话框,则不隐藏
for (Window window : DesignerContext.getDesignerFrame().getOwnedWindows()) {
if (window instanceof JDialog && window.isVisible() && ((JDialog) window).isModal()) {
return;
}
}
try {
//没有指定owner的弹出框用的是SwingUtilities.getSharedOwnerFrame()
Frame sharedOwnerFrame = Reflect.on(SwingUtilities.class).call("getSharedOwnerFrame").get();
for (Window window : sharedOwnerFrame.getOwnedWindows()) {
if (window instanceof JDialog && window.isVisible() && ((JDialog) window).isModal()) {
// 如果有可见模态对话框,则不隐藏
return;
}
}
} catch (Exception ignore) {
//do nothing
}
// 要隐藏 先检查有没有非法输入
// 非法输入检查放在最后,因为可能出现面板弹出新弹框而失去焦点的情况,比如 输入公式时,弹出公式编辑对话框
try {
checkValid();
} catch (Exception exp) {
// 存在非法输入 拒绝隐藏
this.setAlwaysOnTop(true);
FineJOptionPane.showMessageDialog(this, exp.getMessage());
this.requestFocus();
return;
}
if (JavaFxNativeFileChooser.isShowDialogState()) {
JavaFxNativeFileChooser.setShowDialogState(false);
return;
} }
saveSettings();
setVisible(false);
PopupDialogSaveAction saveAction = OSSupportCenter.getAction(PopupDialogSaveAction.class);
saveAction.unregister();
} }
private void initListener() { private void initListener() {
@ -302,6 +262,54 @@ public abstract class UIControlPane extends JControlPane {
} }
} }
/**
* 是否需要隐藏popupEditDialog
*/
protected boolean needToHidePopupEditDialog() {
// 检查是否有子弹窗,如果有,则不隐藏
for (Window window : popupEditDialog.getOwnedWindows()) {
if (window.isVisible()) {
return false;
}
}
// 如果有可见模态对话框,则不隐藏
for (Window window : DesignerContext.getDesignerFrame().getOwnedWindows()) {
if (window instanceof JDialog && window.isVisible() && ((JDialog) window).isModal()) {
return false;
}
}
try {
//没有指定owner的弹出框用的是SwingUtilities.getSharedOwnerFrame()
Frame sharedOwnerFrame = Reflect.on(SwingUtilities.class).call("getSharedOwnerFrame").get();
for (Window window : sharedOwnerFrame.getOwnedWindows()) {
if (window instanceof JDialog && window.isVisible() && ((JDialog) window).isModal()) {
// 如果有可见模态对话框,则不隐藏
return false;
}
}
} catch (Exception ignore) {
//do nothing
}
// 要隐藏 先检查有没有非法输入
// 非法输入检查放在最后,因为可能出现面板弹出新弹框而失去焦点的情况,比如 输入公式时,弹出公式编辑对话框
try {
checkValid();
} catch (Exception exp) {
// 存在非法输入 拒绝隐藏
popupEditDialog.setAlwaysOnTop(true);
FineJOptionPane.showMessageDialog(this, exp.getMessage());
popupEditDialog.requestFocus();
return false;
}
if (JavaFxNativeFileChooser.isShowDialogState()) {
JavaFxNativeFileChooser.setShowDialogState(false);
return false;
}
return true;
}
// 移动弹出编辑面板的工具条 // 移动弹出编辑面板的工具条
private class PopupToolPane extends JPanel { private class PopupToolPane extends JPanel {
private JDialog parentDialog; // 如果不在对话框中,值为null private JDialog parentDialog; // 如果不在对话框中,值为null

10
designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java

@ -321,6 +321,16 @@ public class UISpinner extends JPanel implements UIObserver, GlobalNameObserver
textField.setMaxValue(maxValue); textField.setMaxValue(maxValue);
} }
/**
* 设置最小值
*
* @param minValue 最小值
*/
public void setMinValue(double minValue) {
this.minValue = minValue;
textField.setMinValue(minValue);
}
private void componentInitListeners() { private void componentInitListeners() {
preButton.addActionListener(new ActionListener() { preButton.addActionListener(new ActionListener() {
@Override @Override

41
designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java

@ -265,34 +265,31 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse
int lineStyle = currentLineCombo.getSelectedLineStyle(); int lineStyle = currentLineCombo.getSelectedLineStyle();
Color lineColor = currentLineColorPane.getSelectObject(); Color lineColor = currentLineColorPane.getSelectObject();
CellBorderStyle cellBorderStyle = new CellBorderStyle(); CellBorderStyle cellBorderStyle = new CellBorderStyle();
if (topToggleButton.isSelected()) { if (lineColor != null) {
cellBorderStyle.setTopColor(lineColor); if (topToggleButton.isSelected()) {
cellBorderStyle.setTopColor(lineColor);
}
if (bottomToggleButton.isSelected()) {
cellBorderStyle.setBottomColor(lineColor);
}
if (leftToggleButton.isSelected()) {
cellBorderStyle.setLeftColor(lineColor);
}
if (rightToggleButton.isSelected()) {
cellBorderStyle.setRightColor(lineColor);
}
if (verticalToggleButton.isSelected()) {
cellBorderStyle.setVerticalColor(lineColor);
}
if (horizontalToggleButton.isSelected()) {
cellBorderStyle.setHorizontalColor(lineColor);
}
} }
cellBorderStyle.setTopStyle(topToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setTopStyle(topToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
if (bottomToggleButton.isSelected()) {
cellBorderStyle.setBottomColor(lineColor);
}
cellBorderStyle.setBottomStyle(bottomToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setBottomStyle(bottomToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
if (leftToggleButton.isSelected()) {
cellBorderStyle.setLeftColor(lineColor);
}
cellBorderStyle.setLeftStyle(leftToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setLeftStyle(leftToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
if (rightToggleButton.isSelected()) {
cellBorderStyle.setRightColor(lineColor);
}
cellBorderStyle.setRightStyle(rightToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setRightStyle(rightToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
if (verticalToggleButton.isSelected()) {
cellBorderStyle.setVerticalColor(lineColor);
}
cellBorderStyle.setVerticalStyle(verticalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setVerticalStyle(verticalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
if (horizontalToggleButton.isSelected()) {
cellBorderStyle.setHorizontalColor(lineColor);
}
cellBorderStyle.setHorizontalStyle(horizontalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE); cellBorderStyle.setHorizontalStyle(horizontalToggleButton.isSelected() ? lineStyle : Constants.LINE_NONE);
outerToggleButton.setSelected(leftToggleButton.isSelected() && bottomToggleButton.isSelected() && rightToggleButton.isSelected() && topToggleButton.isSelected()); outerToggleButton.setSelected(leftToggleButton.isSelected() && bottomToggleButton.isSelected() && rightToggleButton.isSelected() && topToggleButton.isSelected());

9
designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java

@ -24,9 +24,12 @@ import com.fr.design.javascript.jsapi.JSImplUpdateAction;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.js.JavaScriptImpl; import com.fr.js.JavaScriptImpl;
import javax.swing.JPanel;
import javax.swing.KeyStroke;
import javax.swing.SwingConstants;
import javax.swing.SwingWorker;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Cursor; import java.awt.Cursor;
import java.awt.Dimension; import java.awt.Dimension;
@ -36,10 +39,6 @@ import java.awt.event.FocusListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.util.ArrayList; import java.util.ArrayList;
import javax.swing.JPanel;
import javax.swing.KeyStroke;
import javax.swing.SwingConstants;
import javax.swing.SwingWorker;
public class JSContentPane extends BasicPane { public class JSContentPane extends BasicPane {
protected RSyntaxTextArea contentTextArea; protected RSyntaxTextArea contentTextArea;

13
designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java

@ -14,21 +14,18 @@ import com.fr.design.javascript.jsapi.JSImplUpdateAction;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.scrollruler.ModLineBorder; import com.fr.design.scrollruler.ModLineBorder;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.js.JavaScriptImpl; import com.fr.js.JavaScriptImpl;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridLayout;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener; import javax.swing.event.TableModelListener;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.GridLayout;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
@ -149,8 +146,6 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane<JavaScriptImpl> {
return importedJsPane; return importedJsPane;
} }
/** /**
* 参数改变 * 参数改变
* *

30
designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java

@ -0,0 +1,30 @@
package com.fr.design.mainframe.platform;
import com.fr.design.actions.UpdateAction;
import com.fr.design.i18n.Toolkit;
import com.fr.design.utils.BrowseUtils;
import com.fr.general.CloudCenter;
import com.fr.log.FineLoggerFactory;
import java.awt.Desktop;
import java.awt.event.ActionEvent;
import java.net.URI;
/**
* 帮助-服务平台
*
* @author Destiny.Lin
* @version 11.0
* created by Destiny.Lin on 2022-12-14
*/
public class ServicePlatformAction extends UpdateAction {
public ServicePlatformAction() {
this.setName(Toolkit.i18nText("Fine-Design_Basic_Service_Platform_Title"));
this.setSmallIcon("/com/fr/design/images/platform/platform", false);
}
@Override
public void actionPerformed(ActionEvent e) {
BrowseUtils.browser(CloudCenter.getInstance().acquireUrlByKind("service.platform"));
}
}

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

@ -56,6 +56,7 @@ import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.locale.impl.SupportLocaleImpl; import com.fr.design.locale.impl.SupportLocaleImpl;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.mainframe.ToolBarNewTemplatePane; import com.fr.design.mainframe.ToolBarNewTemplatePane;
import com.fr.design.mainframe.platform.ServicePlatformAction;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
@ -571,9 +572,14 @@ public abstract class ToolBarMenuDock {
if (AlphaFineConfigManager.isALPHALicAvailable()) { if (AlphaFineConfigManager.isALPHALicAvailable()) {
shortCuts.add(new AlphaFineAction()); shortCuts.add(new AlphaFineAction());
} }
shortCuts.add(new EnvDetectorAction()); shortCuts.add(new EnvDetectorAction());
//服务平台(仅针对中国大陆)
if (GeneralContext.getLocale().equals(Locale.CHINA)) {
shortCuts.add(new ServicePlatformAction());
}
shortCuts.add(SeparatorDef.DEFAULT); shortCuts.add(SeparatorDef.DEFAULT);
if (DesignerEnvManager.getEnvManager().isOpenDebug()) { if (DesignerEnvManager.getEnvManager().isOpenDebug()) {
OSSupportCenter.buildAction(objects -> shortCuts.add(new FineUIAction()), SupportOSImpl.FINEUI); OSSupportCenter.buildAction(objects -> shortCuts.add(new FineUIAction()), SupportOSImpl.FINEUI);

21
designer-base/src/main/java/com/fr/design/update/ui/dialog/UpdateMainDialog.java

@ -118,6 +118,8 @@ public class UpdateMainDialog extends UIDialog {
private ArrayList<Object[]> updateInfoList; private ArrayList<Object[]> updateInfoList;
private Set<String> titleSet;
private boolean getUpdateInfoSuccess; private boolean getUpdateInfoSuccess;
private UpdateInfoCachePropertyManager cacheProperty; private UpdateInfoCachePropertyManager cacheProperty;
@ -267,6 +269,7 @@ public class UpdateMainDialog extends UIDialog {
String keyword = searchUpdateInfoKeyword.getText(); String keyword = searchUpdateInfoKeyword.getText();
if (ComparatorUtils.equals(keyword, StringUtils.EMPTY) && getUpdateInfoSuccess) { if (ComparatorUtils.equals(keyword, StringUtils.EMPTY) && getUpdateInfoSuccess) {
updateInfoList.clear(); updateInfoList.clear();
titleSet.clear();
getUpdateInfo(keyword).execute(); getUpdateInfo(keyword).execute();
} }
} }
@ -281,6 +284,7 @@ public class UpdateMainDialog extends UIDialog {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if (getUpdateInfoSuccess) { if (getUpdateInfoSuccess) {
updateInfoList.clear(); updateInfoList.clear();
titleSet.clear();
getUpdateInfo(searchUpdateInfoKeyword.getText()).execute(); getUpdateInfo(searchUpdateInfoKeyword.getText()).execute();
} }
} }
@ -388,6 +392,7 @@ public class UpdateMainDialog extends UIDialog {
private SwingWorker<JSONArray, Void> getUpdateInfo(final String keyword) { private SwingWorker<JSONArray, Void> getUpdateInfo(final String keyword) {
updateInfoList = new ArrayList<>(); updateInfoList = new ArrayList<>();
titleSet = new HashSet<>();
lastUpdateCacheTime = UpdateConstants.CHANGELOG_X_START; lastUpdateCacheTime = UpdateConstants.CHANGELOG_X_START;
String cacheConfigPath = getUpdateCacheConfig(); String cacheConfigPath = getUpdateCacheConfig();
cacheProperty = new UpdateInfoCachePropertyManager(StableUtils.pathJoin(WorkContext.getCurrent().getPath(), "resources", "offlineres", cacheConfigPath)); cacheProperty = new UpdateInfoCachePropertyManager(StableUtils.pathJoin(WorkContext.getCurrent().getPath(), "resources", "offlineres", cacheConfigPath));
@ -488,7 +493,8 @@ public class UpdateMainDialog extends UIDialog {
continue; continue;
} }
} }
if (isValidLogInfo(updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX]) && curJarDate != null) { if (isValid(updateInfo, GeneralUtils.objectToString(curJarDate))) {
titleSet.add(updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX]);
updateInfoList.add(new Object[]{UPDATELOG_FORMAT.format(updateTime), updateInfo[UpdateInfoTable.UPDATE_VERSION_INDEX], updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX], updateTime.after(curJarDate)}); updateInfoList.add(new Object[]{UPDATELOG_FORMAT.format(updateTime), updateInfo[UpdateInfoTable.UPDATE_VERSION_INDEX], updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX], updateTime.after(curJarDate)});
} }
} }
@ -499,6 +505,11 @@ public class UpdateMainDialog extends UIDialog {
} }
} }
private boolean isValid(String[] updateInfo, String curJarDate) {
return isValidLogInfo(updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX]) && curJarDate != null && curJarDate.compareTo(updateInfo[UpdateInfoTable.UPDATE_DATE_INDEX]) <= 0 && !titleSet.contains(updateInfo[UpdateInfoTable.UPDATE_TITLE_INDEX]);
}
private void updateCachedInfoFile(JSONArray jsonArray) throws Exception { private void updateCachedInfoFile(JSONArray jsonArray) throws Exception {
String cacheDirPath = StableUtils.pathJoin(WorkContext.getCurrent().getPath(), "resources", "offlineres"); String cacheDirPath = StableUtils.pathJoin(WorkContext.getCurrent().getPath(), "resources", "offlineres");
File cacheFileDir = new File(cacheDirPath); File cacheFileDir = new File(cacheDirPath);
@ -554,13 +565,19 @@ public class UpdateMainDialog extends UIDialog {
continue; continue;
} }
} }
if (isValidLogInfo(updateTitle)) { Date curDate = UPDATE_INFO_TABLE_FORMAT.parse(currentNO, new ParsePosition(currentNO.indexOf("-") + 1));
if (isValid4GenerateInfo(updateTitle, GeneralUtils.objectToString(curDate), updateTimeStr)) {
titleSet.add(updateTitle);
updateInfoList.add(new Object[]{updateTimeStr, updateVersionStr, updateTitle, updateTime.after(curJarDate)}); updateInfoList.add(new Object[]{updateTimeStr, updateVersionStr, updateTitle, updateTime.after(curJarDate)});
} }
} }
return new ArrayList<>(updateInfoList); return new ArrayList<>(updateInfoList);
} }
private boolean isValid4GenerateInfo(String updateTitle, String curDate, String updateTimeStr) {
return isValidLogInfo(updateTitle) && curDate.compareTo(updateTimeStr) <= 0 && !titleSet.contains(updateTitle);
}
private boolean containsKeyword(String str, String keyword) { private boolean containsKeyword(String str, String keyword) {
return str.toUpperCase().contains(keyword.toUpperCase()); return str.toUpperCase().contains(keyword.toUpperCase());
} }

3
designer-base/src/main/resources/com/fr/design/images/platform/platform_normal.svg

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M14 6.5V10.5V12H10V6H12.9776C12.725 3.19675 10.369 1 7.5 1C4.63098 1 2.27504 3.19675 2.02242 6H5V12H2V14H6V13H9V16H6V15H1V12V11.5V10.5V6.5V6H1.01894C1.27426 2.64378 4.07839 0 7.5 0C10.9216 0 13.7257 2.64378 13.9811 6H14V6.5ZM13 10.5V7H11V11H13V10.5ZM2 10.5V7H4V11H2V10.5ZM7 15V14H8V15H7Z" fill="#333334"/>
</svg>

After

Width:  |  Height:  |  Size: 458 B

12
designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java

@ -39,6 +39,8 @@ import com.fr.stable.Nameable;
import com.fr.stable.bridge.StableFactory; import com.fr.stable.bridge.StableFactory;
import com.fr.van.chart.designer.component.VanChartUIListControlPane; import com.fr.van.chart.designer.component.VanChartUIListControlPane;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.lang.reflect.Constructor; import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList; import java.util.ArrayList;
@ -186,6 +188,16 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane {
} }
this.populate(nameObjects.toArray(new NameObject[nameObjects.size()])); this.populate(nameObjects.toArray(new NameObject[nameObjects.size()]));
if (popupEditDialog instanceof HyperDialog) {
popupEditDialog.addWindowFocusListener(new WindowAdapter() {
@Override
public void windowLostFocus(WindowEvent e) {
if (needToHidePopupEditDialog()) {
popupEditDialog.setVisible(false);
}
}
});
}
doLayout(); doLayout();
} }

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

@ -51,7 +51,6 @@ public class XElementCase extends XBorderStyleWidgetCreator implements FormEleme
public XElementCase(ElementCaseEditor widget, Dimension initSize) { public XElementCase(ElementCaseEditor widget, Dimension initSize) {
super(widget, initSize); super(widget, initSize);
widget.getElementCaseImage().adjustImageSize(initSize.width, initSize.height, false);
} }
protected void initXCreatorProperties() { protected void initXCreatorProperties() {

88
designer-form/src/main/java/com/fr/design/mainframe/JForm.java

@ -6,8 +6,6 @@ import com.fr.base.Parameter;
import com.fr.base.Releasable; import com.fr.base.Releasable;
import com.fr.base.extension.FileExtension; import com.fr.base.extension.FileExtension;
import com.fr.base.iofile.attr.ExtendSharableAttrMark; import com.fr.base.iofile.attr.ExtendSharableAttrMark;
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;
@ -17,8 +15,8 @@ import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignState; import com.fr.design.DesignState;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.actions.FormMobileAttrAction;
import com.fr.design.actions.FormECParallelCalAction; import com.fr.design.actions.FormECParallelCalAction;
import com.fr.design.actions.FormMobileAttrAction;
import com.fr.design.actions.TemplateParameterAction; import com.fr.design.actions.TemplateParameterAction;
import com.fr.design.actions.core.WorkBookSupportable; import com.fr.design.actions.core.WorkBookSupportable;
import com.fr.design.actions.file.export.EmbeddedFormExportExportAction; import com.fr.design.actions.file.export.EmbeddedFormExportExportAction;
@ -56,8 +54,8 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.form.FormECCompositeProvider; import com.fr.design.mainframe.form.FormECCompositeProvider;
import com.fr.design.mainframe.form.FormECDesignerProvider; import com.fr.design.mainframe.form.FormECDesignerProvider;
import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo; import com.fr.design.mainframe.reuse.ComponentReuseNotificationInfo;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.share.ComponentShareUtil; import com.fr.design.mainframe.share.ComponentShareUtil;
import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.template.info.JFormProcessInfo; import com.fr.design.mainframe.template.info.JFormProcessInfo;
import com.fr.design.mainframe.template.info.TemplateProcessInfo; import com.fr.design.mainframe.template.info.TemplateProcessInfo;
import com.fr.design.mainframe.theme.dialog.TemplateThemeUsingDialog; import com.fr.design.mainframe.theme.dialog.TemplateThemeUsingDialog;
@ -71,7 +69,6 @@ import com.fr.design.parameter.ParameterPropertyPane;
import com.fr.design.preview.FormPreview; import com.fr.design.preview.FormPreview;
import com.fr.design.preview.MobilePreview; import com.fr.design.preview.MobilePreview;
import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane;
import com.fr.design.ui.util.UIUtil;
import com.fr.design.utils.gui.LayoutUtils; import com.fr.design.utils.gui.LayoutUtils;
import com.fr.file.FILE; import com.fr.file.FILE;
import com.fr.file.FILEChooserPane; import com.fr.file.FILEChooserPane;
@ -110,7 +107,14 @@ import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import javax.swing.tree.TreePath; import javax.swing.tree.TreePath;
import java.awt.*; import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
@ -1266,46 +1270,48 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm<F
private void refreshTarget(Form form) { private void refreshTarget(Form form) {
setTarget(form); setTarget(form);
if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate() == this) { if (HistoryTemplateListCache.getInstance().getCurrentEditingTemplate() != this) {
if (this.index == FORM_TAB) { return;
// save state }
FormArea formArea = formDesign.getArea(); // save state
int horizontalValue = formArea.getHorizontalValue(); FormArea formArea = formDesign.getArea();
int verticalValue = formArea.getVerticalValue(); int horizontalValue = formArea.getHorizontalValue();
Dimension areaSize = formArea.getAreaSize(); int verticalValue = formArea.getVerticalValue();
double widthValue = formArea.getWidthPaneValue(); Dimension areaSize = formArea.getAreaSize();
double heightValue = formArea.getHeightPaneValue(); double widthValue = formArea.getWidthPaneValue();
double slideValue = formArea.getSlideValue(); double heightValue = formArea.getHeightPaneValue();
Widget[] selectedWidgets = formArea.getFormEditor().getSelectionModel().getSelection().getSelectedWidgets(); double slideValue = formArea.getSlideValue();
Widget[] selectedWidgets = formArea.getFormEditor().getSelectionModel().getSelection().getSelectedWidgets();
// refresh ui
JForm.this.refreshRoot(); // refresh ui
JForm.this.refreshRoot();
// restore state
formDesign.getArea().setAreaSize(areaSize, horizontalValue, verticalValue, widthValue, heightValue, slideValue); // restore state
formDesign.getArea().undoFixLayoutState(formArea.isFixLayout()); formDesign.getArea().setAreaSize(areaSize, horizontalValue, verticalValue, widthValue, heightValue, slideValue);
this.formDesign.getSelectionModel().setSelectedCreators(FormSelectionUtils.rebuildSelection(formDesign.getRootComponent(), formDesign.getArea().undoFixLayoutState(formArea.isFixLayout());
formDesign.getRootComponent() == selectedBodyLayout() ? selectedWidgets : new Widget[]{selectedBodyLayout().toData()})); this.formDesign.getSelectionModel().setSelectedCreators(FormSelectionUtils.rebuildSelection(formDesign.getRootComponent(),
formDesign.getRootComponent() == selectedBodyLayout() ? selectedWidgets : new Widget[]{selectedBodyLayout().toData()}));
refreshToolArea(); refreshToolArea();
// 停止编辑 恢复浮层展示 // 停止编辑 恢复浮层展示
TreePath[] treePaths = FormHierarchyTreePane.getInstance(formDesign).getComponentTree().getSelectedTreePath(); TreePath[] treePaths = FormHierarchyTreePane.getInstance(formDesign).getComponentTree().getSelectedTreePath();
if (treePaths != null) { if (treePaths != null) {
for (TreePath path : treePaths) { for (TreePath path : treePaths) {
if (path != null) { if (path != null) {
formDesign.stopEditing(path); formDesign.stopEditing(path);
}
}
} }
} else {
String widgetName = this.formDesign.getElementCaseContainerName();
FormElementCaseProvider dataTable = form.getElementCaseByName(widgetName);
this.reportComposite.setSelectedWidget(dataTable);
formDesign.setElementCase(dataTable);
} }
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).refreshDockingView();
} }
if (this.index != FORM_TAB) {
String widgetName = this.formDesign.getElementCaseContainerName();
FormElementCaseProvider dataTable = form.getElementCaseByName(widgetName);
this.reportComposite.setSelectedWidget(dataTable);
formDesign.setElementCase(dataTable);
}
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()).refreshDockingView();
} }
@Override @Override

7
designer-form/src/main/java/com/fr/design/mainframe/widget/ui/FormSingleWidgetCardPane.java

@ -28,9 +28,11 @@ import com.fr.design.widget.Operator;
import com.fr.design.widget.ui.designer.component.WidgetAbsoluteBoundPane; import com.fr.design.widget.ui.designer.component.WidgetAbsoluteBoundPane;
import com.fr.design.widget.ui.designer.component.WidgetBoundPane; import com.fr.design.widget.ui.designer.component.WidgetBoundPane;
import com.fr.design.widget.ui.designer.component.WidgetCardTagBoundPane; import com.fr.design.widget.ui.designer.component.WidgetCardTagBoundPane;
import com.fr.form.main.WidgetUtil;
import com.fr.form.ui.ChartEditor; import com.fr.form.ui.ChartEditor;
import com.fr.form.ui.Widget; import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WScaleLayout; import com.fr.form.ui.container.WScaleLayout;
import com.fr.form.ui.container.WSortLayout;
import com.fr.form.ui.container.WTitleLayout; import com.fr.form.ui.container.WTitleLayout;
import com.fr.form.ui.widget.CRBoundsWidget; import com.fr.form.ui.widget.CRBoundsWidget;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
@ -241,7 +243,12 @@ public class FormSingleWidgetCardPane extends FormWidgetCardPane {
showNameInvalidDialog(Toolkit.i18nText("Fine-Design_Form_Chart_Widget_Rename_Failure")); showNameInvalidDialog(Toolkit.i18nText("Fine-Design_Form_Chart_Widget_Rename_Failure"));
return; return;
} }
String oldName = widget.getWidgetName();
widgetPropertyPane.update(widget); widgetPropertyPane.update(widget);
Widget innerWidget = WidgetUtil.getInnerWidget(widget);
if (!StringUtils.equals(oldName, innerWidget.getWidgetName())) {
innerWidget.setMobileOldWidgetName(oldName);
}
// 上面一行更新了组件 这里必须重新调用getWidgetName // 上面一行更新了组件 这里必须重新调用getWidgetName
xCreator.resetCreatorName(widget.getWidgetName()); xCreator.resetCreatorName(widget.getWidgetName());
xCreator.resetVisible(widget.isVisible()); xCreator.resetVisible(widget.isVisible());

11
designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java

@ -9,12 +9,16 @@ 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.mainframe.HyperlinkGroupPaneActionImpl; import com.fr.design.mainframe.HyperlinkGroupPaneActionImpl;
import com.fr.js.EmailJavaScript;
import com.fr.js.*; import com.fr.js.JavaScript;
import com.fr.js.JavaScriptImpl;
import com.fr.js.NameJavaScriptGroup;
import com.fr.js.ReportletHyperlink;
import com.fr.js.WebHyperlink;
import com.fr.report.cell.cellattr.highlight.HighlightAction; import com.fr.report.cell.cellattr.highlight.HighlightAction;
import com.fr.report.cell.cellattr.highlight.HyperlinkHighlightAction; import com.fr.report.cell.cellattr.highlight.HyperlinkHighlightAction;
import javax.swing.*; import javax.swing.SwingUtilities;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
@ -47,6 +51,7 @@ public class HyperlinkPane extends ConditionAttrSingleConditionPane<HighlightAct
setText(); setText();
} }
}); });
dialog.setModal(false);
dialog.setVisible(true); dialog.setVisible(true);
} }
}); });

67
designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java

@ -3,6 +3,8 @@
*/ */
package com.fr.design.mainframe.form; package com.fr.design.mainframe.form;
import com.fr.base.DynamicUnitList;
import com.fr.base.GraphHelper;
import com.fr.base.TRL; import com.fr.base.TRL;
import com.fr.base.vcs.DesignerMode; import com.fr.base.vcs.DesignerMode;
import com.fr.design.DesignState; import com.fr.design.DesignState;
@ -33,11 +35,14 @@ import com.fr.form.FormElementCaseProvider;
import com.fr.form.fit.common.LightTool; import com.fr.form.fit.common.LightTool;
import com.fr.form.main.Form; import com.fr.form.main.Form;
import com.fr.grid.Grid; import com.fr.grid.Grid;
import com.fr.grid.GridUtils;
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.grid.selection.Selection; import com.fr.grid.selection.Selection;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.report.ReportHelper;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
import com.fr.report.elementcase.ElementCase;
import com.fr.report.elementcase.TemplateElementCase; import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.worksheet.FormElementCase; import com.fr.report.worksheet.FormElementCase;
import com.fr.report.worksheet.WorkSheet; import com.fr.report.worksheet.WorkSheet;
@ -132,16 +137,23 @@ public class FormElementCaseDesigner
} }
/** /**
* 获取当前ElementCase的缩略图 * 获取当前ElementCase的缩略图 缩略图中包含所有有内容的单元格
* *
* @param size 缩略图的大小 * @param size 缩略图的大小
*/ */
@Override @Override
public BufferedImage getElementCaseImage(Dimension size) { public BufferedImage getElementCaseImage(Dimension size) {
Grid grid = this.elementCasePane != null ? this.elementCasePane.getGrid() : null;
if (grid == null) {
return new BufferedImage(0, 0, BufferedImage.TYPE_INT_RGB);
}
resetGrid(grid);
BufferedImage image = null; BufferedImage image = null;
try { try {
int width = size.width; int width = Math.max(grid.getWidth(), size.width);
int height = size.height; int height = Math.max(grid.getHeight(), size.width);
// 使用TYPE_INT_RGB和new Color(255, 255, 255, 1)设置有透明背景buffer image, // 使用TYPE_INT_RGB和new Color(255, 255, 255, 1)设置有透明背景buffer image,
// 使得创建出来的透明像素是(255, 255, 255, 1),而不是(0, 0, 0, 0) // 使得创建出来的透明像素是(255, 255, 255, 1),而不是(0, 0, 0, 0)
@ -157,20 +169,16 @@ public class FormElementCaseDesigner
// 使得创建出来的透明像素是(255, 255, 255, 1),而不是(0, 0, 0, 0) // 使得创建出来的透明像素是(255, 255, 255, 1),而不是(0, 0, 0, 0)
// 这样不支持透明通道缩略图的旧设计器打开新设计器创建的模版时,就不会创建出拥有黑色背景的缩略图 // 这样不支持透明通道缩略图的旧设计器打开新设计器创建的模版时,就不会创建出拥有黑色背景的缩略图
g2d.setColor(new Color(255, 255, 255, 1)); g2d.setColor(new Color(255, 255, 255, 1));
g2d.fillRect(0, 0, (int) size.getWidth(), (int) size.getHeight()); g2d.fillRect(0, 0, width, height);
Grid grid = this.elementCasePane != null ? this.elementCasePane.getGrid() : null; boolean oldTranslucent = grid.isTranslucent();
if (grid != null) { boolean oldShowExtraGridLine = grid.isShowExtraGridLine();
resetGrid(grid); // 截缩图图时grid需支持半透明,不能用默认白色填充画布,否则会遮挡组件样式背景
boolean oldTranslucent = grid.isTranslucent(); grid.setTranslucent(true);
boolean oldShowExtraGridLine = grid.isShowExtraGridLine(); grid.setShowExtraGridLine(false);
// 截缩图图时grid需支持半透明,不能用默认白色填充画布,否则会遮挡组件样式背景 grid.paint(g2d);
grid.setTranslucent(true); grid.setTranslucent(oldTranslucent);
grid.setShowExtraGridLine(false); grid.setShowExtraGridLine(oldShowExtraGridLine);
grid.paint(g2d);
grid.setTranslucent(oldTranslucent);
grid.setShowExtraGridLine(oldShowExtraGridLine);
}
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
@ -180,12 +188,33 @@ public class FormElementCaseDesigner
} }
private void resetGrid(Grid grid) { private void resetGrid(Grid grid) {
grid.setResolution(Constants.DEFAULT_WEBWRITE_AND_SCREEN_RESOLUTION);
grid.updateUI();
grid.setAdsorbHeight(0); grid.setAdsorbHeight(0);
grid.setAdsorbWidth(0); grid.setAdsorbWidth(0);
grid.setVerticalValue(0); grid.setVerticalValue(0);
grid.setHorizontalValue(0); grid.setHorizontalValue(0);
FormElementCasePaneDelegate reportPane = getEditingElementCasePane();
ColumnRow lastColumnRow = GridUtils.getAdjustLastColumnRowOfReportPane(reportPane);
int lastColumn = lastColumnRow.getColumn();
int lastRow = lastColumnRow.getRow();
grid.setVerticalExtent(lastRow);
grid.setHorizontalExtent(lastColumn);
ElementCase report = reportPane.getEditingElementCase();
DynamicUnitList rowHeightList = ReportHelper.getRowHeightList(report);
DynamicUnitList columnWidthList = ReportHelper.getColumnWidthList(report);
int resolution = grid.getResolution();
int width = columnWidthList.getRangeValueFromZero(lastColumn).toPixI(resolution);
int height = rowHeightList.getRangeValueFromZero(lastRow).toPixI(resolution);
int gridLineWidth = GraphHelper.getLineStyleSize(Constants.LINE_THIN);
grid.setSize(width + gridLineWidth, height + gridLineWidth);
grid.updateUI();
} }
/** /**

4
designer-realize/src/main/java/com/fr/design/report/freeze/FormECRepeatAndFreezeSettingPane.java

@ -28,8 +28,8 @@ public class FormECRepeatAndFreezeSettingPane extends RepeatAndFreezeSettingPane
} }
protected void addWriteFrozen(JPanel freezePanel) { protected void addWriteFrozen(JPanel freezePanel, JPanel pagePanel) {
super.initWriteFrozenPane();
} }
} }

25
designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java

@ -3,6 +3,8 @@ package com.fr.design.report.freeze;
import java.awt.Dimension; import java.awt.Dimension;
import javax.swing.JComponent; import javax.swing.JComponent;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
@ -27,9 +29,21 @@ public abstract class FreezeAndRepeatPane extends BasicBeanPane<FT> {
Dimension size = new Dimension(43, 21); Dimension size = new Dimension(43, 21);
if (start instanceof UISpinner) { if (start instanceof UISpinner) {
start.setPreferredSize(size); start.setPreferredSize(size);
((UISpinner) start).addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
updateEndValue();
}
});
} }
if (end instanceof UISpinner) { if (end instanceof UISpinner) {
end.setPreferredSize(size); end.setPreferredSize(size);
((UISpinner) end).addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
updateEndValue();
}
});
} }
this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); this.setLayout(FRGUIPaneFactory.createBoxFlowLayout());
this.add(start); this.add(start);
@ -63,9 +77,20 @@ public abstract class FreezeAndRepeatPane extends BasicBeanPane<FT> {
* 给UISpinner添加Listener * 给UISpinner添加Listener
*/ */
public void addListener(ChangeListener l) { public void addListener(ChangeListener l) {
if (start instanceof UISpinner) {
((UISpinner) start).addChangeListener(l);
}
if (end instanceof UISpinner) { if (end instanceof UISpinner) {
((UISpinner) end).addChangeListener(l); ((UISpinner) end).addChangeListener(l);
} }
} }
private void updateEndValue() {
if (end instanceof UISpinner && start instanceof UISpinner) {
((UISpinner) end).setMinValue(((UISpinner) start).getValue());
((UISpinner) end).setValue(((UISpinner) end).getValue());
}
}
} }

37
designer-realize/src/main/java/com/fr/design/report/freeze/FreezePagePane.java

@ -4,11 +4,13 @@ import com.fr.design.gui.ilable.UILabel;
import javax.swing.SwingConstants; import javax.swing.SwingConstants;
import com.fr.design.i18n.Toolkit;
import com.fr.stable.FT; import com.fr.stable.FT;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
public class FreezePagePane extends FreezeAndRepeatPane { public class FreezePagePane extends FreezeAndRepeatPane {
private boolean isNumber; private boolean isNumber;
private boolean foot;
public FreezePagePane(boolean isNumber) { public FreezePagePane(boolean isNumber) {
this.isNumber = isNumber; this.isNumber = isNumber;
@ -17,6 +19,20 @@ public class FreezePagePane extends FreezeAndRepeatPane {
super.initComponent(); super.initComponent();
} }
public FreezePagePane(boolean isNumber, boolean foot) {
this.foot = foot;
this.isNumber = isNumber;
if (foot) {
start = new UILabel(isNumber ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+" 1" : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+" A", SwingConstants.CENTER);
end = new UILabel();
} else {
start = new UILabel(isNumber ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+" 1" : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+" A", SwingConstants.CENTER);
end = new UILabel(isNumber ? " 1"+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row") : " A"+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column"), SwingConstants.CENTER);
}
super.initComponent();
}
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return "FreezePage"; return "FreezePage";
@ -24,10 +40,18 @@ public class FreezePagePane extends FreezeAndRepeatPane {
@Override @Override
public void populateBean(FT ob) { public void populateBean(FT ob) {
if (isNumber) { if (foot) {
((UILabel) end).setText(String.valueOf(ob.getTo() + 1)+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row")); if (isNumber) {
((UILabel) start).setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+String.valueOf(ob.getFrom() + 1));
} else {
((UILabel) start).setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Frozen_N.O.")+StableUtils.convertIntToABC(ob.getFrom() + 1));
}
} else { } else {
((UILabel) end).setText(StableUtils.convertIntToABC(ob.getTo() + 1)+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column")); if (isNumber) {
((UILabel) end).setText(String.valueOf(ob.getTo() + 1)+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row"));
} else {
((UILabel) end).setText(StableUtils.convertIntToABC(ob.getTo() + 1)+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column"));
}
} }
} }
@ -42,6 +66,11 @@ public class FreezePagePane extends FreezeAndRepeatPane {
@Override @Override
public String getLabeshow() { public String getLabeshow() {
return isNumber ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Row_To") : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_To"); if (foot) {
return isNumber ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Last_Row") : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Last_Col");
} else {
return isNumber ? com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Row_To") : com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_To");
}
} }
} }

259
designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java

@ -1,11 +1,14 @@
package com.fr.design.report.freeze; package com.fr.design.report.freeze;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.extra.WebViewDlgHelper; import com.fr.design.extra.WebViewDlgHelper;
import com.fr.design.gui.frpane.UITabbedPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.ActionLabel; import com.fr.design.gui.ilable.ActionLabel;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.page.ReportPageAttrProvider; import com.fr.page.ReportPageAttrProvider;
@ -29,6 +32,9 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
//边框高度 //边框高度
private static final int LABEL_HEIGHT = 45; private static final int LABEL_HEIGHT = 45;
//tab
private UITabbedPane tabbedPane;
// 重复标题行 // 重复标题行
private RepeatRowPane repeatTitleRowPane; private RepeatRowPane repeatTitleRowPane;
// 重复标题列 // 重复标题列
@ -41,6 +47,10 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
private FreezePagePane freezePageRowPane; private FreezePagePane freezePageRowPane;
// 分页冻结列 // 分页冻结列
private FreezePagePane freezePageColPane; private FreezePagePane freezePageColPane;
//分页冻结结尾行
private FreezePagePane freezeFootRowPane;
//分页冻结结尾列
private FreezePagePane freezeFootColPane;
// 填报冻结行 // 填报冻结行
private FreezeWriteRowPane freezeWriteRowPane; private FreezeWriteRowPane freezeWriteRowPane;
// 填报冻结列 // 填报冻结列
@ -53,12 +63,21 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
private UICheckBox useRepeatFinisCCheckBox; private UICheckBox useRepeatFinisCCheckBox;
// 分页冻结 // 分页冻结
private UICheckBox usePageFrozenCCheckBox; private UICheckBox usePageHeadFrozenCCheckBox;
private UICheckBox usePageFrozenRCheckBox; private UICheckBox usePageHeadFrozenRCheckBox;
private UICheckBox usePageFootFrozenCCheckBox;
private UICheckBox usePageFootFrozenRCheckBox;
// 填报冻结 // 填报冻结
private UICheckBox useWriteFrozenCCheckBox; private UICheckBox useWriteFrozenCCheckBox;
private UICheckBox useWriteFrozenRCheckBox; private UICheckBox useWriteFrozenRCheckBox;
private static final int REPEAT_AND_FROZEN_WIDTH = 600, REPEAT_AND_FROZEN_HEIGHT = 100;
//标题区域
private static final String REPEAT_AND_FROZEN_HEAD = Toolkit.i18nText("Fine-Design_Report_Repeat_Head");
//结尾区域
private static final String REPEAT_AND_FROZEN_FOOT = Toolkit.i18nText("Fine-Design_Report_Repeat_Foot");
/** /**
* 重复标题行 * 重复标题行
*/ */
@ -137,30 +156,41 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
* 分页冻结Pane * 分页冻结Pane
*/ */
private JPanel initPageFrozenPane() { private JPanel initPageFrozenPane() {
JPanel pagePanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
// 分页冻结 // 分页冻结
UILabel pageLabel = new UILabel(getPageFrozenTitle());
JPanel pageLabelPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
pageLabelPanel.add(pageLabel);
pagePanel.add(pageLabelPanel, BorderLayout.NORTH);
JPanel pagecon = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); JPanel pagecon = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
pagecon.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); pagecon.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
pagePanel.add(pagecon, BorderLayout.CENTER);
UILabel warningx = new UILabel("(" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Please_Set_Repeat_First") + ")");
warningx.setForeground(Color.red);
pageLabelPanel.add(warningx);
JPanel pageRowGridPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel pageRowGridPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
pageRowGridPane.add(this.usePageFrozenRCheckBox = new UICheckBox()); pageRowGridPane.add(this.usePageHeadFrozenRCheckBox = new UICheckBox());
pagecon.add(pageRowGridPane);
// 显示行冻结信息的panel // 显示行冻结信息的panel
freezePageRowPane = new FreezePagePane(true); freezePageRowPane = new FreezePagePane(true);
pageRowGridPane.add(freezePageRowPane); pageRowGridPane.add(freezePageRowPane);
pagecon.add(pageRowGridPane);
addPageFrozenCol(pagecon); addPageFrozenCol(pagecon);
addBorder(pagecon, REPEAT_AND_FROZEN_HEAD);
return pagecon;
}
return pagePanel; private JPanel initPageFrozenFootPane() {
JPanel pageContentPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
pageContentPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
// 行冻结
JPanel pageRowPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
pageRowPane.add(this.usePageFootFrozenRCheckBox = new UICheckBox());
// 列冻结
JPanel pageColPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
pageColPane.add(this.usePageFootFrozenCCheckBox = new UICheckBox());
pageContentPanel.add(pageRowPane);
freezeFootRowPane = new FreezePagePane(true, true);
pageRowPane.add(freezeFootRowPane);
pageContentPanel.add(pageColPane);
freezeFootColPane = new FreezePagePane(false, true);
pageColPane.add(freezeFootColPane);
addBorder(pageContentPanel, REPEAT_AND_FROZEN_FOOT);
return pageContentPanel;
} }
/** /**
* 分页冻结列 * 分页冻结列
*/ */
@ -168,7 +198,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
// 显示列冻结信息的panel // 显示列冻结信息的panel
freezePageColPane = new FreezePagePane(false); freezePageColPane = new FreezePagePane(false);
JPanel pageColGridPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel pageColGridPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
pageColGridPane.add(this.usePageFrozenCCheckBox = new UICheckBox()); pageColGridPane.add(this.usePageHeadFrozenCCheckBox = new UICheckBox());
pagecon.add(pageColGridPane); pagecon.add(pageColGridPane);
pageColGridPane.add(freezePageColPane); pageColGridPane.add(freezePageColPane);
} }
@ -176,7 +206,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
/** /**
* 填报冻结Pane * 填报冻结Pane
*/ */
private JPanel initWriteFrozenPane() { protected JPanel initWriteFrozenPane() {
JPanel writePanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel writePanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
// 填报冻结 // 填报冻结
UILabel writeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Face_Write_Frozen") + ":"); UILabel writeLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Face_Write_Frozen") + ":");
@ -209,13 +239,18 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
JPanel cenrepeatPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel cenrepeatPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
outrepeatPanel.add(cenrepeatPanel); outrepeatPanel.add(cenrepeatPanel);
JPanel outfreezePanel = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Frozen")); JPanel outfreezePanel = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Frozen"));
this.add(outrepeatPanel, BorderLayout.NORTH); JPanel pagePanel = new JPanel(FRGUIPaneFactory.createBorderLayout());
this.add(outfreezePanel, BorderLayout.CENTER); JPanel repeatHeadPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
JPanel repeatPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1); JPanel repeatFootPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
repeatPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0)); tabbedPane = new UITabbedPane();
JPanel freezePanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
//添加上方的边界线
outfreezePanel.add(freezePanel); addBorder(repeatHeadPanel, REPEAT_AND_FROZEN_HEAD);
addBorder(repeatFootPanel, REPEAT_AND_FROZEN_FOOT);
pagePanel.add(outrepeatPanel, BorderLayout.NORTH);
pagePanel.add(outfreezePanel, BorderLayout.CENTER);
// 重复打印部分 // 重复打印部分
// 重复打印标题的起始行 // 重复打印标题的起始行
JPanel labelPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel labelPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
@ -223,17 +258,24 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
UILabel warning = new UILabel("(" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_FreezeWarning") + ")"); UILabel warning = new UILabel("(" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_FreezeWarning") + ")");
warning.setForeground(Color.red); warning.setForeground(Color.red);
labelPanel.add(warning); labelPanel.add(warning);
cenrepeatPanel.add(labelPanel, BorderLayout.NORTH); cenrepeatPanel.add(repeatHeadPanel, BorderLayout.NORTH);
cenrepeatPanel.add(repeatPanel, BorderLayout.CENTER); cenrepeatPanel.add(repeatFootPanel, BorderLayout.CENTER);
repeatPanel.add(initRowStartPane()); repeatHeadPanel.add(initRowStartPane());
addColStart(repeatPanel); addColStart(repeatHeadPanel);
repeatPanel.add(initFootRowStarPane()); repeatFootPanel.add(initFootRowStarPane());
addFootColStart(repeatPanel); addFootColStart(repeatFootPanel);
freezePanel.add(initPageFrozenPane(), BorderLayout.NORTH);
addWriteFrozen(freezePanel);
outfreezePanel.add(initPageFrozenPane(), BorderLayout.NORTH);
outfreezePanel.add(initPageFrozenFootPane(),BorderLayout.CENTER);
outfreezePanel.add(new UILabel("<html><font color=gray>&nbsp"+ Toolkit.i18nText("Fine-Design_Report_Engine_Freeze_Tip") + "</font></html>"),BorderLayout.SOUTH);
JPanel writePanel = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Frozen"));
addWriteFrozen(writePanel, pagePanel);
if (tabbedPane.getTabSize() == 0) {
this.add(pagePanel);
}
initPageRwoListener(); initPageRwoListener();
initPageColListener(); initPageColListener();
initWriteListener(); initWriteListener();
@ -253,8 +295,11 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
private void initPageRwoListener() { private void initPageRwoListener() {
repeatTitleRowPane.addListener(freezePageRowListener); repeatTitleRowPane.addListener(freezePageRowListener);
// 分页重复冻结行 repeatFinisRowPane.addListener(freezePageFootRowListener);
usePageFrozenRCheckBox.addChangeListener(usePageFrozenRListener); // 分页重复冻结标题行
usePageHeadFrozenRCheckBox.addChangeListener(usePageFrozenRListener);
//分页重复冻结结尾行
usePageFootFrozenRCheckBox.addChangeListener(freezePageFootRowListener);
//重复标题行 //重复标题行
useRepeatTitleRCheckBox.addChangeListener(useRepeatTitleRListener); useRepeatTitleRCheckBox.addChangeListener(useRepeatTitleRListener);
//重复结尾行 //重复结尾行
@ -263,16 +308,24 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
protected void initPageColListener() { protected void initPageColListener() {
repeatTitleColPane.addListener(freezePageColListener); repeatTitleColPane.addListener(freezePageColListener);
// 分页重复冻结列 repeatFinisColPane.addListener(freezePageFootColListener);
usePageFrozenCCheckBox.addChangeListener(usePageFrozenCListener); // 分页重复冻结标题列
usePageHeadFrozenCCheckBox.addChangeListener(usePageFrozenCListener);
//分页重复冻结结尾列
usePageFootFrozenCCheckBox.addChangeListener(freezePageFootColListener);
//重复标题列 //重复标题列
useRepeatTitleCCheckBox.addChangeListener(useRepeatTitleCListener); useRepeatTitleCCheckBox.addChangeListener(useRepeatTitleCListener);
//重复结尾列 //重复结尾列
useRepeatFinisCCheckBox.addChangeListener(useRepeatFinisCListener); useRepeatFinisCCheckBox.addChangeListener(useRepeatFinisCListener);
} }
protected void addWriteFrozen(JPanel freezePanel) { protected void addWriteFrozen(JPanel freezePanel, JPanel pagePanel) {
freezePanel.add(initWriteFrozenPane(), BorderLayout.CENTER); freezePanel.add(initWriteFrozenPane(), BorderLayout.CENTER);
tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_M_Page_Preview"), pagePanel);
tabbedPane.addTab(Toolkit.i18nText("Fine-Design_Basic_M_Write_Preview"), freezePanel);
//去除对应的焦点虚线边框
tabbedPane.setFocusable(false);
this.add(tabbedPane);
} }
protected void addFootColStart(JPanel repeatPanel) { protected void addFootColStart(JPanel repeatPanel) {
@ -287,7 +340,14 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
repeatFinisColPane.setEnabled(useRepeatFinisCCheckBox.isSelected()); boolean flag = useRepeatFinisCCheckBox.isSelected();
repeatFinisColPane.setEnabled(flag);
if (!flag) {
usePageFootFrozenCCheckBox.setSelected(false);
usePageFootFrozenCCheckBox.setEnabled(false);
} else {
usePageFootFrozenCCheckBox.setEnabled(true);
}
} }
}; };
@ -296,8 +356,14 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
repeatFinisRowPane.setEnabled(useRepeatFinisRCheckBox.isSelected()); boolean flag = useRepeatFinisRCheckBox.isSelected();
repeatFinisRowPane.setEnabled(flag);
if (!flag) {
usePageFootFrozenRCheckBox.setSelected(false);
usePageFootFrozenRCheckBox.setEnabled(false);
} else {
usePageFootFrozenRCheckBox.setEnabled(true);
}
} }
}; };
@ -308,10 +374,10 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
boolean flag = useRepeatTitleCCheckBox.isSelected(); boolean flag = useRepeatTitleCCheckBox.isSelected();
repeatTitleColPane.setEnabled(flag); repeatTitleColPane.setEnabled(flag);
if (!flag) { if (!flag) {
usePageFrozenCCheckBox.setSelected(false); usePageHeadFrozenCCheckBox.setSelected(false);
usePageFrozenCCheckBox.setEnabled(false); usePageHeadFrozenCCheckBox.setEnabled(false);
} else { } else {
usePageFrozenCCheckBox.setEnabled(true); usePageHeadFrozenCCheckBox.setEnabled(true);
} }
} }
}; };
@ -323,10 +389,10 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
boolean flag = useRepeatTitleRCheckBox.isSelected(); boolean flag = useRepeatTitleRCheckBox.isSelected();
repeatTitleRowPane.setEnabled(flag); repeatTitleRowPane.setEnabled(flag);
if (!flag) { if (!flag) {
usePageFrozenRCheckBox.setSelected(false); usePageHeadFrozenRCheckBox.setSelected(false);
usePageFrozenRCheckBox.setEnabled(false); usePageHeadFrozenRCheckBox.setEnabled(false);
} else { } else {
usePageFrozenRCheckBox.setEnabled(true); usePageHeadFrozenRCheckBox.setEnabled(true);
} }
} }
}; };
@ -352,14 +418,14 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
ChangeListener usePageFrozenCListener = new ChangeListener() { ChangeListener usePageFrozenCListener = new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
freezePageColPane.setEnabled(usePageFrozenCCheckBox.isSelected()); freezePageColPane.setEnabled(usePageHeadFrozenCCheckBox.isSelected());
} }
}; };
ChangeListener usePageFrozenRListener = new ChangeListener() { ChangeListener usePageFrozenRListener = new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
freezePageRowPane.setEnabled(usePageFrozenRCheckBox.isSelected()); freezePageRowPane.setEnabled(usePageHeadFrozenRCheckBox.isSelected());
} }
}; };
@ -383,6 +449,28 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
} }
}; };
// 分页重复冻结列数据联动(结尾行)
ChangeListener freezePageFootRowListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
FT ft = repeatFinisRowPane.updateBean();
int to = ft.getTo();
int maxFrom = Math.max(ft.getFrom(), -1);
freezeFootRowPane.populateBean(new FT(maxFrom, Math.max(maxFrom, to)));
}
};
// 分页重复冻结列数据联动(结尾列)
ChangeListener freezePageFootColListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
FT ft = repeatFinisColPane.updateBean();
int to = ft.getTo();
int maxFrom = Math.max(ft.getFrom(), -1);
freezeFootColPane.populateBean(new FT(maxFrom, Math.max(maxFrom, to)));
}
};
/** /**
* 窗口标题 * 窗口标题
* *
@ -407,7 +495,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
if (isDefalut(ft)) { if (isDefalut(ft)) {
this.repeatTitleRowPane.populateBean(defaultFT); this.repeatTitleRowPane.populateBean(defaultFT);
this.repeatTitleRowPane.setEnabled(false); this.repeatTitleRowPane.setEnabled(false);
usePageFrozenRCheckBox.setEnabled(false); usePageHeadFrozenRCheckBox.setEnabled(false);
} else { } else {
this.repeatTitleRowPane.populateBean(ft); this.repeatTitleRowPane.populateBean(ft);
useRepeatTitleRCheckBox.setSelected(true); useRepeatTitleRCheckBox.setSelected(true);
@ -418,12 +506,14 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
this.repeatFinisRowPane.populateBean(defaultFT); this.repeatFinisRowPane.populateBean(defaultFT);
this.repeatFinisRowPane.setEnabled(false); this.repeatFinisRowPane.setEnabled(false);
useRepeatFinisRCheckBox.setSelected(false); useRepeatFinisRCheckBox.setSelected(false);
usePageFootFrozenRCheckBox.setEnabled(false);
} else { } else {
this.repeatFinisRowPane.populateBean(ft); this.repeatFinisRowPane.populateBean(ft);
useRepeatFinisRCheckBox.setSelected(true); useRepeatFinisRCheckBox.setSelected(true);
} }
this.usePageFrozenRCheckBox.setSelected(attribute.isUsePageFrozenRow()); this.usePageHeadFrozenRCheckBox.setSelected(attribute.isUsePageFrozenRow());
this.usePageFootFrozenRCheckBox.setSelected(attribute.isUsePageFootRowFrozen());
this.freezePageRowPane.setEnabled(attribute.isUsePageFrozenRow()); this.freezePageRowPane.setEnabled(attribute.isUsePageFrozenRow());
} }
@ -432,7 +522,7 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
if (isDefalut(ft)) { if (isDefalut(ft)) {
this.repeatTitleColPane.populateBean(defaultFT); this.repeatTitleColPane.populateBean(defaultFT);
this.repeatTitleColPane.setEnabled(false); this.repeatTitleColPane.setEnabled(false);
usePageFrozenCCheckBox.setEnabled(false); usePageHeadFrozenCCheckBox.setEnabled(false);
} else { } else {
this.repeatTitleColPane.populateBean(ft); this.repeatTitleColPane.populateBean(ft);
useRepeatTitleCCheckBox.setSelected(true); useRepeatTitleCCheckBox.setSelected(true);
@ -443,12 +533,14 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
this.repeatFinisColPane.populateBean(defaultFT); this.repeatFinisColPane.populateBean(defaultFT);
this.repeatFinisColPane.setEnabled(false); this.repeatFinisColPane.setEnabled(false);
useRepeatFinisCCheckBox.setSelected(false); useRepeatFinisCCheckBox.setSelected(false);
usePageFootFrozenCCheckBox.setEnabled(false);
} else { } else {
this.repeatFinisColPane.populateBean(ft); this.repeatFinisColPane.populateBean(ft);
useRepeatFinisCCheckBox.setSelected(true); useRepeatFinisCCheckBox.setSelected(true);
} }
this.usePageFrozenCCheckBox.setSelected(attribute.isUsePageFrozenColumn()); this.usePageHeadFrozenCCheckBox.setSelected(attribute.isUsePageFrozenColumn());
this.usePageFootFrozenCCheckBox.setSelected(attribute.isUsePageFootColFrozen());
this.freezePageColPane.setEnabled(attribute.isUsePageFrozenColumn()); this.freezePageColPane.setEnabled(attribute.isUsePageFrozenColumn());
} }
@ -491,9 +583,64 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
updateRowPane(attribute); updateRowPane(attribute);
updateColPane(attribute); updateColPane(attribute);
//单独将重复、分页、填报处理一下,原先的判断逻辑比较混乱,抽出来方便判断
updateUseAttr(attribute);
return attribute; return attribute;
} }
private void updateUseAttr(ReportPageAttrProvider attribute) {
attribute.setUseRepeat(isUseRepeat());
attribute.setUsePageFrozen(isUsePageFrozen());
attribute.setUseWriteFrozen(isUseWriteFrozen());
}
/**
* 是否使用填报冻结
*
* @return 使用则返回true
*/
private boolean isUseWriteFrozen() {
return this.useWriteFrozenCCheckBox.isSelected()
|| this.useWriteFrozenRCheckBox.isSelected();
}
/**
* 是否使用分页冻结
*
* @return 使用则返回true
*/
private boolean isUsePageFrozen() {
return this.usePageHeadFrozenRCheckBox.isSelected()
|| this.usePageHeadFrozenCCheckBox.isSelected()
|| this.usePageFootFrozenRCheckBox.isSelected()
|| this.usePageFootFrozenCCheckBox.isSelected();
}
/**
* 是否使用重复
*
* @return 使用返回true
*/
private boolean isUseRepeat() {
return this.useRepeatTitleRCheckBox.isSelected()
|| this.useRepeatFinisRCheckBox.isSelected()
|| this.useRepeatTitleCCheckBox.isSelected()
|| this.useRepeatFinisCCheckBox.isSelected();
}
/**
* 给内部的重复与冻结选项添加指定的边框
*
* @param jPanel 重复或冻结对应的界面
* @param title 边框的文字
*/
public static void addBorder(JPanel jPanel, String title) {
jPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createMatteBorder(1,0,0,0, UIConstants.TITLED_BORDER_COLOR), title));
jPanel.setPreferredSize(new Dimension(REPEAT_AND_FROZEN_WIDTH,REPEAT_AND_FROZEN_HEIGHT));
}
protected void updateRowPane(ReportPageAttrProvider attribute) { protected void updateRowPane(ReportPageAttrProvider attribute) {
// 重复标题行 // 重复标题行
int titleFrom = valid(useRepeatTitleRCheckBox, this.repeatTitleRowPane.updateBean().getFrom()); int titleFrom = valid(useRepeatTitleRCheckBox, this.repeatTitleRowPane.updateBean().getFrom());
@ -506,7 +653,10 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
attribute.setRepeatFooterRowFrom(finishFrom); attribute.setRepeatFooterRowFrom(finishFrom);
attribute.setRepeatFooterRowTo(finishTo); attribute.setRepeatFooterRowTo(finishTo);
attribute.setUsePageFrozenRow(this.usePageFrozenRCheckBox.isSelected()); attribute.setUsePageFrozenRow(this.usePageHeadFrozenRCheckBox.isSelected());
attribute.setUsePageFootFrozen(this.usePageFootFrozenRCheckBox.isSelected() || this.usePageFootFrozenCCheckBox.isSelected());
attribute.setUsePageFootRowFrozen(this.usePageFootFrozenRCheckBox.isSelected());
} }
private int valid(UICheckBox checkBox, int num) { private int valid(UICheckBox checkBox, int num) {
@ -524,7 +674,10 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
attribute.setRepeatFooterColumnFrom(finishFrom); attribute.setRepeatFooterColumnFrom(finishFrom);
attribute.setRepeatFooterColumnTo(finishTo); attribute.setRepeatFooterColumnTo(finishTo);
attribute.setUsePageFrozenColumn(this.usePageFrozenCCheckBox.isSelected()); attribute.setUsePageFrozenColumn(this.usePageHeadFrozenCCheckBox.isSelected());
attribute.setUsePageFootFrozen(this.usePageFootFrozenRCheckBox.isSelected() || this.usePageFootFrozenCCheckBox.isSelected());
attribute.setUsePageFootColFrozen(this.usePageFootFrozenCCheckBox.isSelected());
} }
/** /**

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

@ -368,7 +368,7 @@ public class MainDesigner extends BaseDesigner {
@Override @Override
protected void upButtonClickEvent() { protected void upButtonClickEvent() {
JTemplate<?, ?> jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); JTemplate<?, ?> jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jt == null) { if (jt == null || jt.isSaving()) {
return; return;
} }
WebPreviewUtils.preview(jt); WebPreviewUtils.preview(jt);

Loading…
Cancel
Save