Browse Source

CHART-18786 feat:表格组件

feature/big-screen
shine 3 years ago
parent
commit
71a48f098d
  1. 4
      designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java
  2. 3
      designer-base/src/main/java/com/fr/design/base/mode/DesignerMode.java
  3. 46
      designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java
  4. 2
      designer-base/src/main/java/com/fr/design/mainframe/DesignerFrame.java
  5. 7
      designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java
  6. 14
      designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java
  7. 4
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java
  8. 16
      designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDockPlus.java
  9. 5
      designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java
  10. 15
      designer-realize/src/main/java/com/fr/design/actions/utils/DeprecatedActionManager.java
  11. 6
      designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java
  12. 11
      designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java
  13. 9
      designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java
  14. 5
      designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java
  15. 13
      designer-realize/src/main/java/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java
  16. 1
      designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java

4
designer-base/src/main/java/com/fr/design/base/mode/DesignModeContext.java

@ -3,6 +3,7 @@ package com.fr.design.base.mode;
import com.fr.design.designer.TargetComponent; import com.fr.design.designer.TargetComponent;
import static com.fr.design.base.mode.DesignerMode.AUTHORITY; import static com.fr.design.base.mode.DesignerMode.AUTHORITY;
import static com.fr.design.base.mode.DesignerMode.DUCHAMP;
public class DesignModeContext { public class DesignModeContext {
@ -42,6 +43,9 @@ public class DesignModeContext {
return mode == AUTHORITY; return mode == AUTHORITY;
} }
public static boolean isDuchampMode() {
return mode == DUCHAMP;
}
public static void doCopy(TargetComponent principal) { public static void doCopy(TargetComponent principal) {
if (isBanCopyAndCut() || principal == null) { if (isBanCopyAndCut() || principal == null) {

3
designer-base/src/main/java/com/fr/design/base/mode/DesignerMode.java

@ -4,5 +4,6 @@ public enum DesignerMode {
NORMAL, NORMAL,
BAN_COPY_AND_CUT, BAN_COPY_AND_CUT,
VCS, VCS,
AUTHORITY AUTHORITY,
DUCHAMP
} }

46
designer-base/src/main/java/com/fr/design/mainframe/CenterRegionContainerPane.java

@ -8,6 +8,7 @@ import com.fr.design.file.MutilTempalteTabPane;
import com.fr.design.file.NewTemplatePane; import com.fr.design.file.NewTemplatePane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.imenu.UIMenuHighLight; import com.fr.design.gui.imenu.UIMenuHighLight;
import com.fr.design.gui.itoolbar.UILargeToolbar;
import com.fr.design.gui.itoolbar.UIToolbar; import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.toolbar.ToolBarMenuDock; import com.fr.design.mainframe.toolbar.ToolBarMenuDock;
@ -40,11 +41,15 @@ public class CenterRegionContainerPane extends JPanel {
private JComponent toolbarComponent;//cpt 字体 等工具栏 private JComponent toolbarComponent;//cpt 字体 等工具栏
private JPanel eastCenterPane; private JPanel eastPane;//=largeToolbar+eastCenterPane
private UILargeToolbar largeToolbar;//预览
private JPanel eastCenterPane;//=combineUp + templateTabPane
private UIToolbar combineUp;//撤销重做 等工具栏 private UIToolbar combineUp;//撤销重做 等工具栏
private NewTemplatePane newWorkBookPane;//模板tab标签 private JPanel templateTabPane;//新建模板 + 模板tab标签
private NewTemplatePane newWorkBookPane;//新建模板button
public static CenterRegionContainerPane getInstance() { public static CenterRegionContainerPane getInstance() {
@ -71,15 +76,15 @@ public class CenterRegionContainerPane extends JPanel {
} }
}; };
toolbarPane.setLayout(FRGUIPaneFactory.createBorderLayout()); toolbarPane.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel eastPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); eastPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
eastPane.add(getToolBarMenuDock().createLargeToolbar(), BorderLayout.WEST); eastPane.add(largeToolbar = getToolBarMenuDock().createLargeToolbar(), BorderLayout.WEST);
eastCenterPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); eastCenterPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
combineUpTooBar(); combineUpTooBar();
eastCenterPane.add(combineUp, BorderLayout.NORTH); eastCenterPane.add(combineUp, BorderLayout.NORTH);
JPanel panel = FRGUIPaneFactory.createBorderLayout_S_Pane(); templateTabPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
panel.add(newWorkBookPane = getToolBarMenuDock().getNewTemplatePane(), BorderLayout.WEST); templateTabPane.add(newWorkBookPane = getToolBarMenuDock().getNewTemplatePane(), BorderLayout.WEST);
panel.add(MutilTempalteTabPane.getInstance(), BorderLayout.CENTER); templateTabPane.add(MutilTempalteTabPane.getInstance(), BorderLayout.CENTER);
eastCenterPane.add(panel, BorderLayout.CENTER); eastCenterPane.add(templateTabPane, BorderLayout.CENTER);
eastPane.add(eastCenterPane, BorderLayout.CENTER); eastPane.add(eastCenterPane, BorderLayout.CENTER);
toolbarPane.add(eastPane, BorderLayout.NORTH); toolbarPane.add(eastPane, BorderLayout.NORTH);
@ -110,9 +115,10 @@ public class CenterRegionContainerPane extends JPanel {
/** /**
* 重置上工具栏 * 重置上工具栏
*/ */
private void resetCombineUpTooBar(JComponent[] toolbar4Form) { private void resetCombineUpTooBar(JComponent[] toolbar4Form, ToolBarMenuDockPlus plus) {
combineUp.removeAll(); combineUp.removeAll();
setUpUpToolBar(toolbar4Form); setUpUpToolBar(toolbar4Form);
plus.insertToCombineUpToolbar(combineUp);
} }
@ -212,7 +218,7 @@ public class CenterRegionContainerPane extends JPanel {
*/ */
protected void resetToolkitByPlus(ToolBarMenuDockPlus plus, ToolBarMenuDock ad) { protected void resetToolkitByPlus(ToolBarMenuDockPlus plus, ToolBarMenuDock ad) {
resetCombineUpTooBar(ad.resetUpToolBar(plus)); resetCombineUpTooBar(ad.resetUpToolBar(plus), plus);
if (toolbarComponent != null) { if (toolbarComponent != null) {
toolbarPane.remove(toolbarComponent); toolbarPane.remove(toolbarComponent);
@ -220,6 +226,26 @@ public class CenterRegionContainerPane extends JPanel {
// 颜色,字体那些按钮的工具栏 // 颜色,字体那些按钮的工具栏
toolbarPane.add(toolbarComponent = ad.resetToolBar(toolbarComponent, plus), BorderLayout.CENTER); toolbarPane.add(toolbarComponent = ad.resetToolBar(toolbarComponent, plus), BorderLayout.CENTER);
if (plus.hasToolBarPane()) {
this.add(toolbarPane, BorderLayout.NORTH);
} else {
this.remove(toolbarPane);
}
resetByDesignMode();
}
private void resetByDesignMode() {
if (DesignModeContext.isDuchampMode()) {
eastPane.remove(largeToolbar);
eastCenterPane.remove(templateTabPane);
centerTemplateCardPane.refresh(HistoryTemplateListCache.getInstance().getCurrentEditingTemplate());
} else {
eastPane.add(largeToolbar, BorderLayout.WEST);
eastCenterPane.add(templateTabPane, BorderLayout.CENTER);
}
} }
JComponent getToolbarComponent() { JComponent getToolbarComponent() {

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

@ -820,7 +820,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
* *
* @param jTemplate 当前模板 * @param jTemplate 当前模板
*/ */
private void refreshBaseContentPane(JTemplate jTemplate) { public void refreshBaseContentPane(JTemplate jTemplate) {
JComponent north = jTemplate.north4DesignerFrame(), JComponent north = jTemplate.north4DesignerFrame(),
center = jTemplate.center4DesignerFrame(), center = jTemplate.center4DesignerFrame(),

7
designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java

@ -53,10 +53,15 @@ public class DesktopCardPane extends BasicPane implements TargetModifiedListener
// 判断是否切换设计器状态到禁止拷贝剪切 // 判断是否切换设计器状态到禁止拷贝剪切
if (jt.getTarget().getAttrMark(DesignBanCopyAttrMark.XML_TAG) != null) { if (jt.getTarget().getAttrMark(DesignBanCopyAttrMark.XML_TAG) != null) {
DesignModeContext.switchTo(DesignerMode.BAN_COPY_AND_CUT); DesignModeContext.switchTo(DesignerMode.BAN_COPY_AND_CUT);
} else if (!DesignModeContext.isVcsMode() && !DesignModeContext.isAuthorityEditing()) { } else if (!DesignModeContext.isVcsMode() && !DesignModeContext.isAuthorityEditing() && !DesignModeContext.isDuchampMode()) {
DesignModeContext.switchTo(DesignerMode.NORMAL); DesignModeContext.switchTo(DesignerMode.NORMAL);
} }
DesignerFrameFileDealerPane.getInstance().setCurrentEditingTemplate(jt); DesignerFrameFileDealerPane.getInstance().setCurrentEditingTemplate(jt);
refresh(jt);
}
protected void refresh(final JTemplate<?, ?> jt) {
if (component != null) { if (component != null) {
layeredPane.remove(component); layeredPane.remove(component);
} }

14
designer-base/src/main/java/com/fr/design/mainframe/EastRegionContainerPane.java

@ -16,7 +16,6 @@ import com.fr.design.layout.VerticalFlowLayout;
import com.fr.design.mainframe.reuse.ReuseGuideDialog; import com.fr.design.mainframe.reuse.ReuseGuideDialog;
import com.fr.design.mainframe.reuse.SnapChatKeys; import com.fr.design.mainframe.reuse.SnapChatKeys;
import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.share.collect.ComponentCollector;
import com.fr.design.menu.SnapChatUtil;
import com.fr.design.notification.SnapChat; import com.fr.design.notification.SnapChat;
import com.fr.design.notification.SnapChatFactory; import com.fr.design.notification.SnapChatFactory;
import com.fr.design.ui.util.UIUtil; import com.fr.design.ui.util.UIUtil;
@ -114,7 +113,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
POLY_REPORT, // 聚合报表-报表块 POLY_REPORT, // 聚合报表-报表块
POLY_CHART(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Settings")), // 聚合报表-图表块 POLY_CHART(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Settings")), // 聚合报表-图表块
AUTHORITY_EDITION, // 权限编辑 AUTHORITY_EDITION, // 权限编辑
AUTHORITY_EDITION_DISABLED; // 权限编辑 AUTHORITY_EDITION_DISABLED, // 权限编辑
DUCHAMP_REPORT;
private String title; private String title;
@ -280,15 +280,15 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
// 单元格元素 // 单元格元素
PropertyItem cellElement = new PropertyItem(KEY_CELL_ELEMENT, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cell_Element"), PropertyItem cellElement = new PropertyItem(KEY_CELL_ELEMENT, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cell_Element"),
"cellelement", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, "cellelement", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART},
new PropertyMode[]{PropertyMode.REPORT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); new PropertyMode[]{PropertyMode.REPORT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT, PropertyMode.DUCHAMP_REPORT});
// 单元格属性 // 单元格属性
PropertyItem cellAttr = new PropertyItem(KEY_CELL_ATTR, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cell_Attributes"), PropertyItem cellAttr = new PropertyItem(KEY_CELL_ATTR, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cell_Attributes"),
"cellattr", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, "cellattr", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART},
new PropertyMode[]{PropertyMode.REPORT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); new PropertyMode[]{PropertyMode.REPORT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT, PropertyMode.DUCHAMP_REPORT});
// 悬浮元素 // 悬浮元素
PropertyItem floatElement = new PropertyItem(KEY_FLOAT_ELEMENT, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Float_Element"), PropertyItem floatElement = new PropertyItem(KEY_FLOAT_ELEMENT, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Float_Element"),
"floatelement", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, "floatelement", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART},
new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_FLOAT, PropertyMode.POLY_REPORT}); new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_FLOAT, PropertyMode.POLY_REPORT, PropertyMode.DUCHAMP_REPORT});
// 控件设置 // 控件设置
PropertyItem widgetSettings = new PropertyItem(KEY_WIDGET_SETTINGS, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Settings"), PropertyItem widgetSettings = new PropertyItem(KEY_WIDGET_SETTINGS, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Component_Settings"),
"widgetsettings", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.FORM, PropertyMode.POLY}, "widgetsettings", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.FORM, PropertyMode.POLY},
@ -296,11 +296,11 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
// 条件属性 // 条件属性
PropertyItem conditionAttr = new PropertyItem(KEY_CONDITION_ATTR, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Condition_Attributes"), PropertyItem conditionAttr = new PropertyItem(KEY_CONDITION_ATTR, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Condition_Attributes"),
"conditionattr", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, "conditionattr", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART},
new PropertyMode[]{PropertyMode.REPORT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); new PropertyMode[]{PropertyMode.REPORT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT, PropertyMode.DUCHAMP_REPORT});
// 超级链接 // 超级链接
PropertyItem hyperlink = new PropertyItem(KEY_HYPERLINK, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Hyperlink"), PropertyItem hyperlink = new PropertyItem(KEY_HYPERLINK, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Hyperlink"),
"hyperlink", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, "hyperlink", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_PARA_WIDGET, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART},
new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_FLOAT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_FLOAT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT, PropertyMode.DUCHAMP_REPORT});
// 组件库 // 组件库
widgetLibSnapChat = SnapChatFactory.createSnapChat(false, SnapChatKeys.COMPONENT); widgetLibSnapChat = SnapChatFactory.createSnapChat(false, SnapChatKeys.COMPONENT);
PropertyItem widgetLib = new PropertyItem( PropertyItem widgetLib = new PropertyItem(

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

@ -156,7 +156,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
// 判断是否切换设计器状态到禁止拷贝剪切 // 判断是否切换设计器状态到禁止拷贝剪切
if (t.getAttrMark(DesignBanCopyAttrMark.XML_TAG) != null) { if (t.getAttrMark(DesignBanCopyAttrMark.XML_TAG) != null) {
DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.BAN_COPY_AND_CUT); DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.BAN_COPY_AND_CUT);
} else if (!DesignModeContext.isVcsMode() && !DesignModeContext.isAuthorityEditing()) { } else if (!DesignModeContext.isVcsMode() && !DesignModeContext.isAuthorityEditing() && !DesignModeContext.isDuchampMode()) {
DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.NORMAL); DesignModeContext.switchTo(com.fr.design.base.mode.DesignerMode.NORMAL);
} }
this.template = t; this.template = t;
@ -640,8 +640,6 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
/** /**
* 添加图片到格子中 * 添加图片到格子中
*
* @return 返回图片URI
*/ */
public void setPictureElem(Elem elem, CellImage cellImage) { public void setPictureElem(Elem elem, CellImage cellImage) {
// 子类实现 // 子类实现

16
designer-base/src/main/java/com/fr/design/mainframe/toolbar/ToolBarMenuDockPlus.java

@ -1,5 +1,6 @@
package com.fr.design.mainframe.toolbar; package com.fr.design.mainframe.toolbar;
import com.fr.design.gui.itoolbar.UIToolbar;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
@ -54,5 +55,20 @@ public interface ToolBarMenuDockPlus {
int getToolBarHeight(); int getToolBarHeight();
/**
* 是否含有工具栏 包含预览按钮 复制粘贴那一行 模板标签页那一行 字体颜色那一行
*
* @return 默认返回true
*/
default boolean hasToolBarPane() {
return true;
}
/**
* 复制粘贴那一行工具栏 插入 工具栏按钮
*/
default void insertToCombineUpToolbar(UIToolbar combineUp) {
}
} }

5
designer-chart/src/main/java/com/fr/design/module/ChartHyperlinkGroup.java

@ -3,6 +3,7 @@ package com.fr.design.module;
import com.fr.chart.web.ChartHyperPoplink; import com.fr.chart.web.ChartHyperPoplink;
import com.fr.chart.web.ChartHyperRelateCellLink; import com.fr.chart.web.ChartHyperRelateCellLink;
import com.fr.chart.web.ChartHyperRelateFloatLink; import com.fr.chart.web.ChartHyperRelateFloatLink;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperPoplinkPane; import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperPoplinkPane;
import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperRelateCellLinkPane; import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperRelateCellLinkPane;
import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperRelateFloatLinkPane; import com.fr.design.chart.series.SeriesCondition.impl.ChartHyperRelateFloatLinkPane;
@ -58,7 +59,7 @@ public class ChartHyperlinkGroup extends BaseHyperlinkGroup {
return false; return false;
} }
if (template.isJWorkBook()) { if (template.isJWorkBook() || DesignModeContext.isDuchampMode()) {
// 如果是普通报表单元格,那么没有 FormHyperlink 选项 // 如果是普通报表单元格,那么没有 FormHyperlink 选项
FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
//返回true表示可用,返回false表示不可用 //返回true表示可用,返回false表示不可用
@ -93,7 +94,7 @@ public class ChartHyperlinkGroup extends BaseHyperlinkGroup {
if (template == null) { if (template == null) {
return false; return false;
} }
if (template.isJWorkBook()) { if (template.isJWorkBook() || DesignModeContext.isDuchampMode()) {
// 如果是普通报表单元格,那么没有 FormHyperlink 选项 // 如果是普通报表单元格,那么没有 FormHyperlink 选项
FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class); FormHyperlinkProvider formHyperlink = StableFactory.getMarkedInstanceObjectFromClass(FormHyperlinkProvider.XML_TAG, FormHyperlinkProvider.class);
//返回true表示可用,返回false表示不可用 //返回true表示可用,返回false表示不可用

15
designer-realize/src/main/java/com/fr/design/actions/utils/DeprecatedActionManager.java

@ -7,24 +7,27 @@ import com.fr.base.present.FormulaPresent;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.actions.UpdateAction; import com.fr.design.actions.UpdateAction;
import com.fr.design.actions.cell.NewPresentAction; import com.fr.design.actions.cell.NewPresentAction;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.edit.clear.*;
import com.fr.design.actions.columnrow.DeleteColumnAction; import com.fr.design.actions.columnrow.DeleteColumnAction;
import com.fr.design.actions.columnrow.DeleteRowAction; import com.fr.design.actions.columnrow.DeleteRowAction;
import com.fr.design.actions.columnrow.InsertColumnAction; import com.fr.design.actions.columnrow.InsertColumnAction;
import com.fr.design.actions.columnrow.InsertRowAction; import com.fr.design.actions.columnrow.InsertRowAction;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.actions.edit.clear.ClearAction;
import com.fr.design.actions.edit.clear.ClearAllAction;
import com.fr.design.actions.edit.clear.ClearContentsAction;
import com.fr.design.actions.edit.clear.ClearFormatsAction;
import com.fr.design.actions.edit.clear.ClearWidgetAction;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.fun.PresentKindProvider; import com.fr.design.fun.PresentKindProvider;
import com.fr.design.gui.imenu.UIMenu; import com.fr.design.gui.imenu.UIMenu;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.design.selection.SelectionEvent; import com.fr.design.selection.SelectionEvent;
import com.fr.design.selection.SelectionListener; import com.fr.design.selection.SelectionListener;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.Selection;
import com.fr.report.cell.cellattr.BarcodePresent; import com.fr.report.cell.cellattr.BarcodePresent;
import com.fr.report.cell.cellattr.CurrencyLinePresent; import com.fr.report.cell.cellattr.CurrencyLinePresent;

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

@ -118,8 +118,6 @@ import javax.swing.JPanel;
import javax.swing.JPopupMenu; import javax.swing.JPopupMenu;
import javax.swing.JScrollBar; import javax.swing.JScrollBar;
import javax.swing.KeyStroke; import javax.swing.KeyStroke;
import java.lang.reflect.Constructor;
import java.util.Set;
import java.awt.AWTEvent; import java.awt.AWTEvent;
import java.awt.Adjustable; import java.awt.Adjustable;
import java.awt.Dimension; import java.awt.Dimension;
@ -133,6 +131,8 @@ import java.awt.event.ActionListener;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.lang.reflect.Constructor;
import java.util.Set;
import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER; import static com.fr.design.gui.syntax.ui.rtextarea.RTADefaultInputMap.DEFAULT_MODIFIER;
@ -181,7 +181,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
DesignerContext.setFormatState(DesignerContext.FORMAT_STATE_ONCE); DesignerContext.setFormatState(DesignerContext.FORMAT_STATE_ONCE);
DesignerContext.setReferencedElementCasePane(ElementCasePane.this); DesignerContext.setReferencedElementCasePane(ElementCasePane.this);
DesignerContext.setReferencedIndex( DesignerContext.setReferencedIndex(
((JWorkBook) HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()).getEditingReportIndex()); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getEditingReportIndex());
formatBrush.setSelected(true); formatBrush.setSelected(true);
formatBrushAction.executeActionReturnUndoRecordNeeded(); formatBrushAction.executeActionReturnUndoRecordNeeded();
} else { } else {

11
designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -15,6 +15,7 @@ import com.fr.design.actions.edit.HyperlinkAction;
import com.fr.design.actions.edit.merge.MergeCellAction; import com.fr.design.actions.edit.merge.MergeCellAction;
import com.fr.design.actions.edit.merge.UnmergeCellAction; import com.fr.design.actions.edit.merge.UnmergeCellAction;
import com.fr.design.actions.utils.DeprecatedActionManager; import com.fr.design.actions.utils.DeprecatedActionManager;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener; import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
@ -101,7 +102,9 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
conditionAttributesGroupPane.populate(ElementCasePaneDelegate.this); conditionAttributesGroupPane.populate(ElementCasePaneDelegate.this);
EastRegionContainerPane.getInstance().replaceFloatElementPane(ReportFloatPane.getInstance()); EastRegionContainerPane.getInstance().replaceFloatElementPane(ReportFloatPane.getInstance());
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT); EastRegionContainerPane.getInstance().switchMode(DesignModeContext.isDuchampMode() ?
EastRegionContainerPane.PropertyMode.DUCHAMP_REPORT :
EastRegionContainerPane.PropertyMode.REPORT);
EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance()); EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance()); EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance());
EastRegionContainerPane.getInstance().replaceConditionAttrPane(conditionAttributesGroupPane); EastRegionContainerPane.getInstance().replaceConditionAttrPane(conditionAttributesGroupPane);
@ -201,7 +204,11 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
menuDef.addShortCut(new GlobalStyleMenuDef(this)); menuDef.addShortCut(new GlobalStyleMenuDef(this));
// 单元格形态 // 单元格形态
menuDef.addShortCut(DeprecatedActionManager.getPresentMenu(this)); menuDef.addShortCut(DeprecatedActionManager.getPresentMenu(this));
menuDef.addShortCut(new CellWidgetAttrAction());
if (!DesignModeContext.isDuchampMode()) {
menuDef.addShortCut(new CellWidgetAttrAction());
}
menuDef.addShortCut(new ConditionAttributesAction()); menuDef.addShortCut(new ConditionAttributesAction());
menuDef.addShortCut(new HyperlinkAction()); menuDef.addShortCut(new HyperlinkAction());

