Browse Source

Merge pull request #7400 in DESIGN/design from release/11.0 to feature/x

* commit '238b59bf1a9df7fe98292196784641969ac3e9f5':
  REPORT-65192 公式合法性检测错误字符位置返回不正确 1.处理一下极少出现的情况,默认返回0的位置吧。
  REPORT-65170【主题边框】悬浮元素的预览图,右下的边框线看不到
  REPORT-65090:将builder的形式换成普通的创建focusPoint的方式
  REPORT-65124 【模板主题】单元格样式编辑的效果有问题
  问题修复
  REPORT-65125 【模板主题】双击数据列设置格式,没有保存成功
  REPORT-64920 复制粘贴接口报错处理
  CHART-22503 标题、图例、轴标题、轴标签、数据表等字符颜色控件-多余增加了自动
feature/x
superman 3 years ago
parent
commit
f238181222
  1. 33
      designer-base/src/main/java/com/fr/design/base/clipboard/ClipboardFilter.java
  2. 8
      designer-base/src/main/java/com/fr/design/cell/CellRectangleStylePreviewPane.java
  3. 39
      designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java
  4. 4
      designer-base/src/main/java/com/fr/design/formula/exception/function/FormulaCheckWrongFunction.java
  5. 15
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java
  6. 7
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java
  7. 7
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartLabelStylePane.java
  8. 2
      designer-form/src/main/java/com/fr/design/fit/NewJForm.java
  9. 8
      designer-realize/src/main/java/com/fr/design/actions/report/ReportEngineAttrAction.java
  10. 58
      designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java
  11. 2
      designer-realize/src/main/java/com/fr/design/report/ReportStylePane.java

33
designer-base/src/main/java/com/fr/design/base/clipboard/ClipboardFilter.java

