Browse Source

Merge branch 'feature/x' of ssh://code.fineres.com:7999/~fanglei/design into feature/x

* 'feature/x' of ssh://code.fineres.com:7999/~fanglei/design:
  无jira 任务,解决冲突
  无jira 合并一个打包版本
  无jira 解决冲突
  REPORT-66196 【优化大文本】新建一个设置,显示部分设置字符长度5,点击保存后,查看有问题
  REPORT-65724 安全性-水印-水印公式不解析 1.所有面板从全局读取水印
  REPORT-65778 11.0设计器单元格默认字体问题-新建报表时工具预览字体默认是字体,但在单元格里输入任意内容后,字体变成了主题默认的黑体
  REPORT-66169 mac双击模板文件时设计器无法唤起
  REPORT-65373 JDK11设计器-菜单栏-文件-选项弹窗边框被截断
  REPORT-66044 单元格复制以后,会导致两个单元格设置同一个表头区域 && REPORT-66020 点击智能框选后撤销,鼠标状态没有恢复默认 && REPORT-65994 添加排序按钮名称问题,交互确认 && REPORT-65993 表头图标颜色有问题
  CHART-22545 设计器语言英语-甘特图-标签格式-控件宽度不一致
  REPORT-65976 final同步传一份
  代码修改
  REPORT-65976 复用组件-绝对布局拖入绝对画布块的组件,绝对画布块里的子组件没有随着绝对画布块的尺寸进行缩放,比绝对画布块小;拖入到占位块里是正常充满的
  REPORT-65194 公式模拟计算计算异常的提示框内的图标不正确 1.计算异常的时候给warn图标
  Revert "REPORT-64445 新老自适应配置面板修改"
  REPORT-64445 新老自适应配置面板修改
feature/x
方磊 3 years ago
parent
commit
4b4673ceab
  1. 2
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 2
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartFormatComBoxWithCheckBox.java
  3. 1
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java
  4. 1
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java
  5. 19
      designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/PreviewWidgetBlock.java
  6. 3
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java
  7. 14
      designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRFitLayoutDefinePane.java
  8. 3
      designer-realize/src/main/java/com/fr/design/actions/utils/ReportActionUtils.java
  9. 2
      designer-realize/src/main/java/com/fr/design/deeplink/DeepLinkManager.java
  10. 14
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java
  11. 7
      designer-realize/src/main/java/com/fr/design/report/NewReportBackgroundPane.java
  12. 19
      designer-realize/src/main/java/com/fr/design/sort/common/AbstractSortGroupPane.java
  13. 2
      designer-realize/src/main/java/com/fr/design/sort/common/AbstractSortPane.java
  14. 44
      designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java
  15. 9
      designer-realize/src/main/java/com/fr/design/sort/common/SortUIExpandablePane.java
  16. 24
      designer-realize/src/main/java/com/fr/design/sort/common/SortUtils.java
  17. 61
      designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java
  18. 1
      designer-realize/src/main/java/com/fr/design/sort/header/HeaderSortRulePane.java
  19. 4
      designer-realize/src/main/java/com/fr/design/sort/header/SortHeaderPane.java

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

@ -108,7 +108,7 @@ public class PreferencePane extends BasicPane {
private static final int CACHING_DEFAULT = 5; private static final int CACHING_DEFAULT = 5;
private static final int CACHING_GAP = 5; private static final int CACHING_GAP = 5;
private static final int MEMORY_TIP_LABEL_MAX_WIDTH = 230; private static final int MEMORY_TIP_LABEL_MAX_WIDTH = 230;
private static final int OFFSET_HEIGHT = 50; private static final int OFFSET_HEIGHT = 60;
private static final String TYPE = "pressed"; private static final String TYPE = "pressed";
private static final String DISPLAY_TYPE = "+"; private static final String DISPLAY_TYPE = "+";

2
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/tooltip/VanChartFormatComBoxWithCheckBox.java

@ -53,7 +53,7 @@ public class VanChartFormatComBoxWithCheckBox extends JPanel {
} }
}); });
formatComBox.setPreferredSize(new Dimension(40, 20)); formatComBox.setPreferredSize(new Dimension(55, 20));
if (showSelectBox()) { if (showSelectBox()) {
this.add(isSelectedBox, BorderLayout.CENTER); this.add(isSelectedBox, BorderLayout.CENTER);

1
designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/LocalWidgetBlock.java

@ -250,6 +250,7 @@ public class LocalWidgetBlock extends PreviewWidgetBlock<DefaultSharableWidget>
ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Share_Drag_Error_Info")); ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Share_Drag_Error_Info"));
return null; return null;
} }
compatibleProcessAbsoluteLayoutResolution(creatorSource);
creatorSource.setWidgetID(UUID.randomUUID().toString()); creatorSource.setWidgetID(UUID.randomUUID().toString());
((AbstractBorderStyleWidget) creatorSource).addWidgetAttrMark(new SharableAttrMark(true)); ((AbstractBorderStyleWidget) creatorSource).addWidgetAttrMark(new SharableAttrMark(true));
//tab布局WCardMainBorderLayout通过反射出来的大小是960*480 //tab布局WCardMainBorderLayout通过反射出来的大小是960*480

