Browse Source

Merge branch 'release/11.0' of ssh://code.fineres.com:7999/~wei/design into release/11.0

release/11.0
WeiYanglu 2 years ago
parent
commit
e76a6606f8
  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. 3
      designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java
  4. 13
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  5. 11
      designer-base/src/main/java/com/fr/design/extra/PluginUtils.java
  6. 5
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java
  7. 98
      designer-base/src/main/java/com/fr/design/gui/controlpane/UIControlPane.java
  8. 10
      designer-base/src/main/java/com/fr/design/gui/ispinner/UISpinner.java
  9. 9
      designer-base/src/main/java/com/fr/design/javascript/JSContentPane.java
  10. 13
      designer-base/src/main/java/com/fr/design/javascript/JavaScriptImplPane.java
  11. 10
      designer-base/src/main/java/com/fr/design/mainframe/JNullTemplate.java
  12. 30
      designer-base/src/main/java/com/fr/design/mainframe/platform/ServicePlatformAction.java
  13. 7
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDock.java
  14. 3
      designer-base/src/main/resources/com/fr/design/images/platform/platform_normal.svg
  15. 4
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java
  16. 12
      designer-chart/src/main/java/com/fr/van/chart/custom/component/VanChartHyperLinkPane.java
  17. 1
      designer-form/src/main/java/com/fr/design/designer/creator/XElementCase.java
  18. 11
      designer-realize/src/main/java/com/fr/design/condition/HyperlinkPane.java
  19. 67
      designer-realize/src/main/java/com/fr/design/mainframe/form/FormElementCaseDesigner.java
  20. 2
      designer-realize/src/main/java/com/fr/design/report/freeze/FormECRepeatAndFreezeSettingPane.java
  21. 25
      designer-realize/src/main/java/com/fr/design/report/freeze/FreezeAndRepeatPane.java
  22. 37
      designer-realize/src/main/java/com/fr/design/report/freeze/FreezePagePane.java
  23. 213
      designer-realize/src/main/java/com/fr/design/report/freeze/RepeatAndFreezeSettingPane.java
  24. 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) {
Iterator<String> it = this.getBook().getTableDataNameIterator();
List<String> names = new ArrayList<>();
try {
// 清空下缓存
tableDataParametersMap.clear();
List<TableData> tableDatas = new ArrayList<>();
while (it.hasNext()) {
String name = it.next();
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) {
ParameterApplyHelper.addPara2Map(map, parameterProviders, filter, null, ParameterSource.DEFAULT_SOURCE);
} else {
ParameterApplyHelper.addPara2Map(map, parameterProviders, null, ParameterSource.TEMPLATE_SOURCE);
}
tableDataParametersMap.put(name, parameterProviders);
tableDataParametersMap.put(names.get(i), parameterProviders);
}
} 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)) {
return;
}
boxCenterAlignmentPane = new BoxCenterAligmentPane("QQ: " + CloudCenter.getInstance().acquireUrlByKind("help.qq"));
contentPane.add(boxCenterAlignmentPane);
JPanel servicePlatformPane = getURLActionPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Service_Platform"), CloudCenter.getInstance().acquireUrlByKind("service.platform"));
contentPane.add(servicePlatformPane);
}
// 是否显示鸣谢面板

3
designer-base/src/main/java/com/fr/design/carton/EventDispatchThreadHangMonitor.java