@ -27,11 +27,7 @@ public abstract class ClipboardFilter {
}
public static <T> T cut(T selection) {
ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign);
Set<ClipboardHandlerProvider> providers = manager.getArray(ClipboardHandlerProvider.XML_TAG);
providers.addAll(clipboardHandlerProviders);
for (ClipboardHandlerProvider provider : providers) {
for (ClipboardHandlerProvider provider : getClipboardHandlerProviders()) {
if (provider.support(selection)) {
selection = ((ClipboardHandlerProvider<T>) provider).cut(selection);
}
@ -40,10 +36,7 @@ public abstract class ClipboardFilter {
}
public static <T> T copy(T selection) {
ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign);
Set<ClipboardHandlerProvider> providers = manager.getArray(ClipboardHandlerProvider.XML_TAG);
providers.addAll(clipboardHandlerProviders);
for (ClipboardHandlerProvider provider : providers) {
for (ClipboardHandlerProvider provider : getClipboardHandlerProviders()) {
if (provider.support(selection)) {
selection = ((ClipboardHandlerProvider<T>) provider).copy(selection);
}
@ -52,15 +45,27 @@ public abstract class ClipboardFilter {
}
public static <T> T paste(T selection) {
ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign);
Set<ClipboardHandlerProvider> providers = manager.getArray(ClipboardHandlerProvider.XML_TAG);
providers.addAll(clipboardHandlerProviders);
for (ClipboardHandlerProvider provider : providers) {
for (ClipboardHandlerProvider provider : getClipboardHandlerProviders()) {
if (provider.support(selection)) {
selection = ((ClipboardHandlerProvider<T>) provider).paste(selection);
}
}
return selection;
}
private static Set<ClipboardHandlerProvider> getClipboardHandlerProviders() {
Set<ClipboardHandlerProvider> providers = new HashSet<>();
for (ClipboardHandlerProvider clipboardHandlerProvider : clipboardHandlerProviders) {
providers.add(clipboardHandlerProvider);
}
ExtraDesignClassManager manager = PluginModule.getAgent(PluginModule.ExtraDesign);
Set<ClipboardHandlerProvider> pluginProviders = manager.getArray(ClipboardHandlerProvider.XML_TAG);
for (ClipboardHandlerProvider clipboardHandlerProvider : pluginProviders) {
providers.add(clipboardHandlerProvider);
}
return providers;
}
}

8
designer-base/src/main/java/com/fr/design/cell/CellRectangleStylePreviewPane.java

@ -15,6 +15,7 @@ import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.GridLayout;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;
@ -46,7 +47,7 @@ public class CellRectangleStylePreviewPane extends JPanel {
for (int r = 0; r < ROW_COUNT; r++) {
for (int c = 0; c < COLUMN_COUNT; c++) {
CellStylePreviewPane pane = new CellStylePreviewPane(false, false);
CellStylePreviewPane pane = new CellStylePreviewPane(c, r, COLUMN_COUNT, ROW_COUNT, false, false);
TemplateCellElement cellElement = DefaultThemedTemplateCellElementCase.createInstance(c, r);
int flags = CellBorderSourceFlag.INVALID_BORDER_SOURCE;
if (supportInnerBorder) {
@ -136,6 +137,11 @@ public class CellRectangleStylePreviewPane extends JPanel {
super.paint(g);
}
@Override
public Rectangle getBounds() {
return super.getBounds();
}
private void paintTransparentBackground(Graphics2D g2d, Style style) {
float alpha = computeTransparentBackgroundAlpha(style);

39
designer-base/src/main/java/com/fr/design/cell/CellStylePreviewPane.java

@ -18,7 +18,9 @@ import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.geom.AffineTransform;
import java.awt.image.BufferedImage;
import java.util.List;
@ -36,10 +38,19 @@ public class CellStylePreviewPane extends JPanel {
private String paintText = "Report";
private Style style = Style.DEFAULT_STYLE;
private final int column;
private final int row;
private final int columnSpan;
private final int rowSpan;
private final boolean autoClearCanvas;
private final boolean paintingMosaic;
public CellStylePreviewPane(boolean autoClearCanvas, boolean paintingMosaic) {
public CellStylePreviewPane(int column, int row, int columnSpan, int rowSpan, boolean autoClearCanvas, boolean paintingMosaic) {
this.column = column;
this.row = row;
this.columnSpan = columnSpan;
this.rowSpan = rowSpan;
this.autoClearCanvas = autoClearCanvas;
this.paintingMosaic = paintingMosaic;
transparentBackgroundWidth = transparentBackgroundImage.getWidth(null);
@ -133,8 +144,30 @@ public class CellStylePreviewPane extends JPanel {
Style.paintContent(g2d, paintText, style, width, height, resolution);
g2d.setClip(null);
Style.paintBorder(g2d, style, width, height);
paintCellBorder(g2d, style);
}
protected void paintCellBorder(Graphics2D g2d, Style style) {
float adjustLeft = 0;
float adjustTop = 0;
float adjustRight = 0;
float adjustBottom = 0;
if (column == 0) {
adjustLeft = GraphHelper.getLineStyleSize(style.getBorderLeft()) / 2.0F;
}
if (row == 0) {
adjustTop = GraphHelper.getLineStyleSize(style.getBorderTop()) / 2.0F;
}
if (column == columnSpan - 1) {
adjustRight = -GraphHelper.getLineStyleSize(style.getBorderRight()) / 2.0F;
}
if (row == rowSpan - 1) {
adjustBottom = -GraphHelper.getLineStyleSize(style.getBorderBottom()) / 2.0F;
}
g2d.translate(adjustLeft, adjustTop);
Style.paintBorder(g2d, style, getWidth() - adjustLeft + adjustRight, getHeight() - adjustTop + adjustBottom);
g2d.translate(-adjustLeft, -adjustTop);
}
@Override

4
designer-base/src/main/java/com/fr/design/formula/exception/function/FormulaCheckWrongFunction.java

@ -73,6 +73,8 @@ public class FormulaCheckWrongFunction implements Function<Exception, FormulaChe
if (invalidFormula.contains(",")) {
invalidFormula = invalidFormula.substring(0, invalidFormula.indexOf(","));
}
return formulaText.indexOf(invalidFormula);
int index = formulaText.indexOf(invalidFormula);
return Math.max(index, 0);
}
}

15
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/CellStyleListEditPane.java

@ -30,9 +30,11 @@ import com.fr.stable.Nameable;
import com.fr.stable.StringUtils;
import javax.swing.BorderFactory;
import javax.swing.DefaultListModel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.ListModel;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.Component;
@ -101,7 +103,7 @@ public class CellStyleListEditPane extends JListControlPane {
@Override
protected JNameEdList createJNameList() {
JNameEdList nameEdList = super.createJNameList();
JNameEdList nameEdList = new NoIconNamedList(new DefaultListModel());
nameEdList.setCellEditor(new UnEditableListCellEditor(new UITextField()));
nameEdList.setCellRenderer(new NoIconNameableListCellRenderer());
return nameEdList;
@ -294,6 +296,17 @@ public class CellStyleListEditPane extends JListControlPane {
return component;
}
}
private class NoIconNamedList extends JNameEdList {
public NoIconNamedList(ListModel dataModel) {
super(dataModel);
}
@Override
public int getIconWidth() {
return 0;
}
}
private class UnEditableListCellEditor extends DefaultListCellEditor {
public UnEditableListCellEditor(UITextField textField) {

7
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartFontPane.java

@ -7,7 +7,6 @@ import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIColorButtonWithAuto;
import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
@ -57,7 +56,11 @@ public class ChartFontPane extends BasicPane {
fontSizeComboBox = new UIComboBox(FONT_SIZES);
bold = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/bold.png"));
italic = new UIToggleButton(BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/italic.png"));
fontColor = new UIColorButtonWithAuto();
fontColor = getColorButton();
}
protected UIColorButton getColorButton() {
return new UIColorButton();
}
protected void initComponents() {

7
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/chart/ChartLabelStylePane.java

@ -2,6 +2,8 @@ package com.fr.design.mainframe.theme.edit.chart;
import com.fr.base.theme.settings.ThemedChartStyle;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIColorButtonWithAuto;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
@ -25,6 +27,11 @@ public class ChartLabelStylePane extends AbstractChartStylePane {
autoButton = new UIButtonGroup<>(new String[]{Toolkit.i18nText("Fine-Design_Chart_Auto"),
Toolkit.i18nText("Fine-Design_Chart_Custom")});
chartFontPane = new ChartFontPane() {
@Override
protected UIColorButton getColorButton() {
return new UIColorButtonWithAuto();
}
public String getUILabelText() {
return Toolkit.i18nText("Fine-Design_Chart_Label_Character");
}

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

@ -51,9 +51,9 @@ public class NewJForm extends JForm {
public NewJForm(Form form) {
super(form);
init();
//新建的模板都要加上新表单标志attr
form.addAttrMark(NewFormMarkAttr.createNewFormAttr());
init();
}
public NewJForm(Form form, FILE file, Parameter[] parameters) {

8
designer-realize/src/main/java/com/fr/design/actions/report/ReportEngineAttrAction.java

@ -74,12 +74,8 @@ public class ReportEngineAttrAction extends ReportComponentAction<WorkSheetDesig
body.put("totalPage", layerReportAttr.isPageQuery() ? 1 : 0);
body.put("pagesize", layerReportAttr.getCountPerPage());
body.put("totalNum", layerReportAttr.isEnableRowCount() ? 1 : 0);
FocusPoint focusPoint = FocusPoint.newBuilder()
.id(FOCUS_ID)
.source(Original.EMBED)
.text(getPath())
.body(body)
.build();
FocusPoint focusPoint = FocusPoint.create(FOCUS_ID, getPath(), Original.EMBED);
focusPoint.setBody(body.toString());
MetricRegistry.getMetric().submit(focusPoint);
}

58
designer-realize/src/main/java/com/fr/design/dscolumn/DSColumnAdvancedPane.java

@ -3,7 +3,6 @@ package com.fr.design.dscolumn;
import com.fr.base.BaseFormula;
import com.fr.data.util.SortOrder;
import com.fr.design.border.UITitledBorder;
import com.fr.design.constants.LayoutConstants;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.DialogActionAdapter;
@ -11,10 +10,10 @@ import com.fr.design.formula.CustomVariableResolver;
import com.fr.design.formula.FormulaFactory;
import com.fr.design.formula.SortFormulaPane;
import com.fr.design.formula.UIFormula;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.itextfield.UITextField;
@ -29,11 +28,19 @@ import com.fr.report.cell.cellattr.CellExpandAttr;
import com.fr.report.cell.cellattr.core.group.DSColumn;
import com.fr.report.cell.cellattr.core.group.SelectCount;
import javax.swing.*;
import java.awt.*;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.JComponent;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Arrays;
import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.BOTTOM;
import static com.fr.report.cell.cellattr.core.group.FilterTypeEnum.SPECIFY;
@ -541,7 +548,7 @@ public class DSColumnAdvancedPane extends BasicPane {
}
}
public static class FormatAttrPane extends TextFormatPane {
public static class ReLayoutTextFormatPane extends TextFormatPane {
protected void initLayout() {
JComponent[][] components = new JComponent[][] { {typeComboBox, textField, roundingBox} };
@ -571,6 +578,45 @@ public class DSColumnAdvancedPane extends BasicPane {
}
}
public static class FormatAttrPane extends AbstractAttrNoScrollPane {
private TextFormatPane formatPane;
@Override
protected JPanel createContentPane() {
this.formatPane = new ReLayoutTextFormatPane();
return this.formatPane;
}
@Override
public Dimension getPreferredSize() {
if (formatPane == null) {
return super.getPreferredSize();
}
return formatPane.getPreferredSize();
}
protected void initContentPane() {
leftContentPane = createContentPane();
if (leftContentPane != null) {
leftContentPane.setBorder(BorderFactory.createEmptyBorder());
this.add(leftContentPane, BorderLayout.CENTER);
}
}
public void populate(CellElement cellElement) {
if (cellElement != null && formatPane != null) {
formatPane.populateBean(cellElement.getStyle());
}
}
public void update(CellElement cellElement) {
if (cellElement != null && formatPane != null) {
cellElement.setStyle(formatPane.update(cellElement.getStyle()));
}
}
}
private void checkButtonEnabled() {
if (useMultiplyNumCheckBox.isSelected()) {
multiNumSpinner.setEnabled(true);

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

@ -79,7 +79,7 @@ public class ReportStylePane extends BasicPane {
setLayout(FRGUIPaneFactory.createBorderLayout());
setBorder(BorderFactory.createEmptyBorder(10, 10, 0, 10));
previewArea = new CellStylePreviewPane(true, true);
previewArea = new CellStylePreviewPane(0, 0, 1,1, true, true);
followingThemeButtonGroup = new UIButtonGroup<>(FOLLOWING_THEME_STRING_ARRAYS);
followingThemeButtonGroup.setAutoFireStateChanged(false);
customStylePane = new CustomFloatStyleSettingPane();

Loading…
Cancel
Save