1
designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/OnlineWidgetBlock.java

@ -194,6 +194,7 @@ public class OnlineWidgetBlock extends AbstractOnlineWidgetBlock {
ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Share_Drag_Error_Info")); ShareUIUtils.showErrorMessageDialog(Toolkit.i18nText("Fine-Design_Share_Drag_Error_Info"));
return; return;
} }
compatibleProcessAbsoluteLayoutResolution(creatorSource);
creatorSource.setWidgetID(UUID.randomUUID().toString()); creatorSource.setWidgetID(UUID.randomUUID().toString());
((AbstractBorderStyleWidget) creatorSource).addWidgetAttrMark(new SharableAttrMark(true)); ((AbstractBorderStyleWidget) creatorSource).addWidgetAttrMark(new SharableAttrMark(true));
SharableWidgetProvider bindInfo = ShareUtils.getElCaseBindInfoById(shareId); SharableWidgetProvider bindInfo = ShareUtils.getElCaseBindInfoById(shareId);

19
designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/PreviewWidgetBlock.java

@ -12,7 +12,12 @@ import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.mainframe.share.ui.online.CarouselStateManger; import com.fr.design.mainframe.share.ui.online.CarouselStateManger;
import com.fr.design.mainframe.share.ui.online.embed.AnimatePopupDialog; import com.fr.design.mainframe.share.ui.online.embed.AnimatePopupDialog;
import com.fr.design.mainframe.share.ui.online.embed.FirstDragAnimateStateManager; import com.fr.design.mainframe.share.ui.online.embed.FirstDragAnimateStateManager;
import com.fr.form.main.Form;
import com.fr.form.main.WidgetGather;
import com.fr.form.share.constants.ShareComponentConstants; import com.fr.form.share.constants.ShareComponentConstants;
import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WAbsoluteLayout;
import com.fr.general.FRScreen;
import com.fr.module.ModuleContext; import com.fr.module.ModuleContext;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
@ -285,4 +290,18 @@ public abstract class PreviewWidgetBlock<T> extends JPanel implements MouseListe
} }
protected void compatibleProcessAbsoluteLayoutResolution(Widget widget) {
Form.traversalWidget(widget, new WidgetGather() {
@Override
public void dealWith(Widget widget) {
((WAbsoluteLayout) widget).setDesigningResolution(FRScreen.p1440.getDimension());
}
@Override
public boolean dealWithAllCards() {
return true;
}
}, WAbsoluteLayout.class);
}
} }

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