9
designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java

@ -193,7 +193,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
} }
@Override @Override
protected UIModeControlContainer createCenterPane() { protected JComponent createCenterPane() {
parameterPane = ModuleContext.isModuleStarted(Module.FORM_MODULE) ? new ParameterDefinitePane() : null; parameterPane = ModuleContext.isModuleStarted(Module.FORM_MODULE) ? new ParameterDefinitePane() : null;
centerPane = new UIModeControlContainer(parameterPane, reportComposite = new ReportComponentComposite(this)) { centerPane = new UIModeControlContainer(parameterPane, reportComposite = new ReportComponentComposite(this)) {
@Override @Override
@ -213,7 +213,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
reportComposite.addTargetModifiedListener(e -> JWorkBook.this.fireTargetModified()); reportComposite.addTargetModifiedListener(e -> JWorkBook.this.fireTargetModified());
reportComposite.setParentContainer(centerPane); reportComposite.setParentContainer(centerPane);
return centerPane; return DesignModeContext.isDuchampMode() ? reportComposite : centerPane;
} }
@Override @Override
@ -312,7 +312,7 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
} }
private boolean hasParameterPane() { private boolean hasParameterPane() {
return parameterPane != null; return parameterPane != null && !DesignModeContext.isDuchampMode();
} }
/** /**
@ -579,7 +579,8 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
super.setTarget(book); super.setTarget(book);
} }
private TargetComponent delegate4ToolbarMenuAdapter() {
public ReportComponent delegate4ToolbarMenuAdapter() {
return this.reportComposite.getEditingReportComponent(); return this.reportComposite.getEditingReportComponent();
} }

5
designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java

@ -2,6 +2,7 @@ package com.fr.design.mainframe;
import com.fr.base.ScreenResolution; import com.fr.base.ScreenResolution;
import com.fr.common.inputevent.InputEventBaseOnOS; import com.fr.common.inputevent.InputEventBaseOnOS;
import com.fr.design.base.mode.DesignModeContext;
import com.fr.design.designer.EditingState; import com.fr.design.designer.EditingState;
import com.fr.design.event.RemoveListener; import com.fr.design.event.RemoveListener;
import com.fr.design.event.TargetModifiedListener; import com.fr.design.event.TargetModifiedListener;
@ -215,7 +216,9 @@ public class ReportComponentComposite extends JComponent implements RemoveListen
jSliderContainer = JFormSliderPane.getInstance(); jSliderContainer = JFormSliderPane.getInstance();
} }
southPane.add(hbarContainer, BorderLayout.NORTH); southPane.add(hbarContainer, BorderLayout.NORTH);
southPane.add(sheetNameTab, BorderLayout.CENTER); if (!DesignModeContext.isDuchampMode()) {
southPane.add(sheetNameTab, BorderLayout.CENTER);
}
southPane.add(jSliderContainer, BorderLayout.EAST); southPane.add(jSliderContainer, BorderLayout.EAST);
return southPane; return southPane;
} }

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

@ -361,10 +361,11 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
cellGUIAttr = CellGUIAttr.DEFAULT_CELLGUIATTR; cellGUIAttr = CellGUIAttr.DEFAULT_CELLGUIATTR;
} }
// 是否在编辑表单中的报表块 // 支持 跟随页面设置 选项 = 不在编辑表单中的报表块 && 不在大屏模板cpt组件中
boolean isInForm = EastRegionContainerPane.getInstance().getCurrentMode().equals(EastRegionContainerPane.PropertyMode.FORM_REPORT); boolean supportFollowTplDefine = !EastRegionContainerPane.getInstance().getCurrentMode().equals(EastRegionContainerPane.PropertyMode.FORM_REPORT)
&& !EastRegionContainerPane.getInstance().getCurrentMode().equals(EastRegionContainerPane.PropertyMode.DUCHAMP_REPORT);
defaultAutoRadioButton.setVisible(!isInForm); defaultAutoRadioButton.setVisible(supportFollowTplDefine);
switch (cellGUIAttr.getAdjustMode()) { switch (cellGUIAttr.getAdjustMode()) {
case CellGUIAttr.ADJUST_MODE_NO_AUTO: case CellGUIAttr.ADJUST_MODE_NO_AUTO:
noAutoRadioButton.setSelected(true); noAutoRadioButton.setSelected(true);
@ -376,10 +377,10 @@ public class CellOtherSetPane extends AbstractCellAttrPane {
autoWidthRadioButton.setSelected(true); autoWidthRadioButton.setSelected(true);
break; break;
case CellGUIAttr.ADJUST_MODE_DEFAULT: case CellGUIAttr.ADJUST_MODE_DEFAULT:
if (isInForm) { if (supportFollowTplDefine) {
autoHeightRadioButton.setSelected(true);
} else {
defaultAutoRadioButton.setSelected(true); defaultAutoRadioButton.setSelected(true);
} else {
autoHeightRadioButton.setSelected(true);
} }
break; break;
default: default:

1
designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java

@ -39,7 +39,6 @@ import com.fr.design.mainframe.JTemplate;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.design.report.RowColumnPane; import com.fr.design.report.RowColumnPane;
import com.fr.design.selection.QuickEditor; import com.fr.design.selection.QuickEditor;
import com.fr.grid.GridUtils; import com.fr.grid.GridUtils;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
import com.fr.report.cell.DefaultTemplateCellElement; import com.fr.report.cell.DefaultTemplateCellElement;

Loading…
Cancel
Save