@ -1,6 +1,7 @@
package com.fr.design.carton;
import com.fr.concurrent.FineExecutors;
import com.fr.design.ui.util.UIUtil;
import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.ArrayUtils;
@ -314,7 +315,7 @@ public final class EventDispatchThreadHangMonitor extends EventQueue {
* 将swing中默认的EventQueue换成自己的
*/
public static void initMonitoring() {
Toolkit.getDefaultToolkit().getSystemEventQueue().push(INSTANCE);
UIUtil.invokeLaterIfNeeded(() -> Toolkit.getDefaultToolkit().getSystemEventQueue().push(INSTANCE));
}
/**

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

@ -209,7 +209,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
* @return
*/
private boolean needUpdate0(Connection origin, Connection connection) {
return !connection.equals(origin) || !isEmbedConnection(connection);
return !connection.equals(origin) || !isEmbedConnection(connection);
}
/**
@ -257,12 +257,21 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
}
private boolean saveByOldWay(List<String> removedConnNames, List<ConnectionBean> addedOrUpdatedConnections) {
final int remaining = ConnectionConfig.getInstance().getRemainingCon(removedConnNames.size(), addedOrUpdatedConnections.size());
try {
return Configurations.modify(new WorkerFacade(ConnectionConfig.class) {
@Override
public void run() {
removedConnNames.forEach(n -> ConnectionConfig.getInstance().removeConnection(n));
addedOrUpdatedConnections.forEach(cb -> ConnectionConfig.getInstance().addConnection(cb.getName(), cb.getConnection()));
int innerRemaining = remaining;
for (ConnectionBean cb : addedOrUpdatedConnections) {
if (innerRemaining > 0) {
ConnectionConfig.getInstance().addConnectionWithoutCheck(cb.getName(), cb.getConnection());
innerRemaining--;
} else {
break;
}
}
}
});
} catch (Exception e) {

11
designer-base/src/main/java/com/fr/design/extra/PluginUtils.java

@ -10,8 +10,8 @@ import com.fr.json.JSONObject;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.PluginVerifyException;
import com.fr.plugin.basic.version.Version;
import com.fr.plugin.basic.version.VersionIntervalType;
import com.fr.plugin.basic.version.VersionIntervalFactory;
import com.fr.plugin.basic.version.VersionIntervalType;
import com.fr.plugin.context.PluginContext;
import com.fr.plugin.context.PluginMarker;
import com.fr.plugin.error.PluginBaseErrorCode;
@ -23,7 +23,7 @@ import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.JOptionPane;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@ -47,9 +47,10 @@ public class PluginUtils {
public static PluginMarker createPluginMarker(String pluginInfo) {
//todo 判空
String[] plugin = pluginInfo.split("_");
return PluginMarker.create(plugin[0], plugin[1]);
int splitIndex = pluginInfo.lastIndexOf("_");
String pluginID = pluginInfo.substring(0, splitIndex);
String version = pluginInfo.substring(splitIndex + 1);
return PluginMarker.create(pluginID, version);
}
public static JSONObject getLatestPluginInfo(String pluginID) throws Exception {

5
designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

@ -156,6 +156,8 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
private DefaultCompletionProvider completionProvider;
private static final Map<String, String> PARAM_PREFIX_MAP = new HashMap<>();
public static final int DESCRIPTION_TEXT_AREA_ROW = 16, DESCRIPTION_TEXT_AREA_COLUMN = 27;
public FormulaPane() {
initComponents();
}
@ -1194,8 +1196,7 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
private void initDescriptionTextArea() {
// Description
descriptionTextArea = new UITextArea();
descriptionTextArea = new UITextArea(DESCRIPTION_TEXT_AREA_ROW,DESCRIPTION_TEXT_AREA_COLUMN);
descriptionTextArea.setBackground(Color.white);
descriptionTextArea.setLineWrap(true);
descriptionTextArea.setWrapStyleWord(true);

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.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Graphics2D;
@ -241,51 +240,12 @@ public abstract class UIControlPane extends JControlPane {
}
private void hideDialog() {
// 检查是否有子弹窗,如果有,则不隐藏
for (Window window : getOwnedWindows()) {
if (window.isVisible()) {
return;
}
}
// 如果有可见模态对话框,则不隐藏
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;
if (needToHidePopupEditDialog()) {
saveSettings();
setVisible(false);
PopupDialogSaveAction saveAction = OSSupportCenter.getAction(PopupDialogSaveAction.class);
saveAction.unregister();
}
saveSettings();
setVisible(false);
PopupDialogSaveAction saveAction = OSSupportCenter.getAction(PopupDialogSaveAction.class);
saveAction.unregister();
}
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 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);
}
/**
* 设置最小值
*
* @param minValue 最小值
*/
public void setMinValue(double minValue) {
this.minValue = minValue;
textField.setMinValue(minValue);
}
private void componentInitListeners() {
preButton.addActionListener(new ActionListener() {
@Override

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.mainframe.DesignerContext;
import com.fr.general.IOUtils;
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.Cursor;
import java.awt.Dimension;
@ -36,10 +39,6 @@ import java.awt.event.FocusListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
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 {
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.scrollruler.ModLineBorder;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.js.JavaScriptImpl;
import com.fr.stable.ParameterProvider;
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.JPanel;
import javax.swing.event.TableModelEvent;
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.HashSet;
import java.util.List;
@ -149,8 +146,6 @@ public class JavaScriptImplPane extends AbstractHyperLinkPane<JavaScriptImpl> {
return importedJsPane;
}
/**
* 参数改变
*

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

@ -204,4 +204,14 @@ public class JNullTemplate extends JTemplate {
public int getToolBarHeight() {
return 0;
}
@Override
public String getPath() {
return null;
}
@Override
public void refreshToolArea() {
DesignerContext.getDesignerFrame().resetToolkitByPlus(this);
}
}

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");
}
@Override
public void actionPerformed(ActionEvent e) {
BrowseUtils.browser(CloudCenter.getInstance().acquireUrlByKind("service.platform"));
}
}

7
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.mainframe.JTemplate;
import com.fr.design.mainframe.ToolBarNewTemplatePane;
import com.fr.design.mainframe.platform.ServicePlatformAction;
import com.fr.design.menu.MenuDef;
import com.fr.design.menu.SeparatorDef;
import com.fr.design.menu.ShortCut;
@ -571,9 +572,11 @@ public abstract class ToolBarMenuDock {
if (AlphaFineConfigManager.isALPHALicAvailable()) {
shortCuts.add(new AlphaFineAction());
}
shortCuts.add(new EnvDetectorAction());
//服务平台
shortCuts.add(new ServicePlatformAction());
shortCuts.add(SeparatorDef.DEFAULT);
if (DesignerEnvManager.getEnvManager().isOpenDebug()) {
OSSupportCenter.buildAction(objects -> shortCuts.add(new FineUIAction()), SupportOSImpl.FINEUI);

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

4
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/SeriesNameUseFieldNamePane.java

@ -161,7 +161,9 @@ public class SeriesNameUseFieldNamePane extends FurtherBasicBeanPane<ChartCollec
public void clearAllBoxList(){
field.clear();
seriesDataPane.getTable().clear();
seriesDataPane.getTable().updateUI();
seriesDataPane.validate();
seriesDataPane.repaint();
seriesDataPane.revalidate();
}
private void fireStop() {

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.van.chart.designer.component.VanChartUIListControlPane;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
@ -186,6 +188,16 @@ public class VanChartHyperLinkPane extends VanChartUIListControlPane {
}
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();
}

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) {
super(widget, initSize);
widget.getElementCaseImage().adjustImageSize(initSize.width, initSize.height, false);
}
protected void initXCreatorProperties() {

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.mainframe.DesignerContext;
import com.fr.design.mainframe.HyperlinkGroupPaneActionImpl;
import com.fr.js.*;
import com.fr.js.EmailJavaScript;
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.HyperlinkHighlightAction;
import javax.swing.*;
import javax.swing.SwingUtilities;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -47,6 +51,7 @@ public class HyperlinkPane extends ConditionAttrSingleConditionPane<HighlightAct
setText();
}
});
dialog.setModal(false);
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;
import com.fr.base.DynamicUnitList;
import com.fr.base.GraphHelper;
import com.fr.base.TRL;
import com.fr.base.vcs.DesignerMode;
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.main.Form;
import com.fr.grid.Grid;
import com.fr.grid.GridUtils;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.log.FineLoggerFactory;
import com.fr.report.ReportHelper;
import com.fr.report.cell.CellElement;
import com.fr.report.elementcase.ElementCase;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.worksheet.FormElementCase;
import com.fr.report.worksheet.WorkSheet;
@ -132,16 +137,23 @@ public class FormElementCaseDesigner
}
/**
* 获取当前ElementCase的缩略图
* 获取当前ElementCase的缩略图 缩略图中包含所有有内容的单元格
*
* @param size 缩略图的大小
*/
@Override
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;
try {
int width = size.width;
int height = size.height;
int width = Math.max(grid.getWidth(), size.width);
int height = Math.max(grid.getHeight(), size.width);
// 使用TYPE_INT_RGB和new Color(255, 255, 255, 1)设置有透明背景buffer image,
// 使得创建出来的透明像素是(255, 255, 255, 1),而不是(0, 0, 0, 0)
@ -157,20 +169,16 @@ public class FormElementCaseDesigner
// 使得创建出来的透明像素是(255, 255, 255, 1),而不是(0, 0, 0, 0)
// 这样不支持透明通道缩略图的旧设计器打开新设计器创建的模版时,就不会创建出拥有黑色背景的缩略图
g2d.setColor(new Color(255, 255, 255, 1));
g2d.fillRect(0, 0, (int) size.getWidth(), (int) size.getHeight());
Grid grid = this.elementCasePane != null ? this.elementCasePane.getGrid() : null;
if (grid != null) {
resetGrid(grid);
boolean oldTranslucent = grid.isTranslucent();
boolean oldShowExtraGridLine = grid.isShowExtraGridLine();
// 截缩图图时grid需支持半透明,不能用默认白色填充画布,否则会遮挡组件样式背景
grid.setTranslucent(true);
grid.setShowExtraGridLine(false);
grid.paint(g2d);
grid.setTranslucent(oldTranslucent);
grid.setShowExtraGridLine(oldShowExtraGridLine);
}
g2d.fillRect(0, 0, width, height);
boolean oldTranslucent = grid.isTranslucent();
boolean oldShowExtraGridLine = grid.isShowExtraGridLine();
// 截缩图图时grid需支持半透明,不能用默认白色填充画布,否则会遮挡组件样式背景
grid.setTranslucent(true);
grid.setShowExtraGridLine(false);
grid.paint(g2d);
grid.setTranslucent(oldTranslucent);
grid.setShowExtraGridLine(oldShowExtraGridLine);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
@ -180,12 +188,33 @@ public class FormElementCaseDesigner
}
private void resetGrid(Grid grid) {
grid.setResolution(Constants.DEFAULT_WEBWRITE_AND_SCREEN_RESOLUTION);
grid.updateUI();
grid.setAdsorbHeight(0);
grid.setAdsorbWidth(0);
grid.setVerticalValue(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();
}
/**

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

@ -28,7 +28,7 @@ public class FormECRepeatAndFreezeSettingPane extends RepeatAndFreezeSettingPane
}
protected void addWriteFrozen(JPanel freezePanel) {
protected void addWriteFrozen(JPanel freezePanel, JPanel pagePanel) {
}

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 javax.swing.JComponent;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ispinner.UISpinner;
@ -27,9 +29,21 @@ public abstract class FreezeAndRepeatPane extends BasicBeanPane<FT> {
Dimension size = new Dimension(43, 21);
if (start instanceof UISpinner) {
start.setPreferredSize(size);
((UISpinner) start).addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
updateEndValue();
}
});
}
if (end instanceof UISpinner) {
end.setPreferredSize(size);
((UISpinner) end).addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
updateEndValue();
}
});
}
this.setLayout(FRGUIPaneFactory.createBoxFlowLayout());
this.add(start);
@ -63,9 +77,20 @@ public abstract class FreezeAndRepeatPane extends BasicBeanPane<FT> {
* 给UISpinner添加Listener
*/
public void addListener(ChangeListener l) {
if (start instanceof UISpinner) {
((UISpinner) start).addChangeListener(l);
}
if (end instanceof UISpinner) {
((UISpinner) end).addChangeListener(l);
}
}
private void updateEndValue() {
if (end 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 com.fr.design.i18n.Toolkit;
import com.fr.stable.FT;
import com.fr.stable.StableUtils;
public class FreezePagePane extends FreezeAndRepeatPane {
private boolean isNumber;
private boolean foot;
public FreezePagePane(boolean isNumber) {
this.isNumber = isNumber;
@ -17,6 +19,20 @@ public class FreezePagePane extends FreezeAndRepeatPane {
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
protected String title4PopupWindow() {
return "FreezePage";
@ -24,10 +40,18 @@ public class FreezePagePane extends FreezeAndRepeatPane {
@Override
public void populateBean(FT ob) {
if (isNumber) {
((UILabel) end).setText(String.valueOf(ob.getTo() + 1)+com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Row"));
if (foot) {
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 {
((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
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");
}
}
}

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

@ -1,11 +1,14 @@
package com.fr.design.report.freeze;
import com.fr.base.FRContext;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
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.ilable.ActionLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.page.ReportPageAttrProvider;
@ -29,6 +32,9 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
//边框高度
private static final int LABEL_HEIGHT = 45;
//tab
private UITabbedPane tabbedPane;
// 重复标题行
private RepeatRowPane repeatTitleRowPane;
// 重复标题列
@ -41,6 +47,10 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
private FreezePagePane freezePageRowPane;
// 分页冻结列
private FreezePagePane freezePageColPane;
//分页冻结结尾行
private FreezePagePane freezeFootRowPane;
//分页冻结结尾列
private FreezePagePane freezeFootColPane;
// 填报冻结行
private FreezeWriteRowPane freezeWriteRowPane;
// 填报冻结列
@ -53,12 +63,21 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
private UICheckBox useRepeatFinisCCheckBox;
// 分页冻结
private UICheckBox usePageFrozenCCheckBox;
private UICheckBox usePageFrozenRCheckBox;
private UICheckBox usePageHeadFrozenCCheckBox;
private UICheckBox usePageHeadFrozenRCheckBox;
private UICheckBox usePageFootFrozenCCheckBox;
private UICheckBox usePageFootFrozenRCheckBox;
// 填报冻结
private UICheckBox useWriteFrozenCCheckBox;
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
*/
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);
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();
pageRowGridPane.add(this.usePageFrozenRCheckBox = new UICheckBox());
pagecon.add(pageRowGridPane);
pageRowGridPane.add(this.usePageHeadFrozenRCheckBox = new UICheckBox());
// 显示行冻结信息的panel
freezePageRowPane = new FreezePagePane(true);
pageRowGridPane.add(freezePageRowPane);
pagecon.add(pageRowGridPane);
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
freezePageColPane = new FreezePagePane(false);
JPanel pageColGridPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
pageColGridPane.add(this.usePageFrozenCCheckBox = new UICheckBox());
pageColGridPane.add(this.usePageHeadFrozenCCheckBox = new UICheckBox());
pagecon.add(pageColGridPane);
pageColGridPane.add(freezePageColPane);
}
@ -209,13 +239,18 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
JPanel cenrepeatPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
outrepeatPanel.add(cenrepeatPanel);
JPanel outfreezePanel = FRGUIPaneFactory.createTitledBorderPane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Frozen"));
this.add(outrepeatPanel, BorderLayout.NORTH);
this.add(outfreezePanel, BorderLayout.CENTER);
JPanel repeatPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
repeatPanel.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
JPanel freezePanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
outfreezePanel.add(freezePanel);
JPanel pagePanel = new JPanel(FRGUIPaneFactory.createBorderLayout());
JPanel repeatHeadPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
JPanel repeatFootPanel = FRGUIPaneFactory.createNColumnGridInnerContainer_S_Pane(1);
tabbedPane = new UITabbedPane();
//添加上方的边界线
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();
@ -223,17 +258,24 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
UILabel warning = new UILabel("(" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_FreezeWarning") + ")");
warning.setForeground(Color.red);
labelPanel.add(warning);
cenrepeatPanel.add(labelPanel, BorderLayout.NORTH);
cenrepeatPanel.add(repeatPanel, BorderLayout.CENTER);
cenrepeatPanel.add(repeatHeadPanel, BorderLayout.NORTH);
cenrepeatPanel.add(repeatFootPanel, BorderLayout.CENTER);
repeatHeadPanel.add(initRowStartPane());
addColStart(repeatHeadPanel);
repeatFootPanel.add(initFootRowStarPane());
addFootColStart(repeatFootPanel);
repeatPanel.add(initRowStartPane());
addColStart(repeatPanel);
repeatPanel.add(initFootRowStarPane());
addFootColStart(repeatPanel);
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();
initPageColListener();
initWriteListener();
@ -253,8 +295,11 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
private void initPageRwoListener() {
repeatTitleRowPane.addListener(freezePageRowListener);
// 分页重复冻结行
usePageFrozenRCheckBox.addChangeListener(usePageFrozenRListener);
repeatFinisRowPane.addListener(freezePageFootRowListener);
// 分页重复冻结标题行
usePageHeadFrozenRCheckBox.addChangeListener(usePageFrozenRListener);
//分页重复冻结结尾行
usePageFootFrozenRCheckBox.addChangeListener(freezePageFootRowListener);
//重复标题行
useRepeatTitleRCheckBox.addChangeListener(useRepeatTitleRListener);
//重复结尾行
@ -263,16 +308,24 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
protected void initPageColListener() {
repeatTitleColPane.addListener(freezePageColListener);
// 分页重复冻结列
usePageFrozenCCheckBox.addChangeListener(usePageFrozenCListener);
repeatFinisColPane.addListener(freezePageFootColListener);
// 分页重复冻结标题列
usePageHeadFrozenCCheckBox.addChangeListener(usePageFrozenCListener);
//分页重复冻结结尾列
usePageFootFrozenCCheckBox.addChangeListener(freezePageFootColListener);
//重复标题列
useRepeatTitleCCheckBox.addChangeListener(useRepeatTitleCListener);
//重复结尾列
useRepeatFinisCCheckBox.addChangeListener(useRepeatFinisCListener);
}
protected void addWriteFrozen(JPanel freezePanel) {
protected void addWriteFrozen(JPanel freezePanel, JPanel pagePanel) {
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) {
@ -287,7 +340,14 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
@Override
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
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();
repeatTitleColPane.setEnabled(flag);
if (!flag) {
usePageFrozenCCheckBox.setSelected(false);
usePageFrozenCCheckBox.setEnabled(false);
usePageHeadFrozenCCheckBox.setSelected(false);
usePageHeadFrozenCCheckBox.setEnabled(false);
} else {
usePageFrozenCCheckBox.setEnabled(true);
usePageHeadFrozenCCheckBox.setEnabled(true);
}
}
};
@ -323,10 +389,10 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
boolean flag = useRepeatTitleRCheckBox.isSelected();
repeatTitleRowPane.setEnabled(flag);
if (!flag) {
usePageFrozenRCheckBox.setSelected(false);
usePageFrozenRCheckBox.setEnabled(false);
usePageHeadFrozenRCheckBox.setSelected(false);
usePageHeadFrozenRCheckBox.setEnabled(false);
} else {
usePageFrozenRCheckBox.setEnabled(true);
usePageHeadFrozenRCheckBox.setEnabled(true);
}
}
};
@ -352,14 +418,14 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
ChangeListener usePageFrozenCListener = new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
freezePageColPane.setEnabled(usePageFrozenCCheckBox.isSelected());
freezePageColPane.setEnabled(usePageHeadFrozenCCheckBox.isSelected());
}
};
ChangeListener usePageFrozenRListener = new ChangeListener() {
@Override
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,8 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
if (isDefalut(ft)) {
this.repeatTitleRowPane.populateBean(defaultFT);
this.repeatTitleRowPane.setEnabled(false);
usePageFrozenRCheckBox.setEnabled(false);
usePageHeadFrozenRCheckBox.setEnabled(false);
usePageFootFrozenRCheckBox.setEnabled(false);
} else {
this.repeatTitleRowPane.populateBean(ft);
useRepeatTitleRCheckBox.setSelected(true);
@ -423,7 +512,8 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
useRepeatFinisRCheckBox.setSelected(true);
}
this.usePageFrozenRCheckBox.setSelected(attribute.isUsePageFrozenRow());
this.usePageHeadFrozenRCheckBox.setSelected(attribute.isUsePageFrozenRow());
this.usePageFootFrozenRCheckBox.setSelected(attribute.isUsePageFootRowFrozen());
this.freezePageRowPane.setEnabled(attribute.isUsePageFrozenRow());
}
@ -432,7 +522,8 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
if (isDefalut(ft)) {
this.repeatTitleColPane.populateBean(defaultFT);
this.repeatTitleColPane.setEnabled(false);
usePageFrozenCCheckBox.setEnabled(false);
usePageHeadFrozenCCheckBox.setEnabled(false);
usePageFootFrozenCCheckBox.setEnabled(false);
} else {
this.repeatTitleColPane.populateBean(ft);
useRepeatTitleCCheckBox.setSelected(true);
@ -448,7 +539,8 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
useRepeatFinisCCheckBox.setSelected(true);
}
this.usePageFrozenCCheckBox.setSelected(attribute.isUsePageFrozenColumn());
this.usePageHeadFrozenCCheckBox.setSelected(attribute.isUsePageFrozenColumn());
this.usePageFootFrozenCCheckBox.setSelected(attribute.isUsePageFootColFrozen());
this.freezePageColPane.setEnabled(attribute.isUsePageFrozenColumn());
}
@ -494,6 +586,17 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
return attribute;
}
/**
* 给内部的重复与冻结选项添加指定的边框
*
* @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) {
// 重复标题行
int titleFrom = valid(useRepeatTitleRCheckBox, this.repeatTitleRowPane.updateBean().getFrom());
@ -506,7 +609,10 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
attribute.setRepeatFooterRowFrom(finishFrom);
attribute.setRepeatFooterRowTo(finishTo);
attribute.setUsePageFrozenRow(this.usePageFrozenRCheckBox.isSelected());
attribute.setUsePageFrozenRow(this.usePageHeadFrozenRCheckBox.isSelected() || this.usePageFootFrozenRCheckBox.isSelected());
attribute.setUsePageFootFrozen(this.usePageFootFrozenRCheckBox.isSelected() || this.usePageFootFrozenCCheckBox.isSelected());
attribute.setUsePageFootRowFrozen(this.usePageFootFrozenRCheckBox.isSelected());
}
private int valid(UICheckBox checkBox, int num) {
@ -524,7 +630,10 @@ public class RepeatAndFreezeSettingPane extends BasicPane {
attribute.setRepeatFooterColumnFrom(finishFrom);
attribute.setRepeatFooterColumnTo(finishTo);
attribute.setUsePageFrozenColumn(this.usePageFrozenCCheckBox.isSelected());
attribute.setUsePageFrozenColumn(this.usePageHeadFrozenCCheckBox.isSelected() || this.usePageFootFrozenCCheckBox.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
protected void upButtonClickEvent() {
JTemplate<?, ?> jt = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jt == null) {
if (jt == null || jt.isSaving()) {
return;
}
WebPreviewUtils.preview(jt);

Loading…
Cancel
Save