@ -104,7 +104,8 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane {
themePane.supportFollowingTheme(ob.supportThemed()); themePane.supportFollowingTheme(ob.supportThemed());
themePane.setFollowingTheme(ob.isBorderStyleFollowingTheme()); themePane.setFollowingTheme(ob.isBorderStyleFollowingTheme());
stylePane.populateBean((LayoutBorderStyle) ob.getBorderStyle()); stylePane.populateBean((LayoutBorderStyle) ob.getBorderStyle());
watermarkEditor.setValue(ReportUtils.getWatermarkAttrFromTemplate(getCurrentIOFile())); //从全局读取水印
watermarkEditor.setValue(ReportUtils.getWatermarkAttrFromTemplateAndGlobal(getCurrentIOFile()));
} }
public WAbsoluteBodyLayout updateSubPane() { public WAbsoluteBodyLayout updateSubPane() {

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

@ -34,8 +34,15 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.act.BorderPacker; import com.fr.general.act.BorderPacker;
import com.fr.report.core.ReportUtils; import com.fr.report.core.ReportUtils;
import javax.swing.*; import javax.swing.BorderFactory;
import java.awt.*; import javax.swing.DefaultComboBoxModel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Rectangle;
/** /**
* Created by ibm on 2017/8/2. * Created by ibm on 2017/8/2.
@ -169,7 +176,8 @@ public class FRFitLayoutDefinePane extends AbstractFRLayoutDefinePane<WFitLayout
themePane.supportFollowingTheme(ob.supportThemed()); themePane.supportFollowingTheme(ob.supportThemed());
themePane.setFollowingTheme(ob.isBorderStyleFollowingTheme()); themePane.setFollowingTheme(ob.isBorderStyleFollowingTheme());
stylePane.populateBean((LayoutBorderStyle) ob.getBorderStyle()); stylePane.populateBean((LayoutBorderStyle) ob.getBorderStyle());
watermarkEditor.setValue(ReportUtils.getWatermarkAttrFromTemplate(getCurrentIOFile())); //从全局读取水印
watermarkEditor.setValue(ReportUtils.getWatermarkAttrFromTemplateAndGlobal(getCurrentIOFile()));
} }
private XLayoutContainer selectedBodyLayout(FormDesigner formDesigner) { private XLayoutContainer selectedBodyLayout(FormDesigner formDesigner) {

3
designer-realize/src/main/java/com/fr/design/actions/utils/ReportActionUtils.java

@ -114,7 +114,8 @@ public class ReportActionUtils {
CellElement editCellElement = report.getCellElement(((CellSelection) sel).getColumn(), ((CellSelection) sel).getRow()); CellElement editCellElement = report.getCellElement(((CellSelection) sel).getColumn(), ((CellSelection) sel).getRow());
if (editCellElement == null) { if (editCellElement == null) {
return AdjustWorkBookDefaultStyleUtils.adjustCellElement(Style.DEFAULT_STYLE); editCellElement = DefaultThemedTemplateCellElementCase.createInstance();
AdjustWorkBookDefaultStyleUtils.adjustCellElement(editCellElement);
} }
//peter:直接返回当前编辑元素的Style //peter:直接返回当前编辑元素的Style

2
designer-realize/src/main/java/com/fr/design/deeplink/DeepLinkManager.java

@ -138,7 +138,7 @@ public class DeepLinkManager {
public String[] createNewArgs(String[] args) { public String[] createNewArgs(String[] args) {
String filePath = this.pendingURL; String filePath = this.pendingURL;
if (OperatingSystem.isMacos() && StringUtils.isNotEmpty(filePath) && new File(filePath).exists()) { if (OperatingSystem.isMacos() && StringUtils.isNotEmpty(filePath) && new File(filePath).exists()) {
List<String> argList = Arrays.asList(args); List<String> argList = new ArrayList<>(Arrays.asList(args));
argList.add(filePath); argList.add(filePath);
markPendingURLConsumed(); markPendingURLConsumed();
return argList.toArray(new String[]{}); return argList.toArray(new String[]{});

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

@ -318,16 +318,14 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
public void itemStateChanged(ItemEvent e) { public void itemStateChanged(ItemEvent e) {
textOverflowComPane.setVisible(e.getStateChange() == ItemEvent.SELECTED); textOverflowComPane.setVisible(e.getStateChange() == ItemEvent.SELECTED);
if (e.getStateChange() == ItemEvent.SELECTED) { if (e.getStateChange() == ItemEvent.SELECTED) {
noAutoRadioButton.setSelected(true);
textOverflowComPane.setVisible(true);
if (showPartComboBox.getSelectedIndex() == 0) { if (showPartComboBox.getSelectedIndex() == 0) {
showPartPane.setPreferredSize(new Dimension(70, 20));
showPartLayout.show(showPartPane, "content"); showPartLayout.show(showPartPane, "content");
} else { } else {
showPartLayout.show(showPartPane, "none"); showPartLayout.show(showPartPane, "none");
showPartPane.setPreferredSize(new Dimension(0, 0)); showPartPane.setPreferredSize(new Dimension(0, 0));
} }
} else { noAutoRadioButton.setSelected(true);
textOverflowComPane.setVisible(false);
} }
} }
}); });
@ -543,11 +541,10 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
if (cellGUIAttr.isHideTextWhenOverflow()) { if (cellGUIAttr.isHideTextWhenOverflow()) {
textOverflowCheckBox.setSelected(true); textOverflowCheckBox.setSelected(true);
if (cellGUIAttr.isShowCharNum()) { if (cellGUIAttr.isShowCharNum()) {
showPartLayout.show(showPartPane, "content"); showPartComboBox.setSelectedIndex(0);
showCharNums.setValue(cellGUIAttr.getShowCharNums()); showCharNums.setValue(cellGUIAttr.getShowCharNums());
} else { } else {
showPartLayout.show(showPartPane, "none"); showPartComboBox.setSelectedIndex(1);
showPartPane.setPreferredSize(new Dimension(0, 0));
} }
showPartPane.setVisible(true); showPartPane.setVisible(true);
if (cellGUIAttr.isTextOverflowEllipsis()) { if (cellGUIAttr.isTextOverflowEllipsis()) {
@ -556,6 +553,9 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
textOverflowTypeComboBox.setSelectedItem(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_NoneSymbol")); textOverflowTypeComboBox.setSelectedItem(Toolkit.i18nText("Fine-Design_Report_CellWrite_TextOverflow_NoneSymbol"));
} }
} else { } else {
showPartComboBox.setSelectedIndex(0);
showCharNums.setValue(cellGUIAttr.getShowCharNums());
textOverflowTypeComboBox.setSelectedIndex(0);
textOverflowCheckBox.setSelected(false); textOverflowCheckBox.setSelected(false);
} }
CellPageAttr cellPageAttr = cellElement.getCellPageAttr(); // 分页 CellPageAttr cellPageAttr = cellElement.getCellPageAttr(); // 分页

7
designer-realize/src/main/java/com/fr/design/report/NewReportBackgroundPane.java

@ -2,7 +2,6 @@ package com.fr.design.report;
import com.fr.base.theme.ReportTheme; import com.fr.base.theme.ReportTheme;
import com.fr.base.theme.TemplateTheme; import com.fr.base.theme.TemplateTheme;
import com.fr.base.theme.settings.ThemedComponentStyle;
import com.fr.base.theme.settings.ThemedReportBodyStyle; import com.fr.base.theme.settings.ThemedReportBodyStyle;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
@ -10,21 +9,19 @@ import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.style.ReportBackgroundSpecialPane;
import com.fr.design.gui.style.FollowingThemePane; import com.fr.design.gui.style.FollowingThemePane;
import com.fr.design.gui.style.ReportBackgroundSpecialPane;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.theme.ui.BorderUtils; import com.fr.design.mainframe.theme.ui.BorderUtils;
import com.fr.form.ui.PaddingMargin;
import com.fr.general.Background; import com.fr.general.Background;
import com.fr.page.ReportSettingsProvider; import com.fr.page.ReportSettingsProvider;
import com.fr.report.stable.ReportSettings; import com.fr.report.stable.ReportSettings;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.border.CompoundBorder; import javax.swing.border.CompoundBorder;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Color; import java.awt.Color;
@ -168,7 +165,7 @@ public class NewReportBackgroundPane extends BasicPane {
container.setBorder(BorderFactory.createEmptyBorder()); container.setBorder(BorderFactory.createEmptyBorder());
JPanel titledPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel titledPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
titledPane.setBorder(new CompoundBorder( titledPane.setBorder(new CompoundBorder(
BorderUtils.createTitleBorder("预览", 12), BorderUtils.createTitleBorder(Toolkit.i18nText("Fine-Design_Basic_Preview"), 12),
BorderFactory.createEmptyBorder(5, 5, 4, 5) BorderFactory.createEmptyBorder(5, 5, 4, 5)
)); ));
titledPane.setPreferredSize(new Dimension(377, 502)); titledPane.setPreferredSize(new Dimension(377, 502));

19
designer-realize/src/main/java/com/fr/design/sort/common/AbstractSortGroupPane.java

@ -123,11 +123,30 @@ public abstract class AbstractSortGroupPane extends JPanel implements ComponentC
} }
protected void refresh() { protected void refresh() {
freshAddSortItemBarTip();
freshSortUIExpandablePaneTip();
validate(); validate();
repaint(); repaint();
revalidate(); revalidate();
} }
void freshAddSortItemBarTip() {
if (sortUIExpandablePanes != null) {
int itemCount = sortUIExpandablePanes.size();
uiButton.setText(itemCount == 0 ? Toolkit.i18nText("Fine-Design_Sort_Add_Main_Sort") : Toolkit.i18nText("Fine-Design_Sort_Add_Second_Sort"));
}
}
void freshSortUIExpandablePaneTip() {
for (int i = 0; i < sortUIExpandablePanes.size(); i++) {
if (i == 0) {
sortUIExpandablePanes.get(i).freshHeaderPaneTip(Toolkit.i18nText("Fine-Design_Sort_Main_Sort"));
} else {
sortUIExpandablePanes.get(i).freshHeaderPaneTip(Toolkit.i18nText("Fine-Design_Sort_Second_Sort"));
}
}
}
class AddSortItemBar extends JPanel { class AddSortItemBar extends JPanel {
AbstractSortGroupPane sortGroupPane; AbstractSortGroupPane sortGroupPane;

2
designer-realize/src/main/java/com/fr/design/sort/common/AbstractSortPane.java

@ -65,7 +65,7 @@ public abstract class AbstractSortPane extends JPanel {
if (cellSortAttr != null) { if (cellSortAttr != null) {
sortHeader = cellSortAttr.getSortHeader(); sortHeader = cellSortAttr.getSortHeader();
} }
sortHeaderPane.populateBean(sortHeader, defaultHeaderArea); sortHeaderPane.populateBean(sortHeader, defaultHeaderArea, cellElement);
} }
refresh(); refresh();
} }

44
designer-realize/src/main/java/com/fr/design/sort/common/SortColumnRowPane.java

@ -50,6 +50,7 @@ public class SortColumnRowPane extends JPanel implements UIObserver {
private final static Icon DISABLED_ICON = IconUtils.readIcon("/com/fr/design/images/buttonicon/select_disabled.svg"); private final static Icon DISABLED_ICON = IconUtils.readIcon("/com/fr/design/images/buttonicon/select_disabled.svg");
private final static Icon ENABLE_ICON = IconUtils.readIcon("/com/fr/design/images/buttonicon/select_normal.svg"); private final static Icon ENABLE_ICON = IconUtils.readIcon("/com/fr/design/images/buttonicon/select_normal.svg");
private boolean enabled; private boolean enabled;
SelectActionListener selectActionListener;
HeaderAreaPane.CellSelectionManager cellSelectionManager; HeaderAreaPane.CellSelectionManager cellSelectionManager;
@ -94,7 +95,8 @@ public class SortColumnRowPane extends JPanel implements UIObserver {
void initSelectButton() { void initSelectButton() {
selectButton = new UIButton(ENABLE_ICON); selectButton = new UIButton(ENABLE_ICON);
selectButton.addMouseListener(new SelectActionListener(this)); selectActionListener = new SelectActionListener(this);
selectButton.addMouseListener(selectActionListener);
this.add(selectButton); this.add(selectButton);
} }
@ -147,6 +149,11 @@ public class SortColumnRowPane extends JPanel implements UIObserver {
return true; return true;
} }
public void cancelSelectState() {
selectActionListener.recoverSelectHeader(SortUtils.getCurrentElementCase());
}
class SelectActionListener extends MouseAdapter { class SelectActionListener extends MouseAdapter {
SortColumnRowPane columnRowPane; SortColumnRowPane columnRowPane;
ColumnRow oldColumnRow; ColumnRow oldColumnRow;
@ -161,7 +168,7 @@ public class SortColumnRowPane extends JPanel implements UIObserver {
@Override @Override
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if (enabled) { if (enabled) {
ElementCasePane elementCasePane = getCurrentElementCase(); ElementCasePane elementCasePane = SortUtils.getCurrentElementCase();
if (elementCasePane == null || isAlreadyAddListener) { if (elementCasePane == null || isAlreadyAddListener) {
return; return;
} }
@ -201,15 +208,21 @@ public class SortColumnRowPane extends JPanel implements UIObserver {
} }
columnRowPane.setColumnRow(columnRow); columnRowPane.setColumnRow(columnRow);
} }
}
recoverSelectHeader(elementCasePane);
}
private void recoverSelectHeader(ElementCasePane elementCasePane) {
if (isAlreadyAddListener) {
restoreDisableHeaderCellsStyle(elementCasePane.getEditingElementCase()); restoreDisableHeaderCellsStyle(elementCasePane.getEditingElementCase());
elementCasePane.removeSelectionChangeListener(gridSelectionChangeListener);
isAlreadyAddListener = false;
elementCasePane.getGrid().setNotShowingTableSelectPane(true);
elementCasePane.setRepeatSelection(false);
elementCasePane.setEditable(true);
elementCasePane.repaint();
oldColumnRow = null;
} }
elementCasePane.removeSelectionChangeListener(gridSelectionChangeListener);
isAlreadyAddListener = false;
elementCasePane.getGrid().setNotShowingTableSelectPane(true);
elementCasePane.setRepeatSelection(false);
elementCasePane.setEditable(true);
elementCasePane.repaint();
oldColumnRow = null;
} }
private void ashDisableHeaderCellsStyle(TemplateElementCase elementCase) { private void ashDisableHeaderCellsStyle(TemplateElementCase elementCase) {
@ -263,17 +276,4 @@ public class SortColumnRowPane extends JPanel implements UIObserver {
repaint(); repaint();
revalidate(); revalidate();
} }
public static ElementCasePane getCurrentElementCase() {
try {
TargetComponent targetComponent
= HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane();
if (targetComponent instanceof ElementCasePane) {
return (ElementCasePane) targetComponent;
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e, e.getMessage());
}
return null;
}
} }

9
designer-realize/src/main/java/com/fr/design/sort/common/SortUIExpandablePane.java

@ -63,7 +63,12 @@ public class SortUIExpandablePane extends JPanel {
headerPane.setShow(show); headerPane.setShow(show);
} }
public void freshHeaderPaneTip(String tip) {
headerPane.tipUILabel.setText(tip);
}
class HeaderPane extends JPanel implements UIObserver { class HeaderPane extends JPanel implements UIObserver {
UILabel tipUILabel;
UILabel iconUiLabel; UILabel iconUiLabel;
UILabel closeButton; UILabel closeButton;
AbstractSortGroupPane sortGroupPane; AbstractSortGroupPane sortGroupPane;
@ -78,8 +83,8 @@ public class SortUIExpandablePane extends JPanel {
private void initComponents() { private void initComponents() {
iconUiLabel = new UILabel(); iconUiLabel = new UILabel();
this.add(iconUiLabel); this.add(iconUiLabel);
UILabel uiLabel = new UILabel(Toolkit.i18nText("Fine-Design_Sort_Second_Sort")); tipUILabel = new UILabel(Toolkit.i18nText("Fine-Design_Sort_Second_Sort"));
this.add(uiLabel); this.add(tipUILabel);
this.add(AbstractSortPane.createIntervalUILabel(108)); this.add(AbstractSortPane.createIntervalUILabel(108));
closeButton = new UILabel(IconUtils.readIcon("/com/fr/design/images/control/close.png")); closeButton = new UILabel(IconUtils.readIcon("/com/fr/design/images/control/close.png"));

24
designer-realize/src/main/java/com/fr/design/sort/common/SortUtils.java

@ -0,0 +1,24 @@
package com.fr.design.sort.common;
import com.fr.design.designer.TargetComponent;
import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.JTemplate;
import com.fr.log.FineLoggerFactory;
public class SortUtils {
public static ElementCasePane getCurrentElementCase() {
try {
JTemplate jTemplate = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate();
if (jTemplate != null) {
TargetComponent targetComponent = jTemplate.getCurrentElementCasePane();
if (targetComponent instanceof ElementCasePane) {
return (ElementCasePane) targetComponent;
}
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e, e.getMessage());
}
return null;
}
}

61
designer-realize/src/main/java/com/fr/design/sort/header/HeaderAreaPane.java

@ -8,6 +8,7 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.sort.common.AbstractSortPane; import com.fr.design.sort.common.AbstractSortPane;
import com.fr.design.sort.common.SortColumnRowPane; import com.fr.design.sort.common.SortColumnRowPane;
import com.fr.design.sort.common.SortUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellExpandAttr; import com.fr.report.cell.cellattr.CellExpandAttr;
@ -35,6 +36,7 @@ public class HeaderAreaPane extends JPanel {
protected int headerAreaPaneWidth; protected int headerAreaPaneWidth;
protected int headerAreaPaneRightWidth; protected int headerAreaPaneRightWidth;
private CellSelectionManager cellSelectionManager = new CellSelectionManager(); private CellSelectionManager cellSelectionManager = new CellSelectionManager();
TemplateCellElement cellElement;
AreaJLayeredPane areaJLayeredPane; AreaJLayeredPane areaJLayeredPane;
@ -62,9 +64,10 @@ public class HeaderAreaPane extends JPanel {
this.add(areaJLayeredPane); this.add(areaJLayeredPane);
} }
public void populateBean(ColumnRow columnRow, boolean showHeaderArea) { public void populateBean(ColumnRow columnRow, boolean showHeaderArea, TemplateCellElement cellElement) {
this.cellElement = cellElement;
boolean enabled = true; boolean enabled = true;
ElementCasePane elementCasePane = getCurrentElementCase(); ElementCasePane elementCasePane = SortUtils.getCurrentElementCase();
if (elementCasePane != null) { if (elementCasePane != null) {
enabled = elementCasePane.isSelectedOneCell(); enabled = elementCasePane.isSelectedOneCell();
} }
@ -72,7 +75,7 @@ public class HeaderAreaPane extends JPanel {
} }
public ColumnRow updateBean(TemplateCellElement cellElement) { public ColumnRow updateBean(TemplateCellElement cellElement) {
ElementCasePane elementCasePane = getCurrentElementCase(); ElementCasePane elementCasePane = SortUtils.getCurrentElementCase();
if (elementCasePane != null) { if (elementCasePane != null) {
if (!elementCasePane.isSelectedOneCell()) { if (!elementCasePane.isSelectedOneCell()) {
return getOldColumnRow(cellElement); return getOldColumnRow(cellElement);
@ -96,19 +99,6 @@ public class HeaderAreaPane extends JPanel {
} }
} }
private ElementCasePane getCurrentElementCase() {
try {
TargetComponent targetComponent
= HistoryTemplateListCache.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane();
if (targetComponent instanceof ElementCasePane) {
return (ElementCasePane) targetComponent;
}
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e, e.getMessage());
}
return null;
}
class AreaJLayeredPane extends JPanel { class AreaJLayeredPane extends JPanel {
SortColumnRowPane columnRowPane; SortColumnRowPane columnRowPane;
JLayeredPane jLayeredPane; JLayeredPane jLayeredPane;
@ -151,6 +141,7 @@ public class HeaderAreaPane extends JPanel {
} }
} else { } else {
cellSelectionManager.removeNotSelectables(columnRowPane.updateBean()); cellSelectionManager.removeNotSelectables(columnRowPane.updateBean());
columnRowPane.cancelSelectState();
} }
} }
@ -176,7 +167,8 @@ public class HeaderAreaPane extends JPanel {
} }
public void populateBean(ColumnRow columnRow, boolean showHeaderArea, boolean enabled) { public void populateBean(ColumnRow columnRow, boolean showHeaderArea, boolean enabled) {
cellSelectionManager.build(); cellSelectionManager.build(cellElement, columnRow);
columnRow = cellSelectionManager.buildCurrentCell(cellElement, columnRow);
columnRowPane.populateBean(columnRow, enabled, cellSelectionManager); columnRowPane.populateBean(columnRow, enabled, cellSelectionManager);
setSortColumnRowPaneShow(showHeaderArea); setSortColumnRowPaneShow(showHeaderArea);
uiComboBox.setSelectedIndex(showHeaderArea ? 1 : 0); uiComboBox.setSelectedIndex(showHeaderArea ? 1 : 0);
@ -203,15 +195,26 @@ public class HeaderAreaPane extends JPanel {
ElementCasePane elementCase; ElementCasePane elementCase;
java.util.List<ColumnRow> notSelectables = new ArrayList<>(); java.util.List<ColumnRow> notSelectables = new ArrayList<>();
void build() { void build(TemplateCellElement templateCellElement, ColumnRow headerColumnRow) {
ElementCasePane elementCase = SortColumnRowPane.getCurrentElementCase(); ElementCasePane elementCase = SortUtils.getCurrentElementCase();
if (elementCase != null) { if (elementCase != null) {
this.elementCase = elementCase; this.elementCase = elementCase;
notSelectables = new ArrayList<>(); notSelectables = new ArrayList<>();
buildNotSelectables(elementCase.getEditingElementCase()); buildNotSelectables(elementCase.getEditingElementCase(), templateCellElement);
} }
} }
private ColumnRow buildCurrentCell(TemplateCellElement templateCellElement, ColumnRow headerColumnRow) {
if (isNotSelectables(headerColumnRow)) {
SortHeader sortHeader = templateCellElement.getCellExpandAttr().getCellSortAttr().getSortHeader();
headerColumnRow = ColumnRow.ERROR;
sortHeader.setHeaderArea(headerColumnRow.toString());
} else {
handleDisableHeaderCell(templateCellElement);
}
return headerColumnRow;
}
public java.util.List<ColumnRow> getNotSelectables() { public java.util.List<ColumnRow> getNotSelectables() {
return this.notSelectables; return this.notSelectables;
} }
@ -232,24 +235,20 @@ public class HeaderAreaPane extends JPanel {
notSelectables.remove(columnRow); notSelectables.remove(columnRow);
} }
private void buildNotSelectables(TemplateElementCase elementCase) { private void buildNotSelectables(TemplateElementCase elementCase, TemplateCellElement excludeTemplateCellElement) {
Iterator iterator = elementCase.cellIterator(); Iterator iterator = elementCase.cellIterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
TemplateCellElement templateCellElement = (TemplateCellElement) iterator.next(); TemplateCellElement templateCellElement = (TemplateCellElement) iterator.next();
CellExpandAttr cellExpandAttr = templateCellElement.getCellExpandAttr(); if (templateCellElement != excludeTemplateCellElement) {
if (cellExpandAttr != null) { handleDisableHeaderCell(templateCellElement);
handleDisableHeaderCell(cellExpandAttr);
}
Object value = templateCellElement.getValue();
if (value instanceof DSColumn) {
handleDisableHeaderCell((DSColumn) value);
} }
} }
} }
private void handleDisableHeaderCell(CellSortable cellSortable) { private void handleDisableHeaderCell(TemplateCellElement templateCellElement) {
if (cellSortable.getCellSortAttr() != null) { CellExpandAttr cellExpandAttr = templateCellElement.getCellExpandAttr();
SortHeader sortHeader = cellSortable.getCellSortAttr().getSortHeader(); if (cellExpandAttr != null && cellExpandAttr.getCellSortAttr() != null) {
SortHeader sortHeader = cellExpandAttr.getCellSortAttr().getSortHeader();
if (sortHeader != null) { if (sortHeader != null) {
String headerArea = sortHeader.getHeaderArea(); String headerArea = sortHeader.getHeaderArea();
if (headerArea != null) { if (headerArea != null) {

1
designer-realize/src/main/java/com/fr/design/sort/header/HeaderSortRulePane.java

@ -135,6 +135,7 @@ public class HeaderSortRulePane extends JPanel {
} }
void refreshIconLabelColor(FineColor fineColor) { void refreshIconLabelColor(FineColor fineColor) {
this.fineColor = fineColor;
Icon icon = getIcon(fineColor); Icon icon = getIcon(fineColor);
refreshIconLabel(icon); refreshIconLabel(icon);
} }

4
designer-realize/src/main/java/com/fr/design/sort/header/SortHeaderPane.java

@ -34,7 +34,7 @@ public class SortHeaderPane extends JPanel {
this.add(headerSettingPane); this.add(headerSettingPane);
} }
public void populateBean(SortHeader sortHeader, String defaultHeaderArea) { public void populateBean(SortHeader sortHeader, String defaultHeaderArea,TemplateCellElement cellElement) {
this.sortHeader = sortHeader; this.sortHeader = sortHeader;
boolean showHeaderArea = false; boolean showHeaderArea = false;
SortHeader.SortItem[] sortItems = null; SortHeader.SortItem[] sortItems = null;
@ -48,7 +48,7 @@ public class SortHeaderPane extends JPanel {
columnRow = ColumnRow.valueOf(headerArea); columnRow = ColumnRow.valueOf(headerArea);
} }
} }
headerAreaPane.populateBean(columnRow, showHeaderArea); headerAreaPane.populateBean(columnRow, showHeaderArea, cellElement);
headerSettingPane.populateBean(sortItems); headerSettingPane.populateBean(sortItems);
} }

Loading…
Cancel
Save